diff --git a/.github/needs_more_info.yml b/.github/needs_more_info.yml new file mode 100644 index 00000000000..934e98898d4 --- /dev/null +++ b/.github/needs_more_info.yml @@ -0,0 +1,6 @@ +{ + daysUntilClose: 7, + needsMoreInfoLabel: 'needs more info', + perform: true, + closeComment: 'This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our [guidelines](https://github.com/Microsoft/vscode/blob/master/CONTRIBUTING.md) for filing issues. Thank you for your contributions.' +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 7e923598730..39b72b995a8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,34 +1,6 @@ { "version": "0.1.0", "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Unit Tests", - "protocol": "legacy", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron", - "windows": { - "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.exe" - }, - "linux": { - "runtimeExecutable": "${workspaceRoot}/.build/electron/code-oss" - }, - "stopOnEntry": false, - "args": [ - "--timeout", - "2000" - ], - "cwd": "${workspaceRoot}", - "env": { - "ELECTRON_RUN_AS_NODE": "true" - }, - "sourceMaps": true, - "outFiles": [ - "${workspaceRoot}/out/**/*.js" - ], - "preLaunchTask": "electron" - }, { "type": "node", "request": "launch", @@ -46,7 +18,6 @@ "name": "Attach to Extension Host", "protocol": "legacy", "port": 5870, - "sourceMaps": true, "restart": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" @@ -58,7 +29,6 @@ "name": "Attach to Shared Process", "protocol": "legacy", "port": 5871, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -69,7 +39,6 @@ "protocol": "legacy", "name": "Attach to Search process", "port": 7890, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -80,7 +49,6 @@ "name": "Attach to CLI Process", "protocol": "legacy", "port": 5874, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -91,7 +59,6 @@ "name": "Attach to Main Process", "protocol": "legacy", "port": 5875, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -106,7 +73,6 @@ "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-api-tests", "--extensionTestsPath=${workspaceRoot}/extensions/vscode-api-tests/out" ], - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -121,7 +87,6 @@ "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-colorize-tests", "--extensionTestsPath=${workspaceRoot}/extensions/vscode-colorize-tests/out" ], - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -159,10 +124,45 @@ "program": "${workspaceRoot}/extensions/git/node_modules/mocha/bin/_mocha", "stopOnEntry": false, "cwd": "${workspaceRoot}/extensions/git", - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/extensions/git/out/**/*.js" ] + }, + { + "name": "Attach to TS Server", + "type": "node", + "request": "attach", + "port": 5859, + "protocol": "legacy", + "outFiles": [ + "${workspaceRoot}/extensions/node_modules/typescript/lib/**/*.js" + ] + }, + { + "type": "node", + "request": "launch", + "name": "Unit Tests", + "protocol": "legacy", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron", + "windows": { + "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.exe" + }, + "linux": { + "runtimeExecutable": "${workspaceRoot}/.build/electron/code-oss" + }, + "stopOnEntry": false, + "args": [ + "--timeout", + "2000" + ], + "cwd": "${workspaceRoot}", + "env": { + "ELECTRON_RUN_AS_NODE": "true" + }, + "outFiles": [ + "${workspaceRoot}/out/**/*.js" + ] } ], "compounds": [ diff --git a/.vscode/settings.json b/.vscode/settings.json index ee2a86a54f5..ed5e39baa7f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,9 @@ ".git": true, ".build": true, "**/.DS_Store": true, - "build/**/*.js": { "when": "$(basename).ts" } + "build/**/*.js": { + "when": "$(basename).ts" + } }, "search.exclude": { "**/node_modules": true, @@ -17,7 +19,6 @@ "extensions/**/out/**": true }, "tslint.enable": true, - "tslint.rulesDirectory": "build/lib/tslint", "lcov.path": [ "./.build/coverage/lcov.info", "./.build/coverage-single/lcov.info" @@ -31,4 +32,4 @@ } } ] -} \ No newline at end of file +} diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 480077c58cf..1c716b56f99 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -40,13 +40,17 @@ const eolFilter = [ '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot}', '!build/{lib,tslintRules}/**/*.js', '!build/monaco/**', - '!build/win32/**' + '!build/win32/**', + '!build/**/*.sh', + '!build/tfs/**/*.js', + '!**/Dockerfile' ]; const indentationFilter = [ '**', '!ThirdPartyNotices.txt', '!**/*.md', + '!**/*.ps1', '!**/*.template', '!**/*.yml', '!**/lib/**', diff --git a/build/gulpfile.js b/build/gulpfile.js deleted file mode 100644 index c0a5700ec1f..00000000000 --- a/build/gulpfile.js +++ /dev/null @@ -1,28 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var gulp = require('gulp'); -var tsb = require('gulp-tsb'); -var util = require('./lib/util'); -var watcher = require('./lib/watch'); -var assign = require('object-assign'); - -var compilation = tsb.create(assign({ verbose: true }, require('./tsconfig.json').compilerOptions)); - -gulp.task('compile', function() { - return gulp.src('**/*.ts', { base: '.' }) - .pipe(compilation()) - .pipe(gulp.dest('')); -}); - -gulp.task('watch', function() { - var src = gulp.src('**/*.ts', { base: '.' }); - - return watcher('**/*.ts', { base: '.' }) - .pipe(util.incremental(compilation, src)) - .pipe(gulp.dest('')); -}); - -gulp.task('default', ['compile']); diff --git a/build/gulpfile.mixin.js b/build/gulpfile.mixin.js index 0a80a8a0337..abf3ce4a90c 100644 --- a/build/gulpfile.mixin.js +++ b/build/gulpfile.mixin.js @@ -48,32 +48,16 @@ gulp.task('mixin', function () { .pipe(util.rebase(1)); if (quality) { - const build = all.pipe(filter('build/**')); const productJsonFilter = filter('product.json', { restore: true }); - const arch = process.env.VSCODE_ELECTRON_PLATFORM || process.arch; - - const vsdaFilter = (function () { - const filter = []; - if (process.platform !== 'win32') { filter.push('!**/vsda_win32.node'); } - if (process.platform !== 'darwin') { filter.push('!**/vsda_darwin.node'); } - if (process.platform !== 'linux' || arch !== 'x64') { filter.push('!**/vsda_linux64.node'); } - if (process.platform !== 'linux' || arch === 'x64') { filter.push('!**/vsda_linux32.node'); } - - return filter; - })(); - const mixin = all - .pipe(filter(['quality/' + quality + '/**'].concat(vsdaFilter))) + .pipe(filter(['quality/' + quality + '/**'])) .pipe(util.rebase(2)) .pipe(productJsonFilter) .pipe(buffer()) - .pipe(json(function (patch) { - const original = require('../product.json'); - return assign(original, patch); - })) + .pipe(json(o => assign({}, require('../product.json'), o))) .pipe(productJsonFilter.restore); - all = es.merge(build, mixin); + all = es.merge(mixin); } return all diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 08a775ce6e6..e73e03c311d 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -31,8 +31,9 @@ const shrinkwrap = require('../npm-shrinkwrap.json'); const crypto = require('crypto'); const i18n = require('./lib/i18n'); +const productDependencies = Object.keys(product.dependencies || {}); const dependencies = Object.keys(shrinkwrap.dependencies) - .concat(Array.isArray(product.extraNodeModules) ? product.extraNodeModules : []); // additional dependencies from our product configuration + .concat(productDependencies); // additional dependencies from our product configuration const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n)); const nodeModules = ['electron', 'original-fs'] .concat(dependencies) @@ -41,8 +42,8 @@ const nodeModules = ['electron', 'original-fs'] // Build const builtInExtensions = [ - { name: 'ms-vscode.node-debug', version: '1.12.14' }, - { name: 'ms-vscode.node-debug2', version: '1.12.4' } + { name: 'ms-vscode.node-debug', version: '1.13.7' }, + { name: 'ms-vscode.node-debug2', version: '1.13.0' } ]; const vscodeEntryPoints = _.flatten([ @@ -59,13 +60,13 @@ const vscodeResources = [ 'out-build/bootstrap-amd.js', 'out-build/paths.js', 'out-build/vs/**/*.{svg,png,cur,html}', + 'out-build/vs/base/node/startupTimers.js', 'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}', 'out-build/vs/base/browser/ui/octiconLabel/octicons/**', 'out-build/vs/workbench/browser/media/*-theme.css', 'out-build/vs/workbench/electron-browser/bootstrap/**', 'out-build/vs/workbench/parts/debug/**/*.json', 'out-build/vs/workbench/parts/execution/**/*.scpt', - 'out-build/vs/workbench/parts/git/**/*.sh', 'out-build/vs/workbench/parts/html/browser/webview-pre.js', 'out-build/vs/**/markdown.css', 'out-build/vs/workbench/parts/tasks/**/*.json', @@ -120,7 +121,7 @@ const config = { name: product.nameLong + ' document', role: 'Editor', ostypes: ["TEXT", "utxt", "TUTX", "****"], - extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"], + extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"], iconFile: 'resources/darwin/code_file.icns' }], darwinBundleURLTypes: [{ @@ -131,25 +132,33 @@ const config = { darwinCredits: darwinCreditsTemplate ? new Buffer(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0, linuxExecutableName: product.applicationName, winIcon: 'resources/win32/code.ico', - token: process.env['GITHUB_TOKEN'] || void 0 + token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0, + repo: product.electronRepository || void 0 }; +function getElectron(arch) { + return () => { + const electronOpts = _.extend({}, config, { + platform: process.platform, + arch, + ffmpegChromium: true, + keepDefaultApp: true + }); + + return gulp.src('package.json') + .pipe(json({ name: product.nameShort })) + .pipe(electron(electronOpts)) + .pipe(filter(['**', '!**/app/package.json'])) + .pipe(vfs.dest('.build/electron')); + }; +} + gulp.task('clean-electron', util.rimraf('.build/electron')); +gulp.task('electron', ['clean-electron'], getElectron(process.arch)); +gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32')); +gulp.task('electron-x64', ['clean-electron'], getElectron('x64')); -gulp.task('electron', ['clean-electron'], () => { - const platform = process.platform; - const arch = process.env.VSCODE_ELECTRON_PLATFORM || (platform === 'win32' ? 'ia32' : process.arch); - const opts = _.extend({}, config, { platform, arch, ffmpegChromium: true, keepDefaultApp: true }); - const name = product.nameShort; - - return gulp.src('package.json') - .pipe(json({ name })) - .pipe(electron(opts)) - .pipe(filter(['**', '!**/app/package.json'])) - .pipe(vfs.dest('.build/electron')); -}); - -const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita']; +const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita', 'ptb']; /** * Compute checksums for some files. @@ -190,7 +199,6 @@ function packageTask(platform, arch, opts) { const destination = path.join(path.dirname(root), 'VSCode') + (platform ? '-' + platform : '') + (arch ? '-' + arch : ''); platform = platform || process.platform; - arch = platform === 'win32' ? 'ia32' : arch; return () => { const out = opts.minified ? 'out-vscode-min' : 'out-vscode'; @@ -273,7 +281,8 @@ function packageTask(platform, arch, opts) { .pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js'])) .pipe(util.cleanNodeModule('v8-profiler', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js'])) - .pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/**'])); + .pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/**'])) + .pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node'])); let all = es.merge( packageJsonStream, @@ -323,19 +332,22 @@ function packageTask(platform, arch, opts) { const buildRoot = path.dirname(root); -gulp.task('clean-vscode-win32', util.rimraf(path.join(buildRoot, 'VSCode-win32'))); +gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'VSCode-win32-ia32'))); +gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'VSCode-win32-x64'))); gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'VSCode-darwin'))); gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'VSCode-linux-ia32'))); gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'VSCode-linux-x64'))); gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'VSCode-linux-arm'))); -gulp.task('vscode-win32', ['optimize-vscode', 'clean-vscode-win32'], packageTask('win32')); +gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32')); +gulp.task('vscode-win32-x64', ['optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64')); gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin')); gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32')); gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64')); gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm')); -gulp.task('vscode-win32-min', ['minify-vscode', 'clean-vscode-win32'], packageTask('win32', null, { minified: true })); +gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true })); +gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true })); gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true })); gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true })); gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true })); @@ -351,7 +363,8 @@ const vscodeLanguages = [ 'fr', 'es', 'ru', - 'it' + 'it', + 'pt-br' ]; const setupDefaultLanguages = [ 'zh-hans', @@ -363,7 +376,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', ['optimize-vscode'], function() { +gulp.task('vscode-translations-push', ['optimize-vscode'], function () { const pathToMetadata = './out-vscode/nls.metadata.json'; const pathToExtensions = './extensions/**/*.nls.json'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; @@ -375,7 +388,7 @@ gulp.task('vscode-translations-push', ['optimize-vscode'], function() { ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); }); -gulp.task('vscode-translations-pull', function() { +gulp.task('vscode-translations-pull', function () { return es.merge( i18n.pullXlfFiles('vscode-editor', apiHostname, apiName, apiToken, vscodeLanguages), i18n.pullXlfFiles('vscode-workbench', apiHostname, apiName, apiToken, vscodeLanguages), @@ -384,7 +397,7 @@ gulp.task('vscode-translations-pull', function() { ).pipe(vfs.dest('../vscode-localization')); }); -gulp.task('vscode-translations-import', function() { +gulp.task('vscode-translations-import', function () { return gulp.src('../vscode-localization/**/*.xlf').pipe(i18n.prepareJsonFiles()).pipe(vfs.dest('./i18n')); }); diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index cc8f75a0c9c..54c73a538c2 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -259,20 +259,16 @@ gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386')); gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64')); gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf')); -// TODO@joao TODO@daniel -// commented out the dependencies to the actual building of VS Code -// we gotta make sure those targets run before these run, in our TFS builds - -gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'/*, 'vscode-linux-ia32-min'*/], prepareDebPackage('ia32')); -gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'/*, 'vscode-linux-x64-min'*/], prepareDebPackage('x64')); -gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'/*, 'vscode-linux-arm-min'*/], prepareDebPackage('arm')); +gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32')); +gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64')); +gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm')); gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32')); gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64')); gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm')); -gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'/*, 'vscode-linux-ia32-min'*/], prepareRpmPackage('ia32')); -gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'/*, 'vscode-linux-x64-min'*/], prepareRpmPackage('x64')); -gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'/*, 'vscode-linux-arm-min'*/], prepareRpmPackage('arm')); +gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32')); +gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64')); +gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm')); gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32')); gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64')); gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm')); @@ -281,9 +277,9 @@ gulp.task('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64')); gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm')); -gulp.task('vscode-linux-ia32-prepare-flatpak', ['clean-vscode-linux-ia32-flatpak'/*, 'vscode-linux-ia32-min'*/], prepareFlatpak('ia32')); -gulp.task('vscode-linux-x64-prepare-flatpak', ['clean-vscode-linux-x64-flatpak'/*, 'vscode-linux-x64-min'*/], prepareFlatpak('x64')); -gulp.task('vscode-linux-arm-prepare-flatpak', ['clean-vscode-linux-arm-flatpak'/*, 'vscode-linux-arm-min'*/], prepareFlatpak('arm')); +gulp.task('vscode-linux-ia32-prepare-flatpak', ['clean-vscode-linux-ia32-flatpak'], prepareFlatpak('ia32')); +gulp.task('vscode-linux-x64-prepare-flatpak', ['clean-vscode-linux-x64-flatpak'], prepareFlatpak('x64')); +gulp.task('vscode-linux-arm-prepare-flatpak', ['clean-vscode-linux-arm-flatpak'], prepareFlatpak('arm')); gulp.task('vscode-linux-ia32-flatpak', ['vscode-linux-ia32-prepare-flatpak'], buildFlatpak('ia32')); gulp.task('vscode-linux-x64-flatpak', ['vscode-linux-x64-prepare-flatpak'], buildFlatpak('x64')); diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 427e4e52538..a4ebd283ee0 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -9,12 +9,16 @@ const gulp = require('gulp'); const path = require('path'); const assert = require('assert'); const cp = require('child_process'); +const _7z = require('7zip')['7z']; const util = require('./lib/util'); const pkg = require('../package.json'); const product = require('../product.json'); const repoPath = path.dirname(__dirname); -const buildPath = path.join(path.dirname(repoPath), 'VSCode-win32'); +const buildPath = arch => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`); +const zipDir = arch => path.join(repoPath, '.build', `win32-${arch}`, 'archive'); +const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`); +const setupDir = arch => path.join(repoPath, '.build', `win32-${arch}`, 'setup'); const issPath = path.join(__dirname, 'win32', 'code.iss'); const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe'); @@ -24,9 +28,9 @@ function packageInnoSetup(iss, options, cb) { const definitions = options.definitions || {}; const keys = Object.keys(definitions); - keys.forEach(key => assert(typeof definitions[key] === 'string', `Missing value for '${ key }' in Inno Setup package step`)); + keys.forEach(key => assert(typeof definitions[key] === 'string', `Missing value for '${key}' in Inno Setup package step`)); - const defs = keys.map(key => `/d${ key }=${ definitions[key] }`); + const defs = keys.map(key => `/d${key}=${definitions[key]}`); const args = [iss].concat(defs); cp.spawn(innoSetupPath, args, { stdio: 'inherit' }) @@ -34,26 +38,48 @@ function packageInnoSetup(iss, options, cb) { .on('exit', () => cb(null)); } -function buildWin32Setup(cb) { - const definitions = { - NameLong: product.nameLong, - NameShort: product.nameShort, - DirName: product.win32DirName, - Version: pkg.version, - RawVersion: pkg.version.replace(/-\w+$/, ''), - NameVersion: product.win32NameVersion, - ExeBasename: product.nameShort, - RegValueName: product.win32RegValueName, - ShellNameShort: product.win32ShellNameShort, - AppMutex: product.win32MutexName, - AppId: product.win32AppId, - AppUserId: product.win32AppUserModelId, - SourceDir: buildPath, - RepoDir: repoPath - }; +function buildWin32Setup(arch) { + return cb => { + const definitions = { + NameLong: product.nameLong, + NameShort: product.nameShort, + DirName: product.win32DirName, + Version: pkg.version, + RawVersion: pkg.version.replace(/-\w+$/, ''), + NameVersion: product.win32NameVersion, + ExeBasename: product.nameShort, + RegValueName: product.win32RegValueName, + ShellNameShort: product.win32ShellNameShort, + AppMutex: product.win32MutexName, + AppId: product.win32AppId, + AppUserId: product.win32AppUserModelId, + SourceDir: buildPath(arch), + RepoDir: repoPath, + OutputDir: setupDir(arch) + }; - packageInnoSetup(issPath, { definitions }, cb); + packageInnoSetup(issPath, { definitions }, cb); + }; } -gulp.task('clean-vscode-win32-setup', util.rimraf('.build/win32/setup')); -gulp.task('vscode-win32-setup', ['clean-vscode-win32-setup'], buildWin32Setup); +gulp.task('clean-vscode-win32-ia32-setup', util.rimraf(setupDir('ia32'))); +gulp.task('vscode-win32-ia32-setup', ['clean-vscode-win32-ia32-setup'], buildWin32Setup('ia32')); + +gulp.task('clean-vscode-win32-x64-setup', util.rimraf(setupDir('x64'))); +gulp.task('vscode-win32-x64-setup', ['clean-vscode-win32-x64-setup'], buildWin32Setup('x64')); + +function archiveWin32Setup(arch) { + return cb => { + const args = ['a', '-tzip', zipPath(arch), buildPath(arch), '-r']; + + cp.spawn(_7z, args, { stdio: 'inherit' }) + .on('error', cb) + .on('exit', () => cb(null)); + }; +} + +gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32'))); +gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32')); + +gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64'))); +gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64')); diff --git a/build/lib/bundle.js b/build/lib/bundle.js index 8914c89c919..5a51bde2156 100644 --- a/build/lib/bundle.js +++ b/build/lib/bundle.js @@ -1,453 +1,453 @@ -/*--------------------------------------------------------------------------------------------- - * 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 fs = require("fs"); -var path = require("path"); -var vm = require("vm"); -/** - * Bundle `entryPoints` given config `config`. - */ -function bundle(entryPoints, config, callback) { - var entryPointsMap = {}; - entryPoints.forEach(function (module) { - entryPointsMap[module.name] = module; - }); - var allMentionedModulesMap = {}; - entryPoints.forEach(function (module) { - allMentionedModulesMap[module.name] = true; - (module.include || []).forEach(function (includedModule) { - allMentionedModulesMap[includedModule] = true; - }); - (module.exclude || []).forEach(function (excludedModule) { - allMentionedModulesMap[excludedModule] = true; - }); - }); - var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js')); - var r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});'); - var loaderModule = { exports: {} }; - r.call({}, require, loaderModule, loaderModule.exports); - var loader = loaderModule.exports; - config.isBuild = true; - loader.config(config); - loader(['require'], function (localRequire) { - var resolvePath = function (path) { - var r = localRequire.toUrl(path); - if (!/\.js/.test(r)) { - return r + '.js'; - } - return r; - }; - for (var moduleId in entryPointsMap) { - var entryPoint = entryPointsMap[moduleId]; - if (entryPoint.append) { - entryPoint.append = entryPoint.append.map(resolvePath); - } - if (entryPoint.prepend) { - entryPoint.prepend = entryPoint.prepend.map(resolvePath); - } - } - }); - loader(Object.keys(allMentionedModulesMap), function () { - var modules = loader.getBuildInfo(); - var partialResult = emitEntryPoints(modules, entryPointsMap); - var cssInlinedResources = loader('vs/css').getInlinedResources(); - callback(null, { - files: partialResult.files, - cssInlinedResources: cssInlinedResources, - bundleData: partialResult.bundleData - }); - }, function (err) { return callback(err, null); }); -} -exports.bundle = bundle; -function emitEntryPoints(modules, entryPoints) { - var modulesMap = {}; - modules.forEach(function (m) { - modulesMap[m.id] = m; - }); - var modulesGraph = {}; - modules.forEach(function (m) { - modulesGraph[m.id] = m.dependencies; - }); - var sortedModules = topologicalSort(modulesGraph); - var result = []; - var usedPlugins = {}; - var bundleData = { - graph: modulesGraph, - bundles: {} - }; - Object.keys(entryPoints).forEach(function (moduleToBundle) { - var info = entryPoints[moduleToBundle]; - var rootNodes = [moduleToBundle].concat(info.include || []); - var allDependencies = visit(rootNodes, modulesGraph); - var excludes = ['require', 'exports', 'module'].concat(info.exclude || []); - excludes.forEach(function (excludeRoot) { - var allExcludes = visit([excludeRoot], modulesGraph); - Object.keys(allExcludes).forEach(function (exclude) { - delete allDependencies[exclude]; - }); - }); - var includedModules = sortedModules.filter(function (module) { - return allDependencies[module]; - }); - bundleData.bundles[moduleToBundle] = includedModules; - var res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend, info.append, info.dest); - result = result.concat(res.files); - for (var pluginName in res.usedPlugins) { - usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName]; - } - }); - Object.keys(usedPlugins).forEach(function (pluginName) { - var plugin = usedPlugins[pluginName]; - if (typeof plugin.finishBuild === 'function') { - var write = function (filename, contents) { - result.push({ - dest: filename, - sources: [{ - path: null, - contents: contents - }] - }); - }; - plugin.finishBuild(write); - } - }); - return { - // TODO@TS 2.1.2 - files: extractStrings(removeDuplicateTSBoilerplate(result)), - bundleData: bundleData - }; -} -function extractStrings(destFiles) { - var parseDefineCall = function (moduleMatch, depsMatch) { - var module = moduleMatch.replace(/^"|"$/g, ''); - var deps = depsMatch.split(','); - deps = deps.map(function (dep) { - dep = dep.trim(); - dep = dep.replace(/^"|"$/g, ''); - dep = dep.replace(/^'|'$/g, ''); - var prefix = null; - var _path = null; - var pieces = dep.split('!'); - if (pieces.length > 1) { - prefix = pieces[0] + '!'; - _path = pieces[1]; - } - else { - prefix = ''; - _path = pieces[0]; - } - if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) { - var res = path.join(path.dirname(module), _path).replace(/\\/g, '/'); - return prefix + res; - } - return prefix + _path; - }); - return { - module: module, - deps: deps - }; - }; - destFiles.forEach(function (destFile, index) { - if (!/\.js$/.test(destFile.dest)) { - return; - } - if (/\.nls\.js$/.test(destFile.dest)) { - return; - } - // Do one pass to record the usage counts for each module id - var useCounts = {}; - destFile.sources.forEach(function (source) { - var matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/); - if (!matches) { - return; - } - var defineCall = parseDefineCall(matches[1], matches[2]); - useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1; - defineCall.deps.forEach(function (dep) { - useCounts[dep] = (useCounts[dep] || 0) + 1; - }); - }); - var sortedByUseModules = Object.keys(useCounts); - sortedByUseModules.sort(function (a, b) { - return useCounts[b] - useCounts[a]; - }); - var replacementMap = {}; - sortedByUseModules.forEach(function (module, index) { - replacementMap[module] = index; - }); - destFile.sources.forEach(function (source) { - source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) { - var defineCall = parseDefineCall(moduleMatch, depsMatch); - return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])"; - }); - }); - destFile.sources.unshift({ - path: null, - contents: [ - '(function() {', - "var __m = " + JSON.stringify(sortedByUseModules) + ";", - "var __M = function(deps) {", - " var result = [];", - " for (var i = 0, len = deps.length; i < len; i++) {", - " result[i] = __m[deps[i]];", - " }", - " return result;", - "};" - ].join('\n') - }); - destFile.sources.push({ - path: null, - contents: '}).call(this);' - }); - }); - return destFiles; -} -function removeDuplicateTSBoilerplate(destFiles) { - // Taken from typescript compiler => emitFiles - var BOILERPLATE = [ - { start: /^var __extends/, end: /^}\)\(\);$/ }, - { start: /^var __assign/, end: /^};$/ }, - { start: /^var __decorate/, end: /^};$/ }, - { start: /^var __metadata/, end: /^};$/ }, - { start: /^var __param/, end: /^};$/ }, - { start: /^var __awaiter/, end: /^};$/ }, - ]; - destFiles.forEach(function (destFile) { - var SEEN_BOILERPLATE = []; - destFile.sources.forEach(function (source) { - var lines = source.contents.split(/\r\n|\n|\r/); - var newLines = []; - var IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; - for (var i = 0; i < lines.length; i++) { - var line = lines[i]; - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - if (END_BOILERPLATE.test(line)) { - IS_REMOVING_BOILERPLATE = false; - } - } - else { - for (var j = 0; j < BOILERPLATE.length; j++) { - var boilerplate = BOILERPLATE[j]; - if (boilerplate.start.test(line)) { - if (SEEN_BOILERPLATE[j]) { - IS_REMOVING_BOILERPLATE = true; - END_BOILERPLATE = boilerplate.end; - } - else { - SEEN_BOILERPLATE[j] = true; - } - } - } - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - } - else { - newLines.push(line); - } - } - } - source.contents = newLines.join('\n'); - }); - }); - return destFiles; -} -function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, append, dest) { - if (!dest) { - dest = entryPoint + '.js'; - } - var mainResult = { - sources: [], - dest: dest - }, results = [mainResult]; - var usedPlugins = {}; - var getLoaderPlugin = function (pluginName) { - if (!usedPlugins[pluginName]) { - usedPlugins[pluginName] = modulesMap[pluginName].exports; - } - return usedPlugins[pluginName]; - }; - includedModules.forEach(function (c) { - var bangIndex = c.indexOf('!'); - if (bangIndex >= 0) { - var pluginName = c.substr(0, bangIndex); - var plugin = getLoaderPlugin(pluginName); - mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1))); - return; - } - var module = modulesMap[c]; - if (module.path === 'empty:') { - return; - } - var contents = readFileAndRemoveBOM(module.path); - if (module.shim) { - mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents)); - } - else { - mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents)); - } - }); - Object.keys(usedPlugins).forEach(function (pluginName) { - var plugin = usedPlugins[pluginName]; - if (typeof plugin.writeFile === 'function') { - var req = (function () { - throw new Error('no-no!'); - }); - req.toUrl = function (something) { return something; }; - var write = function (filename, contents) { - results.push({ - dest: filename, - sources: [{ - path: null, - contents: contents - }] - }); - }; - plugin.writeFile(pluginName, entryPoint, req, write, {}); - } - }); - var toIFile = function (path) { - var contents = readFileAndRemoveBOM(path); - return { - path: path, - contents: contents - }; - }; - var toPrepend = (prepend || []).map(toIFile); - var toAppend = (append || []).map(toIFile); - mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); - return { - files: results, - usedPlugins: usedPlugins - }; -} -function readFileAndRemoveBOM(path) { - var BOM_CHAR_CODE = 65279; - var contents = fs.readFileSync(path, 'utf8'); - // Remove BOM - if (contents.charCodeAt(0) === BOM_CHAR_CODE) { - contents = contents.substring(1); - } - return contents; -} -function emitPlugin(entryPoint, plugin, pluginName, moduleName) { - var result = ''; - if (typeof plugin.write === 'function') { - var write = (function (what) { - result += what; - }); - write.getEntryPoint = function () { - return entryPoint; - }; - write.asModule = function (moduleId, code) { - code = code.replace(/^define\(/, 'define("' + moduleId + '",'); - result += code; - }; - plugin.write(pluginName, moduleName, write); - } - return { - path: null, - contents: result - }; -} -function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) { - // `defineCallPosition` is the position in code: |define() - var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col); - // `parensOffset` is the position in code: define|() - var parensOffset = contents.indexOf('(', defineCallOffset); - var insertStr = '"' + moduleId + '", '; - return { - path: path, - contents: contents.substr(0, parensOffset + 1) + insertStr + contents.substr(parensOffset + 1) - }; -} -function emitShimmedModule(moduleId, myDeps, factory, path, contents) { - var strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : ''); - var strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');'; - return { - path: path, - contents: contents + '\n;\n' + strDefine - }; -} -/** - * Convert a position (line:col) to (offset) in string `str` - */ -function positionToOffset(str, desiredLine, desiredCol) { - if (desiredLine === 1) { - return desiredCol - 1; - } - var line = 1, lastNewLineOffset = -1; - do { - if (desiredLine === line) { - return lastNewLineOffset + 1 + desiredCol - 1; - } - lastNewLineOffset = str.indexOf('\n', lastNewLineOffset + 1); - line++; - } while (lastNewLineOffset >= 0); - return -1; -} -/** - * Return a set of reachable nodes in `graph` starting from `rootNodes` - */ -function visit(rootNodes, graph) { - var result = {}, queue = rootNodes; - rootNodes.forEach(function (node) { - result[node] = true; - }); - while (queue.length > 0) { - var el = queue.shift(); - var myEdges = graph[el] || []; - myEdges.forEach(function (toNode) { - if (!result[toNode]) { - result[toNode] = true; - queue.push(toNode); - } - }); - } - return result; -} -/** - * Perform a topological sort on `graph` - */ -function topologicalSort(graph) { - var allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {}; - Object.keys(graph).forEach(function (fromNode) { - allNodes[fromNode] = true; - outgoingEdgeCount[fromNode] = graph[fromNode].length; - graph[fromNode].forEach(function (toNode) { - allNodes[toNode] = true; - outgoingEdgeCount[toNode] = outgoingEdgeCount[toNode] || 0; - inverseEdges[toNode] = inverseEdges[toNode] || []; - inverseEdges[toNode].push(fromNode); - }); - }); - // https://en.wikipedia.org/wiki/Topological_sorting - var S = [], L = []; - Object.keys(allNodes).forEach(function (node) { - if (outgoingEdgeCount[node] === 0) { - delete outgoingEdgeCount[node]; - S.push(node); - } - }); - while (S.length > 0) { - // Ensure the exact same order all the time with the same inputs - S.sort(); - var n = S.shift(); - L.push(n); - var myInverseEdges = inverseEdges[n] || []; - myInverseEdges.forEach(function (m) { - outgoingEdgeCount[m]--; - if (outgoingEdgeCount[m] === 0) { - delete outgoingEdgeCount[m]; - S.push(m); - } - }); - } - if (Object.keys(outgoingEdgeCount).length > 0) { - throw new Error('Cannot do topological sort on cyclic graph, remaining nodes: ' + Object.keys(outgoingEdgeCount)); - } - return L; -} +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var fs = require("fs"); +var path = require("path"); +var vm = require("vm"); +/** + * Bundle `entryPoints` given config `config`. + */ +function bundle(entryPoints, config, callback) { + var entryPointsMap = {}; + entryPoints.forEach(function (module) { + entryPointsMap[module.name] = module; + }); + var allMentionedModulesMap = {}; + entryPoints.forEach(function (module) { + allMentionedModulesMap[module.name] = true; + (module.include || []).forEach(function (includedModule) { + allMentionedModulesMap[includedModule] = true; + }); + (module.exclude || []).forEach(function (excludedModule) { + allMentionedModulesMap[excludedModule] = true; + }); + }); + var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js')); + var r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});'); + var loaderModule = { exports: {} }; + r.call({}, require, loaderModule, loaderModule.exports); + var loader = loaderModule.exports; + config.isBuild = true; + loader.config(config); + loader(['require'], function (localRequire) { + var resolvePath = function (path) { + var r = localRequire.toUrl(path); + if (!/\.js/.test(r)) { + return r + '.js'; + } + return r; + }; + for (var moduleId in entryPointsMap) { + var entryPoint = entryPointsMap[moduleId]; + if (entryPoint.append) { + entryPoint.append = entryPoint.append.map(resolvePath); + } + if (entryPoint.prepend) { + entryPoint.prepend = entryPoint.prepend.map(resolvePath); + } + } + }); + loader(Object.keys(allMentionedModulesMap), function () { + var modules = loader.getBuildInfo(); + var partialResult = emitEntryPoints(modules, entryPointsMap); + var cssInlinedResources = loader('vs/css').getInlinedResources(); + callback(null, { + files: partialResult.files, + cssInlinedResources: cssInlinedResources, + bundleData: partialResult.bundleData + }); + }, function (err) { return callback(err, null); }); +} +exports.bundle = bundle; +function emitEntryPoints(modules, entryPoints) { + var modulesMap = {}; + modules.forEach(function (m) { + modulesMap[m.id] = m; + }); + var modulesGraph = {}; + modules.forEach(function (m) { + modulesGraph[m.id] = m.dependencies; + }); + var sortedModules = topologicalSort(modulesGraph); + var result = []; + var usedPlugins = {}; + var bundleData = { + graph: modulesGraph, + bundles: {} + }; + Object.keys(entryPoints).forEach(function (moduleToBundle) { + var info = entryPoints[moduleToBundle]; + var rootNodes = [moduleToBundle].concat(info.include || []); + var allDependencies = visit(rootNodes, modulesGraph); + var excludes = ['require', 'exports', 'module'].concat(info.exclude || []); + excludes.forEach(function (excludeRoot) { + var allExcludes = visit([excludeRoot], modulesGraph); + Object.keys(allExcludes).forEach(function (exclude) { + delete allDependencies[exclude]; + }); + }); + var includedModules = sortedModules.filter(function (module) { + return allDependencies[module]; + }); + bundleData.bundles[moduleToBundle] = includedModules; + var res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend, info.append, info.dest); + result = result.concat(res.files); + for (var pluginName in res.usedPlugins) { + usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName]; + } + }); + Object.keys(usedPlugins).forEach(function (pluginName) { + var plugin = usedPlugins[pluginName]; + if (typeof plugin.finishBuild === 'function') { + var write = function (filename, contents) { + result.push({ + dest: filename, + sources: [{ + path: null, + contents: contents + }] + }); + }; + plugin.finishBuild(write); + } + }); + return { + // TODO@TS 2.1.2 + files: extractStrings(removeDuplicateTSBoilerplate(result)), + bundleData: bundleData + }; +} +function extractStrings(destFiles) { + var parseDefineCall = function (moduleMatch, depsMatch) { + var module = moduleMatch.replace(/^"|"$/g, ''); + var deps = depsMatch.split(','); + deps = deps.map(function (dep) { + dep = dep.trim(); + dep = dep.replace(/^"|"$/g, ''); + dep = dep.replace(/^'|'$/g, ''); + var prefix = null; + var _path = null; + var pieces = dep.split('!'); + if (pieces.length > 1) { + prefix = pieces[0] + '!'; + _path = pieces[1]; + } + else { + prefix = ''; + _path = pieces[0]; + } + if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) { + var res = path.join(path.dirname(module), _path).replace(/\\/g, '/'); + return prefix + res; + } + return prefix + _path; + }); + return { + module: module, + deps: deps + }; + }; + destFiles.forEach(function (destFile, index) { + if (!/\.js$/.test(destFile.dest)) { + return; + } + if (/\.nls\.js$/.test(destFile.dest)) { + return; + } + // Do one pass to record the usage counts for each module id + var useCounts = {}; + destFile.sources.forEach(function (source) { + var matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/); + if (!matches) { + return; + } + var defineCall = parseDefineCall(matches[1], matches[2]); + useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1; + defineCall.deps.forEach(function (dep) { + useCounts[dep] = (useCounts[dep] || 0) + 1; + }); + }); + var sortedByUseModules = Object.keys(useCounts); + sortedByUseModules.sort(function (a, b) { + return useCounts[b] - useCounts[a]; + }); + var replacementMap = {}; + sortedByUseModules.forEach(function (module, index) { + replacementMap[module] = index; + }); + destFile.sources.forEach(function (source) { + source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) { + var defineCall = parseDefineCall(moduleMatch, depsMatch); + return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])"; + }); + }); + destFile.sources.unshift({ + path: null, + contents: [ + '(function() {', + "var __m = " + JSON.stringify(sortedByUseModules) + ";", + "var __M = function(deps) {", + " var result = [];", + " for (var i = 0, len = deps.length; i < len; i++) {", + " result[i] = __m[deps[i]];", + " }", + " return result;", + "};" + ].join('\n') + }); + destFile.sources.push({ + path: null, + contents: '}).call(this);' + }); + }); + return destFiles; +} +function removeDuplicateTSBoilerplate(destFiles) { + // Taken from typescript compiler => emitFiles + var BOILERPLATE = [ + { start: /^var __extends/, end: /^}\)\(\);$/ }, + { start: /^var __assign/, end: /^};$/ }, + { start: /^var __decorate/, end: /^};$/ }, + { start: /^var __metadata/, end: /^};$/ }, + { start: /^var __param/, end: /^};$/ }, + { start: /^var __awaiter/, end: /^};$/ }, + ]; + destFiles.forEach(function (destFile) { + var SEEN_BOILERPLATE = []; + destFile.sources.forEach(function (source) { + var lines = source.contents.split(/\r\n|\n|\r/); + var newLines = []; + var IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + if (END_BOILERPLATE.test(line)) { + IS_REMOVING_BOILERPLATE = false; + } + } + else { + for (var j = 0; j < BOILERPLATE.length; j++) { + var boilerplate = BOILERPLATE[j]; + if (boilerplate.start.test(line)) { + if (SEEN_BOILERPLATE[j]) { + IS_REMOVING_BOILERPLATE = true; + END_BOILERPLATE = boilerplate.end; + } + else { + SEEN_BOILERPLATE[j] = true; + } + } + } + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + } + else { + newLines.push(line); + } + } + } + source.contents = newLines.join('\n'); + }); + }); + return destFiles; +} +function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, append, dest) { + if (!dest) { + dest = entryPoint + '.js'; + } + var mainResult = { + sources: [], + dest: dest + }, results = [mainResult]; + var usedPlugins = {}; + var getLoaderPlugin = function (pluginName) { + if (!usedPlugins[pluginName]) { + usedPlugins[pluginName] = modulesMap[pluginName].exports; + } + return usedPlugins[pluginName]; + }; + includedModules.forEach(function (c) { + var bangIndex = c.indexOf('!'); + if (bangIndex >= 0) { + var pluginName = c.substr(0, bangIndex); + var plugin = getLoaderPlugin(pluginName); + mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1))); + return; + } + var module = modulesMap[c]; + if (module.path === 'empty:') { + return; + } + var contents = readFileAndRemoveBOM(module.path); + if (module.shim) { + mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents)); + } + else { + mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents)); + } + }); + Object.keys(usedPlugins).forEach(function (pluginName) { + var plugin = usedPlugins[pluginName]; + if (typeof plugin.writeFile === 'function') { + var req = (function () { + throw new Error('no-no!'); + }); + req.toUrl = function (something) { return something; }; + var write = function (filename, contents) { + results.push({ + dest: filename, + sources: [{ + path: null, + contents: contents + }] + }); + }; + plugin.writeFile(pluginName, entryPoint, req, write, {}); + } + }); + var toIFile = function (path) { + var contents = readFileAndRemoveBOM(path); + return { + path: path, + contents: contents + }; + }; + var toPrepend = (prepend || []).map(toIFile); + var toAppend = (append || []).map(toIFile); + mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); + return { + files: results, + usedPlugins: usedPlugins + }; +} +function readFileAndRemoveBOM(path) { + var BOM_CHAR_CODE = 65279; + var contents = fs.readFileSync(path, 'utf8'); + // Remove BOM + if (contents.charCodeAt(0) === BOM_CHAR_CODE) { + contents = contents.substring(1); + } + return contents; +} +function emitPlugin(entryPoint, plugin, pluginName, moduleName) { + var result = ''; + if (typeof plugin.write === 'function') { + var write = (function (what) { + result += what; + }); + write.getEntryPoint = function () { + return entryPoint; + }; + write.asModule = function (moduleId, code) { + code = code.replace(/^define\(/, 'define("' + moduleId + '",'); + result += code; + }; + plugin.write(pluginName, moduleName, write); + } + return { + path: null, + contents: result + }; +} +function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) { + // `defineCallPosition` is the position in code: |define() + var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col); + // `parensOffset` is the position in code: define|() + var parensOffset = contents.indexOf('(', defineCallOffset); + var insertStr = '"' + moduleId + '", '; + return { + path: path, + contents: contents.substr(0, parensOffset + 1) + insertStr + contents.substr(parensOffset + 1) + }; +} +function emitShimmedModule(moduleId, myDeps, factory, path, contents) { + var strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : ''); + var strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');'; + return { + path: path, + contents: contents + '\n;\n' + strDefine + }; +} +/** + * Convert a position (line:col) to (offset) in string `str` + */ +function positionToOffset(str, desiredLine, desiredCol) { + if (desiredLine === 1) { + return desiredCol - 1; + } + var line = 1, lastNewLineOffset = -1; + do { + if (desiredLine === line) { + return lastNewLineOffset + 1 + desiredCol - 1; + } + lastNewLineOffset = str.indexOf('\n', lastNewLineOffset + 1); + line++; + } while (lastNewLineOffset >= 0); + return -1; +} +/** + * Return a set of reachable nodes in `graph` starting from `rootNodes` + */ +function visit(rootNodes, graph) { + var result = {}, queue = rootNodes; + rootNodes.forEach(function (node) { + result[node] = true; + }); + while (queue.length > 0) { + var el = queue.shift(); + var myEdges = graph[el] || []; + myEdges.forEach(function (toNode) { + if (!result[toNode]) { + result[toNode] = true; + queue.push(toNode); + } + }); + } + return result; +} +/** + * Perform a topological sort on `graph` + */ +function topologicalSort(graph) { + var allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {}; + Object.keys(graph).forEach(function (fromNode) { + allNodes[fromNode] = true; + outgoingEdgeCount[fromNode] = graph[fromNode].length; + graph[fromNode].forEach(function (toNode) { + allNodes[toNode] = true; + outgoingEdgeCount[toNode] = outgoingEdgeCount[toNode] || 0; + inverseEdges[toNode] = inverseEdges[toNode] || []; + inverseEdges[toNode].push(fromNode); + }); + }); + // https://en.wikipedia.org/wiki/Topological_sorting + var S = [], L = []; + Object.keys(allNodes).forEach(function (node) { + if (outgoingEdgeCount[node] === 0) { + delete outgoingEdgeCount[node]; + S.push(node); + } + }); + while (S.length > 0) { + // Ensure the exact same order all the time with the same inputs + S.sort(); + var n = S.shift(); + L.push(n); + var myInverseEdges = inverseEdges[n] || []; + myInverseEdges.forEach(function (m) { + outgoingEdgeCount[m]--; + if (outgoingEdgeCount[m] === 0) { + delete outgoingEdgeCount[m]; + S.push(m); + } + }); + } + if (Object.keys(outgoingEdgeCount).length > 0) { + throw new Error('Cannot do topological sort on cyclic graph, remaining nodes: ' + Object.keys(outgoingEdgeCount)); + } + return L; +} diff --git a/build/lib/compilation.js b/build/lib/compilation.js index e49862b4778..d9691ebc1d2 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -1,171 +1,171 @@ -/*--------------------------------------------------------------------------------------------- - * 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 gulp = require("gulp"); -var tsb = require("gulp-tsb"); -var es = require("event-stream"); -var watch = require('./watch'); -var nls = require("./nls"); -var util = require("./util"); -var reporter_1 = require("./reporter"); -var path = require("path"); -var bom = require("gulp-bom"); -var sourcemaps = require("gulp-sourcemaps"); -var _ = require("underscore"); -var monacodts = require("../monaco/api"); -var fs = require("fs"); -var reporter = reporter_1.createReporter(); -var rootDir = path.join(__dirname, '../../src'); -var options = require('../../src/tsconfig.json').compilerOptions; -options.verbose = false; -options.sourceMap = true; -options.rootDir = rootDir; -options.sourceRoot = util.toFileUri(rootDir); -function createCompile(build, emitError) { - var opts = _.clone(options); - opts.inlineSources = !!build; - opts.noFilesystemLookup = true; - var ts = tsb.create(opts, null, null, function (err) { return reporter(err.toString()); }); - return function (token) { - var utf8Filter = util.filter(function (data) { return /(\/|\\)test(\/|\\).*utf8/.test(data.path); }); - var tsFilter = util.filter(function (data) { return /\.ts$/.test(data.path); }); - var noDeclarationsFilter = util.filter(function (data) { return !(/\.d\.ts$/.test(data.path)); }); - var input = es.through(); - var output = input - .pipe(utf8Filter) - .pipe(bom()) - .pipe(utf8Filter.restore) - .pipe(tsFilter) - .pipe(util.loadSourcemaps()) - .pipe(ts(token)) - .pipe(build ? reloadTypeScriptNodeModule() : es.through()) - .pipe(noDeclarationsFilter) - .pipe(build ? nls() : es.through()) - .pipe(noDeclarationsFilter.restore) - .pipe(sourcemaps.write('.', { - addComment: false, - includeContent: !!build, - sourceRoot: options.sourceRoot - })) - .pipe(tsFilter.restore) - .pipe(reporter.end(emitError)); - return es.duplex(input, output); - }; -} -function compileTask(out, build) { - return function () { - var compile = createCompile(build, true); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); - return src - .pipe(compile()) - .pipe(gulp.dest(out)) - .pipe(monacodtsTask(out, false)); - }; -} -exports.compileTask = compileTask; -function watchTask(out, build) { - return function () { - var compile = createCompile(build); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); - var watchSrc = watch('src/**', { base: 'src' }); - return watchSrc - .pipe(util.incremental(compile, src, true)) - .pipe(gulp.dest(out)) - .pipe(monacodtsTask(out, true)); - }; -} -exports.watchTask = watchTask; -function reloadTypeScriptNodeModule() { - var util = require('gulp-util'); - function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest)); - } - function heapUsed() { - return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB'; - } - return es.through(function (data) { - this.emit('data', data); - }, function () { - log('memory usage after compilation finished: ' + heapUsed()); - // It appears we are running into some variant of - // https://bugs.chromium.org/p/v8/issues/detail?id=2073 - // - // Even though all references are dropped, some - // optimized methods in the TS compiler end up holding references - // to the entire TypeScript language host (>600MB) - // - // The idea is to force v8 to drop references to these - // optimized methods, by "reloading" the typescript node module - log('Reloading typescript node module...'); - var resolvedName = require.resolve('typescript'); - var originalModule = require.cache[resolvedName]; - delete require.cache[resolvedName]; - var newExports = require('typescript'); - require.cache[resolvedName] = originalModule; - for (var prop in newExports) { - if (newExports.hasOwnProperty(prop)) { - originalModule.exports[prop] = newExports[prop]; - } - } - log('typescript node module reloaded.'); - this.emit('end'); - }); -} -function monacodtsTask(out, isWatch) { - var neededFiles = {}; - monacodts.getFilesToWatch(out).forEach(function (filePath) { - filePath = path.normalize(filePath); - neededFiles[filePath] = true; - }); - var inputFiles = {}; - for (var filePath in neededFiles) { - if (/\bsrc(\/|\\)vs\b/.test(filePath)) { - // This file is needed from source => simply read it now - inputFiles[filePath] = fs.readFileSync(filePath).toString(); - } - } - var setInputFile = function (filePath, contents) { - if (inputFiles[filePath] === contents) { - // no change - return; - } - inputFiles[filePath] = contents; - var neededInputFilesCount = Object.keys(neededFiles).length; - var availableInputFilesCount = Object.keys(inputFiles).length; - if (neededInputFilesCount === availableInputFilesCount) { - run(); - } - }; - var run = function () { - var result = monacodts.run(out, inputFiles); - if (!result.isTheSame) { - if (isWatch) { - fs.writeFileSync(result.filePath, result.content); - } - else { - resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.'); - } - } - }; - var resultStream; - if (isWatch) { - watch('build/monaco/*').pipe(es.through(function () { - run(); - })); - } - resultStream = es.through(function (data) { - var filePath = path.normalize(data.path); - if (neededFiles[filePath]) { - setInputFile(filePath, data.contents.toString()); - } - this.emit('data', data); - }); - return resultStream; -} +/*--------------------------------------------------------------------------------------------- + * 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 gulp = require("gulp"); +var tsb = require("gulp-tsb"); +var es = require("event-stream"); +var watch = require('./watch'); +var nls = require("./nls"); +var util = require("./util"); +var reporter_1 = require("./reporter"); +var path = require("path"); +var bom = require("gulp-bom"); +var sourcemaps = require("gulp-sourcemaps"); +var _ = require("underscore"); +var monacodts = require("../monaco/api"); +var fs = require("fs"); +var reporter = reporter_1.createReporter(); +var rootDir = path.join(__dirname, '../../src'); +var options = require('../../src/tsconfig.json').compilerOptions; +options.verbose = false; +options.sourceMap = true; +options.rootDir = rootDir; +options.sourceRoot = util.toFileUri(rootDir); +function createCompile(build, emitError) { + var opts = _.clone(options); + opts.inlineSources = !!build; + opts.noFilesystemLookup = true; + var ts = tsb.create(opts, null, null, function (err) { return reporter(err.toString()); }); + return function (token) { + var utf8Filter = util.filter(function (data) { return /(\/|\\)test(\/|\\).*utf8/.test(data.path); }); + var tsFilter = util.filter(function (data) { return /\.ts$/.test(data.path); }); + var noDeclarationsFilter = util.filter(function (data) { return !(/\.d\.ts$/.test(data.path)); }); + var input = es.through(); + var output = input + .pipe(utf8Filter) + .pipe(bom()) + .pipe(utf8Filter.restore) + .pipe(tsFilter) + .pipe(util.loadSourcemaps()) + .pipe(ts(token)) + .pipe(build ? reloadTypeScriptNodeModule() : es.through()) + .pipe(noDeclarationsFilter) + .pipe(build ? nls() : es.through()) + .pipe(noDeclarationsFilter.restore) + .pipe(sourcemaps.write('.', { + addComment: false, + includeContent: !!build, + sourceRoot: options.sourceRoot + })) + .pipe(tsFilter.restore) + .pipe(reporter.end(emitError)); + return es.duplex(input, output); + }; +} +function compileTask(out, build) { + return function () { + var compile = createCompile(build, true); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + return src + .pipe(compile()) + .pipe(gulp.dest(out)) + .pipe(monacodtsTask(out, false)); + }; +} +exports.compileTask = compileTask; +function watchTask(out, build) { + return function () { + var compile = createCompile(build); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + var watchSrc = watch('src/**', { base: 'src' }); + return watchSrc + .pipe(util.incremental(compile, src, true)) + .pipe(gulp.dest(out)) + .pipe(monacodtsTask(out, true)); + }; +} +exports.watchTask = watchTask; +function reloadTypeScriptNodeModule() { + var util = require('gulp-util'); + function log(message) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest)); + } + function heapUsed() { + return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB'; + } + return es.through(function (data) { + this.emit('data', data); + }, function () { + log('memory usage after compilation finished: ' + heapUsed()); + // It appears we are running into some variant of + // https://bugs.chromium.org/p/v8/issues/detail?id=2073 + // + // Even though all references are dropped, some + // optimized methods in the TS compiler end up holding references + // to the entire TypeScript language host (>600MB) + // + // The idea is to force v8 to drop references to these + // optimized methods, by "reloading" the typescript node module + log('Reloading typescript node module...'); + var resolvedName = require.resolve('typescript'); + var originalModule = require.cache[resolvedName]; + delete require.cache[resolvedName]; + var newExports = require('typescript'); + require.cache[resolvedName] = originalModule; + for (var prop in newExports) { + if (newExports.hasOwnProperty(prop)) { + originalModule.exports[prop] = newExports[prop]; + } + } + log('typescript node module reloaded.'); + this.emit('end'); + }); +} +function monacodtsTask(out, isWatch) { + var neededFiles = {}; + monacodts.getFilesToWatch(out).forEach(function (filePath) { + filePath = path.normalize(filePath); + neededFiles[filePath] = true; + }); + var inputFiles = {}; + for (var filePath in neededFiles) { + if (/\bsrc(\/|\\)vs\b/.test(filePath)) { + // This file is needed from source => simply read it now + inputFiles[filePath] = fs.readFileSync(filePath).toString(); + } + } + var setInputFile = function (filePath, contents) { + if (inputFiles[filePath] === contents) { + // no change + return; + } + inputFiles[filePath] = contents; + var neededInputFilesCount = Object.keys(neededFiles).length; + var availableInputFilesCount = Object.keys(inputFiles).length; + if (neededInputFilesCount === availableInputFilesCount) { + run(); + } + }; + var run = function () { + var result = monacodts.run(out, inputFiles); + if (!result.isTheSame) { + if (isWatch) { + fs.writeFileSync(result.filePath, result.content); + } + else { + resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.'); + } + } + }; + var resultStream; + if (isWatch) { + watch('build/monaco/*').pipe(es.through(function () { + run(); + })); + } + resultStream = es.through(function (data) { + var filePath = path.normalize(data.path); + if (neededFiles[filePath]) { + setInputFile(filePath, data.contents.toString()); + } + this.emit('data', data); + }); + return resultStream; +} diff --git a/build/lib/extensions.js b/build/lib/extensions.js index e0a0d727883..b1b354abcff 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -1,96 +1,96 @@ -/*--------------------------------------------------------------------------------------------- - * 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 event_stream_1 = require("event-stream"); -var assign = require("object-assign"); -var remote = require("gulp-remote-src"); -var flatmap = require('gulp-flatmap'); -var vzip = require('gulp-vinyl-zip'); -var filter = require('gulp-filter'); -var rename = require('gulp-rename'); -var util = require('gulp-util'); -var buffer = require('gulp-buffer'); -var json = require('gulp-json-editor'); -function error(err) { - var result = event_stream_1.through(); - setTimeout(function () { return result.emit('error', err); }); - return result; -} -var baseHeaders = { - 'X-Market-Client-Id': 'VSCode Build', - 'User-Agent': 'VSCode Build', -}; -function src(extensionName, version) { - var filterType = 7; - var value = extensionName; - var criterium = { filterType: filterType, value: value }; - var criteria = [criterium]; - var pageNumber = 1; - var pageSize = 1; - var sortBy = 0; - var sortOrder = 0; - var flags = 0x1 | 0x2 | 0x80; - var assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage']; - var filters = [{ criteria: criteria, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, sortOrder: sortOrder }]; - var body = JSON.stringify({ filters: filters, assetTypes: assetTypes, flags: flags }); - var headers = assign({}, baseHeaders, { - 'Content-Type': 'application/json', - 'Accept': 'application/json;api-version=3.0-preview.1', - 'Content-Length': body.length - }); - var options = { - base: 'https://marketplace.visualstudio.com/_apis/public/gallery', - requestOptions: { - method: 'POST', - gzip: true, - headers: headers, - body: body - } - }; - return remote('/extensionquery', options) - .pipe(flatmap(function (stream, f) { - var rawResult = f.contents.toString('utf8'); - var result = JSON.parse(rawResult); - var extension = result.results[0].extensions[0]; - if (!extension) { - return error("No such extension: " + extension); - } - var metadata = { - id: extension.extensionId, - publisherId: extension.publisher, - publisherDisplayName: extension.publisher.displayName - }; - var extensionVersion = extension.versions.filter(function (v) { return v.version === version; })[0]; - if (!extensionVersion) { - return error("No such extension version: " + extensionName + " @ " + version); - } - var asset = extensionVersion.files.filter(function (f) { return f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage'; })[0]; - if (!asset) { - return error("No VSIX found for extension version: " + extensionName + " @ " + version); - } - util.log('Downloading extension:', util.colors.yellow(extensionName + "@" + version), '...'); - var options = { - base: asset.source, - requestOptions: { - gzip: true, - headers: baseHeaders - } - }; - return remote('', options) - .pipe(flatmap(function (stream) { - var packageJsonFilter = filter('package.json', { restore: true }); - return stream - .pipe(vzip.src()) - .pipe(filter('extension/**')) - .pipe(rename(function (p) { return p.dirname = p.dirname.replace(/^extension\/?/, ''); })) - .pipe(packageJsonFilter) - .pipe(buffer()) - .pipe(json({ __metadata: metadata })) - .pipe(packageJsonFilter.restore); - })); - })); -} -exports.src = src; +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var event_stream_1 = require("event-stream"); +var assign = require("object-assign"); +var remote = require("gulp-remote-src"); +var flatmap = require('gulp-flatmap'); +var vzip = require('gulp-vinyl-zip'); +var filter = require('gulp-filter'); +var rename = require('gulp-rename'); +var util = require('gulp-util'); +var buffer = require('gulp-buffer'); +var json = require('gulp-json-editor'); +function error(err) { + var result = event_stream_1.through(); + setTimeout(function () { return result.emit('error', err); }); + return result; +} +var baseHeaders = { + 'X-Market-Client-Id': 'VSCode Build', + 'User-Agent': 'VSCode Build', +}; +function src(extensionName, version) { + var filterType = 7; + var value = extensionName; + var criterium = { filterType: filterType, value: value }; + var criteria = [criterium]; + var pageNumber = 1; + var pageSize = 1; + var sortBy = 0; + var sortOrder = 0; + var flags = 0x1 | 0x2 | 0x80; + var assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage']; + var filters = [{ criteria: criteria, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, sortOrder: sortOrder }]; + var body = JSON.stringify({ filters: filters, assetTypes: assetTypes, flags: flags }); + var headers = assign({}, baseHeaders, { + 'Content-Type': 'application/json', + 'Accept': 'application/json;api-version=3.0-preview.1', + 'Content-Length': body.length + }); + var options = { + base: 'https://marketplace.visualstudio.com/_apis/public/gallery', + requestOptions: { + method: 'POST', + gzip: true, + headers: headers, + body: body + } + }; + return remote('/extensionquery', options) + .pipe(flatmap(function (stream, f) { + var rawResult = f.contents.toString('utf8'); + var result = JSON.parse(rawResult); + var extension = result.results[0].extensions[0]; + if (!extension) { + return error("No such extension: " + extension); + } + var metadata = { + id: extension.extensionId, + publisherId: extension.publisher, + publisherDisplayName: extension.publisher.displayName + }; + var extensionVersion = extension.versions.filter(function (v) { return v.version === version; })[0]; + if (!extensionVersion) { + return error("No such extension version: " + extensionName + " @ " + version); + } + var asset = extensionVersion.files.filter(function (f) { return f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage'; })[0]; + if (!asset) { + return error("No VSIX found for extension version: " + extensionName + " @ " + version); + } + util.log('Downloading extension:', util.colors.yellow(extensionName + "@" + version), '...'); + var options = { + base: asset.source, + requestOptions: { + gzip: true, + headers: baseHeaders + } + }; + return remote('', options) + .pipe(flatmap(function (stream) { + var packageJsonFilter = filter('package.json', { restore: true }); + return stream + .pipe(vzip.src()) + .pipe(filter('extension/**')) + .pipe(rename(function (p) { return p.dirname = p.dirname.replace(/^extension\/?/, ''); })) + .pipe(packageJsonFilter) + .pipe(buffer()) + .pipe(json({ __metadata: metadata })) + .pipe(packageJsonFilter.restore); + })); + })); +} +exports.src = src; diff --git a/build/lib/git.js b/build/lib/git.js index 8b31b9a2e0f..e9a571b7c9b 100644 --- a/build/lib/git.js +++ b/build/lib/git.js @@ -1,53 +1,53 @@ -/*--------------------------------------------------------------------------------------------- - * 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 fs = require("fs"); -/** - * Returns the sha1 commit version of a repository or undefined in case of failure. - */ -function getVersion(repo) { - var git = path.join(repo, '.git'); - var headPath = path.join(git, 'HEAD'); - var head; - try { - head = fs.readFileSync(headPath, 'utf8').trim(); - } - catch (e) { - return void 0; - } - if (/^[0-9a-f]{40}$/i.test(head)) { - return head; - } - var refMatch = /^ref: (.*)$/.exec(head); - if (!refMatch) { - return void 0; - } - var ref = refMatch[1]; - var refPath = path.join(git, ref); - try { - return fs.readFileSync(refPath, 'utf8').trim(); - } - catch (e) { - // noop - } - var packedRefsPath = path.join(git, 'packed-refs'); - var refsRaw; - try { - refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); - } - catch (e) { - return void 0; - } - var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; - var refsMatch; - var refs = {}; - while (refsMatch = refsRegex.exec(refsRaw)) { - refs[refsMatch[2]] = refsMatch[1]; - } - return refs[ref]; -} -exports.getVersion = getVersion; +/*--------------------------------------------------------------------------------------------- + * 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 fs = require("fs"); +/** + * Returns the sha1 commit version of a repository or undefined in case of failure. + */ +function getVersion(repo) { + var git = path.join(repo, '.git'); + var headPath = path.join(git, 'HEAD'); + var head; + try { + head = fs.readFileSync(headPath, 'utf8').trim(); + } + catch (e) { + return void 0; + } + if (/^[0-9a-f]{40}$/i.test(head)) { + return head; + } + var refMatch = /^ref: (.*)$/.exec(head); + if (!refMatch) { + return void 0; + } + var ref = refMatch[1]; + var refPath = path.join(git, ref); + try { + return fs.readFileSync(refPath, 'utf8').trim(); + } + catch (e) { + // noop + } + var packedRefsPath = path.join(git, 'packed-refs'); + var refsRaw; + try { + refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); + } + catch (e) { + return void 0; + } + var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; + var refsMatch; + var refs = {}; + while (refsMatch = refsRegex.exec(refsRaw)) { + refs[refsMatch[2]] = refsMatch[1]; + } + return refs[ref]; +} +exports.getVersion = getVersion; diff --git a/build/lib/i18n.js b/build/lib/i18n.js index e0bfbe4b987..3f16ccc97f1 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -1,1049 +1,1049 @@ -/*--------------------------------------------------------------------------------------------- - * 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 fs = require("fs"); -var event_stream_1 = require("event-stream"); -var File = require("vinyl"); -var Is = require("is"); -var xml2js = require("xml2js"); -var glob = require("glob"); -var http = require("http"); -var util = require('gulp-util'); -var iconv = require('iconv-lite'); -function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.green('[i18n]'), message].concat(rest)); -} -var LocalizeInfo; -(function (LocalizeInfo) { - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.key) && (Is.undef(candidate.comment) || (Is.array(candidate.comment) && candidate.comment.every(function (element) { return Is.string(element); }))); - } - LocalizeInfo.is = is; -})(LocalizeInfo || (LocalizeInfo = {})); -var BundledFormat; -(function (BundledFormat) { - function is(value) { - if (Is.undef(value)) { - return false; - } - var candidate = value; - var length = Object.keys(value).length; - return length === 3 && Is.defined(candidate.keys) && Is.defined(candidate.messages) && Is.defined(candidate.bundles); - } - BundledFormat.is = is; -})(BundledFormat || (BundledFormat = {})); -var PackageJsonFormat; -(function (PackageJsonFormat) { - function is(value) { - if (Is.undef(value) || !Is.object(value)) { - return false; - } - return Object.keys(value).every(function (key) { - var element = value[key]; - return Is.string(element) || (Is.object(element) && Is.defined(element.message) && Is.defined(element.comment)); - }); - } - PackageJsonFormat.is = is; -})(PackageJsonFormat || (PackageJsonFormat = {})); -var ModuleJsonFormat; -(function (ModuleJsonFormat) { - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); }) - && Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); }); - } - ModuleJsonFormat.is = is; -})(ModuleJsonFormat || (ModuleJsonFormat = {})); -var Line = (function () { - function Line(indent) { - if (indent === void 0) { indent = 0; } - this.indent = indent; - this.buffer = []; - if (indent > 0) { - this.buffer.push(new Array(indent + 1).join(' ')); - } - } - Line.prototype.append = function (value) { - this.buffer.push(value); - return this; - }; - Line.prototype.toString = function () { - return this.buffer.join(''); - }; - return Line; -}()); -exports.Line = Line; -var TextModel = (function () { - function TextModel(contents) { - this._lines = contents.split(/\r\n|\r|\n/); - } - Object.defineProperty(TextModel.prototype, "lines", { - get: function () { - return this._lines; - }, - enumerable: true, - configurable: true - }); - return TextModel; -}()); -var XLF = (function () { - function XLF(project) { - this.project = project; - this.buffer = []; - this.files = Object.create(null); - } - XLF.prototype.toString = function () { - this.appendHeader(); - for (var file in this.files) { - this.appendNewLine("", 2); - for (var _i = 0, _a = this.files[file]; _i < _a.length; _i++) { - var item = _a[_i]; - this.addStringItem(item); - } - this.appendNewLine('', 2); - } - this.appendFooter(); - return this.buffer.join('\r\n'); - }; - XLF.prototype.addFile = function (original, keys, messages) { - this.files[original] = []; - var existingKeys = []; - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - // Ignore duplicate keys because Transifex does not populate those with translated values. - if (existingKeys.indexOf(key) !== -1) { - continue; - } - existingKeys.push(key); - var message = encodeEntities(messages[keys.indexOf(key)]); - var comment = undefined; - // Check if the message contains description (if so, it becomes an object type in JSON) - if (Is.string(key)) { - this.files[original].push({ id: key, message: message, comment: comment }); - } - else { - if (key['comment'] && key['comment'].length > 0) { - comment = key['comment'].map(function (comment) { return encodeEntities(comment); }).join('\r\n'); - } - this.files[original].push({ id: key['key'], message: message, comment: comment }); - } - } - }; - XLF.prototype.addStringItem = function (item) { - if (!item.id || !item.message) { - throw new Error('No item ID or value specified.'); - } - this.appendNewLine("", 4); - this.appendNewLine("" + item.message + "", 6); - if (item.comment) { - this.appendNewLine("" + item.comment + "", 6); - } - this.appendNewLine('', 4); - }; - XLF.prototype.appendHeader = function () { - this.appendNewLine('', 0); - this.appendNewLine('', 0); - }; - XLF.prototype.appendFooter = function () { - this.appendNewLine('', 0); - }; - XLF.prototype.appendNewLine = function (content, indent) { - var line = new Line(indent); - line.append(content); - this.buffer.push(line.toString()); - }; - return XLF; -}()); -XLF.parse = function (xlfString) { - return new Promise(function (resolve, reject) { - var parser = new xml2js.Parser(); - var files = []; - parser.parseString(xlfString, function (err, result) { - if (err) { - reject("Failed to parse XLIFF string. " + err); - } - var fileNodes = result['xliff']['file']; - if (!fileNodes) { - reject('XLIFF file does not contain "xliff" or "file" node(s) required for parsing.'); - } - fileNodes.forEach(function (file) { - var originalFilePath = file.$.original; - if (!originalFilePath) { - reject('XLIFF file node does not contain original attribute to determine the original location of the resource file.'); - } - var language = file.$['target-language'].toLowerCase(); - if (!language) { - reject('XLIFF file node does not contain target-language attribute to determine translated language.'); - } - 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('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 }); - }); - resolve(files); - }); - }); -}; -exports.XLF = XLF; -var vscodeLanguages = [ - 'chs', - 'cht', - 'jpn', - 'kor', - 'deu', - 'fra', - 'esn', - 'rus', - 'ita' -]; -var iso639_3_to_2 = { - 'chs': 'zh-cn', - 'cht': 'zh-tw', - 'csy': 'cs-cz', - 'deu': 'de', - 'enu': 'en', - 'esn': 'es', - 'fra': 'fr', - 'hun': 'hu', - 'ita': 'it', - 'jpn': 'ja', - 'kor': 'ko', - 'nld': 'nl', - 'plk': 'pl', - 'ptb': 'pt-br', - 'ptg': 'pt', - 'rus': 'ru', - 'sve': 'sv-se', - 'trk': 'tr' -}; -/** - * Used to map Transifex to VS Code language code representation. - */ -var iso639_2_to_3 = { - 'zh-hans': 'chs', - 'zh-hant': 'cht', - 'cs-cz': 'csy', - 'de': 'deu', - 'en': 'enu', - 'es': 'esn', - 'fr': 'fra', - 'hu': 'hun', - 'it': 'ita', - 'ja': 'jpn', - 'ko': 'kor', - 'nl': 'nld', - 'pl': 'plk', - 'pt-br': 'ptb', - 'pt': 'ptg', - 'ru': 'rus', - 'sv-se': 'sve', - 'tr': 'trk' -}; -function sortLanguages(directoryNames) { - return directoryNames.map(function (dirName) { - var lower = dirName.toLowerCase(); - return { - name: lower, - iso639_2: iso639_3_to_2[lower] - }; - }).sort(function (a, b) { - if (!a.iso639_2 && !b.iso639_2) { - return 0; - } - if (!a.iso639_2) { - return -1; - } - if (!b.iso639_2) { - return 1; - } - return a.iso639_2 < b.iso639_2 ? -1 : (a.iso639_2 > b.iso639_2 ? 1 : 0); - }); -} -function stripComments(content) { - /** - * First capturing group matches double quoted string - * Second matches single quotes string - * Third matches block comments - * Fourth matches line comments - */ - var regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; - var result = content.replace(regexp, function (match, m1, m2, m3, m4) { - // Only one of m1, m2, m3, m4 matches - if (m3) { - // A block comment. Replace with nothing - return ''; - } - else if (m4) { - // A line comment. If it ends in \r?\n then keep it. - var length_1 = m4.length; - if (length_1 > 2 && m4[length_1 - 1] === '\n') { - return m4[length_1 - 2] === '\r' ? '\r\n' : '\n'; - } - else { - return ''; - } - } - else { - // We match a string - return match; - } - }); - return result; -} -function escapeCharacters(value) { - var result = []; - for (var i = 0; i < value.length; i++) { - var ch = value.charAt(i); - switch (ch) { - case '\'': - result.push('\\\''); - break; - case '"': - result.push('\\"'); - break; - case '\\': - result.push('\\\\'); - break; - case '\n': - result.push('\\n'); - break; - case '\r': - result.push('\\r'); - break; - case '\t': - result.push('\\t'); - break; - case '\b': - result.push('\\b'); - break; - case '\f': - result.push('\\f'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} -function processCoreBundleFormat(fileHeader, json, emitter) { - var keysSection = json.keys; - var messageSection = json.messages; - var bundleSection = json.bundles; - var statistics = Object.create(null); - var total = 0; - var defaultMessages = Object.create(null); - var modules = Object.keys(keysSection); - modules.forEach(function (module) { - var keys = keysSection[module]; - var messages = messageSection[module]; - if (!messages || keys.length !== messages.length) { - emitter.emit('error', "Message for module " + module + " corrupted. Mismatch in number of keys and messages."); - return; - } - var messageMap = Object.create(null); - defaultMessages[module] = messageMap; - keys.map(function (key, i) { - total++; - if (Is.string(key)) { - messageMap[key] = messages[i]; - } - else { - messageMap[key.key] = messages[i]; - } - }); - }); - var languageDirectory = path.join(__dirname, '..', '..', 'i18n'); - var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); - languages.forEach(function (language) { - if (!language.iso639_2) { - return; - } - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("Generating nls bundles for: " + language.iso639_2); - } - statistics[language.iso639_2] = 0; - var localizedModules = Object.create(null); - var cwd = path.join(languageDirectory, language.name, 'src'); - modules.forEach(function (module) { - var order = keysSection[module]; - var i18nFile = path.join(cwd, module) + '.i18n.json'; - var messages = null; - if (fs.existsSync(i18nFile)) { - var content = stripComments(fs.readFileSync(i18nFile, 'utf8')); - messages = JSON.parse(content); - } - else { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("No localized messages found for module " + module + ". Using default messages."); - } - messages = defaultMessages[module]; - statistics[language.iso639_2] = statistics[language.iso639_2] + Object.keys(messages).length; - } - var localizedMessages = []; - order.forEach(function (keyInfo) { - var key = null; - if (Is.string(keyInfo)) { - key = keyInfo; - } - else { - key = keyInfo.key; - } - var message = messages[key]; - if (!message) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("No localized message found for key " + key + " in module " + module + ". Using default message."); - } - message = defaultMessages[module][key]; - statistics[language.iso639_2] = statistics[language.iso639_2] + 1; - } - localizedMessages.push(message); - }); - localizedModules[module] = localizedMessages; - }); - Object.keys(bundleSection).forEach(function (bundle) { - var modules = bundleSection[bundle]; - var contents = [ - fileHeader, - "define(\"" + bundle + ".nls." + language.iso639_2 + "\", {" - ]; - modules.forEach(function (module, index) { - contents.push("\t\"" + module + "\": ["); - var messages = localizedModules[module]; - if (!messages) { - emitter.emit('error', "Didn't find messages for module " + module + "."); - return; - } - messages.forEach(function (message, index) { - contents.push("\t\t\"" + escapeCharacters(message) + (index < messages.length ? '",' : '"')); - }); - contents.push(index < modules.length - 1 ? '\t],' : '\t]'); - }); - contents.push('});'); - emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); - }); - }); - Object.keys(statistics).forEach(function (key) { - var value = statistics[key]; - log(key + " has " + value + " untranslated strings."); - }); - vscodeLanguages.forEach(function (language) { - var iso639_2 = iso639_3_to_2[language]; - if (!iso639_2) { - log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead."); - } - else { - var stats = statistics[iso639_2]; - if (Is.undef(stats)) { - log("\tNo translations found for language " + language + ". Using default language instead."); - } - } - }); -} -function processNlsFiles(opts) { - return event_stream_1.through(function (file) { - var fileName = path.basename(file.path); - if (fileName === 'nls.metadata.json') { - var json = null; - if (file.isBuffer()) { - json = JSON.parse(file.contents.toString('utf8')); - } - else { - this.emit('error', "Failed to read component file: " + file.relative); - } - if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, json, this); - } - } - this.emit('data', file); - }); -} -exports.processNlsFiles = processNlsFiles; -function prepareXlfFiles(projectName, extensionName) { - return event_stream_1.through(function (file) { - if (!file.isBuffer()) { - throw new Error("Failed to read component file: " + file.relative); - } - var extension = path.extname(file.path); - if (extension === '.json') { - var json = JSON.parse(file.contents.toString('utf8')); - if (BundledFormat.is(json)) { - importBundleJson(file, json, this); - } - else if (PackageJsonFormat.is(json) || ModuleJsonFormat.is(json)) { - importModuleOrPackageJson(file, json, projectName, this, extensionName); - } - else { - throw new Error("JSON format cannot be deduced for " + file.relative + "."); - } - } - else if (extension === '.isl') { - importIsl(file, this); - } - }); -} -exports.prepareXlfFiles = prepareXlfFiles; -var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup'; -/** - * Ensure to update those arrays when new resources are pushed to Transifex. - * Used because Transifex does not have API method to pull all project resources. - */ -var editorResources = [ - { name: 'vs/platform', project: editorProject }, - { name: 'vs/editor/contrib', project: editorProject }, - { name: 'vs/editor', project: editorProject }, - { name: 'vs/base', project: editorProject } -]; -var workbenchResources = [ - { name: 'vs/code', project: workbenchProject }, - { name: 'vs/workbench', project: workbenchProject }, - { name: 'vs/workbench/parts/cli', project: workbenchProject }, - { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, - { name: 'vs/workbench/parts/debug', project: workbenchProject }, - { name: 'vs/workbench/parts/emmet', project: workbenchProject }, - { name: 'vs/workbench/parts/execution', project: workbenchProject }, - { name: 'vs/workbench/parts/explorers', project: workbenchProject }, - { name: 'vs/workbench/parts/extensions', project: workbenchProject }, - { name: 'vs/workbench/parts/feedback', project: workbenchProject }, - { name: 'vs/workbench/parts/files', project: workbenchProject }, - { name: 'vs/workbench/parts/git', project: workbenchProject }, - { name: 'vs/workbench/parts/html', project: workbenchProject }, - { name: 'vs/workbench/parts/markers', project: workbenchProject }, - { name: 'vs/workbench/parts/nps', project: workbenchProject }, - { name: 'vs/workbench/parts/output', project: workbenchProject }, - { name: 'vs/workbench/parts/performance', project: workbenchProject }, - { name: 'vs/workbench/parts/preferences', project: workbenchProject }, - { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, - { name: 'vs/workbench/parts/scm', project: workbenchProject }, - { name: 'vs/workbench/parts/search', project: workbenchProject }, - { name: 'vs/workbench/parts/snippets', project: workbenchProject }, - { name: 'vs/workbench/parts/tasks', project: workbenchProject }, - { name: 'vs/workbench/parts/terminal', project: workbenchProject }, - { name: 'vs/workbench/parts/themes', project: workbenchProject }, - { name: 'vs/workbench/parts/trust', project: workbenchProject }, - { name: 'vs/workbench/parts/update', project: workbenchProject }, - { name: 'vs/workbench/parts/watermark', project: workbenchProject }, - { name: 'vs/workbench/parts/welcome', project: workbenchProject }, - { name: 'vs/workbench/services/configuration', project: workbenchProject }, - { name: 'vs/workbench/services/editor', project: workbenchProject }, - { name: 'vs/workbench/services/files', project: workbenchProject }, - { name: 'vs/workbench/services/keybinding', project: workbenchProject }, - { name: 'vs/workbench/services/message', project: workbenchProject }, - { name: 'vs/workbench/services/mode', project: workbenchProject }, - { name: 'vs/workbench/services/textfile', project: workbenchProject }, - { name: 'vs/workbench/services/themes', project: workbenchProject }, - { name: 'setup_messages', project: workbenchProject } -]; -function getResource(sourceFile) { - var resource; - if (sourceFile.startsWith('vs/platform')) { - return { name: 'vs/platform', project: editorProject }; - } - else if (sourceFile.startsWith('vs/editor/contrib')) { - return { name: 'vs/editor/contrib', project: editorProject }; - } - else if (sourceFile.startsWith('vs/editor')) { - return { name: 'vs/editor', project: editorProject }; - } - else if (sourceFile.startsWith('vs/base')) { - return { name: 'vs/base', project: editorProject }; - } - else if (sourceFile.startsWith('vs/code')) { - return { name: 'vs/code', project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench/parts')) { - resource = sourceFile.split('/', 4).join('/'); - return { name: resource, project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench/services')) { - resource = sourceFile.split('/', 4).join('/'); - return { name: resource, project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench')) { - return { name: 'vs/workbench', project: workbenchProject }; - } - throw new Error("Could not identify the XLF bundle for " + sourceFile); -} -exports.getResource = getResource; -function importBundleJson(file, json, stream) { - var bundleXlfs = Object.create(null); - for (var source in json.keys) { - var projectResource = getResource(source); - var resource = projectResource.name; - var project = projectResource.project; - var keys = json.keys[source]; - var messages = json.messages[source]; - if (keys.length !== messages.length) { - throw new Error("There is a mismatch between keys and messages in " + file.relative); - } - var xlf = bundleXlfs[resource] ? bundleXlfs[resource] : bundleXlfs[resource] = new XLF(project); - xlf.addFile('src/' + source, keys, messages); - } - for (var resource in bundleXlfs) { - var newFilePath = bundleXlfs[resource].project + "/" + resource.replace(/\//g, '_') + ".xlf"; - var xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); - stream.emit('data', xlfFile); - } -} -// Keeps existing XLF instances and a state of how many files were already processed for faster file emission -var extensions = Object.create(null); -function importModuleOrPackageJson(file, json, projectName, stream, extensionName) { - if (ModuleJsonFormat.is(json) && json['keys'].length !== json['messages'].length) { - throw new Error("There is a mismatch between keys and messages in " + file.relative); - } - // Prepare the source path for attribute in XLF & extract messages from JSON - var formattedSourcePath = file.relative.replace(/\\/g, '/'); - var messages = Object.keys(json).map(function (key) { return json[key].toString(); }); - // Stores the amount of localization files to be transformed to XLF before the emission - var localizationFilesCount, originalFilePath; - // If preparing XLF for external extension, then use different glob pattern and source path - if (extensionName) { - localizationFilesCount = glob.sync('**/*.nls.json').length; - originalFilePath = "" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); - } - else { - // Used for vscode/extensions folder - extensionName = formattedSourcePath.split('/')[0]; - localizationFilesCount = glob.sync("./extensions/" + extensionName + "/**/*.nls.json").length; - originalFilePath = "extensions/" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); - } - var extension = extensions[extensionName] ? - extensions[extensionName] : extensions[extensionName] = { xlf: new XLF(projectName), processed: 0 }; - if (ModuleJsonFormat.is(json)) { - extension.xlf.addFile(originalFilePath, json['keys'], json['messages']); - } - else { - extension.xlf.addFile(originalFilePath, Object.keys(json), messages); - } - // Check if XLF is populated with file nodes to emit it - if (++extensions[extensionName].processed === localizationFilesCount) { - var newFilePath = path.join(projectName, extensionName + '.xlf'); - var xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); - stream.emit('data', xlfFile); - } -} -function importIsl(file, stream) { - var projectName, resourceFile; - if (path.basename(file.path) === 'Default.isl') { - projectName = setupProject; - resourceFile = 'setup_default.xlf'; - } - else { - projectName = workbenchProject; - resourceFile = 'setup_messages.xlf'; - } - var xlf = new XLF(projectName), keys = [], messages = []; - var model = new TextModel(file.contents.toString()); - var inMessageSection = false; - model.lines.forEach(function (line) { - if (line.length === 0) { - return; - } - var firstChar = line.charAt(0); - switch (firstChar) { - case ';': - // Comment line; - return; - case '[': - inMessageSection = '[Messages]' === line || '[CustomMessages]' === line; - return; - } - if (!inMessageSection) { - return; - } - var sections = line.split('='); - if (sections.length !== 2) { - throw new Error("Badly formatted message found: " + line); - } - else { - var key = sections[0]; - var value = sections[1]; - if (key.length > 0 && value.length > 0) { - keys.push(key); - messages.push(value); - } - } - }); - var originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); - xlf.addFile(originalPath, keys, messages); - // Emit only upon all ISL files combined into single XLF instance - var newFilePath = path.join(projectName, resourceFile); - var xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); - stream.emit('data', xlfFile); -} -function pushXlfFiles(apiHostname, username, password) { - var tryGetPromises = []; - var updateCreatePromises = []; - return event_stream_1.through(function (file) { - var project = path.dirname(file.relative); - var fileName = path.basename(file.path); - var slug = fileName.substr(0, fileName.length - '.xlf'.length); - var credentials = username + ":" + password; - // Check if resource already exists, if not, then create it. - var promise = tryGetResource(project, slug, apiHostname, credentials); - tryGetPromises.push(promise); - promise.then(function (exists) { - if (exists) { - promise = updateResource(project, slug, file, apiHostname, credentials); - } - else { - promise = createResource(project, slug, file, apiHostname, credentials); - } - updateCreatePromises.push(promise); - }); - }, function () { - var _this = this; - // End the pipe only after all the communication with Transifex API happened - Promise.all(tryGetPromises).then(function () { - Promise.all(updateCreatePromises).then(function () { - _this.emit('end'); - }).catch(function (reason) { throw new Error(reason); }); - }).catch(function (reason) { throw new Error(reason); }); - }); -} -exports.pushXlfFiles = pushXlfFiles; -function tryGetResource(project, slug, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/?details", - auth: credentials, - method: 'GET' - }; - var request = http.request(options, function (response) { - if (response.statusCode === 404) { - resolve(false); - } - else if (response.statusCode === 200) { - resolve(true); - } - else { - reject("Failed to query resource " + project + "/" + slug + ". Response: " + response.statusCode + " " + response.statusMessage); - } - }); - request.on('error', function (err) { - reject("Failed to get " + project + "/" + slug + " on Transifex: " + err); - }); - request.end(); - }); -} -function createResource(project, slug, xlfFile, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var data = JSON.stringify({ - 'content': xlfFile.contents.toString(), - 'name': slug, - 'slug': slug, - 'i18n_type': 'XLIFF' - }); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resources", - headers: { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(data) - }, - auth: credentials, - method: 'POST' - }; - var request = http.request(options, function (res) { - if (res.statusCode === 201) { - log("Resource " + project + "/" + slug + " successfully created on Transifex."); - } - else { - reject("Something went wrong in the request creating " + slug + " in " + project + ". " + res.statusCode); - } - }); - request.on('error', function (err) { - reject("Failed to create " + project + "/" + slug + " on Transifex: " + err); - }); - request.write(data); - request.end(); - }); -} -/** - * The following link provides information about how Transifex handles updates of a resource file: - * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files - */ -function updateResource(project, slug, xlfFile, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var data = JSON.stringify({ content: xlfFile.contents.toString() }); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/content", - headers: { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(data) - }, - auth: credentials, - method: 'PUT' - }; - var request = http.request(options, function (res) { - if (res.statusCode === 200) { - res.setEncoding('utf8'); - var responseBuffer_1 = ''; - res.on('data', function (chunk) { - responseBuffer_1 += chunk; - }); - res.on('end', function () { - var response = JSON.parse(responseBuffer_1); - log("Resource " + project + "/" + slug + " successfully updated on Transifex. Strings added: " + response.strings_added + ", updated: " + response.strings_added + ", deleted: " + response.strings_added); - resolve(); - }); - } - else { - reject("Something went wrong in the request updating " + slug + " in " + project + ". " + res.statusCode); - } - }); - request.on('error', function (err) { - reject("Failed to update " + project + "/" + slug + " on Transifex: " + err); - }); - request.write(data); - request.end(); - }); -} -function obtainProjectResources(projectName) { - var resources = []; - if (projectName === editorProject) { - resources = editorResources; - } - else if (projectName === workbenchProject) { - resources = workbenchResources; - } - else if (projectName === extensionsProject) { - var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; }); - var resourcesToPull_1 = []; - extensionsToLocalize.forEach(function (extension) { - if (resourcesToPull_1.indexOf(extension) === -1) { - resourcesToPull_1.push(extension); - resources.push({ name: extension, project: projectName }); - } - }); - } - else if (projectName === setupProject) { - resources.push({ name: 'setup_default', project: setupProject }); - } - return resources; -} -function pullXlfFiles(projectName, apiHostname, username, password, languages, resources) { - if (!resources) { - resources = obtainProjectResources(projectName); - } - if (!resources) { - throw new Error('Transifex projects and resources must be defined to be able to pull translations from Transifex.'); - } - var credentials = username + ":" + password; - var expectedTranslationsCount = languages.length * resources.length; - var translationsRetrieved = 0, called = false; - return event_stream_1.readable(function (count, callback) { - // Mark end of stream when all resources were retrieved - if (translationsRetrieved === expectedTranslationsCount) { - return this.emit('end'); - } - if (!called) { - called = true; - var stream_1 = this; - // Retrieve XLF files from main projects - languages.map(function (language) { - resources.map(function (resource) { - retrieveResource(language, resource, apiHostname, credentials).then(function (file) { - stream_1.emit('data', file); - translationsRetrieved++; - }).catch(function (error) { throw new Error(error); }); - }); - }); - } - callback(); - }); -} -exports.pullXlfFiles = pullXlfFiles; -function retrieveResource(language, resource, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var slug = resource.name.replace(/\//g, '_'); - var project = resource.project; - var iso639 = language.toLowerCase(); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + iso639 + "?file&mode=onlyreviewed", - auth: credentials, - method: 'GET' - }; - var request = http.request(options, function (res) { - var xlfBuffer = []; - res.on('data', function (chunk) { return xlfBuffer.push(chunk); }); - res.on('end', function () { - if (res.statusCode === 200) { - resolve(new File({ contents: Buffer.concat(xlfBuffer), path: project + "/" + iso639_2_to_3[language] + "/" + slug + ".xlf" })); - } - reject(slug + " in " + project + " returned no data. Response code: " + res.statusCode + "."); - }); - }); - request.on('error', function (err) { - reject("Failed to query resource " + slug + " with the following error: " + err); - }); - request.end(); - }); -} -function prepareJsonFiles() { - var parsePromises = []; - return event_stream_1.through(function (xlf) { - var stream = this; - var parsePromise = XLF.parse(xlf.contents.toString()); - parsePromises.push(parsePromise); - parsePromise.then(function (resolvedFiles) { - resolvedFiles.forEach(function (file) { - var messages = file.messages, translatedFile; - // ISL file path always starts with 'build/' - if (file.originalFilePath.startsWith('build/')) { - var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; - if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { - return; - } - translatedFile = createIslFile('..', file.originalFilePath, messages, iso639_2_to_3[file.language]); - } - else { - translatedFile = createI18nFile(iso639_2_to_3[file.language], file.originalFilePath, messages); - } - stream.emit('data', translatedFile); - }); - }, function (rejectReason) { - throw new Error("XLF parsing error: " + rejectReason); - }); - }, function () { - var _this = this; - Promise.all(parsePromises) - .then(function () { _this.emit('end'); }) - .catch(function (reason) { throw new Error(reason); }); - }); -} -exports.prepareJsonFiles = prepareJsonFiles; -function createI18nFile(base, originalFilePath, messages) { - var content = [ - '/*---------------------------------------------------------------------------------------------', - ' * 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.' - ].join('\n') + '\n' + JSON.stringify(messages, null, '\t').replace(/\r\n/g, '\n'); - return new File({ - path: path.join(base, originalFilePath + '.i18n.json'), - contents: new Buffer(content, 'utf8') - }); -} -var languageNames = { - 'chs': 'Simplified Chinese', - 'cht': 'Traditional Chinese', - 'kor': 'Korean' -}; -var languageIds = { - 'chs': '$0804', - 'cht': '$0404', - 'kor': '$0412' -}; -var encodings = { - 'chs': 'CP936', - 'cht': 'CP950', - 'jpn': 'CP932', - 'kor': 'CP949', - 'deu': 'CP1252', - 'fra': 'CP1252', - 'esn': 'CP1252', - 'rus': 'CP1251', - 'ita': 'CP1252' -}; -function createIslFile(base, originalFilePath, messages, language) { - var content = []; - var originalContent; - if (path.basename(originalFilePath) === 'Default') { - originalContent = new TextModel(fs.readFileSync(originalFilePath + '.isl', 'utf8')); - } - else { - originalContent = new TextModel(fs.readFileSync(originalFilePath + '.en.isl', 'utf8')); - } - originalContent.lines.forEach(function (line) { - if (line.length > 0) { - var firstChar = line.charAt(0); - if (firstChar === '[' || firstChar === ';') { - if (line === '; *** Inno Setup version 5.5.3+ English messages ***') { - content.push("; *** Inno Setup version 5.5.3+ " + languageNames[language] + " messages ***"); - } - else { - content.push(line); - } - } - else { - var sections = line.split('='); - var key = sections[0]; - var translated = line; - if (key) { - if (key === 'LanguageName') { - translated = key + "=" + languageNames[language]; - } - else if (key === 'LanguageID') { - translated = key + "=" + languageIds[language]; - } - else if (key === 'LanguageCodePage') { - translated = key + "=" + encodings[language].substr(2); - } - else { - var translatedMessage = messages[key]; - if (translatedMessage) { - translated = key + "=" + translatedMessage; - } - } - } - content.push(translated); - } - } - }); - var tag = iso639_3_to_2[language]; - var basename = path.basename(originalFilePath); - var filePath = path.join(base, path.dirname(originalFilePath), basename) + "." + tag + ".isl"; - return new File({ - path: filePath, - contents: iconv.encode(new Buffer(content.join('\r\n'), 'utf8'), encodings[language]) - }); -} -function encodeEntities(value) { - var result = []; - for (var i = 0; i < value.length; i++) { - var ch = value[i]; - switch (ch) { - case '<': - result.push('<'); - break; - case '>': - result.push('>'); - break; - case '&': - result.push('&'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} -function decodeEntities(value) { - return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); -} +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var fs = require("fs"); +var event_stream_1 = require("event-stream"); +var File = require("vinyl"); +var Is = require("is"); +var xml2js = require("xml2js"); +var glob = require("glob"); +var http = require("http"); +var util = require('gulp-util'); +var iconv = require('iconv-lite'); +function log(message) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + util.log.apply(util, [util.colors.green('[i18n]'), message].concat(rest)); +} +var LocalizeInfo; +(function (LocalizeInfo) { + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.key) && (Is.undef(candidate.comment) || (Is.array(candidate.comment) && candidate.comment.every(function (element) { return Is.string(element); }))); + } + LocalizeInfo.is = is; +})(LocalizeInfo || (LocalizeInfo = {})); +var BundledFormat; +(function (BundledFormat) { + function is(value) { + if (Is.undef(value)) { + return false; + } + var candidate = value; + var length = Object.keys(value).length; + return length === 3 && Is.defined(candidate.keys) && Is.defined(candidate.messages) && Is.defined(candidate.bundles); + } + BundledFormat.is = is; +})(BundledFormat || (BundledFormat = {})); +var PackageJsonFormat; +(function (PackageJsonFormat) { + function is(value) { + if (Is.undef(value) || !Is.object(value)) { + return false; + } + return Object.keys(value).every(function (key) { + var element = value[key]; + return Is.string(element) || (Is.object(element) && Is.defined(element.message) && Is.defined(element.comment)); + }); + } + PackageJsonFormat.is = is; +})(PackageJsonFormat || (PackageJsonFormat = {})); +var ModuleJsonFormat; +(function (ModuleJsonFormat) { + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); }) + && Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); }); + } + ModuleJsonFormat.is = is; +})(ModuleJsonFormat || (ModuleJsonFormat = {})); +var Line = (function () { + function Line(indent) { + if (indent === void 0) { indent = 0; } + this.indent = indent; + this.buffer = []; + if (indent > 0) { + this.buffer.push(new Array(indent + 1).join(' ')); + } + } + Line.prototype.append = function (value) { + this.buffer.push(value); + return this; + }; + Line.prototype.toString = function () { + return this.buffer.join(''); + }; + return Line; +}()); +exports.Line = Line; +var TextModel = (function () { + function TextModel(contents) { + this._lines = contents.split(/\r\n|\r|\n/); + } + Object.defineProperty(TextModel.prototype, "lines", { + get: function () { + return this._lines; + }, + enumerable: true, + configurable: true + }); + return TextModel; +}()); +var XLF = (function () { + function XLF(project) { + this.project = project; + this.buffer = []; + this.files = Object.create(null); + } + XLF.prototype.toString = function () { + this.appendHeader(); + for (var file in this.files) { + this.appendNewLine("", 2); + for (var _i = 0, _a = this.files[file]; _i < _a.length; _i++) { + var item = _a[_i]; + this.addStringItem(item); + } + this.appendNewLine('', 2); + } + this.appendFooter(); + return this.buffer.join('\r\n'); + }; + XLF.prototype.addFile = function (original, keys, messages) { + this.files[original] = []; + var existingKeys = []; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + // Ignore duplicate keys because Transifex does not populate those with translated values. + if (existingKeys.indexOf(key) !== -1) { + continue; + } + existingKeys.push(key); + var message = encodeEntities(messages[keys.indexOf(key)]); + var comment = undefined; + // Check if the message contains description (if so, it becomes an object type in JSON) + if (Is.string(key)) { + this.files[original].push({ id: key, message: message, comment: comment }); + } + else { + if (key['comment'] && key['comment'].length > 0) { + comment = key['comment'].map(function (comment) { return encodeEntities(comment); }).join('\r\n'); + } + this.files[original].push({ id: key['key'], message: message, comment: comment }); + } + } + }; + XLF.prototype.addStringItem = function (item) { + if (!item.id || !item.message) { + throw new Error('No item ID or value specified.'); + } + this.appendNewLine("", 4); + this.appendNewLine("" + item.message + "", 6); + if (item.comment) { + this.appendNewLine("" + item.comment + "", 6); + } + this.appendNewLine('', 4); + }; + XLF.prototype.appendHeader = function () { + this.appendNewLine('', 0); + this.appendNewLine('', 0); + }; + XLF.prototype.appendFooter = function () { + this.appendNewLine('', 0); + }; + XLF.prototype.appendNewLine = function (content, indent) { + var line = new Line(indent); + line.append(content); + this.buffer.push(line.toString()); + }; + return XLF; +}()); +XLF.parse = function (xlfString) { + return new Promise(function (resolve, reject) { + var parser = new xml2js.Parser(); + var files = []; + parser.parseString(xlfString, function (err, result) { + if (err) { + reject("Failed to parse XLIFF string. " + err); + } + var fileNodes = result['xliff']['file']; + if (!fileNodes) { + reject('XLIFF file does not contain "xliff" or "file" node(s) required for parsing.'); + } + fileNodes.forEach(function (file) { + var originalFilePath = file.$.original; + if (!originalFilePath) { + reject('XLIFF file node does not contain original attribute to determine the original location of the resource file.'); + } + var language = file.$['target-language'].toLowerCase(); + if (!language) { + reject('XLIFF file node does not contain target-language attribute to determine translated language.'); + } + 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('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 }); + }); + resolve(files); + }); + }); +}; +exports.XLF = XLF; +var vscodeLanguages = [ + 'chs', + 'cht', + 'jpn', + 'kor', + 'deu', + 'fra', + 'esn', + 'rus', + 'ita' +]; +var iso639_3_to_2 = { + 'chs': 'zh-cn', + 'cht': 'zh-tw', + 'csy': 'cs-cz', + 'deu': 'de', + 'enu': 'en', + 'esn': 'es', + 'fra': 'fr', + 'hun': 'hu', + 'ita': 'it', + 'jpn': 'ja', + 'kor': 'ko', + 'nld': 'nl', + 'plk': 'pl', + 'ptb': 'pt-br', + 'ptg': 'pt', + 'rus': 'ru', + 'sve': 'sv-se', + 'trk': 'tr' +}; +/** + * Used to map Transifex to VS Code language code representation. + */ +var iso639_2_to_3 = { + 'zh-hans': 'chs', + 'zh-hant': 'cht', + 'cs-cz': 'csy', + 'de': 'deu', + 'en': 'enu', + 'es': 'esn', + 'fr': 'fra', + 'hu': 'hun', + 'it': 'ita', + 'ja': 'jpn', + 'ko': 'kor', + 'nl': 'nld', + 'pl': 'plk', + 'pt-br': 'ptb', + 'pt': 'ptg', + 'ru': 'rus', + 'sv-se': 'sve', + 'tr': 'trk' +}; +function sortLanguages(directoryNames) { + return directoryNames.map(function (dirName) { + var lower = dirName.toLowerCase(); + return { + name: lower, + iso639_2: iso639_3_to_2[lower] + }; + }).sort(function (a, b) { + if (!a.iso639_2 && !b.iso639_2) { + return 0; + } + if (!a.iso639_2) { + return -1; + } + if (!b.iso639_2) { + return 1; + } + return a.iso639_2 < b.iso639_2 ? -1 : (a.iso639_2 > b.iso639_2 ? 1 : 0); + }); +} +function stripComments(content) { + /** + * First capturing group matches double quoted string + * Second matches single quotes string + * Third matches block comments + * Fourth matches line comments + */ + var regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; + var result = content.replace(regexp, function (match, m1, m2, m3, m4) { + // Only one of m1, m2, m3, m4 matches + if (m3) { + // A block comment. Replace with nothing + return ''; + } + else if (m4) { + // A line comment. If it ends in \r?\n then keep it. + var length_1 = m4.length; + if (length_1 > 2 && m4[length_1 - 1] === '\n') { + return m4[length_1 - 2] === '\r' ? '\r\n' : '\n'; + } + else { + return ''; + } + } + else { + // We match a string + return match; + } + }); + return result; +} +function escapeCharacters(value) { + var result = []; + for (var i = 0; i < value.length; i++) { + var ch = value.charAt(i); + switch (ch) { + case '\'': + result.push('\\\''); + break; + case '"': + result.push('\\"'); + break; + case '\\': + result.push('\\\\'); + break; + case '\n': + result.push('\\n'); + break; + case '\r': + result.push('\\r'); + break; + case '\t': + result.push('\\t'); + break; + case '\b': + result.push('\\b'); + break; + case '\f': + result.push('\\f'); + break; + default: + result.push(ch); + } + } + return result.join(''); +} +function processCoreBundleFormat(fileHeader, json, emitter) { + var keysSection = json.keys; + var messageSection = json.messages; + var bundleSection = json.bundles; + var statistics = Object.create(null); + var total = 0; + var defaultMessages = Object.create(null); + var modules = Object.keys(keysSection); + modules.forEach(function (module) { + var keys = keysSection[module]; + var messages = messageSection[module]; + if (!messages || keys.length !== messages.length) { + emitter.emit('error', "Message for module " + module + " corrupted. Mismatch in number of keys and messages."); + return; + } + var messageMap = Object.create(null); + defaultMessages[module] = messageMap; + keys.map(function (key, i) { + total++; + if (Is.string(key)) { + messageMap[key] = messages[i]; + } + else { + messageMap[key.key] = messages[i]; + } + }); + }); + var languageDirectory = path.join(__dirname, '..', '..', 'i18n'); + var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); + languages.forEach(function (language) { + if (!language.iso639_2) { + return; + } + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("Generating nls bundles for: " + language.iso639_2); + } + statistics[language.iso639_2] = 0; + var localizedModules = Object.create(null); + var cwd = path.join(languageDirectory, language.name, 'src'); + modules.forEach(function (module) { + var order = keysSection[module]; + var i18nFile = path.join(cwd, module) + '.i18n.json'; + var messages = null; + if (fs.existsSync(i18nFile)) { + var content = stripComments(fs.readFileSync(i18nFile, 'utf8')); + messages = JSON.parse(content); + } + else { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("No localized messages found for module " + module + ". Using default messages."); + } + messages = defaultMessages[module]; + statistics[language.iso639_2] = statistics[language.iso639_2] + Object.keys(messages).length; + } + var localizedMessages = []; + order.forEach(function (keyInfo) { + var key = null; + if (Is.string(keyInfo)) { + key = keyInfo; + } + else { + key = keyInfo.key; + } + var message = messages[key]; + if (!message) { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("No localized message found for key " + key + " in module " + module + ". Using default message."); + } + message = defaultMessages[module][key]; + statistics[language.iso639_2] = statistics[language.iso639_2] + 1; + } + localizedMessages.push(message); + }); + localizedModules[module] = localizedMessages; + }); + Object.keys(bundleSection).forEach(function (bundle) { + var modules = bundleSection[bundle]; + var contents = [ + fileHeader, + "define(\"" + bundle + ".nls." + language.iso639_2 + "\", {" + ]; + modules.forEach(function (module, index) { + contents.push("\t\"" + module + "\": ["); + var messages = localizedModules[module]; + if (!messages) { + emitter.emit('error', "Didn't find messages for module " + module + "."); + return; + } + messages.forEach(function (message, index) { + contents.push("\t\t\"" + escapeCharacters(message) + (index < messages.length ? '",' : '"')); + }); + contents.push(index < modules.length - 1 ? '\t],' : '\t]'); + }); + contents.push('});'); + emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); + }); + }); + Object.keys(statistics).forEach(function (key) { + var value = statistics[key]; + log(key + " has " + value + " untranslated strings."); + }); + vscodeLanguages.forEach(function (language) { + var iso639_2 = iso639_3_to_2[language]; + if (!iso639_2) { + log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead."); + } + else { + var stats = statistics[iso639_2]; + if (Is.undef(stats)) { + log("\tNo translations found for language " + language + ". Using default language instead."); + } + } + }); +} +function processNlsFiles(opts) { + return event_stream_1.through(function (file) { + var fileName = path.basename(file.path); + if (fileName === 'nls.metadata.json') { + var json = null; + if (file.isBuffer()) { + json = JSON.parse(file.contents.toString('utf8')); + } + else { + this.emit('error', "Failed to read component file: " + file.relative); + } + if (BundledFormat.is(json)) { + processCoreBundleFormat(opts.fileHeader, json, this); + } + } + this.emit('data', file); + }); +} +exports.processNlsFiles = processNlsFiles; +function prepareXlfFiles(projectName, extensionName) { + return event_stream_1.through(function (file) { + if (!file.isBuffer()) { + throw new Error("Failed to read component file: " + file.relative); + } + var extension = path.extname(file.path); + if (extension === '.json') { + var json = JSON.parse(file.contents.toString('utf8')); + if (BundledFormat.is(json)) { + importBundleJson(file, json, this); + } + else if (PackageJsonFormat.is(json) || ModuleJsonFormat.is(json)) { + importModuleOrPackageJson(file, json, projectName, this, extensionName); + } + else { + throw new Error("JSON format cannot be deduced for " + file.relative + "."); + } + } + else if (extension === '.isl') { + importIsl(file, this); + } + }); +} +exports.prepareXlfFiles = prepareXlfFiles; +var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup'; +/** + * Ensure to update those arrays when new resources are pushed to Transifex. + * Used because Transifex does not have API method to pull all project resources. + */ +var editorResources = [ + { name: 'vs/platform', project: editorProject }, + { name: 'vs/editor/contrib', project: editorProject }, + { name: 'vs/editor', project: editorProject }, + { name: 'vs/base', project: editorProject } +]; +var workbenchResources = [ + { name: 'vs/code', project: workbenchProject }, + { name: 'vs/workbench', project: workbenchProject }, + { name: 'vs/workbench/parts/cli', project: workbenchProject }, + { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, + { name: 'vs/workbench/parts/debug', project: workbenchProject }, + { name: 'vs/workbench/parts/emmet', project: workbenchProject }, + { name: 'vs/workbench/parts/execution', project: workbenchProject }, + { name: 'vs/workbench/parts/explorers', project: workbenchProject }, + { name: 'vs/workbench/parts/extensions', project: workbenchProject }, + { name: 'vs/workbench/parts/feedback', project: workbenchProject }, + { name: 'vs/workbench/parts/files', project: workbenchProject }, + { name: 'vs/workbench/parts/html', project: workbenchProject }, + { name: 'vs/workbench/parts/markers', project: workbenchProject }, + { name: 'vs/workbench/parts/nps', project: workbenchProject }, + { name: 'vs/workbench/parts/output', project: workbenchProject }, + { name: 'vs/workbench/parts/performance', project: workbenchProject }, + { name: 'vs/workbench/parts/preferences', project: workbenchProject }, + { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, + { name: 'vs/workbench/parts/scm', project: workbenchProject }, + { name: 'vs/workbench/parts/search', project: workbenchProject }, + { name: 'vs/workbench/parts/snippets', project: workbenchProject }, + { name: 'vs/workbench/parts/tasks', project: workbenchProject }, + { name: 'vs/workbench/parts/terminal', project: workbenchProject }, + { name: 'vs/workbench/parts/themes', project: workbenchProject }, + { name: 'vs/workbench/parts/trust', project: workbenchProject }, + { name: 'vs/workbench/parts/update', project: workbenchProject }, + { name: 'vs/workbench/parts/watermark', project: workbenchProject }, + { name: 'vs/workbench/parts/welcome', project: workbenchProject }, + { name: 'vs/workbench/services/configuration', project: workbenchProject }, + { name: 'vs/workbench/services/editor', project: workbenchProject }, + { name: 'vs/workbench/services/files', project: workbenchProject }, + { name: 'vs/workbench/services/keybinding', project: workbenchProject }, + { name: 'vs/workbench/services/message', project: workbenchProject }, + { name: 'vs/workbench/services/mode', project: workbenchProject }, + { name: 'vs/workbench/services/textfile', project: workbenchProject }, + { name: 'vs/workbench/services/themes', project: workbenchProject }, + { name: 'setup_messages', project: workbenchProject } +]; +function getResource(sourceFile) { + var resource; + if (/^vs\/platform/.test(sourceFile)) { + return { name: 'vs/platform', project: editorProject }; + } + else if (/^vs\/editor\/contrib/.test(sourceFile)) { + return { name: 'vs/editor/contrib', project: editorProject }; + } + else if (/^vs\/editor/.test(sourceFile)) { + return { name: 'vs/editor', project: editorProject }; + } + else if (/^vs\/base/.test(sourceFile)) { + return { name: 'vs/base', project: editorProject }; + } + else if (/^vs\/code/.test(sourceFile)) { + return { name: 'vs/code', project: workbenchProject }; + } + else if (/^vs\/workbench\/parts/.test(sourceFile)) { + resource = sourceFile.split('/', 4).join('/'); + return { name: resource, project: workbenchProject }; + } + else if (/^vs\/workbench\/services/.test(sourceFile)) { + resource = sourceFile.split('/', 4).join('/'); + return { name: resource, project: workbenchProject }; + } + else if (/^vs\/workbench/.test(sourceFile)) { + return { name: 'vs/workbench', project: workbenchProject }; + } + throw new Error("Could not identify the XLF bundle for " + sourceFile); +} +exports.getResource = getResource; +function importBundleJson(file, json, stream) { + var bundleXlfs = Object.create(null); + for (var source in json.keys) { + var projectResource = getResource(source); + var resource = projectResource.name; + var project = projectResource.project; + var keys = json.keys[source]; + var messages = json.messages[source]; + if (keys.length !== messages.length) { + throw new Error("There is a mismatch between keys and messages in " + file.relative); + } + var xlf = bundleXlfs[resource] ? bundleXlfs[resource] : bundleXlfs[resource] = new XLF(project); + xlf.addFile('src/' + source, keys, messages); + } + for (var resource in bundleXlfs) { + var newFilePath = bundleXlfs[resource].project + "/" + resource.replace(/\//g, '_') + ".xlf"; + var xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); + stream.emit('data', xlfFile); + } +} +// Keeps existing XLF instances and a state of how many files were already processed for faster file emission +var extensions = Object.create(null); +function importModuleOrPackageJson(file, json, projectName, stream, extensionName) { + if (ModuleJsonFormat.is(json) && json['keys'].length !== json['messages'].length) { + throw new Error("There is a mismatch between keys and messages in " + file.relative); + } + // Prepare the source path for attribute in XLF & extract messages from JSON + var formattedSourcePath = file.relative.replace(/\\/g, '/'); + var messages = Object.keys(json).map(function (key) { return json[key].toString(); }); + // Stores the amount of localization files to be transformed to XLF before the emission + var localizationFilesCount, originalFilePath; + // If preparing XLF for external extension, then use different glob pattern and source path + if (extensionName) { + localizationFilesCount = glob.sync('**/*.nls.json').length; + originalFilePath = "" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); + } + else { + // Used for vscode/extensions folder + extensionName = formattedSourcePath.split('/')[0]; + localizationFilesCount = glob.sync("./extensions/" + extensionName + "/**/*.nls.json").length; + originalFilePath = "extensions/" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); + } + var extension = extensions[extensionName] ? + extensions[extensionName] : extensions[extensionName] = { xlf: new XLF(projectName), processed: 0 }; + if (ModuleJsonFormat.is(json)) { + extension.xlf.addFile(originalFilePath, json['keys'], json['messages']); + } + else { + extension.xlf.addFile(originalFilePath, Object.keys(json), messages); + } + // Check if XLF is populated with file nodes to emit it + if (++extensions[extensionName].processed === localizationFilesCount) { + var newFilePath = path.join(projectName, extensionName + '.xlf'); + var xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); + stream.emit('data', xlfFile); + } +} +function importIsl(file, stream) { + var projectName, resourceFile; + if (path.basename(file.path) === 'Default.isl') { + projectName = setupProject; + resourceFile = 'setup_default.xlf'; + } + else { + projectName = workbenchProject; + resourceFile = 'setup_messages.xlf'; + } + var xlf = new XLF(projectName), keys = [], messages = []; + var model = new TextModel(file.contents.toString()); + var inMessageSection = false; + model.lines.forEach(function (line) { + if (line.length === 0) { + return; + } + var firstChar = line.charAt(0); + switch (firstChar) { + case ';': + // Comment line; + return; + case '[': + inMessageSection = '[Messages]' === line || '[CustomMessages]' === line; + return; + } + if (!inMessageSection) { + return; + } + var sections = line.split('='); + if (sections.length !== 2) { + throw new Error("Badly formatted message found: " + line); + } + else { + var key = sections[0]; + var value = sections[1]; + if (key.length > 0 && value.length > 0) { + keys.push(key); + messages.push(value); + } + } + }); + var originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); + xlf.addFile(originalPath, keys, messages); + // Emit only upon all ISL files combined into single XLF instance + var newFilePath = path.join(projectName, resourceFile); + var xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); + stream.emit('data', xlfFile); +} +function pushXlfFiles(apiHostname, username, password) { + var tryGetPromises = []; + var updateCreatePromises = []; + return event_stream_1.through(function (file) { + var project = path.dirname(file.relative); + var fileName = path.basename(file.path); + var slug = fileName.substr(0, fileName.length - '.xlf'.length); + var credentials = username + ":" + password; + // Check if resource already exists, if not, then create it. + var promise = tryGetResource(project, slug, apiHostname, credentials); + tryGetPromises.push(promise); + promise.then(function (exists) { + if (exists) { + promise = updateResource(project, slug, file, apiHostname, credentials); + } + else { + promise = createResource(project, slug, file, apiHostname, credentials); + } + updateCreatePromises.push(promise); + }); + }, function () { + var _this = this; + // End the pipe only after all the communication with Transifex API happened + Promise.all(tryGetPromises).then(function () { + Promise.all(updateCreatePromises).then(function () { + _this.emit('end'); + }).catch(function (reason) { throw new Error(reason); }); + }).catch(function (reason) { throw new Error(reason); }); + }); +} +exports.pushXlfFiles = pushXlfFiles; +function tryGetResource(project, slug, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/?details", + auth: credentials, + method: 'GET' + }; + var request = http.request(options, function (response) { + if (response.statusCode === 404) { + resolve(false); + } + else if (response.statusCode === 200) { + resolve(true); + } + else { + reject("Failed to query resource " + project + "/" + slug + ". Response: " + response.statusCode + " " + response.statusMessage); + } + }); + request.on('error', function (err) { + reject("Failed to get " + project + "/" + slug + " on Transifex: " + err); + }); + request.end(); + }); +} +function createResource(project, slug, xlfFile, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var data = JSON.stringify({ + 'content': xlfFile.contents.toString(), + 'name': slug, + 'slug': slug, + 'i18n_type': 'XLIFF' + }); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resources", + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(data) + }, + auth: credentials, + method: 'POST' + }; + var request = http.request(options, function (res) { + if (res.statusCode === 201) { + log("Resource " + project + "/" + slug + " successfully created on Transifex."); + } + else { + reject("Something went wrong in the request creating " + slug + " in " + project + ". " + res.statusCode); + } + }); + request.on('error', function (err) { + reject("Failed to create " + project + "/" + slug + " on Transifex: " + err); + }); + request.write(data); + request.end(); + }); +} +/** + * The following link provides information about how Transifex handles updates of a resource file: + * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files + */ +function updateResource(project, slug, xlfFile, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var data = JSON.stringify({ content: xlfFile.contents.toString() }); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/content", + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(data) + }, + auth: credentials, + method: 'PUT' + }; + var request = http.request(options, function (res) { + if (res.statusCode === 200) { + res.setEncoding('utf8'); + var responseBuffer_1 = ''; + res.on('data', function (chunk) { + responseBuffer_1 += chunk; + }); + res.on('end', function () { + var response = JSON.parse(responseBuffer_1); + log("Resource " + project + "/" + slug + " successfully updated on Transifex. Strings added: " + response.strings_added + ", updated: " + response.strings_added + ", deleted: " + response.strings_added); + resolve(); + }); + } + else { + reject("Something went wrong in the request updating " + slug + " in " + project + ". " + res.statusCode); + } + }); + request.on('error', function (err) { + reject("Failed to update " + project + "/" + slug + " on Transifex: " + err); + }); + request.write(data); + request.end(); + }); +} +function obtainProjectResources(projectName) { + var resources = []; + if (projectName === editorProject) { + resources = editorResources; + } + else if (projectName === workbenchProject) { + resources = workbenchResources; + } + else if (projectName === extensionsProject) { + var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; }); + var resourcesToPull_1 = []; + extensionsToLocalize.forEach(function (extension) { + if (resourcesToPull_1.indexOf(extension) === -1) { + resourcesToPull_1.push(extension); + resources.push({ name: extension, project: projectName }); + } + }); + } + else if (projectName === setupProject) { + resources.push({ name: 'setup_default', project: setupProject }); + } + return resources; +} +function pullXlfFiles(projectName, apiHostname, username, password, languages, resources) { + if (!resources) { + resources = obtainProjectResources(projectName); + } + if (!resources) { + throw new Error('Transifex projects and resources must be defined to be able to pull translations from Transifex.'); + } + var credentials = username + ":" + password; + var expectedTranslationsCount = languages.length * resources.length; + var translationsRetrieved = 0, called = false; + return event_stream_1.readable(function (count, callback) { + // Mark end of stream when all resources were retrieved + if (translationsRetrieved === expectedTranslationsCount) { + return this.emit('end'); + } + if (!called) { + called = true; + var stream_1 = this; + // Retrieve XLF files from main projects + languages.map(function (language) { + resources.map(function (resource) { + retrieveResource(language, resource, apiHostname, credentials).then(function (file) { + stream_1.emit('data', file); + translationsRetrieved++; + }).catch(function (error) { throw new Error(error); }); + }); + }); + } + callback(); + }); +} +exports.pullXlfFiles = pullXlfFiles; +function retrieveResource(language, resource, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var slug = resource.name.replace(/\//g, '_'); + var project = resource.project; + var iso639 = language.toLowerCase(); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + iso639 + "?file&mode=onlyreviewed", + auth: credentials, + method: 'GET' + }; + var request = http.request(options, function (res) { + var xlfBuffer = []; + res.on('data', function (chunk) { return xlfBuffer.push(chunk); }); + res.on('end', function () { + if (res.statusCode === 200) { + resolve(new File({ contents: Buffer.concat(xlfBuffer), path: project + "/" + iso639_2_to_3[language] + "/" + slug + ".xlf" })); + } + reject(slug + " in " + project + " returned no data. Response code: " + res.statusCode + "."); + }); + }); + request.on('error', function (err) { + reject("Failed to query resource " + slug + " with the following error: " + err); + }); + request.end(); + }); +} +function prepareJsonFiles() { + var parsePromises = []; + return event_stream_1.through(function (xlf) { + var stream = this; + var parsePromise = XLF.parse(xlf.contents.toString()); + parsePromises.push(parsePromise); + parsePromise.then(function (resolvedFiles) { + resolvedFiles.forEach(function (file) { + var messages = file.messages, translatedFile; + // ISL file path always starts with 'build/' + if (/^build\//.test(file.originalFilePath)) { + var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; + if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { + return; + } + translatedFile = createIslFile('..', file.originalFilePath, messages, iso639_2_to_3[file.language]); + } + else { + translatedFile = createI18nFile(iso639_2_to_3[file.language], file.originalFilePath, messages); + } + stream.emit('data', translatedFile); + }); + }, function (rejectReason) { + throw new Error("XLF parsing error: " + rejectReason); + }); + }, function () { + var _this = this; + Promise.all(parsePromises) + .then(function () { _this.emit('end'); }) + .catch(function (reason) { throw new Error(reason); }); + }); +} +exports.prepareJsonFiles = prepareJsonFiles; +function createI18nFile(base, originalFilePath, messages) { + var content = [ + '/*---------------------------------------------------------------------------------------------', + ' * 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.' + ].join('\n') + '\n' + JSON.stringify(messages, null, '\t').replace(/\r\n/g, '\n'); + return new File({ + path: path.join(base, originalFilePath + '.i18n.json'), + contents: new Buffer(content, 'utf8') + }); +} +var languageNames = { + 'chs': 'Simplified Chinese', + 'cht': 'Traditional Chinese', + 'kor': 'Korean' +}; +var languageIds = { + 'chs': '$0804', + 'cht': '$0404', + 'kor': '$0412' +}; +var encodings = { + 'chs': 'CP936', + 'cht': 'CP950', + 'jpn': 'CP932', + 'kor': 'CP949', + 'deu': 'CP1252', + 'fra': 'CP1252', + 'esn': 'CP1252', + 'rus': 'CP1251', + 'ita': 'CP1252', + 'ptb': 'CP1252' +}; +function createIslFile(base, originalFilePath, messages, language) { + var content = []; + var originalContent; + if (path.basename(originalFilePath) === 'Default') { + originalContent = new TextModel(fs.readFileSync(originalFilePath + '.isl', 'utf8')); + } + else { + originalContent = new TextModel(fs.readFileSync(originalFilePath + '.en.isl', 'utf8')); + } + originalContent.lines.forEach(function (line) { + if (line.length > 0) { + var firstChar = line.charAt(0); + if (firstChar === '[' || firstChar === ';') { + if (line === '; *** Inno Setup version 5.5.3+ English messages ***') { + content.push("; *** Inno Setup version 5.5.3+ " + languageNames[language] + " messages ***"); + } + else { + content.push(line); + } + } + else { + var sections = line.split('='); + var key = sections[0]; + var translated = line; + if (key) { + if (key === 'LanguageName') { + translated = key + "=" + languageNames[language]; + } + else if (key === 'LanguageID') { + translated = key + "=" + languageIds[language]; + } + else if (key === 'LanguageCodePage') { + translated = key + "=" + encodings[language].substr(2); + } + else { + var translatedMessage = messages[key]; + if (translatedMessage) { + translated = key + "=" + translatedMessage; + } + } + } + content.push(translated); + } + } + }); + var tag = iso639_3_to_2[language]; + var basename = path.basename(originalFilePath); + var filePath = path.join(base, path.dirname(originalFilePath), basename) + "." + tag + ".isl"; + return new File({ + path: filePath, + contents: iconv.encode(new Buffer(content.join('\r\n'), 'utf8'), encodings[language]) + }); +} +function encodeEntities(value) { + var result = []; + for (var i = 0; i < value.length; i++) { + var ch = value[i]; + switch (ch) { + case '<': + result.push('<'); + break; + case '>': + result.push('>'); + break; + case '&': + result.push('&'); + break; + default: + result.push(ch); + } + } + return result.join(''); +} +function decodeEntities(value) { + return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); +} diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 434d3301752..9667b01fa2f 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -140,23 +140,23 @@ class TextModel { } export class XLF { - private buffer: string[]; + private buffer: string[]; private files: Map; - constructor(public project: string) { - this.buffer = []; + constructor(public project: string) { + this.buffer = []; this.files = Object.create(null); } - public toString(): string { - this.appendHeader(); + public toString(): string { + this.appendHeader(); for (let file in this.files) { this.appendNewLine(``, 2); for (let item of this.files[file]) { this.addStringItem(item); } - this.appendNewLine('', 2); + this.appendNewLine('', 2); } this.appendFooter(); @@ -190,43 +190,43 @@ export class XLF { } } - private addStringItem(item: Item): void { - if (!item.id || !item.message) { - throw new Error('No item ID or value specified.'); - } + private addStringItem(item: Item): void { + if (!item.id || !item.message) { + throw new Error('No item ID or value specified.'); + } - this.appendNewLine(``, 4); - this.appendNewLine(`${item.message}`, 6); + this.appendNewLine(``, 4); + this.appendNewLine(`${item.message}`, 6); - if (item.comment) { - this.appendNewLine(`${item.comment}`, 6); - } + if (item.comment) { + this.appendNewLine(`${item.comment}`, 6); + } - this.appendNewLine('', 4); + this.appendNewLine('', 4); } - private appendHeader(): void { - this.appendNewLine('', 0); - this.appendNewLine('', 0); + private appendHeader(): void { + this.appendNewLine('', 0); + this.appendNewLine('', 0); } - private appendFooter(): void { - this.appendNewLine('', 0); - } + private appendFooter(): void { + this.appendNewLine('', 0); + } - private appendNewLine(content: string, indent?: number): void { - let line = new Line(indent); - line.append(content); - this.buffer.push(line.toString()); - } + private appendNewLine(content: string, indent?: number): void { + let line = new Line(indent); + line.append(content); + this.buffer.push(line.toString()); + } - static parse = function(xlfString: string) : Promise { + static parse = function (xlfString: string): Promise { return new Promise((resolve, reject) => { let parser = new xml2js.Parser(); let files: { messages: Map, originalFilePath: string, language: string }[] = []; - parser.parseString(xlfString, function(err, result) { + parser.parseString(xlfString, function (err, result) { if (err) { reject(`Failed to parse XLIFF string. ${err}`); } @@ -372,7 +372,7 @@ function stripComments(content: string): string { // A line comment. If it ends in \r?\n then keep it. let length = m4.length; if (length > 2 && m4[length - 1] === '\n') { - return m4[length - 2] === '\r' ? '\r\n': '\n'; + return m4[length - 2] === '\r' ? '\r\n' : '\n'; } else { return ''; } @@ -384,11 +384,11 @@ function stripComments(content: string): string { return result; } -function escapeCharacters(value:string):string { - var result:string[] = []; +function escapeCharacters(value: string): string { + var result: string[] = []; for (var i = 0; i < value.length; i++) { var ch = value.charAt(i); - switch(ch) { + switch (ch) { case '\'': result.push('\\\''); break; @@ -420,7 +420,7 @@ function escapeCharacters(value:string):string { return result.join(''); } -function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter: any) { +function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitter: any) { let keysSection = json.keys; let messageSection = json.messages; let bundleSection = json.bundles; @@ -511,12 +511,12 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter return; } messages.forEach((message, index) => { - contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",': '"'}`); + contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",' : '"'}`); }); contents.push(index < modules.length - 1 ? '\t],' : '\t]'); }); contents.push('});'); - emitter.emit('data', new File( { path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); + emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); }); }); Object.keys(statistics).forEach(key => { @@ -536,8 +536,8 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter }); } -export function processNlsFiles(opts:{fileHeader:string;}): ThroughStream { - return through(function(file: File) { +export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream { + return through(function (file: File) { let fileName = path.basename(file.path); if (fileName === 'nls.metadata.json') { let json = null; @@ -606,7 +606,6 @@ const workbenchResources: Resource[] = [ { name: 'vs/workbench/parts/extensions', project: workbenchProject }, { name: 'vs/workbench/parts/feedback', project: workbenchProject }, { name: 'vs/workbench/parts/files', project: workbenchProject }, - { name: 'vs/workbench/parts/git', project: workbenchProject }, { name: 'vs/workbench/parts/html', project: workbenchProject }, { name: 'vs/workbench/parts/markers', project: workbenchProject }, { name: 'vs/workbench/parts/nps', project: workbenchProject }, @@ -638,27 +637,27 @@ const workbenchResources: Resource[] = [ export function getResource(sourceFile: string): Resource { let resource: string; - if (sourceFile.startsWith('vs/platform')) { + if (/^vs\/platform/.test(sourceFile)) { return { name: 'vs/platform', project: editorProject }; - } else if (sourceFile.startsWith('vs/editor/contrib')) { + } else if (/^vs\/editor\/contrib/.test(sourceFile)) { return { name: 'vs/editor/contrib', project: editorProject }; - } else if (sourceFile.startsWith('vs/editor')) { + } else if (/^vs\/editor/.test(sourceFile)) { return { name: 'vs/editor', project: editorProject }; - } else if (sourceFile.startsWith('vs/base')) { + } else if (/^vs\/base/.test(sourceFile)) { return { name: 'vs/base', project: editorProject }; - } else if (sourceFile.startsWith('vs/code')) { + } else if (/^vs\/code/.test(sourceFile)) { return { name: 'vs/code', project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench/parts')) { + } else if (/^vs\/workbench\/parts/.test(sourceFile)) { resource = sourceFile.split('/', 4).join('/'); return { name: resource, project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench/services')) { + } else if (/^vs\/workbench\/services/.test(sourceFile)) { resource = sourceFile.split('/', 4).join('/'); return { name: resource, project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench')) { + } else if (/^vs\/workbench/.test(sourceFile)) { return { name: 'vs/workbench', project: workbenchProject }; } - throw new Error (`Could not identify the XLF bundle for ${sourceFile}`); + throw new Error(`Could not identify the XLF bundle for ${sourceFile}`); } @@ -682,7 +681,7 @@ function importBundleJson(file: File, json: BundledFormat, stream: ThroughStream for (let resource in bundleXlfs) { const newFilePath = `${bundleXlfs[resource].project}/${resource.replace(/\//g, '_')}.xlf`; - const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); stream.emit('data', xlfFile); } } @@ -724,7 +723,7 @@ function importModuleOrPackageJson(file: File, json: ModuleJsonFormat | PackageJ // Check if XLF is populated with file nodes to emit it if (++extensions[extensionName].processed === localizationFilesCount) { const newFilePath = path.join(projectName, extensionName + '.xlf'); - const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); stream.emit('data', xlfFile); } } @@ -775,12 +774,12 @@ function importIsl(file: File, stream: ThroughStream) { } }); - const originalPath = file.path.substring(file.cwd.length+1, file.path.split('.')[0].length).replace(/\\/g, '/'); + const originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); xlf.addFile(originalPath, keys, messages); // Emit only upon all ISL files combined into single XLF instance const newFilePath = path.join(projectName, resourceFile); - const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); stream.emit('data', xlfFile); } @@ -788,7 +787,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st let tryGetPromises = []; let updateCreatePromises = []; - return through(function(file: File) { + return through(function (file: File) { const project = path.dirname(file.relative); const fileName = path.basename(file.path); const slug = fileName.substr(0, fileName.length - '.xlf'.length); @@ -806,7 +805,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st updateCreatePromises.push(promise); }); - }, function() { + }, function () { // End the pipe only after all the communication with Transifex API happened Promise.all(tryGetPromises).then(() => { Promise.all(updateCreatePromises).then(() => { @@ -881,7 +880,7 @@ function createResource(project: string, slug: string, xlfFile: File, apiHostnam * The following link provides information about how Transifex handles updates of a resource file: * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files */ -function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string) : Promise { +function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string): Promise { return new Promise((resolve, reject) => { const data = JSON.stringify({ content: xlfFile.contents.toString() }); const options = { @@ -957,7 +956,7 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username: let expectedTranslationsCount = languages.length * resources.length; let translationsRetrieved = 0, called = false; - return readable(function(count, callback) { + return readable(function (count, callback) { // Mark end of stream when all resources were retrieved if (translationsRetrieved === expectedTranslationsCount) { return this.emit('end'); @@ -968,8 +967,8 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username: const stream = this; // Retrieve XLF files from main projects - languages.map(function(language) { - resources.map(function(resource) { + languages.map(function (language) { + resources.map(function (resource) { retrieveResource(language, resource, apiHostname, credentials).then((file: File) => { stream.emit('data', file); translationsRetrieved++; @@ -995,14 +994,14 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre }; let request = http.request(options, (res) => { - let xlfBuffer: Buffer[] = []; - res.on('data', (chunk) => xlfBuffer.push(chunk)); - res.on('end', () => { - if (res.statusCode === 200) { - resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${iso639_2_to_3[language]}/${slug}.xlf` })); - } - reject(`${slug} in ${project} returned no data. Response code: ${res.statusCode}.`); - }); + let xlfBuffer: Buffer[] = []; + res.on('data', (chunk: Buffer) => xlfBuffer.push(chunk)); + res.on('end', () => { + if (res.statusCode === 200) { + resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${iso639_2_to_3[language]}/${slug}.xlf` })); + } + reject(`${slug} in ${project} returned no data. Response code: ${res.statusCode}.`); + }); }); request.on('error', (err) => { reject(`Failed to query resource ${slug} with the following error: ${err}`); @@ -1014,17 +1013,17 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre export function prepareJsonFiles(): ThroughStream { let parsePromises: Promise[] = []; - return through(function(xlf: File) { + return through(function (xlf: File) { let stream = this; let parsePromise = XLF.parse(xlf.contents.toString()); parsePromises.push(parsePromise); parsePromise.then( - function(resolvedFiles) { + function (resolvedFiles) { resolvedFiles.forEach(file => { let messages = file.messages, translatedFile; // ISL file path always starts with 'build/' - if (file.originalFilePath.startsWith('build/')) { + if (/^build\//.test(file.originalFilePath)) { const defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { return; @@ -1038,11 +1037,11 @@ export function prepareJsonFiles(): ThroughStream { stream.emit('data', translatedFile); }); }, - function(rejectReason) { + function (rejectReason) { throw new Error(`XLF parsing error: ${rejectReason}`); } ); - }, function() { + }, function () { Promise.all(parsePromises) .then(() => { this.emit('end'); }) .catch(reason => { throw new Error(reason); }); @@ -1086,7 +1085,8 @@ const encodings: Map = { 'fra': 'CP1252', 'esn': 'CP1252', 'rus': 'CP1251', - 'ita': 'CP1252' + 'ita': 'CP1252', + 'ptb': 'CP1252' }; function createIslFile(base: string, originalFilePath: string, messages: Map, language: string): File { @@ -1162,6 +1162,6 @@ function encodeEntities(value: string): string { return result.join(''); } -function decodeEntities(value:string): string { +function decodeEntities(value: string): string { return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); } \ No newline at end of file diff --git a/build/lib/nls.js b/build/lib/nls.js index e695200d1bd..da8e6a27a53 100644 --- a/build/lib/nls.js +++ b/build/lib/nls.js @@ -1,355 +1,355 @@ -"use strict"; -var ts = require("./typescript/typescriptServices"); -var lazy = require("lazy.js"); -var event_stream_1 = require("event-stream"); -var File = require("vinyl"); -var sm = require("source-map"); -var assign = require("object-assign"); -var path = require("path"); -var CollectStepResult; -(function (CollectStepResult) { - CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes"; - CollectStepResult[CollectStepResult["YesAndRecurse"] = 1] = "YesAndRecurse"; - CollectStepResult[CollectStepResult["No"] = 2] = "No"; - CollectStepResult[CollectStepResult["NoAndRecurse"] = 3] = "NoAndRecurse"; -})(CollectStepResult || (CollectStepResult = {})); -function collect(node, fn) { - var result = []; - function loop(node) { - var stepResult = fn(node); - if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) { - result.push(node); - } - if (stepResult === CollectStepResult.YesAndRecurse || stepResult === CollectStepResult.NoAndRecurse) { - ts.forEachChild(node, loop); - } - } - loop(node); - return result; -} -function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; -} -function template(lines) { - var indent = '', wrap = ''; - if (lines.length > 1) { - indent = '\t'; - wrap = '\n'; - } - return "/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine([], [" + (wrap + lines.map(function (l) { return indent + l; }).join(',\n') + wrap) + "]);"; -} -/** - * Returns a stream containing the patched JavaScript and source maps. - */ -function nls() { - var input = event_stream_1.through(); - var output = input.pipe(event_stream_1.through(function (f) { - var _this = this; - if (!f.sourceMap) { - return this.emit('error', new Error("File " + f.relative + " does not have sourcemaps.")); - } - var source = f.sourceMap.sources[0]; - if (!source) { - return this.emit('error', new Error("File " + f.relative + " does not have a source in the source map.")); - } - var root = f.sourceMap.sourceRoot; - if (root) { - source = path.join(root, source); - } - var typescript = f.sourceMap.sourcesContent[0]; - if (!typescript) { - return this.emit('error', new Error("File " + f.relative + " does not have the original content in the source map.")); - } - nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); }); - })); - return event_stream_1.duplex(input, output); -} -function isImportNode(node) { - return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */; -} -(function (nls_1) { - function fileFrom(file, contents, path) { - if (path === void 0) { path = file.path; } - return new File({ - contents: new Buffer(contents), - base: file.base, - cwd: file.cwd, - path: path - }); - } - nls_1.fileFrom = fileFrom; - function mappedPositionFrom(source, lc) { - return { source: source, line: lc.line + 1, column: lc.character }; - } - nls_1.mappedPositionFrom = mappedPositionFrom; - function lcFrom(position) { - return { line: position.line - 1, character: position.column }; - } - nls_1.lcFrom = lcFrom; - var SingleFileServiceHost = (function () { - function SingleFileServiceHost(options, filename, contents) { - var _this = this; - this.options = options; - this.filename = filename; - this.getCompilationSettings = function () { return _this.options; }; - this.getScriptFileNames = function () { return [_this.filename]; }; - this.getScriptVersion = function () { return '1'; }; - this.getScriptSnapshot = function (name) { return name === _this.filename ? _this.file : _this.lib; }; - this.getCurrentDirectory = function () { return ''; }; - this.getDefaultLibFileName = function () { return 'lib.d.ts'; }; - this.file = ts.ScriptSnapshot.fromString(contents); - this.lib = ts.ScriptSnapshot.fromString(''); - } - return SingleFileServiceHost; - }()); - nls_1.SingleFileServiceHost = SingleFileServiceHost; - function isCallExpressionWithinTextSpanCollectStep(textSpan, node) { - if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) { - return CollectStepResult.No; - } - return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; - } - function analyze(contents, options) { - if (options === void 0) { options = {}; } - var filename = 'file.ts'; - var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); - var service = ts.createLanguageService(serviceHost); - var sourceFile = service.getSourceFile(filename); - // all imports - var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; })); - // import nls = require('vs/nls'); - var importEqualsDeclarations = imports - .filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; }) - .map(function (n) { return n; }) - .filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; }) - .filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; }); - // import ... from 'vs/nls'; - var importDeclarations = imports - .filter(function (n) { return n.kind === 212 /* ImportDeclaration */; }) - .map(function (n) { return n; }) - .filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; }) - .filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; }) - .filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; }); - var nlsExpressions = importEqualsDeclarations - .map(function (d) { return d.moduleReference.expression; }) - .concat(importDeclarations.map(function (d) { return d.moduleSpecifier; })) - .map(function (d) { return ({ - start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), - end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) - }); }); - // `nls.localize(...)` calls - var nlsLocalizeCallExpressions = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; }) - .map(function (d) { return d.importClause.namedBindings.name; }) - .concat(importEqualsDeclarations.map(function (d) { return d.name; })) - .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }) - .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) - .map(function (a) { return lazy(a).last(); }) - .filter(function (n) { return !!n; }) - .map(function (n) { return n; }) - .filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; }); - // `localize` named imports - var allLocalizeImportDeclarations = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; }) - .map(function (d) { return d.importClause.namedBindings.elements; }) - .flatten(); - // `localize` read-only references - var localizeReferences = allLocalizeImportDeclarations - .filter(function (d) { return d.name.getText() === 'localize'; }) - .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }); - // custom named `localize` read-only references - var namedLocalizeReferences = allLocalizeImportDeclarations - .filter(function (d) { return d.propertyName && d.propertyName.getText() === 'localize'; }) - .map(function (n) { return service.getReferencesAtPosition(filename, n.name.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }); - // find the deepest call expressions AST nodes that contain those references - var localizeCallExpressions = localizeReferences - .concat(namedLocalizeReferences) - .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) - .map(function (a) { return lazy(a).last(); }) - .filter(function (n) { return !!n; }) - .map(function (n) { return n; }); - // collect everything - var localizeCalls = nlsLocalizeCallExpressions - .concat(localizeCallExpressions) - .map(function (e) { return e.arguments; }) - .filter(function (a) { return a.length > 1; }) - .sort(function (a, b) { return a[0].getStart() - b[0].getStart(); }) - .map(function (a) { return ({ - keySpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getEnd()) }, - key: a[0].getText(), - valueSpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getEnd()) }, - value: a[1].getText() - }); }); - return { - localizeCalls: localizeCalls.toArray(), - nlsExpressions: nlsExpressions.toArray() - }; - } - nls_1.analyze = analyze; - var TextModel = (function () { - function TextModel(contents) { - var regex = /\r\n|\r|\n/g; - var index = 0; - var match; - this.lines = []; - this.lineEndings = []; - while (match = regex.exec(contents)) { - this.lines.push(contents.substring(index, match.index)); - this.lineEndings.push(match[0]); - index = regex.lastIndex; - } - if (contents.length > 0) { - this.lines.push(contents.substring(index, contents.length)); - this.lineEndings.push(''); - } - } - TextModel.prototype.get = function (index) { - return this.lines[index]; - }; - TextModel.prototype.set = function (index, line) { - this.lines[index] = line; - }; - Object.defineProperty(TextModel.prototype, "lineCount", { - get: function () { - return this.lines.length; - }, - enumerable: true, - configurable: true - }); - /** - * Applies patch(es) to the model. - * Multiple patches must be ordered. - * Does not support patches spanning multiple lines. - */ - TextModel.prototype.apply = function (patch) { - var startLineNumber = patch.span.start.line; - var endLineNumber = patch.span.end.line; - var startLine = this.lines[startLineNumber] || ''; - var endLine = this.lines[endLineNumber] || ''; - this.lines[startLineNumber] = [ - startLine.substring(0, patch.span.start.character), - patch.content, - endLine.substring(patch.span.end.character) - ].join(''); - for (var i = startLineNumber + 1; i <= endLineNumber; i++) { - this.lines[i] = ''; - } - }; - TextModel.prototype.toString = function () { - return lazy(this.lines).zip(this.lineEndings) - .flatten().toArray().join(''); - }; - return TextModel; - }()); - nls_1.TextModel = TextModel; - function patchJavascript(patches, contents, moduleId) { - var model = new nls.TextModel(contents); - // patch the localize calls - lazy(patches).reverse().each(function (p) { return model.apply(p); }); - // patch the 'vs/nls' imports - var firstLine = model.get(0); - var patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); - model.set(0, patchedFirstLine); - return model.toString(); - } - nls_1.patchJavascript = patchJavascript; - function patchSourcemap(patches, rsm, smc) { - var smg = new sm.SourceMapGenerator({ - file: rsm.file, - sourceRoot: rsm.sourceRoot - }); - patches = patches.reverse(); - var currentLine = -1; - var currentLineDiff = 0; - var source = null; - smc.eachMapping(function (m) { - var patch = patches[patches.length - 1]; - var original = { line: m.originalLine, column: m.originalColumn }; - var generated = { line: m.generatedLine, column: m.generatedColumn }; - if (currentLine !== generated.line) { - currentLineDiff = 0; - } - currentLine = generated.line; - generated.column += currentLineDiff; - if (patch && m.generatedLine - 1 === patch.span.end.line && m.generatedColumn === patch.span.end.character) { - var originalLength = patch.span.end.character - patch.span.start.character; - var modifiedLength = patch.content.length; - var lengthDiff = modifiedLength - originalLength; - currentLineDiff += lengthDiff; - generated.column += lengthDiff; - patches.pop(); - } - source = rsm.sourceRoot ? path.relative(rsm.sourceRoot, m.source) : m.source; - source = source.replace(/\\/g, '/'); - smg.addMapping({ source: source, name: m.name, original: original, generated: generated }); - }, null, sm.SourceMapConsumer.GENERATED_ORDER); - if (source) { - smg.setSourceContent(source, smc.sourceContentFor(source)); - } - return JSON.parse(smg.toString()); - } - nls_1.patchSourcemap = patchSourcemap; - function patch(moduleId, typescript, javascript, sourcemap) { - var _a = analyze(typescript), localizeCalls = _a.localizeCalls, nlsExpressions = _a.nlsExpressions; - if (localizeCalls.length === 0) { - return { javascript: javascript, sourcemap: sourcemap }; - } - var nlsKeys = template(localizeCalls.map(function (lc) { return lc.key; })); - var nls = template(localizeCalls.map(function (lc) { return lc.value; })); - var smc = new sm.SourceMapConsumer(sourcemap); - var positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); - var i = 0; - // build patches - var patches = lazy(localizeCalls) - .map(function (lc) { return ([ - { range: lc.keySpan, content: '' + (i++) }, - { range: lc.valueSpan, content: 'null' } - ]); }) - .flatten() - .map(function (c) { - var start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start))); - var end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end))); - return { span: { start: start, end: end }, content: c.content }; - }) - .toArray(); - javascript = patchJavascript(patches, javascript, moduleId); - // since imports are not within the sourcemap information, - // we must do this MacGyver style - if (nlsExpressions.length) { - javascript = javascript.replace(/^define\(.*$/m, function (line) { - return line.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); - }); - } - sourcemap = patchSourcemap(patches, sourcemap, smc); - return { javascript: javascript, sourcemap: sourcemap, nlsKeys: nlsKeys, nls: nls }; - } - nls_1.patch = patch; - function patchFiles(javascriptFile, typescript) { - // hack? - var moduleId = javascriptFile.relative - .replace(/\.js$/, '') - .replace(/\\/g, '/'); - var _a = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap), javascript = _a.javascript, sourcemap = _a.sourcemap, nlsKeys = _a.nlsKeys, nls = _a.nls; - var result = [fileFrom(javascriptFile, javascript)]; - result[0].sourceMap = sourcemap; - if (nlsKeys) { - result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); - } - if (nls) { - result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); - } - return result; - } - nls_1.patchFiles = patchFiles; -})(nls || (nls = {})); -module.exports = nls; +"use strict"; +var ts = require("./typescript/typescriptServices"); +var lazy = require("lazy.js"); +var event_stream_1 = require("event-stream"); +var File = require("vinyl"); +var sm = require("source-map"); +var assign = require("object-assign"); +var path = require("path"); +var CollectStepResult; +(function (CollectStepResult) { + CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes"; + CollectStepResult[CollectStepResult["YesAndRecurse"] = 1] = "YesAndRecurse"; + CollectStepResult[CollectStepResult["No"] = 2] = "No"; + CollectStepResult[CollectStepResult["NoAndRecurse"] = 3] = "NoAndRecurse"; +})(CollectStepResult || (CollectStepResult = {})); +function collect(node, fn) { + var result = []; + function loop(node) { + var stepResult = fn(node); + if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) { + result.push(node); + } + if (stepResult === CollectStepResult.YesAndRecurse || stepResult === CollectStepResult.NoAndRecurse) { + ts.forEachChild(node, loop); + } + } + loop(node); + return result; +} +function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; +} +function template(lines) { + var indent = '', wrap = ''; + if (lines.length > 1) { + indent = '\t'; + wrap = '\n'; + } + return "/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine([], [" + (wrap + lines.map(function (l) { return indent + l; }).join(',\n') + wrap) + "]);"; +} +/** + * Returns a stream containing the patched JavaScript and source maps. + */ +function nls() { + var input = event_stream_1.through(); + var output = input.pipe(event_stream_1.through(function (f) { + var _this = this; + if (!f.sourceMap) { + return this.emit('error', new Error("File " + f.relative + " does not have sourcemaps.")); + } + var source = f.sourceMap.sources[0]; + if (!source) { + return this.emit('error', new Error("File " + f.relative + " does not have a source in the source map.")); + } + var root = f.sourceMap.sourceRoot; + if (root) { + source = path.join(root, source); + } + var typescript = f.sourceMap.sourcesContent[0]; + if (!typescript) { + return this.emit('error', new Error("File " + f.relative + " does not have the original content in the source map.")); + } + nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); }); + })); + return event_stream_1.duplex(input, output); +} +function isImportNode(node) { + return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */; +} +(function (nls_1) { + function fileFrom(file, contents, path) { + if (path === void 0) { path = file.path; } + return new File({ + contents: new Buffer(contents), + base: file.base, + cwd: file.cwd, + path: path + }); + } + nls_1.fileFrom = fileFrom; + function mappedPositionFrom(source, lc) { + return { source: source, line: lc.line + 1, column: lc.character }; + } + nls_1.mappedPositionFrom = mappedPositionFrom; + function lcFrom(position) { + return { line: position.line - 1, character: position.column }; + } + nls_1.lcFrom = lcFrom; + var SingleFileServiceHost = (function () { + function SingleFileServiceHost(options, filename, contents) { + var _this = this; + this.options = options; + this.filename = filename; + this.getCompilationSettings = function () { return _this.options; }; + this.getScriptFileNames = function () { return [_this.filename]; }; + this.getScriptVersion = function () { return '1'; }; + this.getScriptSnapshot = function (name) { return name === _this.filename ? _this.file : _this.lib; }; + this.getCurrentDirectory = function () { return ''; }; + this.getDefaultLibFileName = function () { return 'lib.d.ts'; }; + this.file = ts.ScriptSnapshot.fromString(contents); + this.lib = ts.ScriptSnapshot.fromString(''); + } + return SingleFileServiceHost; + }()); + nls_1.SingleFileServiceHost = SingleFileServiceHost; + function isCallExpressionWithinTextSpanCollectStep(textSpan, node) { + if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) { + return CollectStepResult.No; + } + return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; + } + function analyze(contents, options) { + if (options === void 0) { options = {}; } + var filename = 'file.ts'; + var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); + var service = ts.createLanguageService(serviceHost); + var sourceFile = service.getSourceFile(filename); + // all imports + var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; })); + // import nls = require('vs/nls'); + var importEqualsDeclarations = imports + .filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; }) + .map(function (n) { return n; }) + .filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; }) + .filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; }); + // import ... from 'vs/nls'; + var importDeclarations = imports + .filter(function (n) { return n.kind === 212 /* ImportDeclaration */; }) + .map(function (n) { return n; }) + .filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; }) + .filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; }) + .filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; }); + var nlsExpressions = importEqualsDeclarations + .map(function (d) { return d.moduleReference.expression; }) + .concat(importDeclarations.map(function (d) { return d.moduleSpecifier; })) + .map(function (d) { return ({ + start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), + end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) + }); }); + // `nls.localize(...)` calls + var nlsLocalizeCallExpressions = importDeclarations + .filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; }) + .map(function (d) { return d.importClause.namedBindings.name; }) + .concat(importEqualsDeclarations.map(function (d) { return d.name; })) + .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }) + .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) + .map(function (a) { return lazy(a).last(); }) + .filter(function (n) { return !!n; }) + .map(function (n) { return n; }) + .filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; }); + // `localize` named imports + var allLocalizeImportDeclarations = importDeclarations + .filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; }) + .map(function (d) { return d.importClause.namedBindings.elements; }) + .flatten(); + // `localize` read-only references + var localizeReferences = allLocalizeImportDeclarations + .filter(function (d) { return d.name.getText() === 'localize'; }) + .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }); + // custom named `localize` read-only references + var namedLocalizeReferences = allLocalizeImportDeclarations + .filter(function (d) { return d.propertyName && d.propertyName.getText() === 'localize'; }) + .map(function (n) { return service.getReferencesAtPosition(filename, n.name.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }); + // find the deepest call expressions AST nodes that contain those references + var localizeCallExpressions = localizeReferences + .concat(namedLocalizeReferences) + .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) + .map(function (a) { return lazy(a).last(); }) + .filter(function (n) { return !!n; }) + .map(function (n) { return n; }); + // collect everything + var localizeCalls = nlsLocalizeCallExpressions + .concat(localizeCallExpressions) + .map(function (e) { return e.arguments; }) + .filter(function (a) { return a.length > 1; }) + .sort(function (a, b) { return a[0].getStart() - b[0].getStart(); }) + .map(function (a) { return ({ + keySpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getEnd()) }, + key: a[0].getText(), + valueSpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getEnd()) }, + value: a[1].getText() + }); }); + return { + localizeCalls: localizeCalls.toArray(), + nlsExpressions: nlsExpressions.toArray() + }; + } + nls_1.analyze = analyze; + var TextModel = (function () { + function TextModel(contents) { + var regex = /\r\n|\r|\n/g; + var index = 0; + var match; + this.lines = []; + this.lineEndings = []; + while (match = regex.exec(contents)) { + this.lines.push(contents.substring(index, match.index)); + this.lineEndings.push(match[0]); + index = regex.lastIndex; + } + if (contents.length > 0) { + this.lines.push(contents.substring(index, contents.length)); + this.lineEndings.push(''); + } + } + TextModel.prototype.get = function (index) { + return this.lines[index]; + }; + TextModel.prototype.set = function (index, line) { + this.lines[index] = line; + }; + Object.defineProperty(TextModel.prototype, "lineCount", { + get: function () { + return this.lines.length; + }, + enumerable: true, + configurable: true + }); + /** + * Applies patch(es) to the model. + * Multiple patches must be ordered. + * Does not support patches spanning multiple lines. + */ + TextModel.prototype.apply = function (patch) { + var startLineNumber = patch.span.start.line; + var endLineNumber = patch.span.end.line; + var startLine = this.lines[startLineNumber] || ''; + var endLine = this.lines[endLineNumber] || ''; + this.lines[startLineNumber] = [ + startLine.substring(0, patch.span.start.character), + patch.content, + endLine.substring(patch.span.end.character) + ].join(''); + for (var i = startLineNumber + 1; i <= endLineNumber; i++) { + this.lines[i] = ''; + } + }; + TextModel.prototype.toString = function () { + return lazy(this.lines).zip(this.lineEndings) + .flatten().toArray().join(''); + }; + return TextModel; + }()); + nls_1.TextModel = TextModel; + function patchJavascript(patches, contents, moduleId) { + var model = new nls.TextModel(contents); + // patch the localize calls + lazy(patches).reverse().each(function (p) { return model.apply(p); }); + // patch the 'vs/nls' imports + var firstLine = model.get(0); + var patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); + model.set(0, patchedFirstLine); + return model.toString(); + } + nls_1.patchJavascript = patchJavascript; + function patchSourcemap(patches, rsm, smc) { + var smg = new sm.SourceMapGenerator({ + file: rsm.file, + sourceRoot: rsm.sourceRoot + }); + patches = patches.reverse(); + var currentLine = -1; + var currentLineDiff = 0; + var source = null; + smc.eachMapping(function (m) { + var patch = patches[patches.length - 1]; + var original = { line: m.originalLine, column: m.originalColumn }; + var generated = { line: m.generatedLine, column: m.generatedColumn }; + if (currentLine !== generated.line) { + currentLineDiff = 0; + } + currentLine = generated.line; + generated.column += currentLineDiff; + if (patch && m.generatedLine - 1 === patch.span.end.line && m.generatedColumn === patch.span.end.character) { + var originalLength = patch.span.end.character - patch.span.start.character; + var modifiedLength = patch.content.length; + var lengthDiff = modifiedLength - originalLength; + currentLineDiff += lengthDiff; + generated.column += lengthDiff; + patches.pop(); + } + source = rsm.sourceRoot ? path.relative(rsm.sourceRoot, m.source) : m.source; + source = source.replace(/\\/g, '/'); + smg.addMapping({ source: source, name: m.name, original: original, generated: generated }); + }, null, sm.SourceMapConsumer.GENERATED_ORDER); + if (source) { + smg.setSourceContent(source, smc.sourceContentFor(source)); + } + return JSON.parse(smg.toString()); + } + nls_1.patchSourcemap = patchSourcemap; + function patch(moduleId, typescript, javascript, sourcemap) { + var _a = analyze(typescript), localizeCalls = _a.localizeCalls, nlsExpressions = _a.nlsExpressions; + if (localizeCalls.length === 0) { + return { javascript: javascript, sourcemap: sourcemap }; + } + var nlsKeys = template(localizeCalls.map(function (lc) { return lc.key; })); + var nls = template(localizeCalls.map(function (lc) { return lc.value; })); + var smc = new sm.SourceMapConsumer(sourcemap); + var positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); + var i = 0; + // build patches + var patches = lazy(localizeCalls) + .map(function (lc) { return ([ + { range: lc.keySpan, content: '' + (i++) }, + { range: lc.valueSpan, content: 'null' } + ]); }) + .flatten() + .map(function (c) { + var start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start))); + var end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end))); + return { span: { start: start, end: end }, content: c.content }; + }) + .toArray(); + javascript = patchJavascript(patches, javascript, moduleId); + // since imports are not within the sourcemap information, + // we must do this MacGyver style + if (nlsExpressions.length) { + javascript = javascript.replace(/^define\(.*$/m, function (line) { + return line.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); + }); + } + sourcemap = patchSourcemap(patches, sourcemap, smc); + return { javascript: javascript, sourcemap: sourcemap, nlsKeys: nlsKeys, nls: nls }; + } + nls_1.patch = patch; + function patchFiles(javascriptFile, typescript) { + // hack? + var moduleId = javascriptFile.relative + .replace(/\.js$/, '') + .replace(/\\/g, '/'); + var _a = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap), javascript = _a.javascript, sourcemap = _a.sourcemap, nlsKeys = _a.nlsKeys, nls = _a.nls; + var result = [fileFrom(javascriptFile, javascript)]; + result[0].sourceMap = sourcemap; + if (nlsKeys) { + result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); + } + if (nls) { + result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); + } + return result; + } + nls_1.patchFiles = patchFiles; +})(nls || (nls = {})); +module.exports = nls; diff --git a/build/lib/optimize.js b/build/lib/optimize.js index 9ff371cda9a..d3bc1ee5c8c 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -1,235 +1,235 @@ -/*--------------------------------------------------------------------------------------------- - * 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 gulp = require("gulp"); -var sourcemaps = require("gulp-sourcemaps"); -var filter = require("gulp-filter"); -var minifyCSS = require("gulp-cssnano"); -var uglify = require("gulp-uglify"); -var es = require("event-stream"); -var concat = require("gulp-concat"); -var VinylFile = require("vinyl"); -var bundle = require("./bundle"); -var util = require("./util"); -var i18n = require("./i18n"); -var gulpUtil = require("gulp-util"); -var flatmap = require("gulp-flatmap"); -var pump = require("pump"); -var REPO_ROOT_PATH = path.join(__dirname, '../..'); -function log(prefix, message) { - gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); -} -function loaderConfig(emptyPaths) { - var result = { - paths: { - 'vs': 'out-build/vs', - 'vscode': 'empty:' - }, - nodeModules: emptyPaths || [] - }; - result['vs/css'] = { inlineResources: true }; - return result; -} -exports.loaderConfig = loaderConfig; -var IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i; -function loader(bundledFileHeader, bundleLoader) { - var sources = [ - 'out-build/vs/loader.js' - ]; - if (bundleLoader) { - sources = sources.concat([ - 'out-build/vs/css.js', - 'out-build/vs/nls.js' - ]); - } - var isFirst = true; - return (gulp - .src(sources, { base: 'out-build' }) - .pipe(es.through(function (data) { - if (isFirst) { - isFirst = false; - this.emit('data', new VinylFile({ - path: 'fake', - base: '', - contents: new Buffer(bundledFileHeader) - })); - this.emit('data', data); - } - else { - this.emit('data', data); - } - })) - .pipe(util.loadSourcemaps()) - .pipe(concat('vs/loader.js')) - .pipe(es.mapSync(function (f) { - f.sourceMap.sourceRoot = util.toFileUri(path.join(REPO_ROOT_PATH, 'src')); - return f; - }))); -} -function toConcatStream(bundledFileHeader, sources, dest) { - var useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest); - // If a bundle ends up including in any of the sources our copyright, then - // insert a fake source at the beginning of each bundle with our copyright - var containsOurCopyright = false; - for (var i = 0, len = sources.length; i < len; i++) { - var fileContents = sources[i].contents; - if (IS_OUR_COPYRIGHT_REGEXP.test(fileContents)) { - containsOurCopyright = true; - break; - } - } - if (containsOurCopyright) { - sources.unshift({ - path: null, - contents: bundledFileHeader - }); - } - var treatedSources = sources.map(function (source) { - var root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : ''; - var base = source.path ? root + '/out-build' : ''; - return new VinylFile({ - path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', - base: base, - contents: new Buffer(source.contents) - }); - }); - return es.readArray(treatedSources) - .pipe(useSourcemaps ? util.loadSourcemaps() : es.through()) - .pipe(concat(dest)); -} -function toBundleStream(bundledFileHeader, bundles) { - return es.merge(bundles.map(function (bundle) { - return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest); - })); -} -function optimizeTask(opts) { - var entryPoints = opts.entryPoints; - var otherSources = opts.otherSources; - var resources = opts.resources; - var loaderConfig = opts.loaderConfig; - var bundledFileHeader = opts.header; - var bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader); - var out = opts.out; - return function () { - var bundlesStream = es.through(); // this stream will contain the bundled files - var resourcesStream = es.through(); // this stream will contain the resources - var bundleInfoStream = es.through(); // this stream will contain bundleInfo.json - bundle.bundle(entryPoints, loaderConfig, function (err, result) { - if (err) { - return bundlesStream.emit('error', JSON.stringify(err)); - } - toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream); - // Remove css inlined resources - var filteredResources = resources.slice(); - result.cssInlinedResources.forEach(function (resource) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log('optimizer', 'excluding inlined: ' + resource); - } - filteredResources.push('!' + resource); - }); - gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream); - var bundleInfoArray = []; - if (opts.bundleInfo) { - bundleInfoArray.push(new VinylFile({ - path: 'bundleInfo.json', - base: '.', - contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) - })); - } - es.readArray(bundleInfoArray).pipe(bundleInfoStream); - }); - var otherSourcesStream = es.through(); - var otherSourcesStreamArr = []; - gulp.src(otherSources, { base: 'out-build' }) - .pipe(es.through(function (data) { - otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative)); - }, function () { - if (!otherSourcesStreamArr.length) { - setTimeout(function () { otherSourcesStream.emit('end'); }, 0); - } - else { - es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); - } - })); - var result = es.merge(loader(bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream); - return result - .pipe(sourcemaps.write('./', { - sourceRoot: null, - addComment: true, - includeContent: true - })) - .pipe(i18n.processNlsFiles({ - fileHeader: bundledFileHeader - })) - .pipe(gulp.dest(out)); - }; -} -exports.optimizeTask = optimizeTask; -; -/** - * Wrap around uglify and allow the preserveComments function - * to have a file "context" to include our copyright only once per file. - */ -function uglifyWithCopyrights() { - var preserveComments = function (f) { - return function (node, comment) { - var text = comment.value; - var type = comment.type; - if (/@minifier_do_not_preserve/.test(text)) { - return false; - } - var isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text); - if (isOurCopyright) { - if (f.__hasOurCopyright) { - return false; - } - f.__hasOurCopyright = true; - return true; - } - if ('comment2' === type) { - // check for /*!. Note that text doesn't contain leading /* - return (text.length > 0 && text[0] === '!') || /@preserve|license|@cc_on|copyright/i.test(text); - } - else if ('comment1' === type) { - return /license|copyright/i.test(text); - } - return false; - }; - }; - var input = es.through(); - var output = input - .pipe(flatmap(function (stream, f) { - return stream.pipe(uglify({ - preserveComments: preserveComments(f), - output: { - // linux tfs build agent is crashing, does this help?§ - max_line_len: 3200000 - } - })); - })); - return es.duplex(input, output); -} -function minifyTask(src, sourceMapBaseUrl) { - var sourceMappingURL = sourceMapBaseUrl && (function (f) { return sourceMapBaseUrl + "/" + f.relative + ".map"; }); - return function (cb) { - var jsFilter = filter('**/*.js', { restore: true }); - var cssFilter = filter('**/*.css', { restore: true }); - pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', { - sourceMappingURL: sourceMappingURL, - sourceRoot: null, - includeContent: true, - addComment: true - }), gulp.dest(src + '-min'), function (err) { - if (err instanceof uglify.GulpUglifyError) { - console.error("Uglify error in '" + (err.cause && err.cause.filename) + "'"); - } - cb(err); - }); - }; -} -exports.minifyTask = minifyTask; -; +/*--------------------------------------------------------------------------------------------- + * 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 gulp = require("gulp"); +var sourcemaps = require("gulp-sourcemaps"); +var filter = require("gulp-filter"); +var minifyCSS = require("gulp-cssnano"); +var uglify = require("gulp-uglify"); +var es = require("event-stream"); +var concat = require("gulp-concat"); +var VinylFile = require("vinyl"); +var bundle = require("./bundle"); +var util = require("./util"); +var i18n = require("./i18n"); +var gulpUtil = require("gulp-util"); +var flatmap = require("gulp-flatmap"); +var pump = require("pump"); +var REPO_ROOT_PATH = path.join(__dirname, '../..'); +function log(prefix, message) { + gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); +} +function loaderConfig(emptyPaths) { + var result = { + paths: { + 'vs': 'out-build/vs', + 'vscode': 'empty:' + }, + nodeModules: emptyPaths || [] + }; + result['vs/css'] = { inlineResources: true }; + return result; +} +exports.loaderConfig = loaderConfig; +var IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i; +function loader(bundledFileHeader, bundleLoader) { + var sources = [ + 'out-build/vs/loader.js' + ]; + if (bundleLoader) { + sources = sources.concat([ + 'out-build/vs/css.js', + 'out-build/vs/nls.js' + ]); + } + var isFirst = true; + return (gulp + .src(sources, { base: 'out-build' }) + .pipe(es.through(function (data) { + if (isFirst) { + isFirst = false; + this.emit('data', new VinylFile({ + path: 'fake', + base: '', + contents: new Buffer(bundledFileHeader) + })); + this.emit('data', data); + } + else { + this.emit('data', data); + } + })) + .pipe(util.loadSourcemaps()) + .pipe(concat('vs/loader.js')) + .pipe(es.mapSync(function (f) { + f.sourceMap.sourceRoot = util.toFileUri(path.join(REPO_ROOT_PATH, 'src')); + return f; + }))); +} +function toConcatStream(bundledFileHeader, sources, dest) { + var useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest); + // If a bundle ends up including in any of the sources our copyright, then + // insert a fake source at the beginning of each bundle with our copyright + var containsOurCopyright = false; + for (var i = 0, len = sources.length; i < len; i++) { + var fileContents = sources[i].contents; + if (IS_OUR_COPYRIGHT_REGEXP.test(fileContents)) { + containsOurCopyright = true; + break; + } + } + if (containsOurCopyright) { + sources.unshift({ + path: null, + contents: bundledFileHeader + }); + } + var treatedSources = sources.map(function (source) { + var root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : ''; + var base = source.path ? root + '/out-build' : ''; + return new VinylFile({ + path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', + base: base, + contents: new Buffer(source.contents) + }); + }); + return es.readArray(treatedSources) + .pipe(useSourcemaps ? util.loadSourcemaps() : es.through()) + .pipe(concat(dest)); +} +function toBundleStream(bundledFileHeader, bundles) { + return es.merge(bundles.map(function (bundle) { + return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest); + })); +} +function optimizeTask(opts) { + var entryPoints = opts.entryPoints; + var otherSources = opts.otherSources; + var resources = opts.resources; + var loaderConfig = opts.loaderConfig; + var bundledFileHeader = opts.header; + var bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader); + var out = opts.out; + return function () { + var bundlesStream = es.through(); // this stream will contain the bundled files + var resourcesStream = es.through(); // this stream will contain the resources + var bundleInfoStream = es.through(); // this stream will contain bundleInfo.json + bundle.bundle(entryPoints, loaderConfig, function (err, result) { + if (err) { + return bundlesStream.emit('error', JSON.stringify(err)); + } + toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream); + // Remove css inlined resources + var filteredResources = resources.slice(); + result.cssInlinedResources.forEach(function (resource) { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log('optimizer', 'excluding inlined: ' + resource); + } + filteredResources.push('!' + resource); + }); + gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream); + var bundleInfoArray = []; + if (opts.bundleInfo) { + bundleInfoArray.push(new VinylFile({ + path: 'bundleInfo.json', + base: '.', + contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) + })); + } + es.readArray(bundleInfoArray).pipe(bundleInfoStream); + }); + var otherSourcesStream = es.through(); + var otherSourcesStreamArr = []; + gulp.src(otherSources, { base: 'out-build' }) + .pipe(es.through(function (data) { + otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative)); + }, function () { + if (!otherSourcesStreamArr.length) { + setTimeout(function () { otherSourcesStream.emit('end'); }, 0); + } + else { + es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); + } + })); + var result = es.merge(loader(bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream); + return result + .pipe(sourcemaps.write('./', { + sourceRoot: null, + addComment: true, + includeContent: true + })) + .pipe(i18n.processNlsFiles({ + fileHeader: bundledFileHeader + })) + .pipe(gulp.dest(out)); + }; +} +exports.optimizeTask = optimizeTask; +; +/** + * Wrap around uglify and allow the preserveComments function + * to have a file "context" to include our copyright only once per file. + */ +function uglifyWithCopyrights() { + var preserveComments = function (f) { + return function (node, comment) { + var text = comment.value; + var type = comment.type; + if (/@minifier_do_not_preserve/.test(text)) { + return false; + } + var isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text); + if (isOurCopyright) { + if (f.__hasOurCopyright) { + return false; + } + f.__hasOurCopyright = true; + return true; + } + if ('comment2' === type) { + // check for /*!. Note that text doesn't contain leading /* + return (text.length > 0 && text[0] === '!') || /@preserve|license|@cc_on|copyright/i.test(text); + } + else if ('comment1' === type) { + return /license|copyright/i.test(text); + } + return false; + }; + }; + var input = es.through(); + var output = input + .pipe(flatmap(function (stream, f) { + return stream.pipe(uglify({ + preserveComments: preserveComments(f), + output: { + // linux tfs build agent is crashing, does this help?§ + max_line_len: 3200000 + } + })); + })); + return es.duplex(input, output); +} +function minifyTask(src, sourceMapBaseUrl) { + var sourceMappingURL = sourceMapBaseUrl && (function (f) { return sourceMapBaseUrl + "/" + f.relative + ".map"; }); + return function (cb) { + var jsFilter = filter('**/*.js', { restore: true }); + var cssFilter = filter('**/*.css', { restore: true }); + pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', { + sourceMappingURL: sourceMappingURL, + sourceRoot: null, + includeContent: true, + addComment: true + }), gulp.dest(src + '-min'), function (err) { + if (err instanceof uglify.GulpUglifyError) { + console.error("Uglify error in '" + (err.cause && err.cause.filename) + "'"); + } + cb(err); + }); + }; +} +exports.minifyTask = minifyTask; +; diff --git a/build/lib/reporter.js b/build/lib/reporter.js index e7eb9fc2aa5..a1df81a6573 100644 --- a/build/lib/reporter.js +++ b/build/lib/reporter.js @@ -1,83 +1,83 @@ -/*--------------------------------------------------------------------------------------------- - * 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 es = require("event-stream"); -var _ = require("underscore"); -var util = require("gulp-util"); -var fs = require("fs"); -var path = require("path"); -var allErrors = []; -var startTime = null; -var count = 0; -function onStart() { - if (count++ > 0) { - return; - } - startTime = new Date().getTime(); - util.log("Starting " + util.colors.green('compilation') + "..."); -} -function onEnd() { - if (--count > 0) { - return; - } - log(); -} -var buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log'); -try { - fs.mkdirSync(path.dirname(buildLogPath)); -} -catch (err) { - // ignore -} -function log() { - var errors = _.flatten(allErrors); - errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); }); - var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; - var messages = errors - .map(function (err) { return regex.exec(err); }) - .filter(function (match) { return !!match; }) - .map(function (_a) { - var path = _a[1], line = _a[2], column = _a[3], message = _a[4]; - return ({ path: path, line: Number.parseInt(line), column: Number.parseInt(column), message: message }); - }); - try { - fs.writeFileSync(buildLogPath, JSON.stringify(messages)); - } - catch (err) { - //noop - } - util.log("Finished " + util.colors.green('compilation') + " with " + errors.length + " errors after " + util.colors.magenta((new Date().getTime() - startTime) + ' ms')); -} -function createReporter() { - var errors = []; - allErrors.push(errors); - var ReportFunc = (function () { - function ReportFunc(err) { - errors.push(err); - } - ReportFunc.hasErrors = function () { - return errors.length > 0; - }; - ReportFunc.end = function (emitError) { - errors.length = 0; - onStart(); - return es.through(null, function () { - onEnd(); - if (emitError && errors.length > 0) { - log(); - this.emit('error'); - } - else { - this.emit('end'); - } - }); - }; - return ReportFunc; - }()); - return ReportFunc; -} -exports.createReporter = createReporter; -; +/*--------------------------------------------------------------------------------------------- + * 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 es = require("event-stream"); +var _ = require("underscore"); +var util = require("gulp-util"); +var fs = require("fs"); +var path = require("path"); +var allErrors = []; +var startTime = null; +var count = 0; +function onStart() { + if (count++ > 0) { + return; + } + startTime = new Date().getTime(); + util.log("Starting " + util.colors.green('compilation') + "..."); +} +function onEnd() { + if (--count > 0) { + return; + } + log(); +} +var buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log'); +try { + fs.mkdirSync(path.dirname(buildLogPath)); +} +catch (err) { + // ignore +} +function log() { + var errors = _.flatten(allErrors); + errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); }); + var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; + var messages = errors + .map(function (err) { return regex.exec(err); }) + .filter(function (match) { return !!match; }) + .map(function (_a) { + var path = _a[1], line = _a[2], column = _a[3], message = _a[4]; + return ({ path: path, line: parseInt(line), column: parseInt(column), message: message }); + }); + try { + fs.writeFileSync(buildLogPath, JSON.stringify(messages)); + } + catch (err) { + //noop + } + util.log("Finished " + util.colors.green('compilation') + " with " + errors.length + " errors after " + util.colors.magenta((new Date().getTime() - startTime) + ' ms')); +} +function createReporter() { + var errors = []; + allErrors.push(errors); + var ReportFunc = (function () { + function ReportFunc(err) { + errors.push(err); + } + ReportFunc.hasErrors = function () { + return errors.length > 0; + }; + ReportFunc.end = function (emitError) { + errors.length = 0; + onStart(); + return es.through(null, function () { + onEnd(); + if (emitError && errors.length > 0) { + log(); + this.emit('error'); + } + else { + this.emit('end'); + } + }); + }; + return ReportFunc; + }()); + return ReportFunc; +} +exports.createReporter = createReporter; +; diff --git a/build/lib/reporter.ts b/build/lib/reporter.ts index a61db941289..e072a60bbfd 100644 --- a/build/lib/reporter.ts +++ b/build/lib/reporter.ts @@ -48,7 +48,7 @@ function log(): void { const messages = errors .map(err => regex.exec(err)) .filter(match => !!match) - .map(([, path, line, column, message]) => ({ path, line: Number.parseInt(line), column: Number.parseInt(column), message })); + .map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message })); try { diff --git a/build/lib/test/i18n.test.js b/build/lib/test/i18n.test.js index 03f84214b8c..17d5a3fcbf9 100644 --- a/build/lib/test/i18n.test.js +++ b/build/lib/test/i18n.test.js @@ -1,40 +1,40 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert = require("assert"); -var i18n = require("../i18n"); -suite('XLF Parser Tests', function () { - var sampleXlf = 'Key #1Key #2 &'; - var sampleTranslatedXlf = 'Key #1Кнопка #1Key #2 &Кнопка #2 &'; - var originalFilePath = 'vs/base/common/keybinding'; - var keys = ['key1', 'key2']; - var messages = ['Key #1', 'Key #2 &']; - var translatedMessages = { key1: 'Кнопка #1', key2: 'Кнопка #2 &' }; - test('Keys & messages to XLF conversion', function () { - var xlf = new i18n.XLF('vscode-workbench'); - xlf.addFile(originalFilePath, keys, messages); - var xlfString = xlf.toString(); - assert.strictEqual(xlfString.replace(/\s{2,}/g, ''), sampleXlf); - }); - test('XLF to keys & messages conversion', function () { - i18n.XLF.parse(sampleTranslatedXlf).then(function (resolvedFiles) { - assert.deepEqual(resolvedFiles[0].messages, translatedMessages); - assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath); - }); - }); - test('JSON file source path to Transifex resource match', function () { - var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench'; - var platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject }; - assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); - assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); - assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); - assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); - assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); - assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); - assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); - assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); - }); -}); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var assert = require("assert"); +var i18n = require("../i18n"); +suite('XLF Parser Tests', function () { + var sampleXlf = 'Key #1Key #2 &'; + var sampleTranslatedXlf = 'Key #1Кнопка #1Key #2 &Кнопка #2 &'; + var originalFilePath = 'vs/base/common/keybinding'; + var keys = ['key1', 'key2']; + var messages = ['Key #1', 'Key #2 &']; + var translatedMessages = { key1: 'Кнопка #1', key2: 'Кнопка #2 &' }; + test('Keys & messages to XLF conversion', function () { + var xlf = new i18n.XLF('vscode-workbench'); + xlf.addFile(originalFilePath, keys, messages); + var xlfString = xlf.toString(); + assert.strictEqual(xlfString.replace(/\s{2,}/g, ''), sampleXlf); + }); + test('XLF to keys & messages conversion', function () { + i18n.XLF.parse(sampleTranslatedXlf).then(function (resolvedFiles) { + assert.deepEqual(resolvedFiles[0].messages, translatedMessages); + assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath); + }); + }); + test('JSON file source path to Transifex resource match', function () { + var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench'; + var platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject }; + assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); + assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); + assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); + assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); + assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); + assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); + assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); + assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); + }); +}); diff --git a/build/lib/tslint/allowAsyncRule.js b/build/lib/tslint/allowAsyncRule.js index cdd121e00db..ee2a652e3c9 100644 --- a/build/lib/tslint/allowAsyncRule.js +++ b/build/lib/tslint/allowAsyncRule.js @@ -1,59 +1,59 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var ts = require("typescript"); -var Lint = require("tslint"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var allowed = this.getOptions().ruleArguments[0]; - return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed)); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var AsyncRuleWalker = (function (_super) { - __extends(AsyncRuleWalker, _super); - function AsyncRuleWalker(file, opts, allowed) { - var _this = _super.call(this, file, opts) || this; - _this.allowed = allowed; - return _this; - } - AsyncRuleWalker.prototype.visitMethodDeclaration = function (node) { - this.visitFunctionLikeDeclaration(node); - }; - AsyncRuleWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitFunctionLikeDeclaration(node); - }; - AsyncRuleWalker.prototype.visitFunctionLikeDeclaration = function (node) { - var _this = this; - var flags = ts.getCombinedModifierFlags(node); - if (!(flags & ts.ModifierFlags.Async)) { - return; - } - var path = node.getSourceFile().path; - var pathParts = path.split(/\\|\//); - if (pathParts.some(function (part) { return _this.allowed.some(function (allowed) { return part === allowed; }); })) { - return; - } - var message = "You are not allowed to use async function in this layer. Allowed layers are: [" + this.allowed + "]"; - this.addFailureAtNode(node, message); - }; - return AsyncRuleWalker; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); +var Lint = require("tslint"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var allowed = this.getOptions().ruleArguments[0]; + return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed)); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var AsyncRuleWalker = (function (_super) { + __extends(AsyncRuleWalker, _super); + function AsyncRuleWalker(file, opts, allowed) { + var _this = _super.call(this, file, opts) || this; + _this.allowed = allowed; + return _this; + } + AsyncRuleWalker.prototype.visitMethodDeclaration = function (node) { + this.visitFunctionLikeDeclaration(node); + }; + AsyncRuleWalker.prototype.visitFunctionDeclaration = function (node) { + this.visitFunctionLikeDeclaration(node); + }; + AsyncRuleWalker.prototype.visitFunctionLikeDeclaration = function (node) { + var _this = this; + var flags = ts.getCombinedModifierFlags(node); + if (!(flags & ts.ModifierFlags.Async)) { + return; + } + var path = node.getSourceFile().path; + var pathParts = path.split(/\\|\//); + if (pathParts.some(function (part) { return _this.allowed.some(function (allowed) { return part === allowed; }); })) { + return; + } + var message = "You are not allowed to use async function in this layer. Allowed layers are: [" + this.allowed + "]"; + this.addFailureAtNode(node, message); + }; + return AsyncRuleWalker; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/allowAsyncRule.ts b/build/lib/tslint/allowAsyncRule.ts index 6506929cb9b..e61765bf53d 100644 --- a/build/lib/tslint/allowAsyncRule.ts +++ b/build/lib/tslint/allowAsyncRule.ts @@ -34,7 +34,7 @@ class AsyncRuleWalker extends Lint.RuleWalker { return; } - const path = node.getSourceFile().path; + const path = (node.getSourceFile() as any).path; const pathParts = path.split(/\\|\//); if (pathParts.some(part => this.allowed.some(allowed => part === allowed))) { diff --git a/build/lib/tslint/duplicateImportsRule.js b/build/lib/tslint/duplicateImportsRule.js index d63cb42a5d2..c3e96b8e412 100644 --- a/build/lib/tslint/duplicateImportsRule.js +++ b/build/lib/tslint/duplicateImportsRule.js @@ -1,50 +1,50 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var path_1 = require("path"); -var Lint = require("tslint"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var ImportPatterns = (function (_super) { - __extends(ImportPatterns, _super); - function ImportPatterns(file, opts) { - var _this = _super.call(this, file, opts) || this; - _this.imports = Object.create(null); - return _this; - } - ImportPatterns.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - if (this.imports[path]) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Duplicate imports for '" + path + "'.")); - } - this.imports[path] = true; - }; - return ImportPatterns; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var path_1 = require("path"); +var Lint = require("tslint"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var ImportPatterns = (function (_super) { + __extends(ImportPatterns, _super); + function ImportPatterns(file, opts) { + var _this = _super.call(this, file, opts) || this; + _this.imports = Object.create(null); + return _this; + } + ImportPatterns.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + if (path[0] === '.') { + path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); + } + if (this.imports[path]) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Duplicate imports for '" + path + "'.")); + } + this.imports[path] = true; + }; + return ImportPatterns; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/importPatternsRule.js b/build/lib/tslint/importPatternsRule.js index f79ffca6165..6bd94309cf8 100644 --- a/build/lib/tslint/importPatternsRule.js +++ b/build/lib/tslint/importPatternsRule.js @@ -1,57 +1,57 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var Lint = require("tslint"); -var minimatch = require("minimatch"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var configs = this.getOptions().ruleArguments; - for (var _i = 0, configs_1 = configs; _i < configs_1.length; _i++) { - var config = configs_1[_i]; - if (minimatch(sourceFile.fileName, config.target)) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); - } - } - return []; - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var ImportPatterns = (function (_super) { - __extends(ImportPatterns, _super); - function ImportPatterns(file, opts, _config) { - var _this = _super.call(this, file, opts) || this; - _this._config = _config; - return _this; - } - ImportPatterns.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - // ignore relative paths - if (path[0] === '.') { - return; - } - if (!minimatch(path, this._config.restrictions)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction.")); - } - }; - return ImportPatterns; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var Lint = require("tslint"); +var minimatch = require("minimatch"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var configs = this.getOptions().ruleArguments; + for (var _i = 0, configs_1 = configs; _i < configs_1.length; _i++) { + var config = configs_1[_i]; + if (minimatch(sourceFile.fileName, config.target)) { + return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); + } + } + return []; + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var ImportPatterns = (function (_super) { + __extends(ImportPatterns, _super); + function ImportPatterns(file, opts, _config) { + var _this = _super.call(this, file, opts) || this; + _this._config = _config; + return _this; + } + ImportPatterns.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + // ignore relative paths + if (path[0] === '.') { + return; + } + if (!minimatch(path, this._config.restrictions)) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction.")); + } + }; + return ImportPatterns; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/layeringRule.js b/build/lib/tslint/layeringRule.js index 0d5b3771e3c..37a60b2b44f 100644 --- a/build/lib/tslint/layeringRule.js +++ b/build/lib/tslint/layeringRule.js @@ -1,85 +1,85 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var Lint = require("tslint"); -var path_1 = require("path"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var parts = path_1.dirname(sourceFile.fileName).split(/\\|\//); - var ruleArgs = this.getOptions().ruleArguments[0]; - var config; - for (var i = parts.length - 1; i >= 0; i--) { - if (ruleArgs[parts[i]]) { - config = { - allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), - disallowed: new Set() - }; - Object.keys(ruleArgs).forEach(function (key) { - if (!config.allowed.has(key)) { - config.disallowed.add(key); - } - }); - break; - } - } - if (!config) { - return []; - } - return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var LayeringRule = (function (_super) { - __extends(LayeringRule, _super); - function LayeringRule(file, config, opts) { - var _this = _super.call(this, file, opts) || this; - _this._config = config; - return _this; - } - LayeringRule.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - var parts = path_1.dirname(path).split(/\\|\//); - for (var i = parts.length - 1; i >= 0; i--) { - var part = parts[i]; - if (this._config.allowed.has(part)) { - // GOOD - same layer - return; - } - if (this._config.disallowed.has(part)) { - // BAD - wrong layer - var message = "Bad layering. You are not allowed to access '" + part + "' from here, allowed layers are: [" + LayeringRule._print(this._config.allowed) + "]"; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); - return; - } - } - }; - LayeringRule._print = function (set) { - var r = []; - set.forEach(function (e) { return r.push(e); }); - return r.join(', '); - }; - return LayeringRule; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var Lint = require("tslint"); +var path_1 = require("path"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var parts = path_1.dirname(sourceFile.fileName).split(/\\|\//); + var ruleArgs = this.getOptions().ruleArguments[0]; + var config; + for (var i = parts.length - 1; i >= 0; i--) { + if (ruleArgs[parts[i]]) { + config = { + allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), + disallowed: new Set() + }; + Object.keys(ruleArgs).forEach(function (key) { + if (!config.allowed.has(key)) { + config.disallowed.add(key); + } + }); + break; + } + } + if (!config) { + return []; + } + return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var LayeringRule = (function (_super) { + __extends(LayeringRule, _super); + function LayeringRule(file, config, opts) { + var _this = _super.call(this, file, opts) || this; + _this._config = config; + return _this; + } + LayeringRule.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + if (path[0] === '.') { + path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); + } + var parts = path_1.dirname(path).split(/\\|\//); + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i]; + if (this._config.allowed.has(part)) { + // GOOD - same layer + return; + } + if (this._config.disallowed.has(part)) { + // BAD - wrong layer + var message = "Bad layering. You are not allowed to access '" + part + "' from here, allowed layers are: [" + LayeringRule._print(this._config.allowed) + "]"; + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); + return; + } + } + }; + LayeringRule._print = function (set) { + var r = []; + set.forEach(function (e) { return r.push(e); }); + return r.join(', '); + }; + return LayeringRule; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js index 657c5f8a870..db189931465 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.js +++ b/build/lib/tslint/noUnexternalizedStringsRule.js @@ -1,177 +1,177 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var ts = require("typescript"); -var Lint = require("tslint"); -/** - * Implementation of the no-unexternalized-strings rule. - */ -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -function isStringLiteral(node) { - return node && node.kind === ts.SyntaxKind.StringLiteral; -} -function isObjectLiteral(node) { - return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; -} -function isPropertyAssignment(node) { - return node && node.kind === ts.SyntaxKind.PropertyAssignment; -} -var NoUnexternalizedStringsRuleWalker = (function (_super) { - __extends(NoUnexternalizedStringsRuleWalker, _super); - function NoUnexternalizedStringsRuleWalker(file, opts) { - var _this = _super.call(this, file, opts) || this; - _this.signatures = Object.create(null); - _this.ignores = Object.create(null); - _this.messageIndex = undefined; - _this.keyIndex = undefined; - _this.usedKeys = Object.create(null); - var options = _this.getOptions(); - var first = options && options.length > 0 ? options[0] : null; - if (first) { - if (Array.isArray(first.signatures)) { - first.signatures.forEach(function (signature) { return _this.signatures[signature] = true; }); - } - if (Array.isArray(first.ignores)) { - first.ignores.forEach(function (ignore) { return _this.ignores[ignore] = true; }); - } - if (typeof first.messageIndex !== 'undefined') { - _this.messageIndex = first.messageIndex; - } - if (typeof first.keyIndex !== 'undefined') { - _this.keyIndex = first.keyIndex; - } - } - return _this; - } - NoUnexternalizedStringsRuleWalker.prototype.visitSourceFile = function (node) { - var _this = this; - _super.prototype.visitSourceFile.call(this, node); - Object.keys(this.usedKeys).forEach(function (key) { - var occurences = _this.usedKeys[key]; - if (occurences.length > 1) { - occurences.forEach(function (occurence) { - _this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value."))); - }); - } - }); - }; - NoUnexternalizedStringsRuleWalker.prototype.visitStringLiteral = function (node) { - this.checkStringLiteral(node); - _super.prototype.visitStringLiteral.call(this, node); - }; - NoUnexternalizedStringsRuleWalker.prototype.checkStringLiteral = function (node) { - var text = node.getText(); - var doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; - var info = this.findDescribingParent(node); - // Ignore strings in import and export nodes. - if (info && info.ignoreUsage) { - return; - } - var callInfo = info ? info.callInfo : null; - var functionName = callInfo ? callInfo.callExpression.expression.getText() : null; - if (functionName && this.ignores[functionName]) { - return; - } - if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { - var s = node.getText(); - var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"); - var fix = new Lint.Fix('Unexternalitzed string', [replacement]); - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix)); - return; - } - // We have a single quoted string outside a localize function name. - if (!doubleQuoted && !this.signatures[functionName]) { - return; - } - // We have a string that is a direct argument into the localize call. - var keyArg = callInfo.argIndex === this.keyIndex - ? callInfo.callExpression.arguments[this.keyIndex] - : null; - if (keyArg) { - if (isStringLiteral(keyArg)) { - this.recordKey(keyArg, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - else if (isObjectLiteral(keyArg)) { - for (var i = 0; i < keyArg.properties.length; i++) { - var property = keyArg.properties[i]; - if (isPropertyAssignment(property)) { - var name_1 = property.name.getText(); - if (name_1 === 'key') { - var initializer = property.initializer; - if (isStringLiteral(initializer)) { - this.recordKey(initializer, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - break; - } - } - } - } - } - var messageArg = callInfo.argIndex === this.messageIndex - ? callInfo.callExpression.arguments[this.messageIndex] - : null; - if (messageArg && messageArg !== node) { - this.addFailure(this.createFailure(messageArg.getStart(), messageArg.getWidth(), "Message argument to '" + callInfo.callExpression.expression.getText() + "' must be a string literal.")); - return; - } - }; - NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) { - var text = keyNode.getText(); - var occurences = this.usedKeys[text]; - if (!occurences) { - occurences = []; - this.usedKeys[text] = occurences; - } - if (messageNode) { - if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { - return; - } - } - occurences.push({ key: keyNode, message: messageNode }); - }; - NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) { - var parent; - while ((parent = node.parent)) { - var kind = parent.kind; - if (kind === ts.SyntaxKind.CallExpression) { - var callExpression = parent; - return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; - } - else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { - return { ignoreUsage: true }; - } - else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration - || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration - || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration - || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { - return null; - } - node = parent; - } - }; - return NoUnexternalizedStringsRuleWalker; -}(Lint.RuleWalker)); -NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE = '"'; +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); +var Lint = require("tslint"); +/** + * Implementation of the no-unexternalized-strings rule. + */ +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +function isStringLiteral(node) { + return node && node.kind === ts.SyntaxKind.StringLiteral; +} +function isObjectLiteral(node) { + return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; +} +function isPropertyAssignment(node) { + return node && node.kind === ts.SyntaxKind.PropertyAssignment; +} +var NoUnexternalizedStringsRuleWalker = (function (_super) { + __extends(NoUnexternalizedStringsRuleWalker, _super); + function NoUnexternalizedStringsRuleWalker(file, opts) { + var _this = _super.call(this, file, opts) || this; + _this.signatures = Object.create(null); + _this.ignores = Object.create(null); + _this.messageIndex = undefined; + _this.keyIndex = undefined; + _this.usedKeys = Object.create(null); + var options = _this.getOptions(); + var first = options && options.length > 0 ? options[0] : null; + if (first) { + if (Array.isArray(first.signatures)) { + first.signatures.forEach(function (signature) { return _this.signatures[signature] = true; }); + } + if (Array.isArray(first.ignores)) { + first.ignores.forEach(function (ignore) { return _this.ignores[ignore] = true; }); + } + if (typeof first.messageIndex !== 'undefined') { + _this.messageIndex = first.messageIndex; + } + if (typeof first.keyIndex !== 'undefined') { + _this.keyIndex = first.keyIndex; + } + } + return _this; + } + NoUnexternalizedStringsRuleWalker.prototype.visitSourceFile = function (node) { + var _this = this; + _super.prototype.visitSourceFile.call(this, node); + Object.keys(this.usedKeys).forEach(function (key) { + var occurences = _this.usedKeys[key]; + if (occurences.length > 1) { + occurences.forEach(function (occurence) { + _this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value."))); + }); + } + }); + }; + NoUnexternalizedStringsRuleWalker.prototype.visitStringLiteral = function (node) { + this.checkStringLiteral(node); + _super.prototype.visitStringLiteral.call(this, node); + }; + NoUnexternalizedStringsRuleWalker.prototype.checkStringLiteral = function (node) { + var text = node.getText(); + var doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; + var info = this.findDescribingParent(node); + // Ignore strings in import and export nodes. + if (info && info.ignoreUsage) { + return; + } + var callInfo = info ? info.callInfo : null; + var functionName = callInfo ? callInfo.callExpression.expression.getText() : null; + if (functionName && this.ignores[functionName]) { + return; + } + if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { + var s = node.getText(); + var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"); + var fix = new Lint.Fix('Unexternalitzed string', [replacement]); + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix)); + return; + } + // We have a single quoted string outside a localize function name. + if (!doubleQuoted && !this.signatures[functionName]) { + return; + } + // We have a string that is a direct argument into the localize call. + var keyArg = callInfo.argIndex === this.keyIndex + ? callInfo.callExpression.arguments[this.keyIndex] + : null; + if (keyArg) { + if (isStringLiteral(keyArg)) { + this.recordKey(keyArg, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); + } + else if (isObjectLiteral(keyArg)) { + for (var i = 0; i < keyArg.properties.length; i++) { + var property = keyArg.properties[i]; + if (isPropertyAssignment(property)) { + var name_1 = property.name.getText(); + if (name_1 === 'key') { + var initializer = property.initializer; + if (isStringLiteral(initializer)) { + this.recordKey(initializer, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); + } + break; + } + } + } + } + } + var messageArg = callInfo.argIndex === this.messageIndex + ? callInfo.callExpression.arguments[this.messageIndex] + : null; + if (messageArg && messageArg !== node) { + this.addFailure(this.createFailure(messageArg.getStart(), messageArg.getWidth(), "Message argument to '" + callInfo.callExpression.expression.getText() + "' must be a string literal.")); + return; + } + }; + NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) { + var text = keyNode.getText(); + var occurences = this.usedKeys[text]; + if (!occurences) { + occurences = []; + this.usedKeys[text] = occurences; + } + if (messageNode) { + if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { + return; + } + } + occurences.push({ key: keyNode, message: messageNode }); + }; + NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) { + var parent; + while ((parent = node.parent)) { + var kind = parent.kind; + if (kind === ts.SyntaxKind.CallExpression) { + var callExpression = parent; + return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; + } + else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { + return { ignoreUsage: true }; + } + else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration + || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration + || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration + || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { + return null; + } + node = parent; + } + }; + return NoUnexternalizedStringsRuleWalker; +}(Lint.RuleWalker)); +NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE = '"'; diff --git a/build/lib/typings/lib.es6.d.ts b/build/lib/typings/lib.es6.d.ts deleted file mode 100644 index 8cc95f419b1..00000000000 --- a/build/lib/typings/lib.es6.d.ts +++ /dev/null @@ -1,18296 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): T; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -declare var Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -declare var Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: NumberConstructor; - -interface TemplateStringsArray extends Array { - raw: string[]; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare var Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} - -interface RegExpConstructor { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare var RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -declare var Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -declare var EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -declare var RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -declare var ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -declare var SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -declare var TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -declare var URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} - -declare var Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PropertyKey = string | number | symbol; - -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - [Symbol.toStringTag]: string; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string; - - // Well-known Symbols - - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - isConcatSpreadable: symbol; - - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - iterator: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - split: symbol; - - /** - * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. - */ - toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the with - * environment bindings of the associated objects. - */ - unscopables: symbol; -} -declare var Symbol: SymbolConstructor; - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface Function { - /** - * Returns a new function object that is identical to the argument object in all ways except - * for its identity and the value of its HomeObject internal slot. - */ - toMethod(newHome: Object): Function; - - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - name: string; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface ArrayLike { - length: number; - [n: number]: T; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - contains(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface GeneratorFunction extends Function { - -} - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - (...args: string[]): GeneratorFunction; - prototype: GeneratorFunction; -} -declare var GeneratorFunction: GeneratorFunctionConstructor; - -interface Generator extends IterableIterator { - next(value?: any): IteratorResult; - throw(exception: any): IteratorResult; - return(value: T): IteratorResult; - [Symbol.iterator](): Generator; - [Symbol.toStringTag]: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[] ): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; - - [Symbol.toStringTag]: string; -} - -interface RegExp { - /** - * Matches a string with a regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - match(string: string): string[]; - - /** - * Replaces text in a string, using a regular expression. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of rgExp in stringObj. - */ - replace(string: string, replaceValue: string): string; - - search(string: string): number; - - /** - * Returns an Array object into which substrings of the result of converting string to a String - * have been stored. The substrings are determined by searching from left to right for matches - * of the this value regular expression; these occurrences are not part of any substring in the - * returned array, but serve to divide up the String value. - * - * If the regular expression that contains capturing parentheses, then each time separator is - * matched the results (including any undefined results) of the capturing parentheses are spliced. - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than limit elements. - */ - split(string: string, limit?: number): string[]; - - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - unicode: boolean; -} - -interface Map { - clear(): void; - delete(key: K): boolean; - entries(): IterableIterator<[K, V]>; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - keys(): IterableIterator; - set(key: K, value?: V): Map; - size: number; - values(): IterableIterator; - [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; -} - -interface MapConstructor { - new (): Map; - new (iterable: Iterable<[K, V]>): Map; - prototype: Map; -} -declare var Map: MapConstructor; - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: Iterable<[K, V]>): WeakMap; - prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - entries(): IterableIterator<[T, T]>; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - keys(): IterableIterator; - size: number; - values(): IterableIterator; - [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; -} - -interface SetConstructor { - new (): Set; - new (iterable: Iterable): Set; - prototype: Set; -} -declare var Set: SetConstructor; - -interface WeakSet { - add(value: T): WeakSet; - clear(): void; - delete(value: T): boolean; - has(value: T): boolean; - [Symbol.toStringTag]: string; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: Iterable): WeakSet; - prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; - -interface JSON { - [Symbol.toStringTag]: string; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin: number, end?: number): ArrayBuffer; - - [Symbol.toStringTag]: string; -} - -interface ArrayBufferConstructor { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): boolean; -} -declare var ArrayBuffer: ArrayBufferConstructor; - -interface DataView { - buffer: ArrayBuffer; - byteLength: number; - byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian: boolean): void; - - [Symbol.toStringTag]: string; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare var DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int8Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int8Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int8Array; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int8ArrayConstructor { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} -declare var Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint8Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint8Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint8Array; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint8ArrayConstructor { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} -declare var Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint8ClampedArray; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint8ClampedArray; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: Uint8ClampedArray): Uint8ClampedArray; - new (array: number[]): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int16Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int16Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int16Array; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int16ArrayConstructor { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} -declare var Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint16Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint16Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint16Array; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint16ArrayConstructor { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} -declare var Uint16Array: Uint16ArrayConstructor; - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int32Array; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int32ArrayConstructor { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare var Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint32Array; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint32ArrayConstructor { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare var Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Float32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Float32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Float32Array; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Float32ArrayConstructor { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} -declare var Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Float64Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Float64Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Float64Array; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Float64ArrayConstructor { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare var Float64Array: Float64ArrayConstructor; - -interface ProxyHandler { - getPrototypeOf? (target: T): any; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, thisArg: any, argArray?: any): any; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T -} -declare var Proxy: ProxyConstructor; - -declare module Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - - [Symbol.toStringTag]: string; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; - - [Symbol.species]: Function; -} - -declare var Promise: PromiseConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -}///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name?: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { - key?: string; - location?: number; - repeat?: boolean; -} - -interface MouseEventInit extends SharedKeyboardAndMouseEventInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface SharedKeyboardAndMouseEventInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - keyModifierStateAltGraph?: boolean; - keyModifierStateCapsLock?: boolean; - keyModifierStateFn?: boolean; - keyModifierStateFnLock?: boolean; - keyModifierStateHyper?: boolean; - keyModifierStateNumLock?: boolean; - keyModifierStateOS?: boolean; - keyModifierStateScrollLock?: boolean; - keyModifierStateSuper?: boolean; - keyModifierStateSymbol?: boolean; - keyModifierStateSymbolLock?: boolean; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: any): void; - getFloatTimeDomainData(array: any): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCache extends EventTarget { - oncached: (ev: Event) => any; - onchecking: (ev: Event) => any; - ondownloading: (ev: Event) => any; - onerror: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - status: number; - abort(): void; - swapCache(): void; - update(): void; - CHECKING: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - UNCACHED: number; - UPDATEREADY: number; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - UNCACHED: number; - UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - attributeName: string; - attributeValue: string; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - name: string; - ownerElement: Element; - specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - duration: number; - length: number; - numberOfChannels: number; - sampleRate: number; - getChannelData(channel: number): any; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (ev: Event) => any; - playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - currentTime: number; - destination: AudioDestinationNode; - listener: AudioListener; - sampleRate: number; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: any, imag: any): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - context: AudioContext; - numberOfInputs: number; - numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: any, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - inputBuffer: AudioBuffer; - outputBuffer: AudioBuffer; - playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - id: string; - kind: string; - label: string; - language: string; - sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - onchange: (ev: Event) => any; - onremovetrack: (ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - Q: AudioParam; - detune: AudioParam; - frequency: AudioParam; - gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - size: number; - type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - cssRules: CSSRuleList; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - href: string; - media: MediaList; - styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selector: string; - selectorText: string; - style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - parentRule: CSSRule; - parentStyleSheet: CSSStyleSheet; - type: number; - CHARSET_RULE: number; - FONT_FACE_RULE: number; - IMPORT_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - MEDIA_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - STYLE_RULE: number; - SUPPORTS_RULE: number; - UNKNOWN_RULE: number; - VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - CHARSET_RULE: number; - FONT_FACE_RULE: number; - IMPORT_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - MEDIA_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - STYLE_RULE: number; - SUPPORTS_RULE: number; - UNKNOWN_RULE: number; - VIEWPORT_RULE: number; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string; - alignItems: string; - alignSelf: string; - alignmentBaseline: string; - animation: string; - animationDelay: string; - animationDirection: string; - animationDuration: string; - animationFillMode: string; - animationIterationCount: string; - animationName: string; - animationPlayState: string; - animationTimingFunction: string; - backfaceVisibility: string; - background: string; - backgroundAttachment: string; - backgroundClip: string; - backgroundColor: string; - backgroundImage: string; - backgroundOrigin: string; - backgroundPosition: string; - backgroundPositionX: string; - backgroundPositionY: string; - backgroundRepeat: string; - backgroundSize: string; - baselineShift: string; - border: string; - borderBottom: string; - borderBottomColor: string; - borderBottomLeftRadius: string; - borderBottomRightRadius: string; - borderBottomStyle: string; - borderBottomWidth: string; - borderCollapse: string; - borderColor: string; - borderImage: string; - borderImageOutset: string; - borderImageRepeat: string; - borderImageSlice: string; - borderImageSource: string; - borderImageWidth: string; - borderLeft: string; - borderLeftColor: string; - borderLeftStyle: string; - borderLeftWidth: string; - borderRadius: string; - borderRight: string; - borderRightColor: string; - borderRightStyle: string; - borderRightWidth: string; - borderSpacing: string; - borderStyle: string; - borderTop: string; - borderTopColor: string; - borderTopLeftRadius: string; - borderTopRightRadius: string; - borderTopStyle: string; - borderTopWidth: string; - borderWidth: string; - bottom: string; - boxShadow: string; - boxSizing: string; - breakAfter: string; - breakBefore: string; - breakInside: string; - captionSide: string; - clear: string; - clip: string; - clipPath: string; - clipRule: string; - color: string; - colorInterpolationFilters: string; - columnCount: any; - columnFill: string; - columnGap: any; - columnRule: string; - columnRuleColor: any; - columnRuleStyle: string; - columnRuleWidth: any; - columnSpan: string; - columnWidth: any; - columns: string; - content: string; - counterIncrement: string; - counterReset: string; - cssFloat: string; - cssText: string; - cursor: string; - direction: string; - display: string; - dominantBaseline: string; - emptyCells: string; - enableBackground: string; - fill: string; - fillOpacity: string; - fillRule: string; - filter: string; - flex: string; - flexBasis: string; - flexDirection: string; - flexFlow: string; - flexGrow: string; - flexShrink: string; - flexWrap: string; - floodColor: string; - floodOpacity: string; - font: string; - fontFamily: string; - fontFeatureSettings: string; - fontSize: string; - fontSizeAdjust: string; - fontStretch: string; - fontStyle: string; - fontVariant: string; - fontWeight: string; - glyphOrientationHorizontal: string; - glyphOrientationVertical: string; - height: string; - imeMode: string; - justifyContent: string; - kerning: string; - left: string; - length: number; - letterSpacing: string; - lightingColor: string; - lineHeight: string; - listStyle: string; - listStyleImage: string; - listStylePosition: string; - listStyleType: string; - margin: string; - marginBottom: string; - marginLeft: string; - marginRight: string; - marginTop: string; - marker: string; - markerEnd: string; - markerMid: string; - markerStart: string; - mask: string; - maxHeight: string; - maxWidth: string; - minHeight: string; - minWidth: string; - msContentZoomChaining: string; - msContentZoomLimit: string; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string; - msContentZoomSnapPoints: string; - msContentZoomSnapType: string; - msContentZooming: string; - msFlowFrom: string; - msFlowInto: string; - msFontFeatureSettings: string; - msGridColumn: any; - msGridColumnAlign: string; - msGridColumnSpan: any; - msGridColumns: string; - msGridRow: any; - msGridRowAlign: string; - msGridRowSpan: any; - msGridRows: string; - msHighContrastAdjust: string; - msHyphenateLimitChars: string; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string; - msImeAlign: string; - msOverflowStyle: string; - msScrollChaining: string; - msScrollLimit: string; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string; - msScrollSnapPointsX: string; - msScrollSnapPointsY: string; - msScrollSnapType: string; - msScrollSnapX: string; - msScrollSnapY: string; - msScrollTranslation: string; - msTextCombineHorizontal: string; - msTextSizeAdjust: any; - msTouchAction: string; - msTouchSelect: string; - msUserSelect: string; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string; - order: string; - orphans: string; - outline: string; - outlineColor: string; - outlineStyle: string; - outlineWidth: string; - overflow: string; - overflowX: string; - overflowY: string; - padding: string; - paddingBottom: string; - paddingLeft: string; - paddingRight: string; - paddingTop: string; - pageBreakAfter: string; - pageBreakBefore: string; - pageBreakInside: string; - parentRule: CSSRule; - perspective: string; - perspectiveOrigin: string; - pointerEvents: string; - position: string; - quotes: string; - right: string; - rubyAlign: string; - rubyOverhang: string; - rubyPosition: string; - stopColor: string; - stopOpacity: string; - stroke: string; - strokeDasharray: string; - strokeDashoffset: string; - strokeLinecap: string; - strokeLinejoin: string; - strokeMiterlimit: string; - strokeOpacity: string; - strokeWidth: string; - tableLayout: string; - textAlign: string; - textAlignLast: string; - textAnchor: string; - textDecoration: string; - textFillColor: string; - textIndent: string; - textJustify: string; - textKashida: string; - textKashidaSpace: string; - textOverflow: string; - textShadow: string; - textTransform: string; - textUnderlinePosition: string; - top: string; - touchAction: string; - transform: string; - transformOrigin: string; - transformStyle: string; - transition: string; - transitionDelay: string; - transitionDuration: string; - transitionProperty: string; - transitionTimingFunction: string; - unicodeBidi: string; - verticalAlign: string; - visibility: string; - webkitAlignContent: string; - webkitAlignItems: string; - webkitAlignSelf: string; - webkitAnimation: string; - webkitAnimationDelay: string; - webkitAnimationDirection: string; - webkitAnimationDuration: string; - webkitAnimationFillMode: string; - webkitAnimationIterationCount: string; - webkitAnimationName: string; - webkitAnimationPlayState: string; - webkitAnimationTimingFunction: string; - webkitAppearance: string; - webkitBackfaceVisibility: string; - webkitBackground: string; - webkitBackgroundAttachment: string; - webkitBackgroundClip: string; - webkitBackgroundColor: string; - webkitBackgroundImage: string; - webkitBackgroundOrigin: string; - webkitBackgroundPosition: string; - webkitBackgroundPositionX: string; - webkitBackgroundPositionY: string; - webkitBackgroundRepeat: string; - webkitBackgroundSize: string; - webkitBorderBottomLeftRadius: string; - webkitBorderBottomRightRadius: string; - webkitBorderImage: string; - webkitBorderImageOutset: string; - webkitBorderImageRepeat: string; - webkitBorderImageSlice: string; - webkitBorderImageSource: string; - webkitBorderImageWidth: string; - webkitBorderRadius: string; - webkitBorderTopLeftRadius: string; - webkitBorderTopRightRadius: string; - webkitBoxAlign: string; - webkitBoxDirection: string; - webkitBoxFlex: string; - webkitBoxOrdinalGroup: string; - webkitBoxOrient: string; - webkitBoxPack: string; - webkitBoxSizing: string; - webkitColumnBreakAfter: string; - webkitColumnBreakBefore: string; - webkitColumnBreakInside: string; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string; - webkitColumnRuleWidth: any; - webkitColumnSpan: string; - webkitColumnWidth: any; - webkitColumns: string; - webkitFilter: string; - webkitFlex: string; - webkitFlexBasis: string; - webkitFlexDirection: string; - webkitFlexFlow: string; - webkitFlexGrow: string; - webkitFlexShrink: string; - webkitFlexWrap: string; - webkitJustifyContent: string; - webkitOrder: string; - webkitPerspective: string; - webkitPerspectiveOrigin: string; - webkitTapHighlightColor: string; - webkitTextFillColor: string; - webkitTextSizeAdjust: any; - webkitTransform: string; - webkitTransformOrigin: string; - webkitTransformStyle: string; - webkitTransition: string; - webkitTransitionDelay: string; - webkitTransitionDuration: string; - webkitTransitionProperty: string; - webkitTransitionTimingFunction: string; - webkitUserSelect: string; - webkitWritingMode: string; - whiteSpace: string; - widows: string; - width: string; - wordBreak: string; - wordSpacing: string; - wordWrap: string; - writingMode: string; - zIndex: string; - zoom: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readOnly: boolean; - selectorText: string; - style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - cssRules: CSSRuleList; - cssText: string; - href: string; - id: string; - imports: StyleSheetList; - isAlternate: boolean; - isPrefAlternate: boolean; - ownerRule: CSSRule; - owningElement: Element; - pages: StyleSheetPageList; - readOnly: boolean; - rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D { - canvas: HTMLCanvasElement; - fillStyle: any; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: any; - textAlign: string; - textBaseline: string; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - beginPath(): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - closePath(): void; - createImageData(imageDataOrSw: number, sh?: number): ImageData; - createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; - createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; - createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - lineTo(x: number, y: number): void; - measureText(text: string): TextMetrics; - moveTo(x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - height: number; - left: number; - right: number; - top: number; - width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - code: number; - reason: string; - wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - commandName: string; - detail: string; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - accuracy: number; - altitude: number; - altitudeAccuracy: number; - heading: number; - latitude: number; - longitude: number; - speed: number; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - algorithm: KeyAlgorithm; - extractable: boolean; - type: string; - usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - code: number; - message: string; - name: string; - toString(): string; - ABORT_ERR: number; - DATA_CLONE_ERR: number; - DOMSTRING_SIZE_ERR: number; - HIERARCHY_REQUEST_ERR: number; - INDEX_SIZE_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_ACCESS_ERR: number; - INVALID_CHARACTER_ERR: number; - INVALID_MODIFICATION_ERR: number; - INVALID_NODE_TYPE_ERR: number; - INVALID_STATE_ERR: number; - NAMESPACE_ERR: number; - NETWORK_ERR: number; - NOT_FOUND_ERR: number; - NOT_SUPPORTED_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - PARSE_ERR: number; - QUOTA_EXCEEDED_ERR: number; - SECURITY_ERR: number; - SERIALIZE_ERR: number; - SYNTAX_ERR: number; - TIMEOUT_ERR: number; - TYPE_MISMATCH_ERR: number; - URL_MISMATCH_ERR: number; - VALIDATION_ERR: number; - WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - ABORT_ERR: number; - DATA_CLONE_ERR: number; - DOMSTRING_SIZE_ERR: number; - HIERARCHY_REQUEST_ERR: number; - INDEX_SIZE_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_ACCESS_ERR: number; - INVALID_CHARACTER_ERR: number; - INVALID_MODIFICATION_ERR: number; - INVALID_NODE_TYPE_ERR: number; - INVALID_STATE_ERR: number; - NAMESPACE_ERR: number; - NETWORK_ERR: number; - NOT_FOUND_ERR: number; - NOT_SUPPORTED_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - PARSE_ERR: number; - QUOTA_EXCEEDED_ERR: number; - SECURITY_ERR: number; - SERIALIZE_ERR: number; - SYNTAX_ERR: number; - TIMEOUT_ERR: number; - TYPE_MISMATCH_ERR: number; - URL_MISMATCH_ERR: number; - VALIDATION_ERR: number; - WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string, version: string): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - files: FileList; - items: DataTransferItemList; - types: DOMStringList; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - kind: string; - type: string; - getAsFile(): File; - getAsString(_callback: FunctionStringCallback): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - length: number; - add(data: File): DataTransferItem; - clear(): void; - item(index: number): File; - remove(index: number): void; - [index: number]: File; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - id: number; - type: string; - uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - x: number; - y: number; - z: number; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceMotionEvent extends Event { - acceleration: DeviceAcceleration; - accelerationIncludingGravity: DeviceAcceleration; - interval: number; - rotationRate: DeviceRotationRate; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - absolute: boolean; - alpha: number; - beta: number; - gamma: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - alpha: number; - beta: number; - gamma: number; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { - /** - * Sets or gets the URL for the current document. - */ - URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - all: HTMLCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - cookie: string; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollection; - fullscreenElement: Element; - fullscreenEnabled: boolean; - head: HTMLHeadElement; - hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - media: string; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - msHidden: boolean; - msVisibilityState: string; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: Event) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (ev: FocusEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: PointerEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - onfullscreenchange: (ev: Event) => any; - onfullscreenerror: (ev: Event) => any; - oninput: (ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - onmscontentzoom: (ev: UIEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - onmspointerover: (ev: MSPointerEvent) => any; - onmspointerup: (ev: MSPointerEvent) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - onpointerlockchange: (ev: Event) => any; - onpointerlockerror: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: ProgressEvent) => any; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - onsubmit: (ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - onwebkitfullscreenchange: (ev: Event) => any; - onwebkitfullscreenerror: (ev: Event) => any; - plugins: HTMLCollection; - pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - security: string; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - webkitCurrentFullScreenElement: Element; - webkitFullscreenElement: Element; - webkitFullscreenEnabled: boolean; - webkitIsFullScreen: boolean; - xmlEncoding: string; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string; - adoptNode(source: Node): Node; - captureEvents(): void; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "abbr"): HTMLPhraseElement; - createElement(tagName: "acronym"): HTMLPhraseElement; - createElement(tagName: "address"): HTMLBlockElement; - createElement(tagName: "applet"): HTMLAppletElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "b"): HTMLPhraseElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "basefont"): HTMLBaseFontElement; - createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "big"): HTMLPhraseElement; - createElement(tagName: "blockquote"): HTMLBlockElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "center"): HTMLBlockElement; - createElement(tagName: "cite"): HTMLPhraseElement; - createElement(tagName: "code"): HTMLPhraseElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "dd"): HTMLDDElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dfn"): HTMLPhraseElement; - createElement(tagName: "dir"): HTMLDirectoryElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "dt"): HTMLDTElement; - createElement(tagName: "em"): HTMLPhraseElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "frame"): HTMLFrameElement; - createElement(tagName: "frameset"): HTMLFrameSetElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "i"): HTMLPhraseElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "isindex"): HTMLIsIndexElement; - createElement(tagName: "kbd"): HTMLPhraseElement; - createElement(tagName: "keygen"): HTMLBlockElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "listing"): HTMLBlockElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "marquee"): HTMLMarqueeElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nextid"): HTMLNextIdElement; - createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "plaintext"): HTMLBlockElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "rt"): HTMLPhraseElement; - createElement(tagName: "ruby"): HTMLPhraseElement; - createElement(tagName: "s"): HTMLPhraseElement; - createElement(tagName: "samp"): HTMLPhraseElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "source"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "strike"): HTMLPhraseElement; - createElement(tagName: "strong"): HTMLPhraseElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "sub"): HTMLPhraseElement; - createElement(tagName: "sup"): HTMLPhraseElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "tt"): HTMLPhraseElement; - createElement(tagName: "u"): HTMLPhraseElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "var"): HTMLPhraseElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; - createElement(tagName: "xmp"): HTMLBlockElement; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - getElementsByClassName(classNames: string): NodeList; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: "a"): NodeListOf; - getElementsByTagName(tagname: "abbr"): NodeListOf; - getElementsByTagName(tagname: "acronym"): NodeListOf; - getElementsByTagName(tagname: "address"): NodeListOf; - getElementsByTagName(tagname: "applet"): NodeListOf; - getElementsByTagName(tagname: "area"): NodeListOf; - getElementsByTagName(tagname: "article"): NodeListOf; - getElementsByTagName(tagname: "aside"): NodeListOf; - getElementsByTagName(tagname: "audio"): NodeListOf; - getElementsByTagName(tagname: "b"): NodeListOf; - getElementsByTagName(tagname: "base"): NodeListOf; - getElementsByTagName(tagname: "basefont"): NodeListOf; - getElementsByTagName(tagname: "bdo"): NodeListOf; - getElementsByTagName(tagname: "big"): NodeListOf; - getElementsByTagName(tagname: "blockquote"): NodeListOf; - getElementsByTagName(tagname: "body"): NodeListOf; - getElementsByTagName(tagname: "br"): NodeListOf; - getElementsByTagName(tagname: "button"): NodeListOf; - getElementsByTagName(tagname: "canvas"): NodeListOf; - getElementsByTagName(tagname: "caption"): NodeListOf; - getElementsByTagName(tagname: "center"): NodeListOf; - getElementsByTagName(tagname: "circle"): NodeListOf; - getElementsByTagName(tagname: "cite"): NodeListOf; - getElementsByTagName(tagname: "clippath"): NodeListOf; - getElementsByTagName(tagname: "code"): NodeListOf; - getElementsByTagName(tagname: "col"): NodeListOf; - getElementsByTagName(tagname: "colgroup"): NodeListOf; - getElementsByTagName(tagname: "datalist"): NodeListOf; - getElementsByTagName(tagname: "dd"): NodeListOf; - getElementsByTagName(tagname: "defs"): NodeListOf; - getElementsByTagName(tagname: "del"): NodeListOf; - getElementsByTagName(tagname: "desc"): NodeListOf; - getElementsByTagName(tagname: "dfn"): NodeListOf; - getElementsByTagName(tagname: "dir"): NodeListOf; - getElementsByTagName(tagname: "div"): NodeListOf; - getElementsByTagName(tagname: "dl"): NodeListOf; - getElementsByTagName(tagname: "dt"): NodeListOf; - getElementsByTagName(tagname: "ellipse"): NodeListOf; - getElementsByTagName(tagname: "em"): NodeListOf; - getElementsByTagName(tagname: "embed"): NodeListOf; - getElementsByTagName(tagname: "feblend"): NodeListOf; - getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; - getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(tagname: "fecomposite"): NodeListOf; - getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; - getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; - getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; - getElementsByTagName(tagname: "fedistantlight"): NodeListOf; - getElementsByTagName(tagname: "feflood"): NodeListOf; - getElementsByTagName(tagname: "fefunca"): NodeListOf; - getElementsByTagName(tagname: "fefuncb"): NodeListOf; - getElementsByTagName(tagname: "fefuncg"): NodeListOf; - getElementsByTagName(tagname: "fefuncr"): NodeListOf; - getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; - getElementsByTagName(tagname: "feimage"): NodeListOf; - getElementsByTagName(tagname: "femerge"): NodeListOf; - getElementsByTagName(tagname: "femergenode"): NodeListOf; - getElementsByTagName(tagname: "femorphology"): NodeListOf; - getElementsByTagName(tagname: "feoffset"): NodeListOf; - getElementsByTagName(tagname: "fepointlight"): NodeListOf; - getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; - getElementsByTagName(tagname: "fespotlight"): NodeListOf; - getElementsByTagName(tagname: "fetile"): NodeListOf; - getElementsByTagName(tagname: "feturbulence"): NodeListOf; - getElementsByTagName(tagname: "fieldset"): NodeListOf; - getElementsByTagName(tagname: "figcaption"): NodeListOf; - getElementsByTagName(tagname: "figure"): NodeListOf; - getElementsByTagName(tagname: "filter"): NodeListOf; - getElementsByTagName(tagname: "font"): NodeListOf; - getElementsByTagName(tagname: "footer"): NodeListOf; - getElementsByTagName(tagname: "foreignobject"): NodeListOf; - getElementsByTagName(tagname: "form"): NodeListOf; - getElementsByTagName(tagname: "frame"): NodeListOf; - getElementsByTagName(tagname: "frameset"): NodeListOf; - getElementsByTagName(tagname: "g"): NodeListOf; - getElementsByTagName(tagname: "h1"): NodeListOf; - getElementsByTagName(tagname: "h2"): NodeListOf; - getElementsByTagName(tagname: "h3"): NodeListOf; - getElementsByTagName(tagname: "h4"): NodeListOf; - getElementsByTagName(tagname: "h5"): NodeListOf; - getElementsByTagName(tagname: "h6"): NodeListOf; - getElementsByTagName(tagname: "head"): NodeListOf; - getElementsByTagName(tagname: "header"): NodeListOf; - getElementsByTagName(tagname: "hgroup"): NodeListOf; - getElementsByTagName(tagname: "hr"): NodeListOf; - getElementsByTagName(tagname: "html"): NodeListOf; - getElementsByTagName(tagname: "i"): NodeListOf; - getElementsByTagName(tagname: "iframe"): NodeListOf; - getElementsByTagName(tagname: "image"): NodeListOf; - getElementsByTagName(tagname: "img"): NodeListOf; - getElementsByTagName(tagname: "input"): NodeListOf; - getElementsByTagName(tagname: "ins"): NodeListOf; - getElementsByTagName(tagname: "isindex"): NodeListOf; - getElementsByTagName(tagname: "kbd"): NodeListOf; - getElementsByTagName(tagname: "keygen"): NodeListOf; - getElementsByTagName(tagname: "label"): NodeListOf; - getElementsByTagName(tagname: "legend"): NodeListOf; - getElementsByTagName(tagname: "li"): NodeListOf; - getElementsByTagName(tagname: "line"): NodeListOf; - getElementsByTagName(tagname: "lineargradient"): NodeListOf; - getElementsByTagName(tagname: "link"): NodeListOf; - getElementsByTagName(tagname: "listing"): NodeListOf; - getElementsByTagName(tagname: "map"): NodeListOf; - getElementsByTagName(tagname: "mark"): NodeListOf; - getElementsByTagName(tagname: "marker"): NodeListOf; - getElementsByTagName(tagname: "marquee"): NodeListOf; - getElementsByTagName(tagname: "mask"): NodeListOf; - getElementsByTagName(tagname: "menu"): NodeListOf; - getElementsByTagName(tagname: "meta"): NodeListOf; - getElementsByTagName(tagname: "metadata"): NodeListOf; - getElementsByTagName(tagname: "nav"): NodeListOf; - getElementsByTagName(tagname: "nextid"): NodeListOf; - getElementsByTagName(tagname: "nobr"): NodeListOf; - getElementsByTagName(tagname: "noframes"): NodeListOf; - getElementsByTagName(tagname: "noscript"): NodeListOf; - getElementsByTagName(tagname: "object"): NodeListOf; - getElementsByTagName(tagname: "ol"): NodeListOf; - getElementsByTagName(tagname: "optgroup"): NodeListOf; - getElementsByTagName(tagname: "option"): NodeListOf; - getElementsByTagName(tagname: "p"): NodeListOf; - getElementsByTagName(tagname: "param"): NodeListOf; - getElementsByTagName(tagname: "path"): NodeListOf; - getElementsByTagName(tagname: "pattern"): NodeListOf; - getElementsByTagName(tagname: "plaintext"): NodeListOf; - getElementsByTagName(tagname: "polygon"): NodeListOf; - getElementsByTagName(tagname: "polyline"): NodeListOf; - getElementsByTagName(tagname: "pre"): NodeListOf; - getElementsByTagName(tagname: "progress"): NodeListOf; - getElementsByTagName(tagname: "q"): NodeListOf; - getElementsByTagName(tagname: "radialgradient"): NodeListOf; - getElementsByTagName(tagname: "rect"): NodeListOf; - getElementsByTagName(tagname: "rt"): NodeListOf; - getElementsByTagName(tagname: "ruby"): NodeListOf; - getElementsByTagName(tagname: "s"): NodeListOf; - getElementsByTagName(tagname: "samp"): NodeListOf; - getElementsByTagName(tagname: "script"): NodeListOf; - getElementsByTagName(tagname: "section"): NodeListOf; - getElementsByTagName(tagname: "select"): NodeListOf; - getElementsByTagName(tagname: "small"): NodeListOf; - getElementsByTagName(tagname: "source"): NodeListOf; - getElementsByTagName(tagname: "span"): NodeListOf; - getElementsByTagName(tagname: "stop"): NodeListOf; - getElementsByTagName(tagname: "strike"): NodeListOf; - getElementsByTagName(tagname: "strong"): NodeListOf; - getElementsByTagName(tagname: "style"): NodeListOf; - getElementsByTagName(tagname: "sub"): NodeListOf; - getElementsByTagName(tagname: "sup"): NodeListOf; - getElementsByTagName(tagname: "svg"): NodeListOf; - getElementsByTagName(tagname: "switch"): NodeListOf; - getElementsByTagName(tagname: "symbol"): NodeListOf; - getElementsByTagName(tagname: "table"): NodeListOf; - getElementsByTagName(tagname: "tbody"): NodeListOf; - getElementsByTagName(tagname: "td"): NodeListOf; - getElementsByTagName(tagname: "text"): NodeListOf; - getElementsByTagName(tagname: "textpath"): NodeListOf; - getElementsByTagName(tagname: "textarea"): NodeListOf; - getElementsByTagName(tagname: "tfoot"): NodeListOf; - getElementsByTagName(tagname: "th"): NodeListOf; - getElementsByTagName(tagname: "thead"): NodeListOf; - getElementsByTagName(tagname: "title"): NodeListOf; - getElementsByTagName(tagname: "tr"): NodeListOf; - getElementsByTagName(tagname: "track"): NodeListOf; - getElementsByTagName(tagname: "tspan"): NodeListOf; - getElementsByTagName(tagname: "tt"): NodeListOf; - getElementsByTagName(tagname: "u"): NodeListOf; - getElementsByTagName(tagname: "ul"): NodeListOf; - getElementsByTagName(tagname: "use"): NodeListOf; - getElementsByTagName(tagname: "var"): NodeListOf; - getElementsByTagName(tagname: "video"): NodeListOf; - getElementsByTagName(tagname: "view"): NodeListOf; - getElementsByTagName(tagname: "wbr"): NodeListOf; - getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; - getElementsByTagName(tagname: "xmp"): NodeListOf; - getElementsByTagName(tagname: string): NodeList; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - msGetPrintDocumentForNamedFlow(flowName: string): Document; - msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - entities: NamedNodeMap; - internalSubset: string; - name: string; - notations: NamedNodeMap; - publicId: string; - systemId: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - attack: AudioParam; - knee: AudioParam; - ratio: AudioParam; - reduction: AudioParam; - release: AudioParam; - threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_texture_filter_anisotropic { - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { - classList: DOMTokenList; - clientHeight: number; - clientLeft: number; - clientTop: number; - clientWidth: number; - msContentZoomFactor: number; - msRegionOverflow: string; - onariarequest: (ev: AriaRequestEvent) => any; - oncommand: (ev: CommandEvent) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsgotpointercapture: (ev: MSPointerEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmslostpointercapture: (ev: MSPointerEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - onmspointerover: (ev: MSPointerEvent) => any; - onmspointerup: (ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (ev: Event) => any; - onwebkitfullscreenerror: (ev: Event) => any; - scrollHeight: number; - scrollLeft: number; - scrollTop: number; - scrollWidth: number; - tagName: string; - getAttribute(name?: string): string; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "circle"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "clippath"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "defs"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "desc"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "ellipse"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "feblend"): NodeListOf; - getElementsByTagName(name: "fecolormatrix"): NodeListOf; - getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(name: "fecomposite"): NodeListOf; - getElementsByTagName(name: "feconvolvematrix"): NodeListOf; - getElementsByTagName(name: "fediffuselighting"): NodeListOf; - getElementsByTagName(name: "fedisplacementmap"): NodeListOf; - getElementsByTagName(name: "fedistantlight"): NodeListOf; - getElementsByTagName(name: "feflood"): NodeListOf; - getElementsByTagName(name: "fefunca"): NodeListOf; - getElementsByTagName(name: "fefuncb"): NodeListOf; - getElementsByTagName(name: "fefuncg"): NodeListOf; - getElementsByTagName(name: "fefuncr"): NodeListOf; - getElementsByTagName(name: "fegaussianblur"): NodeListOf; - getElementsByTagName(name: "feimage"): NodeListOf; - getElementsByTagName(name: "femerge"): NodeListOf; - getElementsByTagName(name: "femergenode"): NodeListOf; - getElementsByTagName(name: "femorphology"): NodeListOf; - getElementsByTagName(name: "feoffset"): NodeListOf; - getElementsByTagName(name: "fepointlight"): NodeListOf; - getElementsByTagName(name: "fespecularlighting"): NodeListOf; - getElementsByTagName(name: "fespotlight"): NodeListOf; - getElementsByTagName(name: "fetile"): NodeListOf; - getElementsByTagName(name: "feturbulence"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "filter"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "foreignobject"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "g"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "image"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "line"): NodeListOf; - getElementsByTagName(name: "lineargradient"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marker"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "mask"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "metadata"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "path"): NodeListOf; - getElementsByTagName(name: "pattern"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "polygon"): NodeListOf; - getElementsByTagName(name: "polyline"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "radialgradient"): NodeListOf; - getElementsByTagName(name: "rect"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "stop"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "svg"): NodeListOf; - getElementsByTagName(name: "switch"): NodeListOf; - getElementsByTagName(name: "symbol"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "text"): NodeListOf; - getElementsByTagName(name: "textpath"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tspan"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "use"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "view"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - colno: number; - error: any; - filename: string; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - bubbles: boolean; - cancelBubble: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - returnValue: boolean; - srcElement: Element; - target: EventTarget; - timeStamp: number; - type: string; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} - -declare var File: { - prototype: File; - new(): File; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new(): FormData; -} - -interface GainNode extends AudioNode { - gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - axes: number[]; - buttons: GamepadButton[]; - connected: boolean; - id: string; - index: number; - mapping: string; - timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - pressed: boolean; - value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - type: string; - urn: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement): void; - add(element: HTMLElement, before?: number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBlockElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - clear: string; - /** - * Sets or retrieves the width of the object. - */ - width: number; -} - -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onblur: (ev: FocusEvent) => any; - onerror: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - onload: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onresize: (ev: UIEvent) => any; - onstorage: (ev: StorageEvent) => any; - onunload: (ev: Event) => any; - text: any; - vLink: any; - createTextRange(): TextRange; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d"): CanvasRenderingContext2D; - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; - getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElement extends Element { - accessKey: string; - children: HTMLCollection; - className: string; - contentEditable: string; - dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - id: string; - innerHTML: string; - innerText: string; - isContentEditable: boolean; - lang: string; - offsetHeight: number; - offsetLeft: number; - offsetParent: Element; - offsetTop: number; - offsetWidth: number; - onabort: (ev: Event) => any; - onactivate: (ev: UIEvent) => any; - onbeforeactivate: (ev: UIEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onbeforedeactivate: (ev: UIEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - onblur: (ev: FocusEvent) => any; - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - onchange: (ev: Event) => any; - onclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: PointerEvent) => any; - oncopy: (ev: DragEvent) => any; - oncuechange: (ev: Event) => any; - oncut: (ev: DragEvent) => any; - ondblclick: (ev: MouseEvent) => any; - ondeactivate: (ev: UIEvent) => any; - ondrag: (ev: DragEvent) => any; - ondragend: (ev: DragEvent) => any; - ondragenter: (ev: DragEvent) => any; - ondragleave: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrop: (ev: DragEvent) => any; - ondurationchange: (ev: Event) => any; - onemptied: (ev: Event) => any; - onended: (ev: Event) => any; - onerror: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - oninput: (ev: Event) => any; - onkeydown: (ev: KeyboardEvent) => any; - onkeypress: (ev: KeyboardEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onload: (ev: Event) => any; - onloadeddata: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onloadstart: (ev: Event) => any; - onmousedown: (ev: MouseEvent) => any; - onmouseenter: (ev: MouseEvent) => any; - onmouseleave: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - onmousewheel: (ev: MouseWheelEvent) => any; - onmscontentzoom: (ev: UIEvent) => any; - onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; - onpaste: (ev: DragEvent) => any; - onpause: (ev: Event) => any; - onplay: (ev: Event) => any; - onplaying: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onratechange: (ev: Event) => any; - onreset: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onseeked: (ev: Event) => any; - onseeking: (ev: Event) => any; - onselect: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - onstalled: (ev: Event) => any; - onsubmit: (ev: Event) => any; - onsuspend: (ev: Event) => any; - ontimeupdate: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - onwaiting: (ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - contains(child: HTMLElement): boolean; - dragDrop(): boolean; - focus(): void; - getElementsByClassName(classNames: string): NodeList; - insertAdjacentElement(position: string, insertedElement: Element): Element; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - msGetInputContext(): MSInputMethodContext; - scrollIntoView(top?: boolean): void; - setActive(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - onerror: (ev: Event) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - onload: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onresize: (ev: UIEvent) => any; - onstorage: (ev: StorageEvent) => any; - onunload: (ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - clear: string; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - crossOrigin: string; - currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - naturalWidth: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - x: number; - y: number; - msGetAsCastingSource(): any; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - prompt: string; -} - -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (ev: Event) => any; - onfinish: (ev: Event) => any; - onstart: (ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - networkState: number; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: any; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - textTracks: TextTrackList; - videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - HAVE_CURRENT_DATA: number; - HAVE_ENOUGH_DATA: number; - HAVE_FUTURE_DATA: number; - HAVE_METADATA: number; - HAVE_NOTHING: number; - NETWORK_EMPTY: number; - NETWORK_IDLE: number; - NETWORK_LOADING: number; - NETWORK_NO_SOURCE: number; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_CURRENT_DATA: number; - HAVE_ENOUGH_DATA: number; - HAVE_FUTURE_DATA: number; - HAVE_METADATA: number; - HAVE_NOTHING: number; - NETWORK_EMPTY: number; - NETWORK_IDLE: number; - NETWORK_LOADING: number; - NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} - -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - object: any; - readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; - clear: string; - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - options: HTMLSelectElement; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: HTMLElement): void; - add(element: HTMLElement, before?: number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readyState: number; - src: string; - srclang: string; - track: TextTrack; - ERROR: number; - LOADED: number; - LOADING: number; - NONE: number; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADED: number; - LOADING: number; - NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - msIsLayoutOptimalForPlayback: boolean; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (ev: Event) => any; - onMSVideoFrameStepCompleted: (ev: Event) => any; - onMSVideoOptimalLayoutChanged: (ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - webkitDisplayingFullscreen: boolean; - webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - newURL: string; - oldURL: string; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - length: number; - state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - pushState(statedata: any, title?: string, url?: string): void; - replaceState(statedata: any, title?: string, url?: string): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - direction: string; - key: any; - primaryKey: any; - source: any; - advance(count: number): void; - continue(key?: any): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - NEXT: string; - NEXT_NO_DUPLICATE: string; - PREV: string; - PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - NEXT: string; - NEXT_NO_DUPLICATE: string; - PREV: string; - PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabase extends EventTarget { - name: string; - objectStoreNames: DOMStringList; - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - version: string; - close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string; - name: string; - objectStore: IDBObjectStore; - unique: boolean; - count(key?: any): IDBRequest; - get(key: any): IDBRequest; - getKey(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - lower: any; - lowerOpen: boolean; - upper: any; - upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - keyPath: string; - name: string; - transaction: IDBTransaction; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - delete(key: any): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: any, direction?: string): IDBRequest; - put(value: any, key?: any): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (ev: Event) => any; - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequest extends EventTarget { - error: DOMError; - onerror: (ev: Event) => any; - onsuccess: (ev: Event) => any; - readyState: string; - result: any; - source: any; - transaction: IDBTransaction; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransaction extends EventTarget { - db: IDBDatabase; - error: DOMError; - mode: string; - onabort: (ev: Event) => any; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - READ_WRITE: string; - VERSION_CHANGE: string; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - READ_WRITE: string; - VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: number[]; - height: number; - width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface KeyboardEvent extends UIEvent { - altKey: boolean; - char: string; - charCode: number; - ctrlKey: boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_MOBILE: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_MOBILE: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - CURRENT: string; - HIGH: string; - IDLE: string; - NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperation extends EventTarget { - error: DOMError; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - readyState: number; - result: any; - start(): void; - COMPLETED: number; - ERROR: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - COMPLETED: number; - ERROR: number; - STARTED: number; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): MSCSSMatrix; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): MSCSSMatrix; -} - -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - clientX: number; - clientY: number; - expansion: number; - gestureObject: any; - hwTimestamp: number; - offsetX: number; - offsetY: number; - rotation: number; - scale: number; - screenX: number; - screenY: number; - translationX: number; - translationY: number; - velocityAngular: number; - velocityExpansion: number; - velocityX: number; - velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - constrictionActive: boolean; - status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - canGoBack: boolean; - canGoForward: boolean; - containsFullScreenElement: boolean; - documentTitle: string; - height: number; - settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSHeaderFooter { - URL: string; - dateLong: string; - dateShort: string; - font: string; - htmlFoot: string; - htmlHead: string; - page: number; - pageTotal: number; - textFoot: string; - textHead: string; - timeLong: string; - timeShort: string; - title: string; -} - -declare var MSHeaderFooter: { - prototype: MSHeaderFooter; - new(): MSHeaderFooter; -} - -interface MSInputMethodContext extends EventTarget { - compositionEndOffset: number; - compositionStartOffset: number; - oncandidatewindowhide: (ev: Event) => any; - oncandidatewindowshow: (ev: Event) => any; - oncandidatewindowupdate: (ev: Event) => any; - target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - currentState: number; - inertiaDestinationX: number; - inertiaDestinationY: number; - lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_CANCELLED: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_CANCELLED: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - code: number; - systemCode: number; - MS_MEDIA_KEYERR_CLIENT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_CLIENT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - error: MSMediaKeyError; - keySystem: string; - sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; -} - -interface MSMimeTypesCollection { - length: number; -} - -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} - -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface MSPointerEvent extends MouseEvent { - currentPoint: any; - height: number; - hwTimestamp: number; - intermediatePoints: any; - isPrimary: boolean; - pointerId: number; - pointerType: any; - pressure: number; - rotation: number; - tiltX: number; - tiltY: number; - width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { - percentScale: number; - showHeaderFooter: boolean; - shrinkToFit: boolean; - drawPreviewPage(element: HTMLElement, pageNumber: number): void; - endPrint(): void; - getPrintTaskOptionValue(key: string): any; - invalidatePreview(): void; - setPageCount(pageCount: number): void; - startPrint(): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSPrintManagerTemplatePrinter: { - prototype: MSPrintManagerTemplatePrinter; - new(): MSPrintManagerTemplatePrinter; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - actionURL: string; - buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSTemplatePrinter { - collate: boolean; - copies: number; - currentPage: boolean; - currentPageAvail: boolean; - duplex: boolean; - footer: string; - frameActive: boolean; - frameActiveEnabled: boolean; - frameAsShown: boolean; - framesetDocument: boolean; - header: string; - headerFooterFont: string; - marginBottom: number; - marginLeft: number; - marginRight: number; - marginTop: number; - orientation: string; - pageFrom: number; - pageHeight: number; - pageTo: number; - pageWidth: number; - selectedPages: boolean; - selection: boolean; - selectionEnabled: boolean; - unprintableBottom: number; - unprintableLeft: number; - unprintableRight: number; - unprintableTop: number; - usePrinterCopyCollate: boolean; - createHeaderFooter(): MSHeaderFooter; - deviceSupports(property: string): any; - ensurePrintDialogDefaults(): boolean; - getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; - getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; - getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginRightImportant(pageRule: CSSPageRule): boolean; - getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginTopImportant(pageRule: CSSPageRule): boolean; - printBlankPage(): void; - printNonNative(document: any): boolean; - printNonNativeFrames(document: any, activeFrame: boolean): void; - printPage(element: HTMLElement): void; - showPageSetupDialog(): boolean; - showPrintDialog(): boolean; - startDoc(title: string): boolean; - stopDoc(): void; - updatePageStatus(status: number): void; -} - -declare var MSTemplatePrinter: { - prototype: MSTemplatePrinter; - new(): MSTemplatePrinter; -} - -interface MSWebViewAsyncOperation extends EventTarget { - error: DOMError; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - readyState: number; - result: any; - target: MSHTMLWebViewElement; - type: number; - start(): void; - COMPLETED: number; - ERROR: number; - STARTED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - COMPLETED: number; - ERROR: number; - STARTED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_DECODE: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_DECODE: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaList { - length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - activeSourceBuffers: SourceBufferList; - duration: number; - readyState: string; - sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MessageChannel { - port1: MessagePort; - port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - data: any; - origin: string; - ports: any; - source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - description: string; - enabledPlugin: Plugin; - suffixes: string; - type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - fromElement: Element; - layerX: number; - layerY: number; - metaKey: boolean; - movementX: number; - movementY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - toElement: Element; - which: number; - x: number; - y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - wheelDeltaX: number; - wheelDeltaY: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} - -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface MutationEvent extends Event { - attrChange: number; - attrName: string; - newValue: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - ADDITION: number; - MODIFICATION: number; - REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - ADDITION: number; - MODIFICATION: number; - REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - addedNodes: NodeList; - attributeName: string; - attributeNamespace: string; - nextSibling: Node; - oldValue: string; - previousSibling: Node; - removedNodes: NodeList; - target: Node; - type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - isSuccess: boolean; - webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { - appCodeName: string; - appMinorVersion: string; - browserLanguage: string; - connectionSpeed: number; - cookieEnabled: boolean; - cpuClass: string; - language: string; - maxTouchPoints: number; - mimeTypes: MSMimeTypesCollection; - msManipulationViewsEnabled: boolean; - msMaxTouchPoints: number; - msPointerEnabled: boolean; - plugins: MSPluginsCollection; - pointerEnabled: boolean; - systemLanguage: string; - userLanguage: string; - webdriver: boolean; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - attributes: NamedNodeMap; - baseURI: string; - childNodes: NodeList; - firstChild: Node; - lastChild: Node; - localName: string; - namespaceURI: string; - nextSibling: Node; - nodeName: string; - nodeType: number; - nodeValue: string; - ownerDocument: Document; - parentElement: HTMLElement; - parentNode: Node; - prefix: string; - previousSibling: Node; - textContent: string; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild?: Node): Node; - isDefaultNamespace(namespaceURI: string): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string): string; - lookupPrefix(namespaceURI: string): string; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - ATTRIBUTE_NODE: number; - CDATA_SECTION_NODE: number; - COMMENT_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - DOCUMENT_NODE: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_POSITION_PRECEDING: number; - DOCUMENT_TYPE_NODE: number; - ELEMENT_NODE: number; - ENTITY_NODE: number; - ENTITY_REFERENCE_NODE: number; - NOTATION_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - ATTRIBUTE_NODE: number; - CDATA_SECTION_NODE: number; - COMMENT_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - DOCUMENT_NODE: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_POSITION_PRECEDING: number; - DOCUMENT_TYPE_NODE: number; - ELEMENT_NODE: number; - ENTITY_NODE: number; - ENTITY_REFERENCE_NODE: number; - NOTATION_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - TEXT_NODE: number; -} - -interface NodeFilter { - FILTER_ACCEPT: number; - FILTER_REJECT: number; - FILTER_SKIP: number; - SHOW_ALL: number; - SHOW_ATTRIBUTE: number; - SHOW_CDATA_SECTION: number; - SHOW_COMMENT: number; - SHOW_DOCUMENT: number; - SHOW_DOCUMENT_FRAGMENT: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_ELEMENT: number; - SHOW_ENTITY: number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_PROCESSING_INSTRUCTION: number; - SHOW_TEXT: number; -} -declare var NodeFilter: NodeFilter; - -interface NodeIterator { - expandEntityReferences: boolean; - filter: NodeFilter; - root: Node; - whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (ev: Event) => any; - startRendering(): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNode extends AudioNode { - detune: AudioParam; - frequency: AudioParam; - onended: (ev: Event) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface PageTransitionEvent extends Event { - persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - activeNetworkRequestCount: number; - averageFrameTime: number; - averagePaintTime: number; - extraInformationEnabled: boolean; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - maxCpuSpeed: number; - paintRequestsPerSecond: number; - performanceCounter: number; - performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number): any; - getRecentFrames(last: number): any; - getRecentMemoryUsage(last: number): any; - getRecentPaintRequests(last: number): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - duration: number; - entryType: string; - name: string; - startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; - TYPE_RELOAD: number; - TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; - TYPE_RELOAD: number; - TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - connectEnd: number; - connectStart: number; - domComplete: number; - domContentLoadedEventEnd: number; - domContentLoadedEventStart: number; - domInteractive: number; - domLoading: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - loadEventEnd: number; - loadEventStart: number; - navigationStart: number; - redirectCount: number; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; - type: string; - unloadEventEnd: number; - unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - connectEnd: number; - connectStart: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - initiatorType: string; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - connectEnd: number; - connectStart: number; - domComplete: number; - domContentLoadedEventEnd: number; - domContentLoadedEventStart: number; - domInteractive: number; - domLoading: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - loadEventEnd: number; - loadEventStart: number; - msFirstPaint: number; - navigationStart: number; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; - unloadEventEnd: number; - unloadEventStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - description: string; - filename: string; - length: number; - name: string; - version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - currentPoint: any; - height: number; - hwTimestamp: number; - intermediatePoints: any; - isPrimary: boolean; - pointerId: number; - pointerType: any; - pressure: number; - rotation: number; - tiltX: number; - tiltY: number; - width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - coords: Coordinates; - timestamp: Date; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - PERMISSION_DENIED: number; - POSITION_UNAVAILABLE: number; - TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - PERMISSION_DENIED: number; - POSITION_UNAVAILABLE: number; - TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - lengthComputable: boolean; - loaded: number; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface Range { - collapsed: boolean; - commonAncestorContainer: Node; - endContainer: Node; - endOffset: number; - startContainer: Node; - startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - END_TO_END: number; - END_TO_START: number; - START_TO_END: number; - START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - END_TO_START: number; - START_TO_END: number; - START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - r: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - amplitude: SVGAnimatedNumber; - exponent: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - slope: SVGAnimatedNumber; - tableValues: SVGAnimatedNumberList; - type: SVGAnimatedEnumeration; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElement extends Element { - id: string; - onclick: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusin: (ev: FocusEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onload: (ev: Event) => any; - onmousedown: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - viewportElement: SVGElement; - xmlbase: string; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - childNodes: SVGElementInstanceList; - correspondingElement: SVGElement; - correspondingUseElement: SVGUseElement; - firstChild: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - parentNode: SVGElementInstance; - previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - rx: SVGAnimatedLength; - ry: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - SVG_FEBLEND_MODE_COLOR: number; - SVG_FEBLEND_MODE_COLOR_BURN: number; - SVG_FEBLEND_MODE_COLOR_DODGE: number; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_DIFFERENCE: number; - SVG_FEBLEND_MODE_EXCLUSION: number; - SVG_FEBLEND_MODE_HARD_LIGHT: number; - SVG_FEBLEND_MODE_HUE: number; - SVG_FEBLEND_MODE_LIGHTEN: number; - SVG_FEBLEND_MODE_LUMINOSITY: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_OVERLAY: number; - SVG_FEBLEND_MODE_SATURATION: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_SOFT_LIGHT: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_COLOR: number; - SVG_FEBLEND_MODE_COLOR_BURN: number; - SVG_FEBLEND_MODE_COLOR_DODGE: number; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_DIFFERENCE: number; - SVG_FEBLEND_MODE_EXCLUSION: number; - SVG_FEBLEND_MODE_HARD_LIGHT: number; - SVG_FEBLEND_MODE_HUE: number; - SVG_FEBLEND_MODE_LIGHTEN: number; - SVG_FEBLEND_MODE_LUMINOSITY: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_OVERLAY: number; - SVG_FEBLEND_MODE_SATURATION: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_SOFT_LIGHT: number; - SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - k1: SVGAnimatedNumber; - k2: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - k4: SVGAnimatedNumber; - operator: SVGAnimatedEnumeration; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - bias: SVGAnimatedNumber; - divisor: SVGAnimatedNumber; - edgeMode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - kernelMatrix: SVGAnimatedNumberList; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - orderY: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_NONE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_WRAP: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_NONE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - diffuseConstant: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - scale: SVGAnimatedNumber; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - SVG_CHANNEL_A: number; - SVG_CHANNEL_B: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_A: number; - SVG_CHANNEL_B: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - stdDeviationX: SVGAnimatedNumber; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dx: SVGAnimatedNumber; - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - x: SVGAnimatedNumber; - y: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - limitingConeAngle: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; - pointsAtY: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - y: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - baseFrequencyY: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - seed: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - type: SVGAnimatedEnumeration; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_STITCHTYPE_STITCH: number; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_STITCHTYPE_STITCH: number; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - filterResX: SVGAnimatedInteger; - filterResY: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - height: SVGAnimatedLength; - primitiveUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - height: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - spreadMethod: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_REPEAT: number; - SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_REPEAT: number; - SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - height: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_EXS: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_EXS: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - x1: SVGAnimatedLength; - x2: SVGAnimatedLength; - y1: SVGAnimatedLength; - y2: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - x1: SVGAnimatedLength; - x2: SVGAnimatedLength; - y1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - markerHeight: SVGAnimatedLength; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - orientType: SVGAnimatedEnumeration; - refX: SVGAnimatedLength; - refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - height: SVGAnimatedLength; - maskContentUnits: SVGAnimatedEnumeration; - maskUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_ARC_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_MOVETO_REL: number; - PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_ARC_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_MOVETO_REL: number; - PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - height: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - patternUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_MEETORSLICE_MEET: number; - SVG_MEETORSLICE_SLICE: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_MEETORSLICE_MEET: number; - SVG_MEETORSLICE_SLICE: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; - r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - height: SVGAnimatedLength; - rx: SVGAnimatedLength; - ry: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - currentTranslate: SVGPoint; - height: SVGAnimatedLength; - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onscroll: (ev: UIEvent) => any; - onunload: (ev: Event) => any; - onzoom: (ev: SVGZoomEvent) => any; - pixelUnitToMillimeterX: number; - pixelUnitToMillimeterY: number; - screenPixelToMillimeterX: number; - screenPixelToMillimeterY: number; - viewport: SVGRect; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - title: string; - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - lengthAdjust: SVGAnimatedEnumeration; - textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - startOffset: SVGAnimatedLength; - TEXTPATH_METHODTYPE_ALIGN: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_METHODTYPE_ALIGN: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - dx: SVGAnimatedLengthList; - dy: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - x: SVGAnimatedLengthList; - y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - angle: number; - matrix: SVGMatrix; - type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_SKEWY: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_SKEWY: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - animatedInstanceRoot: SVGElementInstance; - height: SVGAnimatedLength; - instanceRoot: SVGElementInstance; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - viewTarget: SVGStringList; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - SVG_ZOOMANDPAN_DISABLE: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface SVGZoomEvent extends UIEvent { - newScale: number; - newTranslate: SVGPoint; - previousScale: number; - previousTranslate: SVGPoint; - zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface Screen extends EventTarget { - availHeight: number; - availWidth: number; - bufferDepth: number; - colorDepth: number; - deviceXDPI: number; - deviceYDPI: number; - fontSmoothingEnabled: boolean; - height: number; - logicalXDPI: number; - logicalYDPI: number; - msOrientation: string; - onmsorientationchange: (ev: Event) => any; - pixelDepth: number; - systemXDPI: number; - systemYDPI: number; - width: number; - msLockOrientation(orientations: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - callingUri: string; - value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNode extends AudioNode { - bufferSize: number; - onaudioprocess: (ev: AudioProcessingEvent) => any; - addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - anchorNode: Node; - anchorOffset: number; - focusNode: Node; - focusOffset: number; - isCollapsed: boolean; - rangeCount: number; - type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - audioTracks: AudioTrackList; - buffered: TimeRanges; - mode: string; - timestampOffset: number; - updating: boolean; - videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer): void; - appendBuffer(data: ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - length: number; - clear(): void; - getItem(key: string): any; - key(index: number): string; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; - url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - href: string; - media: MediaList; - ownerNode: Node; - parentStyleSheet: StyleSheet; - title: string; - type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; - deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; - deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - digest(algorithm: string, data: ArrayBufferView): any; - digest(algorithm: Algorithm, data: ArrayBufferView): any; - encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - exportKey(format: string, key: CryptoKey): any; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; - generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; - verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - wholeText: string; - replaceWholeText(content: string): Text; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - data: string; - inputMethod: number; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_MULTIMODAL: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_MULTIMODAL: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextRange { - boundingHeight: number; - boundingLeft: number; - boundingTop: number; - boundingWidth: number; - htmlText: string; - offsetLeft: number; - offsetTop: number; - text: string; - collapse(start?: boolean): void; - compareEndPoints(how: string, sourceRange: TextRange): number; - duplicate(): TextRange; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - execCommandShowHelp(cmdID: string): boolean; - expand(Unit: string): boolean; - findText(string: string, count?: number, flags?: number): boolean; - getBookmark(): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - inRange(range: TextRange): boolean; - isEqual(range: TextRange): boolean; - move(unit: string, count?: number): number; - moveEnd(unit: string, count?: number): number; - moveStart(unit: string, count?: number): number; - moveToBookmark(bookmark: string): boolean; - moveToElementText(element: Element): void; - moveToPoint(x: number, y: number): void; - parentElement(): Element; - pasteHTML(html: string): void; - queryCommandEnabled(cmdID: string): boolean; - queryCommandIndeterm(cmdID: string): boolean; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - queryCommandValue(cmdID: string): any; - scrollIntoView(fStart?: boolean): void; - select(): void; - setEndPoint(how: string, SourceRange: TextRange): void; -} - -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} - -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface TextTrack extends EventTarget { - activeCues: TextTrackCueList; - cues: TextTrackCueList; - inBandMetadataTrackDispatchType: string; - kind: string; - label: string; - language: string; - mode: any; - oncuechange: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - DISABLED: number; - ERROR: number; - HIDDEN: number; - LOADED: number; - LOADING: number; - NONE: number; - SHOWING: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - DISABLED: number; - ERROR: number; - HIDDEN: number; - LOADED: number; - LOADING: number; - NONE: number; - SHOWING: number; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (ev: Event) => any; - onexit: (ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - clientX: number; - clientY: number; - identifier: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; - target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - length: number; - item(index: number): Touch; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - elapsedTime: number; - propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - expandEntityReferences: boolean; - filter: NodeFilter; - root: Node; - whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} -declare var URL: URL; - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - badInput: boolean; - customError: boolean; - patternMismatch: boolean; - rangeOverflow: boolean; - rangeUnderflow: boolean; - stepMismatch: boolean; - tooLong: boolean; - typeMismatch: boolean; - valid: boolean; - valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - corruptedVideoFrames: number; - creationTime: number; - droppedVideoFrames: number; - totalFrameDelay: number; - totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - id: string; - kind: string; - label: string; - language: string; - selected: boolean; - sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - onchange: (ev: Event) => any; - onremovetrack: (ev: TrackEvent) => any; - selectedIndex: number; - getTrackById(id: string): VideoTrack; - item(index: number): VideoTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - UNMASKED_RENDERER_WEBGL: number; - UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - UNMASKED_RENDERER_WEBGL: number; - UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: any; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - name: string; - size: number; - type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - canvas: HTMLCanvasElement; - drawingBufferHeight: number; - drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - bindTexture(target: number, texture: WebGLTexture): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, size: ArrayBufferView, usage: number): void; - bufferData(target: number, size: any, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - bufferSubData(target: number, offset: number, data: any): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer; - createFramebuffer(): WebGLFramebuffer; - createProgram(): WebGLProgram; - createRenderbuffer(): WebGLRenderbuffer; - createShader(type: number): WebGLShader; - createTexture(): WebGLTexture; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - deleteProgram(program: WebGLProgram): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - deleteShader(shader: WebGLShader): void; - deleteTexture(texture: WebGLTexture): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - getAttribLocation(program: WebGLProgram, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram): string; - getProgramParameter(program: WebGLProgram, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader): string; - getShaderParameter(shader: WebGLShader, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getShaderSource(shader: WebGLShader): string; - getSupportedExtensions(): string[]; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - isProgram(program: WebGLProgram): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - isShader(shader: WebGLShader): boolean; - isTexture(texture: WebGLTexture): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - stencilMaskSeparate(face: number, mask: number): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - texParameterf(target: number, pname: number, param: number): void; - texParameteri(target: number, pname: number, param: number): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: any): void; - uniform1i(location: WebGLUniformLocation, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: any): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: any): void; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: any): void; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - useProgram(program: WebGLProgram): void; - validateProgram(program: WebGLProgram): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: any): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: any): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: any): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: any): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - ACTIVE_ATTRIBUTES: number; - ACTIVE_TEXTURE: number; - ACTIVE_UNIFORMS: number; - ALIASED_LINE_WIDTH_RANGE: number; - ALIASED_POINT_SIZE_RANGE: number; - ALPHA: number; - ALPHA_BITS: number; - ALWAYS: number; - ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ATTACHED_SHADERS: number; - BACK: number; - BLEND: number; - BLEND_COLOR: number; - BLEND_DST_ALPHA: number; - BLEND_DST_RGB: number; - BLEND_EQUATION: number; - BLEND_EQUATION_ALPHA: number; - BLEND_EQUATION_RGB: number; - BLEND_SRC_ALPHA: number; - BLEND_SRC_RGB: number; - BLUE_BITS: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - BROWSER_DEFAULT_WEBGL: number; - BUFFER_SIZE: number; - BUFFER_USAGE: number; - BYTE: number; - CCW: number; - CLAMP_TO_EDGE: number; - COLOR_ATTACHMENT0: number; - COLOR_BUFFER_BIT: number; - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - COMPILE_STATUS: number; - COMPRESSED_TEXTURE_FORMATS: number; - CONSTANT_ALPHA: number; - CONSTANT_COLOR: number; - CONTEXT_LOST_WEBGL: number; - CULL_FACE: number; - CULL_FACE_MODE: number; - CURRENT_PROGRAM: number; - CURRENT_VERTEX_ATTRIB: number; - CW: number; - DECR: number; - DECR_WRAP: number; - DELETE_STATUS: number; - DEPTH_ATTACHMENT: number; - DEPTH_BITS: number; - DEPTH_BUFFER_BIT: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_COMPONENT: number; - DEPTH_COMPONENT16: number; - DEPTH_FUNC: number; - DEPTH_RANGE: number; - DEPTH_STENCIL: number; - DEPTH_STENCIL_ATTACHMENT: number; - DEPTH_TEST: number; - DEPTH_WRITEMASK: number; - DITHER: number; - DONT_CARE: number; - DST_ALPHA: number; - DST_COLOR: number; - DYNAMIC_DRAW: number; - ELEMENT_ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - EQUAL: number; - FASTEST: number; - FLOAT: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - FRAGMENT_SHADER: number; - FRAMEBUFFER: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_BINDING: number; - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_UNSUPPORTED: number; - FRONT: number; - FRONT_AND_BACK: number; - FRONT_FACE: number; - FUNC_ADD: number; - FUNC_REVERSE_SUBTRACT: number; - FUNC_SUBTRACT: number; - GENERATE_MIPMAP_HINT: number; - GEQUAL: number; - GREATER: number; - GREEN_BITS: number; - HIGH_FLOAT: number; - HIGH_INT: number; - IMPLEMENTATION_COLOR_READ_FORMAT: number; - IMPLEMENTATION_COLOR_READ_TYPE: number; - INCR: number; - INCR_WRAP: number; - INT: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - INVALID_ENUM: number; - INVALID_FRAMEBUFFER_OPERATION: number; - INVALID_OPERATION: number; - INVALID_VALUE: number; - INVERT: number; - KEEP: number; - LEQUAL: number; - LESS: number; - LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_NEAREST: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - LINE_WIDTH: number; - LINK_STATUS: number; - LOW_FLOAT: number; - LOW_INT: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - MAX_RENDERBUFFER_SIZE: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_SIZE: number; - MAX_VARYING_VECTORS: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VIEWPORT_DIMS: number; - MEDIUM_FLOAT: number; - MEDIUM_INT: number; - MIRRORED_REPEAT: number; - NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - NEAREST_MIPMAP_NEAREST: number; - NEVER: number; - NICEST: number; - NONE: number; - NOTEQUAL: number; - NO_ERROR: number; - ONE: number; - ONE_MINUS_CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_DST_ALPHA: number; - ONE_MINUS_DST_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - ONE_MINUS_SRC_COLOR: number; - OUT_OF_MEMORY: number; - PACK_ALIGNMENT: number; - POINTS: number; - POLYGON_OFFSET_FACTOR: number; - POLYGON_OFFSET_FILL: number; - POLYGON_OFFSET_UNITS: number; - RED_BITS: number; - RENDERBUFFER: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_BINDING: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - RENDERBUFFER_WIDTH: number; - RENDERER: number; - REPEAT: number; - REPLACE: number; - RGB: number; - RGB565: number; - RGB5_A1: number; - RGBA: number; - RGBA4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - SAMPLES: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_BUFFERS: number; - SAMPLE_COVERAGE: number; - SAMPLE_COVERAGE_INVERT: number; - SAMPLE_COVERAGE_VALUE: number; - SCISSOR_BOX: number; - SCISSOR_TEST: number; - SHADER_TYPE: number; - SHADING_LANGUAGE_VERSION: number; - SHORT: number; - SRC_ALPHA: number; - SRC_ALPHA_SATURATE: number; - SRC_COLOR: number; - STATIC_DRAW: number; - STENCIL_ATTACHMENT: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - STENCIL_BITS: number; - STENCIL_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FAIL: number; - STENCIL_FUNC: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_TEST: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STREAM_DRAW: number; - SUBPIXEL_BITS: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE1: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE2: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE3: number; - TEXTURE30: number; - TEXTURE31: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE_2D: number; - TEXTURE_BINDING_2D: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - TRIANGLES: number; - TRIANGLE_FAN: number; - TRIANGLE_STRIP: number; - UNPACK_ALIGNMENT: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - UNSIGNED_BYTE: number; - UNSIGNED_INT: number; - UNSIGNED_SHORT: number; - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - VALIDATE_STATUS: number; - VENDOR: number; - VERSION: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_SHADER: number; - VIEWPORT: number; - ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - ACTIVE_ATTRIBUTES: number; - ACTIVE_TEXTURE: number; - ACTIVE_UNIFORMS: number; - ALIASED_LINE_WIDTH_RANGE: number; - ALIASED_POINT_SIZE_RANGE: number; - ALPHA: number; - ALPHA_BITS: number; - ALWAYS: number; - ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ATTACHED_SHADERS: number; - BACK: number; - BLEND: number; - BLEND_COLOR: number; - BLEND_DST_ALPHA: number; - BLEND_DST_RGB: number; - BLEND_EQUATION: number; - BLEND_EQUATION_ALPHA: number; - BLEND_EQUATION_RGB: number; - BLEND_SRC_ALPHA: number; - BLEND_SRC_RGB: number; - BLUE_BITS: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - BROWSER_DEFAULT_WEBGL: number; - BUFFER_SIZE: number; - BUFFER_USAGE: number; - BYTE: number; - CCW: number; - CLAMP_TO_EDGE: number; - COLOR_ATTACHMENT0: number; - COLOR_BUFFER_BIT: number; - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - COMPILE_STATUS: number; - COMPRESSED_TEXTURE_FORMATS: number; - CONSTANT_ALPHA: number; - CONSTANT_COLOR: number; - CONTEXT_LOST_WEBGL: number; - CULL_FACE: number; - CULL_FACE_MODE: number; - CURRENT_PROGRAM: number; - CURRENT_VERTEX_ATTRIB: number; - CW: number; - DECR: number; - DECR_WRAP: number; - DELETE_STATUS: number; - DEPTH_ATTACHMENT: number; - DEPTH_BITS: number; - DEPTH_BUFFER_BIT: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_COMPONENT: number; - DEPTH_COMPONENT16: number; - DEPTH_FUNC: number; - DEPTH_RANGE: number; - DEPTH_STENCIL: number; - DEPTH_STENCIL_ATTACHMENT: number; - DEPTH_TEST: number; - DEPTH_WRITEMASK: number; - DITHER: number; - DONT_CARE: number; - DST_ALPHA: number; - DST_COLOR: number; - DYNAMIC_DRAW: number; - ELEMENT_ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - EQUAL: number; - FASTEST: number; - FLOAT: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - FRAGMENT_SHADER: number; - FRAMEBUFFER: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_BINDING: number; - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_UNSUPPORTED: number; - FRONT: number; - FRONT_AND_BACK: number; - FRONT_FACE: number; - FUNC_ADD: number; - FUNC_REVERSE_SUBTRACT: number; - FUNC_SUBTRACT: number; - GENERATE_MIPMAP_HINT: number; - GEQUAL: number; - GREATER: number; - GREEN_BITS: number; - HIGH_FLOAT: number; - HIGH_INT: number; - IMPLEMENTATION_COLOR_READ_FORMAT: number; - IMPLEMENTATION_COLOR_READ_TYPE: number; - INCR: number; - INCR_WRAP: number; - INT: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - INVALID_ENUM: number; - INVALID_FRAMEBUFFER_OPERATION: number; - INVALID_OPERATION: number; - INVALID_VALUE: number; - INVERT: number; - KEEP: number; - LEQUAL: number; - LESS: number; - LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_NEAREST: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - LINE_WIDTH: number; - LINK_STATUS: number; - LOW_FLOAT: number; - LOW_INT: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - MAX_RENDERBUFFER_SIZE: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_SIZE: number; - MAX_VARYING_VECTORS: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VIEWPORT_DIMS: number; - MEDIUM_FLOAT: number; - MEDIUM_INT: number; - MIRRORED_REPEAT: number; - NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - NEAREST_MIPMAP_NEAREST: number; - NEVER: number; - NICEST: number; - NONE: number; - NOTEQUAL: number; - NO_ERROR: number; - ONE: number; - ONE_MINUS_CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_DST_ALPHA: number; - ONE_MINUS_DST_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - ONE_MINUS_SRC_COLOR: number; - OUT_OF_MEMORY: number; - PACK_ALIGNMENT: number; - POINTS: number; - POLYGON_OFFSET_FACTOR: number; - POLYGON_OFFSET_FILL: number; - POLYGON_OFFSET_UNITS: number; - RED_BITS: number; - RENDERBUFFER: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_BINDING: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - RENDERBUFFER_WIDTH: number; - RENDERER: number; - REPEAT: number; - REPLACE: number; - RGB: number; - RGB565: number; - RGB5_A1: number; - RGBA: number; - RGBA4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - SAMPLES: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_BUFFERS: number; - SAMPLE_COVERAGE: number; - SAMPLE_COVERAGE_INVERT: number; - SAMPLE_COVERAGE_VALUE: number; - SCISSOR_BOX: number; - SCISSOR_TEST: number; - SHADER_TYPE: number; - SHADING_LANGUAGE_VERSION: number; - SHORT: number; - SRC_ALPHA: number; - SRC_ALPHA_SATURATE: number; - SRC_COLOR: number; - STATIC_DRAW: number; - STENCIL_ATTACHMENT: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - STENCIL_BITS: number; - STENCIL_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FAIL: number; - STENCIL_FUNC: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_TEST: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STREAM_DRAW: number; - SUBPIXEL_BITS: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE1: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE2: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE3: number; - TEXTURE30: number; - TEXTURE31: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE_2D: number; - TEXTURE_BINDING_2D: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - TRIANGLES: number; - TRIANGLE_FAN: number; - TRIANGLE_STRIP: number; - UNPACK_ALIGNMENT: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - UNSIGNED_BYTE: number; - UNSIGNED_INT: number; - UNSIGNED_SHORT: number; - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - VALIDATE_STATUS: number; - VENDOR: number; - VERSION: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_SHADER: number; - VIEWPORT: number; - ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - precision: number; - rangeMax: number; - rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocket extends EventTarget { - binaryType: string; - bufferedAmount: number; - extensions: string; - onclose: (ev: CloseEvent) => any; - onerror: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onopen: (ev: Event) => any; - protocol: string; - readyState: number; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - CLOSED: number; - CLOSING: number; - CONNECTING: number; - OPEN: number; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: any): WebSocket; - CLOSED: number; - CLOSING: number; - CONNECTING: number; - OPEN: number; -} - -interface WheelEvent extends MouseEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; - DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; - DOM_DELTA_PIXEL: number; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - animationStartTime: number; - applicationCache: ApplicationCache; - clientInformation: Navigator; - closed: boolean; - crypto: Crypto; - defaultStatus: string; - devicePixelRatio: number; - doNotTrack: string; - document: Document; - event: Event; - external: External; - frameElement: Element; - frames: Window; - history: History; - innerHeight: number; - innerWidth: number; - length: number; - location: Location; - locationbar: BarProp; - menubar: BarProp; - msAnimationStartTime: number; - msTemplatePrinter: MSTemplatePrinter; - name: string; - navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (ev: Event) => any; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onblur: (ev: FocusEvent) => any; - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - onchange: (ev: Event) => any; - onclick: (ev: MouseEvent) => any; - oncompassneedscalibration: (ev: Event) => any; - oncontextmenu: (ev: PointerEvent) => any; - ondblclick: (ev: MouseEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - ondrag: (ev: DragEvent) => any; - ondragend: (ev: DragEvent) => any; - ondragenter: (ev: DragEvent) => any; - ondragleave: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrop: (ev: DragEvent) => any; - ondurationchange: (ev: Event) => any; - onemptied: (ev: Event) => any; - onended: (ev: Event) => any; - onerror: ErrorEventHandler; - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - oninput: (ev: Event) => any; - onkeydown: (ev: KeyboardEvent) => any; - onkeypress: (ev: KeyboardEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onload: (ev: Event) => any; - onloadeddata: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onloadstart: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onmousedown: (ev: MouseEvent) => any; - onmouseenter: (ev: MouseEvent) => any; - onmouseleave: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - onmousewheel: (ev: MouseWheelEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - onmspointerover: (ev: MSPointerEvent) => any; - onmspointerup: (ev: MSPointerEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpause: (ev: Event) => any; - onplay: (ev: Event) => any; - onplaying: (ev: Event) => any; - onpopstate: (ev: PopStateEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onratechange: (ev: Event) => any; - onreadystatechange: (ev: ProgressEvent) => any; - onreset: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onscroll: (ev: UIEvent) => any; - onseeked: (ev: Event) => any; - onseeking: (ev: Event) => any; - onselect: (ev: UIEvent) => any; - onstalled: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onsubmit: (ev: Event) => any; - onsuspend: (ev: Event) => any; - ontimeupdate: (ev: Event) => any; - ontouchcancel: any; - ontouchend: any; - ontouchmove: any; - ontouchstart: any; - onunload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - onwaiting: (ev: Event) => any; - opener: Window; - orientation: string; - outerHeight: number; - outerWidth: number; - pageXOffset: number; - pageYOffset: number; - parent: Window; - performance: Performance; - personalbar: BarProp; - screen: Screen; - screenLeft: number; - screenTop: number; - screenX: number; - screenY: number; - scrollX: number; - scrollY: number; - scrollbars: BarProp; - self: Window; - status: string; - statusbar: BarProp; - styleMedia: StyleMedia; - toolbar: BarProp; - top: Window; - window: Window; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msCancelRequestAnimationFrame(handle: number): void; - msMatchMedia(mediaQuery: string): MediaQueryList; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; - postMessage(message: any, targetOrigin: string, ports?: any): void; - print(): void; - prompt(message?: string, _default?: string): string; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: Window; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - msCaching: string; - onreadystatechange: (ev: ProgressEvent) => any; - readyState: number; - response: any; - responseBody: any; - responseText: string; - responseType: string; - responseXML: any; - status: number; - statusText: string; - timeout: number; - upload: XMLHttpRequestUpload; - withCredentials: boolean; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - DONE: number; - HEADERS_RECEIVED: number; - LOADING: number; - OPENED: number; - UNSENT: number; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - DONE: number; - HEADERS_RECEIVED: number; - LOADING: number; - OPENED: number; - UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - booleanValue: boolean; - invalidIteratorState: boolean; - numberValue: number; - resultType: number; - singleNodeValue: Node; - snapshotLength: number; - stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - ANY_TYPE: number; - ANY_UNORDERED_NODE_TYPE: number; - BOOLEAN_TYPE: number; - FIRST_ORDERED_NODE_TYPE: number; - NUMBER_TYPE: number; - ORDERED_NODE_ITERATOR_TYPE: number; - ORDERED_NODE_SNAPSHOT_TYPE: number; - STRING_TYPE: number; - UNORDERED_NODE_ITERATOR_TYPE: number; - UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - ANY_TYPE: number; - ANY_UNORDERED_NODE_TYPE: number; - BOOLEAN_TYPE: number; - FIRST_ORDERED_NODE_TYPE: number; - NUMBER_TYPE: number; - ORDERED_NODE_ITERATOR_TYPE: number; - ORDERED_NODE_SNAPSHOT_TYPE: number; - STRING_TYPE: number; - UNORDERED_NODE_ITERATOR_TYPE: number; - UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorker { - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - childElementCount: number; - firstElementChild: Element; - lastElementChild: Element; - nextElementSibling: Element; - previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlers { - onpointercancel: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerenter: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onwheel: (ev: WheelEvent) => any; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - indexedDB: IDBFactory; - msIndexedDB: IDBFactory; -} - -interface LinkStyle { - sheet: StyleSheet; -} - -interface MSBaseReader { - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - onloadstart: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - readyState: number; - result: any; - abort(): void; - DONE: number; - EMPTY: number; - LOADING: number; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorID { - appName: string; - appVersion: string; - platform: string; - product: string; - productSub: string; - userAgent: string; - vendor: string; - vendorSub: string; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NodeSelector { - querySelector(selectors: string): Element; - querySelectorAll(selectors: string): NodeList; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - animatedPoints: SVGPointList; - points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - height: SVGAnimatedLength; - result: SVGAnimatedString; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTests { - requiredExtensions: SVGStringList; - requiredFeatures: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - console: Console; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - msSetImmediate(expression: any, ...args: any[]): number; - setImmediate(expression: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTarget { - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - onloadstart: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: ProgressEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (event: Event, source?: string, fileno?: number, columnNumber?: number): void; - (event: string, source?: string, fileno?: number, columnNumber?: number): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (): void; -} -interface FunctionStringCallback { - (data: string): void; -} -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var animationStartTime: number; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msAnimationStartTime: number; -declare var msTemplatePrinter: MSTemplatePrinter; -declare var name: string; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (ev: Event) => any; -declare var onafterprint: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onblur: (ev: FocusEvent) => any; -declare var oncanplay: (ev: Event) => any; -declare var oncanplaythrough: (ev: Event) => any; -declare var onchange: (ev: Event) => any; -declare var onclick: (ev: MouseEvent) => any; -declare var oncompassneedscalibration: (ev: Event) => any; -declare var oncontextmenu: (ev: PointerEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var ondragend: (ev: DragEvent) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrop: (ev: DragEvent) => any; -declare var ondurationchange: (ev: Event) => any; -declare var onemptied: (ev: Event) => any; -declare var onended: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (ev: FocusEvent) => any; -declare var onhashchange: (ev: HashChangeEvent) => any; -declare var oninput: (ev: Event) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onload: (ev: Event) => any; -declare var onloadeddata: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onloadstart: (ev: Event) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onmouseover: (ev: MouseEvent) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onmsgesturechange: (ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; -declare var onmsgestureend: (ev: MSGestureEvent) => any; -declare var onmsgesturehold: (ev: MSGestureEvent) => any; -declare var onmsgesturestart: (ev: MSGestureEvent) => any; -declare var onmsgesturetap: (ev: MSGestureEvent) => any; -declare var onmsinertiastart: (ev: MSGestureEvent) => any; -declare var onmspointercancel: (ev: MSPointerEvent) => any; -declare var onmspointerdown: (ev: MSPointerEvent) => any; -declare var onmspointerenter: (ev: MSPointerEvent) => any; -declare var onmspointerleave: (ev: MSPointerEvent) => any; -declare var onmspointermove: (ev: MSPointerEvent) => any; -declare var onmspointerout: (ev: MSPointerEvent) => any; -declare var onmspointerover: (ev: MSPointerEvent) => any; -declare var onmspointerup: (ev: MSPointerEvent) => any; -declare var onoffline: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var onorientationchange: (ev: Event) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var onpause: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onplaying: (ev: Event) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onprogress: (ev: ProgressEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onreadystatechange: (ev: ProgressEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var onselect: (ev: UIEvent) => any; -declare var onstalled: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var ontouchcancel: any; -declare var ontouchend: any; -declare var ontouchmove: any; -declare var ontouchstart: any; -declare var onunload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var onwaiting: (ev: Event) => any; -declare var opener: Window; -declare var orientation: string; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function toString(): string; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function msClearImmediate(handle: number): void; -declare function msSetImmediate(expression: any, ...args: any[]): number; -declare function setImmediate(expression: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerleave: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; -declare var onwheel: (ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare var msIndexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; diff --git a/build/lib/typings/node.d.ts b/build/lib/typings/node.d.ts deleted file mode 100644 index f9b3a68a893..00000000000 --- a/build/lib/typings/node.d.ts +++ /dev/null @@ -1,1536 +0,0 @@ -// Type definitions for Node.js v0.12.0 -// Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript , DefinitelyTyped -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/************************************************ -* * -* Node.js v0.12.0 API * -* * -************************************************/ - -/************************************************ -* * -* GLOBAL * -* * -************************************************/ -declare var process: NodeJS.Process; -declare var global: NodeJS.Global; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearTimeout(timeoutId: NodeJS.Timer): void; -declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearInterval(intervalId: NodeJS.Timer): void; -declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; -declare function clearImmediate(immediateId: any): void; - -declare var require: { - (id: string): any; - resolve(id:string): string; - cache: any; - extensions: any; - main: any; -}; - -declare var module: { - exports: any; - require(id: string): any; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; -}; - -// Same as module.exports -declare var exports: any; -declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - - -// Buffer class -interface Buffer extends NodeBuffer {} -declare var Buffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - -/************************************************ -* * -* GLOBAL INTERFACES * -* * -************************************************/ -declare module NodeJS { - export interface ErrnoException extends Error { - errno?: number; - code?: string; - path?: string; - syscall?: string; - } - - export interface EventEmitter { - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): void; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - } - - export interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: ReadableStream): ReadableStream; - } - - export interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface ReadWriteStream extends ReadableStream, WritableStream {} - - export interface Process extends EventEmitter { - stdout: WritableStream; - stderr: WritableStream; - stdin: ReadableStream; - argv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - env: any; - exit(code?: number): void; - getgid(): number; - setgid(id: number): void; - setgid(id: string): void; - getuid(): number; - setuid(id: number): void; - setuid(id: string): void; - version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - openssl: string; - }; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid: number, signal?: string): void; - pid: number; - title: string; - arch: string; - platform: string; - memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; - nextTick(callback: Function): void; - umask(mask?: number): number; - uptime(): number; - hrtime(time?:number[]): number[]; - - // Worker - send?(message: any, sendHandle?: any): void; - } - - export interface Global { - Array: typeof Array; - ArrayBuffer: typeof ArrayBuffer; - Boolean: typeof Boolean; - Buffer: typeof Buffer; - DataView: typeof DataView; - Date: typeof Date; - Error: typeof Error; - EvalError: typeof EvalError; - Float32Array: typeof Float32Array; - Float64Array: typeof Float64Array; - Function: typeof Function; - GLOBAL: Global; - Infinity: typeof Infinity; - Int16Array: typeof Int16Array; - Int32Array: typeof Int32Array; - Int8Array: typeof Int8Array; - Intl: typeof Intl; - JSON: typeof JSON; - Map: typeof Map; - Math: typeof Math; - NaN: typeof NaN; - Number: typeof Number; - Object: typeof Object; - Promise: Function; - RangeError: typeof RangeError; - ReferenceError: typeof ReferenceError; - RegExp: typeof RegExp; - Set: typeof Set; - String: typeof String; - Symbol: Function; - SyntaxError: typeof SyntaxError; - TypeError: typeof TypeError; - URIError: typeof URIError; - Uint16Array: typeof Uint16Array; - Uint32Array: typeof Uint32Array; - Uint8Array: typeof Uint8Array; - Uint8ClampedArray: Function; - WeakMap: typeof WeakMap; - WeakSet: Function; - clearImmediate: (immediateId: any) => void; - clearInterval: (intervalId: NodeJS.Timer) => void; - clearTimeout: (timeoutId: NodeJS.Timer) => void; - console: typeof console; - decodeURI: typeof decodeURI; - decodeURIComponent: typeof decodeURIComponent; - encodeURI: typeof encodeURI; - encodeURIComponent: typeof encodeURIComponent; - escape: (str: string) => string; - eval: typeof eval; - global: Global; - isFinite: typeof isFinite; - isNaN: typeof isNaN; - parseFloat: typeof parseFloat; - parseInt: typeof parseInt; - process: Process; - root: Global; - setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; - setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - undefined: typeof undefined; - unescape: (str: string) => string; - gc: () => void; - } - - export interface Timer { - ref() : void; - unref() : void; - } -} - -/** - * @deprecated - */ -interface NodeBuffer { - [index: number]: number; - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): any; - length: number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - readUInt8(offset: number, noAsset?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - writeUInt8(value: number, offset: number, noAssert?: boolean): void; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeInt8(value: number, offset: number, noAssert?: boolean): void; - writeInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeFloatLE(value: number, offset: number, noAssert?: boolean): void; - writeFloatBE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; - fill(value: any, offset?: number, end?: number): void; -} - -/************************************************ -* * -* MODULES * -* * -************************************************/ -declare module "buffer" { - export var INSPECT_MAX_BYTES: number; -} - -declare module "querystring" { - export function stringify(obj: any, sep?: string, eq?: string): string; - export function parse(str: string, sep?: string, eq?: string, options?: { maxKeys?: number; }): any; - export function escape(str: string): string; - export function unescape(str: string): string; -} - -declare module "events" { - export class EventEmitter implements NodeJS.EventEmitter { - static listenerCount(emitter: EventEmitter, event: string): number; - - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): void; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - } -} - -declare module "http" { - import events = require("events"); - import net = require("net"); - import stream = require("stream"); - - export interface Server extends events.EventEmitter { - listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; - listen(port: number, hostname?: string, callback?: Function): Server; - listen(path: string, callback?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(cb?: any): Server; - address(): { port: number; family: string; address: string; }; - maxHeadersCount: number; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ServerRequest extends IncomingMessage { - connection: net.Socket; - } - export interface ServerResponse extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - writeContinue(): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; - writeHead(statusCode: number, headers?: any): void; - statusCode: number; - setHeader(name: string, value: string): void; - sendDate: boolean; - getHeader(name: string): string; - removeHeader(name: string): void; - write(chunk: any, encoding?: string): any; - addTrailers(headers: any): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface ClientRequest extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - write(chunk: any, encoding?: string): void; - abort(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface IncomingMessage extends events.EventEmitter, stream.Readable { - httpVersion: string; - headers: any; - rawHeaders: string[]; - trailers: any; - rawTrailers: any; - setTimeout(msecs: number, callback: Function): NodeJS.Timer; - /** - * Only valid for request obtained from http.Server. - */ - method?: string; - /** - * Only valid for request obtained from http.Server. - */ - url?: string; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusCode?: number; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusMessage?: string; - socket: net.Socket; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ClientResponse extends IncomingMessage { } - - export interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number; - } - - export class Agent { - maxSockets: number; - sockets: any; - requests: any; - - constructor(opts?: AgentOptions); - - /** - * Destroy any sockets that are currently in use by the agent. - * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, - * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, - * sockets may hang open for quite a long time before the server terminates them. - */ - destroy(): void; - } - - export var STATUS_CODES: { - [errorCode: number]: string; - [errorCode: string]: string; - }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; - export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export var globalAgent: Agent; -} - -declare module "cluster" { - import child = require("child_process"); - import events = require("events"); - - export interface ClusterSettings { - exec?: string; - args?: string[]; - silent?: boolean; - } - - export class Worker extends events.EventEmitter { - id: string; - process: child.ChildProcess; - suicide: boolean; - send(message: any, sendHandle?: any): void; - kill(signal?: string): void; - destroy(signal?: string): void; - disconnect(): void; - } - - export var settings: ClusterSettings; - export var isMaster: boolean; - export var isWorker: boolean; - export function setupMaster(settings?: ClusterSettings): void; - export function fork(env?: any): Worker; - export function disconnect(callback?: Function): void; - export var worker: Worker; - export var workers: Worker[]; - - // Event emitter - export function addListener(event: string, listener: Function): void; - export function on(event: string, listener: Function): any; - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListeners(event?: string): void; - export function setMaxListeners(n: number): void; - export function listeners(event: string): Function[]; - export function emit(event: string, ...args: any[]): boolean; -} - -declare module "zlib" { - import stream = require("stream"); - export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } - - export interface Gzip extends stream.Transform { } - export interface Gunzip extends stream.Transform { } - export interface Deflate extends stream.Transform { } - export interface Inflate extends stream.Transform { } - export interface DeflateRaw extends stream.Transform { } - export interface InflateRaw extends stream.Transform { } - export interface Unzip extends stream.Transform { } - - export function createGzip(options?: ZlibOptions): Gzip; - export function createGunzip(options?: ZlibOptions): Gunzip; - export function createDeflate(options?: ZlibOptions): Deflate; - export function createInflate(options?: ZlibOptions): Inflate; - export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; - export function createInflateRaw(options?: ZlibOptions): InflateRaw; - export function createUnzip(options?: ZlibOptions): Unzip; - - export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - - // Constants - export var Z_NO_FLUSH: number; - export var Z_PARTIAL_FLUSH: number; - export var Z_SYNC_FLUSH: number; - export var Z_FULL_FLUSH: number; - export var Z_FINISH: number; - export var Z_BLOCK: number; - export var Z_TREES: number; - export var Z_OK: number; - export var Z_STREAM_END: number; - export var Z_NEED_DICT: number; - export var Z_ERRNO: number; - export var Z_STREAM_ERROR: number; - export var Z_DATA_ERROR: number; - export var Z_MEM_ERROR: number; - export var Z_BUF_ERROR: number; - export var Z_VERSION_ERROR: number; - export var Z_NO_COMPRESSION: number; - export var Z_BEST_SPEED: number; - export var Z_BEST_COMPRESSION: number; - export var Z_DEFAULT_COMPRESSION: number; - export var Z_FILTERED: number; - export var Z_HUFFMAN_ONLY: number; - export var Z_RLE: number; - export var Z_FIXED: number; - export var Z_DEFAULT_STRATEGY: number; - export var Z_BINARY: number; - export var Z_TEXT: number; - export var Z_ASCII: number; - export var Z_UNKNOWN: number; - export var Z_DEFLATED: number; - export var Z_NULL: number; -} - -declare module "os" { - export function tmpdir(): string; - export function hostname(): string; - export function type(): string; - export function platform(): string; - export function arch(): string; - export function release(): string; - export function uptime(): number; - export function loadavg(): number[]; - export function totalmem(): number; - export function freemem(): number; - export function cpus(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; - export function networkInterfaces(): any; - export var EOL: string; -} - -declare module "https" { - import tls = require("tls"); - import events = require("events"); - import http = require("http"); - - export interface ServerOptions { - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - crl?: any; - ciphers?: string; - honorCipherOrder?: boolean; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; - SNICallback?: (servername: string) => any; - } - - export interface RequestOptions { - host?: string; - hostname?: string; - port?: number; - path?: string; - method?: string; - headers?: any; - auth?: string; - agent?: any; - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - ciphers?: string; - rejectUnauthorized?: boolean; - } - - export interface Agent { - maxSockets: number; - sockets: any; - requests: any; - } - export var Agent: { - new (options?: RequestOptions): Agent; - }; - export interface Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export var globalAgent: Agent; -} - -declare module "punycode" { - export function decode(string: string): string; - export function encode(string: string): string; - export function toUnicode(domain: string): string; - export function toASCII(domain: string): string; - export var ucs2: ucs2; - interface ucs2 { - decode(string: string): string; - encode(codePoints: number[]): string; - } - export var version: any; -} - -declare module "repl" { - import stream = require("stream"); - import events = require("events"); - - export interface ReplOptions { - prompt?: string; - input?: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - terminal?: boolean; - eval?: Function; - useColors?: boolean; - useGlobal?: boolean; - ignoreUndefined?: boolean; - writer?: Function; - } - export function start(options: ReplOptions): events.EventEmitter; -} - -declare module "readline" { - import events = require("events"); - import stream = require("stream"); - - export interface ReadLine extends events.EventEmitter { - setPrompt(prompt: string, length: number): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: Function): void; - pause(): void; - resume(): void; - close(): void; - write(data: any, key?: any): void; - } - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output: NodeJS.WritableStream; - completer?: Function; - terminal?: boolean; - } - export function createInterface(options: ReadLineOptions): ReadLine; -} - -declare module "vm" { - export interface Context { } - export interface Script { - runInThisContext(): void; - runInNewContext(sandbox?: Context): void; - } - export function runInThisContext(code: string, filename?: string): void; - export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; - export function runInContext(code: string, context: Context, filename?: string): void; - export function createContext(initSandbox?: Context): Context; - export function createScript(code: string, filename?: string): Script; -} - -declare module "child_process" { - import events = require("events"); - import stream = require("stream"); - - export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; - stdout: stream.Readable; - stderr: stream.Readable; - pid: number; - kill(signal?: string): void; - send(message: any, sendHandle?: any): void; - disconnect(): void; - } - - export function spawn(command: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - custom?: any; - env?: any; - detached?: boolean; - }): ChildProcess; - export function exec(command: string, options: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: string; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function fork(modulePath: string, args?: string[], options?: { - cwd?: string; - env?: any; - encoding?: string; - }): ChildProcess; - export function execSync(command: string, options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): ChildProcess; - export function execFileSync(command: string, args?: string[], options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): ChildProcess; -} - -declare module "url" { - export interface Url { - href: string; - protocol: string; - auth: string; - hostname: string; - port: string; - host: string; - pathname: string; - search: string; - query: any; // string | Object - slashes: boolean; - hash?: string; - path?: string; - } - - export interface UrlOptions { - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: any; - hash?: string; - path?: string; - } - - export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; - export function format(url: UrlOptions): string; - export function resolve(from: string, to: string): string; -} - -declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; -} - -declare module "net" { - import stream = require("stream"); - - export interface Socket extends stream.Duplex { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - connect(port: number, host?: string, connectionListener?: Function): void; - connect(path: string, connectionListener?: Function): void; - bufferSize: number; - setEncoding(encoding?: string): void; - write(data: any, encoding?: string, callback?: Function): void; - destroy(): void; - pause(): void; - resume(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setKeepAlive(enable?: boolean, initialDelay?: number): void; - address(): { port: number; family: string; address: string; }; - unref(): void; - ref(): void; - - remoteAddress: string; - remoteFamily: string; - remotePort: number; - localAddress: string; - localPort: number; - bytesRead: number; - bytesWritten: number; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - - export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; - }; - - export interface Server extends Socket { - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(callback?: Function): Server; - address(): { port: number; family: string; address: string; }; - maxConnections: number; - connections: number; - } - export function createServer(connectionListener?: (socket: Socket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; - export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function connect(port: number, host?: string, connectionListener?: Function): Socket; - export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; - export function createConnection(path: string, connectionListener?: Function): Socket; - export function isIP(input: string): number; - export function isIPv4(input: string): boolean; - export function isIPv6(input: string): boolean; -} - -declare module "dgram" { - import events = require("events"); - - interface RemoteInfo { - address: string; - port: number; - size: number; - } - - interface AddressInfo { - address: string; - family: string; - port: number; - } - - export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - - interface Socket extends events.EventEmitter { - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - bind(port: number, address?: string, callback?: () => void): void; - close(): void; - address(): AddressInfo; - setBroadcast(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setMulticastLoopback(flag: boolean): void; - addMembership(multicastAddress: string, multicastInterface?: string): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - } -} - -declare module "fs" { - import stream = require("stream"); - import events = require("events"); - - interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - } - - interface FSWatcher extends events.EventEmitter { - close(): void; - } - - export interface ReadStream extends stream.Readable { - close(): void; - } - export interface WriteStream extends stream.Writable { - close(): void; - } - - export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncateSync(path: string, len?: number): void; - export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncateSync(fd: number, len?: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - export function readlinkSync(path: string): string; - export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: {[path: string]: string}): string; - export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function unlinkSync(path: string): void; - export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function rmdirSync(path: string): void; - export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdirSync(path: string, mode?: number): void; - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function openSync(path: string, flags: string, mode?: number): number; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function utimesSync(path: string, atime: Date, mtime: Date): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function futimesSync(fd: number, atime: Date, mtime: Date): void; - export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; - export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; - export function readFileSync(filename: string, encoding: string): string; - export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; - export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; - export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; - export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; - export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; - export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void): void; - export function existsSync(path: string): boolean; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: string; - mode?: number; - bufferSize?: number; - }): ReadStream; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: string; - mode?: string; - bufferSize?: number; - }): ReadStream; - export function createWriteStream(path: string, options?: { - flags?: string; - encoding?: string; - string?: string; - }): WriteStream; -} - -declare module "path" { - - export interface ParsedPath { - root: string; - dir: string; - base: string; - ext: string; - name: string; - } - - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - - export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } - - export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } -} - -declare module "string_decoder" { - export interface NodeStringDecoder { - write(buffer: Buffer): string; - detectIncompleteChar(buffer: Buffer): number; - } - export var StringDecoder: { - new (encoding: string): NodeStringDecoder; - }; -} - -declare module "tls" { - import crypto = require("crypto"); - import net = require("net"); - import stream = require("stream"); - - var CLIENT_RENEG_LIMIT: number; - var CLIENT_RENEG_WINDOW: number; - - export interface TlsOptions { - pfx?: any; //string or buffer - key?: any; //string or buffer - passphrase?: string; - cert?: any; - ca?: any; //string or buffer - crl?: any; //string or string array - ciphers?: string; - honorCipherOrder?: any; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; //array or Buffer; - SNICallback?: (servername: string) => any; - } - - export interface ConnectionOptions { - host?: string; - port?: number; - socket?: net.Socket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer - passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer - rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer - servername?: string; - } - - export interface Server extends net.Server { - // Extended base methods - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - - listen(port: number, host?: string, callback?: Function): Server; - close(): Server; - address(): { port: number; family: string; address: string; }; - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; - maxConnections: number; - connections: number; - } - - export interface ClearTextStream extends stream.Duplex { - authorized: boolean; - authorizationError: Error; - getPeerCertificate(): any; - getCipher: { - name: string; - version: string; - }; - address: { - port: number; - family: string; - address: string; - }; - remoteAddress: string; - remotePort: number; - } - - export interface SecurePair { - encrypted: any; - cleartext: any; - } - - export interface SecureContextOptions { - pfx?: any; //string | buffer - key?: any; //string | buffer - passphrase?: string; - cert?: any; // string | buffer - ca?: any; // string | buffer - crl?: any; // string | string[] - ciphers?: string; - honorCipherOrder?: boolean; - } - - export interface SecureContext { - context: any; - } - - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - export function createSecureContext(details: SecureContextOptions): SecureContext; -} - -declare module "crypto" { - export interface CredentialDetails { - pfx: string; - key: string; - passphrase: string; - cert: string; - ca: any; //string | string array - crl: any; //string | string array - ciphers: string; - } - export interface Credentials { context?: any; } - export function createCredentials(details: CredentialDetails): Credentials; - export function createHash(algorithm: string): Hash; - export function createHmac(algorithm: string, key: string): Hmac; - export function createHmac(algorithm: string, key: Buffer): Hmac; - interface Hash { - update(data: any, input_encoding?: string): Hash; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - interface Hmac { - update(data: any, input_encoding?: string): Hmac; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export function createCipher(algorithm: string, password: any): Cipher; - export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - interface Cipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createDecipher(algorithm: string, password: any): Decipher; - export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - interface Decipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createSign(algorithm: string): Signer; - interface Signer { - update(data: any): void; - sign(private_key: string, output_format: string): string; - } - export function createVerify(algorith: string): Verify; - interface Verify { - update(data: any): void; - verify(object: string, signature: string, signature_format?: string): boolean; - } - export function createDiffieHellman(prime_length: number): DiffieHellman; - export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; - interface DiffieHellman { - generateKeys(encoding?: string): string; - computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; - getPrime(encoding?: string): string; - getGenerator(encoding: string): string; - getPublicKey(encoding?: string): string; - getPrivateKey(encoding?: string): string; - setPublicKey(public_key: string, encoding?: string): void; - setPrivateKey(public_key: string, encoding?: string): void; - } - export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer; - export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; - export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; -} - -declare module "stream" { - import events = require("events"); - - export interface Stream extends events.EventEmitter { - pipe(destination: T, options?: { end?: boolean; }): T; - } - - export interface ReadableOptions { - highWaterMark?: number; - encoding?: string; - objectMode?: boolean; - } - - export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { - readable: boolean; - constructor(opts?: ReadableOptions); - _read(size: number): void; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - } - - export interface WritableOptions { - highWaterMark?: number; - decodeStrings?: boolean; - } - - export class Writable extends events.EventEmitter implements NodeJS.WritableStream { - writable: boolean; - constructor(opts?: WritableOptions); - _write(data: Buffer, encoding: string, callback: Function): void; - _write(data: string, encoding: string, callback: Function): void; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean; - } - - // Note: Duplex extends both Readable and Writable. - export class Duplex extends Readable implements NodeJS.ReadWriteStream { - writable: boolean; - constructor(opts?: DuplexOptions); - _write(data: Buffer, encoding: string, callback: Function): void; - _write(data: string, encoding: string, callback: Function): void; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface TransformOptions extends ReadableOptions, WritableOptions {} - - // Note: Transform lacks the _read and _write methods of Readable/Writable. - export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { - readable: boolean; - writable: boolean; - constructor(opts?: TransformOptions); - _transform(chunk: Buffer, encoding: string, callback: Function): void; - _transform(chunk: string, encoding: string, callback: Function): void; - _flush(callback: Function): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export class PassThrough extends Transform {} -} - -declare module "util" { - export interface InspectOptions { - showHidden?: boolean; - depth?: number; - colors?: boolean; - customInspect?: boolean; - } - - export function format(format: any, ...param: any[]): string; - export function debug(string: string): void; - export function error(...param: any[]): void; - export function puts(...param: any[]): void; - export function print(...param: any[]): void; - export function log(string: string): void; - export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export function isArray(object: any): boolean; - export function isRegExp(object: any): boolean; - export function isDate(object: any): boolean; - export function isError(object: any): boolean; - export function inherits(constructor: any, superConstructor: any): void; -} - -declare module "assert" { - function internal (value: any, message?: string): void; - module internal { - export class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); - } - - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export var throws: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export var doesNotThrow: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export function ifError(value: any): void; - } - - export = internal; -} - -declare module "tty" { - import net = require("net"); - - export function isatty(fd: number): boolean; - export interface ReadStream extends net.Socket { - isRaw: boolean; - setRawMode(mode: boolean): void; - } - export interface WriteStream extends net.Socket { - columns: number; - rows: number; - } -} - -declare module "domain" { - import events = require("events"); - - export class Domain extends events.EventEmitter { - run(fn: Function): void; - add(emitter: events.EventEmitter): void; - remove(emitter: events.EventEmitter): void; - bind(cb: (err: Error, data: any) => any): any; - intercept(cb: (data: any) => any): any; - dispose(): void; - - addListener(event: string, listener: Function): Domain; - on(event: string, listener: Function): Domain; - once(event: string, listener: Function): Domain; - removeListener(event: string, listener: Function): Domain; - removeAllListeners(event?: string): Domain; - } - - export function create(): Domain; -} diff --git a/build/lib/util.js b/build/lib/util.js index 4ffed162246..8ce093e800f 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -1,213 +1,213 @@ -/*--------------------------------------------------------------------------------------------- - * 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 es = require("event-stream"); -var debounce = require("debounce"); -var _filter = require("gulp-filter"); -var rename = require("gulp-rename"); -var _ = require("underscore"); -var path = require("path"); -var fs = require("fs"); -var _rimraf = require("rimraf"); -var git = require("./git"); -var VinylFile = require("vinyl"); -var NoCancellationToken = { isCancellationRequested: function () { return false; } }; -function incremental(streamProvider, initial, supportsCancellation) { - var input = es.through(); - var output = es.through(); - var state = 'idle'; - var buffer = Object.create(null); - var token = !supportsCancellation ? null : { isCancellationRequested: function () { return Object.keys(buffer).length > 0; } }; - var run = function (input, isCancellable) { - state = 'running'; - var stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken); - input - .pipe(stream) - .pipe(es.through(null, function () { - state = 'idle'; - eventuallyRun(); - })) - .pipe(output); - }; - if (initial) { - run(initial, false); - } - var eventuallyRun = debounce(function () { - var paths = Object.keys(buffer); - if (paths.length === 0) { - return; - } - var data = paths.map(function (path) { return buffer[path]; }); - buffer = Object.create(null); - run(es.readArray(data), true); - }, 500); - input.on('data', function (f) { - buffer[f.path] = f; - if (state === 'idle') { - eventuallyRun(); - } - }); - return es.duplex(input, output); -} -exports.incremental = incremental; -function fixWin32DirectoryPermissions() { - if (!/win32/.test(process.platform)) { - return es.through(); - } - return es.mapSync(function (f) { - if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { - f.stat.mode = 16877; - } - return f; - }); -} -exports.fixWin32DirectoryPermissions = fixWin32DirectoryPermissions; -function setExecutableBit(pattern) { - var setBit = es.mapSync(function (f) { - f.stat.mode = 33261; - return f; - }); - if (!pattern) { - return setBit; - } - var input = es.through(); - var filter = _filter(pattern, { restore: true }); - var output = input - .pipe(filter) - .pipe(setBit) - .pipe(filter.restore); - return es.duplex(input, output); -} -exports.setExecutableBit = setExecutableBit; -function toFileUri(filePath) { - var match = filePath.match(/^([a-z])\:(.*)$/i); - if (match) { - filePath = '/' + match[1].toUpperCase() + ':' + match[2]; - } - return 'file://' + filePath.replace(/\\/g, '/'); -} -exports.toFileUri = toFileUri; -function skipDirectories() { - return es.mapSync(function (f) { - if (!f.isDirectory()) { - return f; - } - }); -} -exports.skipDirectories = skipDirectories; -function cleanNodeModule(name, excludes, includes) { - var toGlob = function (path) { return '**/node_modules/' + name + (path ? '/' + path : ''); }; - var negate = function (str) { return '!' + str; }; - var allFilter = _filter(toGlob('**'), { restore: true }); - var globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); - var input = es.through(); - var nodeModuleInput = input.pipe(allFilter); - var output = nodeModuleInput.pipe(_filter(globs)); - if (includes) { - var includeGlobs = includes.map(toGlob); - output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs))); - } - output = output.pipe(allFilter.restore); - return es.duplex(input, output); -} -exports.cleanNodeModule = cleanNodeModule; -function loadSourcemaps() { - var input = es.through(); - var output = input - .pipe(es.map(function (f, cb) { - if (f.sourceMap) { - cb(null, f); - return; - } - if (!f.contents) { - cb(new Error('empty file')); - return; - } - var contents = f.contents.toString('utf8'); - var reg = /\/\/# sourceMappingURL=(.*)$/g; - var lastMatch = null, match = null; - while (match = reg.exec(contents)) { - lastMatch = match; - } - if (!lastMatch) { - f.sourceMap = { - version: 3, - names: [], - mappings: '', - sources: [f.relative.replace(/\//g, '/')], - sourcesContent: [contents] - }; - cb(null, f); - return; - } - f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); - fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) { - if (err) { - return cb(err); - } - f.sourceMap = JSON.parse(contents); - cb(null, f); - }); - })); - return es.duplex(input, output); -} -exports.loadSourcemaps = loadSourcemaps; -function stripSourceMappingURL() { - var input = es.through(); - var output = input - .pipe(es.mapSync(function (f) { - var contents = f.contents.toString('utf8'); - f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); - return f; - })); - return es.duplex(input, output); -} -exports.stripSourceMappingURL = stripSourceMappingURL; -function rimraf(dir) { - var retries = 0; - var retry = function (cb) { - _rimraf(dir, { maxBusyTries: 1 }, function (err) { - if (!err) { - return cb(); - } - ; - if (err.code === 'ENOTEMPTY' && ++retries < 5) { - return setTimeout(function () { return retry(cb); }, 10); - } - return cb(err); - }); - }; - return function (cb) { return retry(cb); }; -} -exports.rimraf = rimraf; -function getVersion(root) { - var version = process.env['BUILD_SOURCEVERSION']; - if (!version || !/^[0-9a-f]{40}$/i.test(version)) { - version = git.getVersion(root); - } - return version; -} -exports.getVersion = getVersion; -function rebase(count) { - return rename(function (f) { - var parts = f.dirname.split(/[\/\\]/); - f.dirname = parts.slice(count).join(path.sep); - }); -} -exports.rebase = rebase; -function filter(fn) { - var result = es.through(function (data) { - if (fn(data)) { - this.emit('data', data); - } - else { - result.restore.push(data); - } - }); - result.restore = es.through(); - return result; -} -exports.filter = filter; +/*--------------------------------------------------------------------------------------------- + * 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 es = require("event-stream"); +var debounce = require("debounce"); +var _filter = require("gulp-filter"); +var rename = require("gulp-rename"); +var _ = require("underscore"); +var path = require("path"); +var fs = require("fs"); +var _rimraf = require("rimraf"); +var git = require("./git"); +var VinylFile = require("vinyl"); +var NoCancellationToken = { isCancellationRequested: function () { return false; } }; +function incremental(streamProvider, initial, supportsCancellation) { + var input = es.through(); + var output = es.through(); + var state = 'idle'; + var buffer = Object.create(null); + var token = !supportsCancellation ? null : { isCancellationRequested: function () { return Object.keys(buffer).length > 0; } }; + var run = function (input, isCancellable) { + state = 'running'; + var stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken); + input + .pipe(stream) + .pipe(es.through(null, function () { + state = 'idle'; + eventuallyRun(); + })) + .pipe(output); + }; + if (initial) { + run(initial, false); + } + var eventuallyRun = debounce(function () { + var paths = Object.keys(buffer); + if (paths.length === 0) { + return; + } + var data = paths.map(function (path) { return buffer[path]; }); + buffer = Object.create(null); + run(es.readArray(data), true); + }, 500); + input.on('data', function (f) { + buffer[f.path] = f; + if (state === 'idle') { + eventuallyRun(); + } + }); + return es.duplex(input, output); +} +exports.incremental = incremental; +function fixWin32DirectoryPermissions() { + if (!/win32/.test(process.platform)) { + return es.through(); + } + return es.mapSync(function (f) { + if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { + f.stat.mode = 16877; + } + return f; + }); +} +exports.fixWin32DirectoryPermissions = fixWin32DirectoryPermissions; +function setExecutableBit(pattern) { + var setBit = es.mapSync(function (f) { + f.stat.mode = 33261; + return f; + }); + if (!pattern) { + return setBit; + } + var input = es.through(); + var filter = _filter(pattern, { restore: true }); + var output = input + .pipe(filter) + .pipe(setBit) + .pipe(filter.restore); + return es.duplex(input, output); +} +exports.setExecutableBit = setExecutableBit; +function toFileUri(filePath) { + var match = filePath.match(/^([a-z])\:(.*)$/i); + if (match) { + filePath = '/' + match[1].toUpperCase() + ':' + match[2]; + } + return 'file://' + filePath.replace(/\\/g, '/'); +} +exports.toFileUri = toFileUri; +function skipDirectories() { + return es.mapSync(function (f) { + if (!f.isDirectory()) { + return f; + } + }); +} +exports.skipDirectories = skipDirectories; +function cleanNodeModule(name, excludes, includes) { + var toGlob = function (path) { return '**/node_modules/' + name + (path ? '/' + path : ''); }; + var negate = function (str) { return '!' + str; }; + var allFilter = _filter(toGlob('**'), { restore: true }); + var globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); + var input = es.through(); + var nodeModuleInput = input.pipe(allFilter); + var output = nodeModuleInput.pipe(_filter(globs)); + if (includes) { + var includeGlobs = includes.map(toGlob); + output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs))); + } + output = output.pipe(allFilter.restore); + return es.duplex(input, output); +} +exports.cleanNodeModule = cleanNodeModule; +function loadSourcemaps() { + var input = es.through(); + var output = input + .pipe(es.map(function (f, cb) { + if (f.sourceMap) { + cb(null, f); + return; + } + if (!f.contents) { + cb(new Error('empty file')); + return; + } + var contents = f.contents.toString('utf8'); + var reg = /\/\/# sourceMappingURL=(.*)$/g; + var lastMatch = null, match = null; + while (match = reg.exec(contents)) { + lastMatch = match; + } + if (!lastMatch) { + f.sourceMap = { + version: 3, + names: [], + mappings: '', + sources: [f.relative.replace(/\//g, '/')], + sourcesContent: [contents] + }; + cb(null, f); + return; + } + f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); + fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) { + if (err) { + return cb(err); + } + f.sourceMap = JSON.parse(contents); + cb(null, f); + }); + })); + return es.duplex(input, output); +} +exports.loadSourcemaps = loadSourcemaps; +function stripSourceMappingURL() { + var input = es.through(); + var output = input + .pipe(es.mapSync(function (f) { + var contents = f.contents.toString('utf8'); + f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); + return f; + })); + return es.duplex(input, output); +} +exports.stripSourceMappingURL = stripSourceMappingURL; +function rimraf(dir) { + var retries = 0; + var retry = function (cb) { + _rimraf(dir, { maxBusyTries: 1 }, function (err) { + if (!err) { + return cb(); + } + ; + if (err.code === 'ENOTEMPTY' && ++retries < 5) { + return setTimeout(function () { return retry(cb); }, 10); + } + return cb(err); + }); + }; + return function (cb) { return retry(cb); }; +} +exports.rimraf = rimraf; +function getVersion(root) { + var version = process.env['BUILD_SOURCEVERSION']; + if (!version || !/^[0-9a-f]{40}$/i.test(version)) { + version = git.getVersion(root); + } + return version; +} +exports.getVersion = getVersion; +function rebase(count) { + return rename(function (f) { + var parts = f.dirname.split(/[\/\\]/); + f.dirname = parts.slice(count).join(path.sep); + }); +} +exports.rebase = rebase; +function filter(fn) { + var result = es.through(function (data) { + if (fn(data)) { + this.emit('data', data); + } + else { + result.restore.push(data); + } + }); + result.restore = es.through(); + return result; +} +exports.filter = filter; diff --git a/build/lib/util.ts b/build/lib/util.ts index 44cc657c0c0..8f4f1ea75e9 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -22,19 +22,19 @@ export interface ICancellationToken { isCancellationRequested(): boolean; } -const NoCancellationToken:ICancellationToken = { isCancellationRequested: () => false }; +const NoCancellationToken: ICancellationToken = { isCancellationRequested: () => false }; export interface IStreamProvider { - (cancellationToken?:ICancellationToken): NodeJS.ReadWriteStream; + (cancellationToken?: ICancellationToken): NodeJS.ReadWriteStream; } -export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadWriteStream, supportsCancellation:boolean): NodeJS.ReadWriteStream { +export function incremental(streamProvider: IStreamProvider, initial: NodeJS.ReadWriteStream, supportsCancellation: boolean): NodeJS.ReadWriteStream { const input = es.through(); const output = es.through(); let state = 'idle'; let buffer = Object.create(null); - const token:ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 }; + const token: ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 }; const run = (input, isCancellable) => { state = 'running'; @@ -66,7 +66,7 @@ export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadW run(es.readArray(data), true); }, 500); - input.on('data', f => { + input.on('data', (f: any) => { buffer[f.path] = f; if (state === 'idle') { @@ -82,7 +82,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream { return es.through(); } - return es.mapSync(f => { + return es.mapSync(f => { if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { f.stat.mode = 16877; } @@ -92,7 +92,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream { } export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteStream { - var setBit = es.mapSync(f => { + var setBit = es.mapSync(f => { f.stat.mode = /* 100755 */ 33261; return f; }); @@ -111,7 +111,7 @@ export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteSt return es.duplex(input, output); } -export function toFileUri(filePath:string): string { +export function toFileUri(filePath: string): string { const match = filePath.match(/^([a-z])\:(.*)$/i); if (match) { @@ -122,23 +122,23 @@ export function toFileUri(filePath:string): string { } export function skipDirectories(): NodeJS.ReadWriteStream { - return es.mapSync(f => { + return es.mapSync(f => { if (!f.isDirectory()) { return f; } }); } -export function cleanNodeModule(name:string, excludes:string[], includes:string[]): NodeJS.ReadWriteStream { - const toGlob = (path:string) => '**/node_modules/' + name + (path ? '/' + path : ''); - const negate = (str:string) => '!' + str; +export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream { + const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); + const negate = (str: string) => '!' + str; const allFilter = _filter(toGlob('**'), { restore: true }); const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); const input = es.through(); const nodeModuleInput = input.pipe(allFilter); - let output:NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs)); + let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs)); if (includes) { const includeGlobs = includes.map(toGlob); @@ -157,7 +157,7 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream { const input = es.through(); const output = input - .pipe(es.map((f, cb): FileSourceMap => { + .pipe(es.map((f, cb): FileSourceMap => { if (f.sourceMap) { cb(null, f); return; @@ -207,7 +207,7 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream { const input = es.through(); const output = input - .pipe(es.mapSync(f => { + .pipe(es.mapSync(f => { const contents = (f.contents).toString('utf8'); f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); return f; @@ -216,11 +216,11 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream { return es.duplex(input, output); } -export function rimraf(dir:string):(cb:any)=>void { +export function rimraf(dir: string): (cb: any) => void { let retries = 0; const retry = cb => { - _rimraf(dir, { maxBusyTries: 1 }, (err:any) => { + _rimraf(dir, { maxBusyTries: 1 }, (err: any) => { if (!err) { return cb(); }; @@ -236,7 +236,7 @@ export function rimraf(dir:string):(cb:any)=>void { return cb => retry(cb); } -export function getVersion(root:string): string { +export function getVersion(root: string): string { let version = process.env['BUILD_SOURCEVERSION']; if (!version || !/^[0-9a-f]{40}$/i.test(version)) { @@ -246,7 +246,7 @@ export function getVersion(root:string): string { return version; } -export function rebase(count:number): NodeJS.ReadWriteStream { +export function rebase(count: number): NodeJS.ReadWriteStream { return rename(f => { const parts = f.dirname.split(/[\/\\]/); f.dirname = parts.slice(count).join(path.sep); @@ -257,7 +257,7 @@ export interface FilterStream extends NodeJS.ReadWriteStream { restore: ThroughStream; } -export function filter(fn:(data:any)=>boolean):FilterStream { +export function filter(fn: (data: any) => boolean): FilterStream { const result = es.through(function (data) { if (fn(data)) { this.emit('data', data); diff --git a/build/monaco/api.js b/build/monaco/api.js index 96d03bf8da6..83eacd16a3d 100644 --- a/build/monaco/api.js +++ b/build/monaco/api.js @@ -1,327 +1,327 @@ -/*--------------------------------------------------------------------------------------------- - * 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 fs = require("fs"); -var ts = require("typescript"); -var path = require("path"); -var tsfmt = require('../../tsfmt.json'); -var util = require('gulp-util'); -function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.cyan('[monaco.d.ts]'), message].concat(rest)); -} -var SRC = path.join(__dirname, '../../src'); -var OUT_ROOT = path.join(__dirname, '../../'); -var RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); -var DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); -var CURRENT_PROCESSING_RULE = ''; -function logErr(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log(util.colors.red('[monaco.d.ts]'), 'WHILE HANDLING RULE: ', CURRENT_PROCESSING_RULE); - util.log.apply(util, [util.colors.red('[monaco.d.ts]'), message].concat(rest)); -} -function moduleIdToPath(out, moduleId) { - if (/\.d\.ts/.test(moduleId)) { - return path.join(SRC, moduleId); - } - return path.join(OUT_ROOT, out, moduleId) + '.d.ts'; -} -var SOURCE_FILE_MAP = {}; -function getSourceFile(out, inputFiles, moduleId) { - if (!SOURCE_FILE_MAP[moduleId]) { - var filePath = path.normalize(moduleIdToPath(out, moduleId)); - if (!inputFiles.hasOwnProperty(filePath)) { - logErr('CANNOT FIND FILE ' + filePath + '. YOU MIGHT NEED TO RESTART gulp'); - return null; - } - var fileContents = inputFiles[filePath]; - var sourceFile = ts.createSourceFile(filePath, fileContents, ts.ScriptTarget.ES5); - SOURCE_FILE_MAP[moduleId] = sourceFile; - } - return SOURCE_FILE_MAP[moduleId]; -} -function isDeclaration(a) { - return (a.kind === ts.SyntaxKind.InterfaceDeclaration - || a.kind === ts.SyntaxKind.EnumDeclaration - || a.kind === ts.SyntaxKind.ClassDeclaration - || a.kind === ts.SyntaxKind.TypeAliasDeclaration - || a.kind === ts.SyntaxKind.FunctionDeclaration - || a.kind === ts.SyntaxKind.ModuleDeclaration); -} -function visitTopLevelDeclarations(sourceFile, visitor) { - var stop = false; - var visit = function (node) { - if (stop) { - return; - } - switch (node.kind) { - case ts.SyntaxKind.InterfaceDeclaration: - case ts.SyntaxKind.EnumDeclaration: - case ts.SyntaxKind.ClassDeclaration: - case ts.SyntaxKind.VariableStatement: - case ts.SyntaxKind.TypeAliasDeclaration: - case ts.SyntaxKind.FunctionDeclaration: - case ts.SyntaxKind.ModuleDeclaration: - stop = visitor(node); - } - // if (node.kind !== ts.SyntaxKind.SourceFile) { - // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { - // console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]); - // console.log(getNodeText(sourceFile, node)); - // } - // } - if (stop) { - return; - } - ts.forEachChild(node, visit); - }; - visit(sourceFile); -} -function getAllTopLevelDeclarations(sourceFile) { - var all = []; - visitTopLevelDeclarations(sourceFile, function (node) { - if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) { - var interfaceDeclaration = node; - var triviaStart = interfaceDeclaration.pos; - var triviaEnd = interfaceDeclaration.name.pos; - var triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd }); - // // let nodeText = getNodeText(sourceFile, node); - // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { - // console.log('TRIVIA: ', triviaText); - // } - if (triviaText.indexOf('@internal') === -1) { - all.push(node); - } - } - else { - var nodeText = getNodeText(sourceFile, node); - if (nodeText.indexOf('@internal') === -1) { - all.push(node); - } - } - return false /*continue*/; - }); - return all; -} -function getTopLevelDeclaration(sourceFile, typeName) { - var result = null; - visitTopLevelDeclarations(sourceFile, function (node) { - if (isDeclaration(node)) { - if (node.name.text === typeName) { - result = node; - return true /*stop*/; - } - return false /*continue*/; - } - // node is ts.VariableStatement - if (getNodeText(sourceFile, node).indexOf(typeName) >= 0) { - result = node; - return true /*stop*/; - } - return false /*continue*/; - }); - return result; -} -function getNodeText(sourceFile, node) { - return sourceFile.getFullText().substring(node.pos, node.end); -} -function getMassagedTopLevelDeclarationText(sourceFile, declaration) { - var result = getNodeText(sourceFile, declaration); - // if (result.indexOf('MonacoWorker') >= 0) { - // console.log('here!'); - // // console.log(ts.SyntaxKind[declaration.kind]); - // } - if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) { - var interfaceDeclaration = declaration; - var members = interfaceDeclaration.members; - members.forEach(function (member) { - try { - var memberText = getNodeText(sourceFile, member); - if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) { - // console.log('BEFORE: ', result); - result = result.replace(memberText, ''); - // console.log('AFTER: ', result); - } - } - catch (err) { - // life.. - } - }); - } - result = result.replace(/export default/g, 'export'); - result = result.replace(/export declare/g, 'export'); - return result; -} -function format(text) { - // Parse the source text - var sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true); - // Get the formatting edits on the input sources - var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt); - // Apply the edits on the input code - return applyEdits(text, edits); - function getRuleProvider(options) { - // Share this between multiple formatters using the same options. - // This represents the bulk of the space the formatter uses. - var ruleProvider = new ts.formatting.RulesProvider(); - ruleProvider.ensureUpToDate(options); - return ruleProvider; - } - function applyEdits(text, edits) { - // Apply edits in reverse on the existing text - var result = text; - for (var i = edits.length - 1; i >= 0; i--) { - var change = edits[i]; - var head = result.slice(0, change.span.start); - var tail = result.slice(change.span.start + change.span.length); - result = head + change.newText + tail; - } - return result; - } -} -function createReplacer(data) { - data = data || ''; - var rawDirectives = data.split(';'); - var directives = []; - rawDirectives.forEach(function (rawDirective) { - if (rawDirective.length === 0) { - return; - } - var pieces = rawDirective.split('=>'); - var findStr = pieces[0]; - var replaceStr = pieces[1]; - findStr = findStr.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&'); - findStr = '\\b' + findStr + '\\b'; - directives.push([new RegExp(findStr, 'g'), replaceStr]); - }); - return function (str) { - for (var i = 0; i < directives.length; i++) { - str = str.replace(directives[i][0], directives[i][1]); - } - return str; - }; -} -function generateDeclarationFile(out, inputFiles, recipe) { - var lines = recipe.split(/\r\n|\n|\r/); - var result = []; - lines.forEach(function (line) { - var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/); - if (m1) { - CURRENT_PROCESSING_RULE = line; - var moduleId = m1[1]; - var sourceFile_1 = getSourceFile(out, inputFiles, moduleId); - if (!sourceFile_1) { - return; - } - var replacer_1 = createReplacer(m1[2]); - var typeNames = m1[3].split(/,/); - typeNames.forEach(function (typeName) { - typeName = typeName.trim(); - if (typeName.length === 0) { - return; - } - var declaration = getTopLevelDeclaration(sourceFile_1, typeName); - if (!declaration) { - logErr('Cannot find type ' + typeName); - return; - } - result.push(replacer_1(getMassagedTopLevelDeclarationText(sourceFile_1, declaration))); - }); - return; - } - var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/); - if (m2) { - CURRENT_PROCESSING_RULE = line; - var moduleId = m2[1]; - var sourceFile_2 = getSourceFile(out, inputFiles, moduleId); - if (!sourceFile_2) { - return; - } - var replacer_2 = createReplacer(m2[2]); - var typeNames = m2[3].split(/,/); - var typesToExcludeMap_1 = {}; - var typesToExcludeArr_1 = []; - typeNames.forEach(function (typeName) { - typeName = typeName.trim(); - if (typeName.length === 0) { - return; - } - typesToExcludeMap_1[typeName] = true; - typesToExcludeArr_1.push(typeName); - }); - getAllTopLevelDeclarations(sourceFile_2).forEach(function (declaration) { - if (isDeclaration(declaration)) { - if (typesToExcludeMap_1[declaration.name.text]) { - return; - } - } - else { - // node is ts.VariableStatement - var nodeText = getNodeText(sourceFile_2, declaration); - for (var i = 0; i < typesToExcludeArr_1.length; i++) { - if (nodeText.indexOf(typesToExcludeArr_1[i]) >= 0) { - return; - } - } - } - result.push(replacer_2(getMassagedTopLevelDeclarationText(sourceFile_2, declaration))); - }); - return; - } - result.push(line); - }); - var resultTxt = result.join('\n'); - resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri'); - resultTxt = resultTxt.replace(/\bEvent= 0) { + // console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]); + // console.log(getNodeText(sourceFile, node)); + // } + // } + if (stop) { + return; + } + ts.forEachChild(node, visit); + }; + visit(sourceFile); +} +function getAllTopLevelDeclarations(sourceFile) { + var all = []; + visitTopLevelDeclarations(sourceFile, function (node) { + if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) { + var interfaceDeclaration = node; + var triviaStart = interfaceDeclaration.pos; + var triviaEnd = interfaceDeclaration.name.pos; + var triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd }); + // // let nodeText = getNodeText(sourceFile, node); + // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { + // console.log('TRIVIA: ', triviaText); + // } + if (triviaText.indexOf('@internal') === -1) { + all.push(node); + } + } + else { + var nodeText = getNodeText(sourceFile, node); + if (nodeText.indexOf('@internal') === -1) { + all.push(node); + } + } + return false /*continue*/; + }); + return all; +} +function getTopLevelDeclaration(sourceFile, typeName) { + var result = null; + visitTopLevelDeclarations(sourceFile, function (node) { + if (isDeclaration(node)) { + if (node.name.text === typeName) { + result = node; + return true /*stop*/; + } + return false /*continue*/; + } + // node is ts.VariableStatement + if (getNodeText(sourceFile, node).indexOf(typeName) >= 0) { + result = node; + return true /*stop*/; + } + return false /*continue*/; + }); + return result; +} +function getNodeText(sourceFile, node) { + return sourceFile.getFullText().substring(node.pos, node.end); +} +function getMassagedTopLevelDeclarationText(sourceFile, declaration) { + var result = getNodeText(sourceFile, declaration); + // if (result.indexOf('MonacoWorker') >= 0) { + // console.log('here!'); + // // console.log(ts.SyntaxKind[declaration.kind]); + // } + if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) { + var interfaceDeclaration = declaration; + var members = interfaceDeclaration.members; + members.forEach(function (member) { + try { + var memberText = getNodeText(sourceFile, member); + if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) { + // console.log('BEFORE: ', result); + result = result.replace(memberText, ''); + // console.log('AFTER: ', result); + } + } + catch (err) { + // life.. + } + }); + } + result = result.replace(/export default/g, 'export'); + result = result.replace(/export declare/g, 'export'); + return result; +} +function format(text) { + // Parse the source text + var sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true); + // Get the formatting edits on the input sources + var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt); + // Apply the edits on the input code + return applyEdits(text, edits); + function getRuleProvider(options) { + // Share this between multiple formatters using the same options. + // This represents the bulk of the space the formatter uses. + var ruleProvider = new ts.formatting.RulesProvider(); + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } + function applyEdits(text, edits) { + // Apply edits in reverse on the existing text + var result = text; + for (var i = edits.length - 1; i >= 0; i--) { + var change = edits[i]; + var head = result.slice(0, change.span.start); + var tail = result.slice(change.span.start + change.span.length); + result = head + change.newText + tail; + } + return result; + } +} +function createReplacer(data) { + data = data || ''; + var rawDirectives = data.split(';'); + var directives = []; + rawDirectives.forEach(function (rawDirective) { + if (rawDirective.length === 0) { + return; + } + var pieces = rawDirective.split('=>'); + var findStr = pieces[0]; + var replaceStr = pieces[1]; + findStr = findStr.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&'); + findStr = '\\b' + findStr + '\\b'; + directives.push([new RegExp(findStr, 'g'), replaceStr]); + }); + return function (str) { + for (var i = 0; i < directives.length; i++) { + str = str.replace(directives[i][0], directives[i][1]); + } + return str; + }; +} +function generateDeclarationFile(out, inputFiles, recipe) { + var lines = recipe.split(/\r\n|\n|\r/); + var result = []; + lines.forEach(function (line) { + var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/); + if (m1) { + CURRENT_PROCESSING_RULE = line; + var moduleId = m1[1]; + var sourceFile_1 = getSourceFile(out, inputFiles, moduleId); + if (!sourceFile_1) { + return; + } + var replacer_1 = createReplacer(m1[2]); + var typeNames = m1[3].split(/,/); + typeNames.forEach(function (typeName) { + typeName = typeName.trim(); + if (typeName.length === 0) { + return; + } + var declaration = getTopLevelDeclaration(sourceFile_1, typeName); + if (!declaration) { + logErr('Cannot find type ' + typeName); + return; + } + result.push(replacer_1(getMassagedTopLevelDeclarationText(sourceFile_1, declaration))); + }); + return; + } + var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/); + if (m2) { + CURRENT_PROCESSING_RULE = line; + var moduleId = m2[1]; + var sourceFile_2 = getSourceFile(out, inputFiles, moduleId); + if (!sourceFile_2) { + return; + } + var replacer_2 = createReplacer(m2[2]); + var typeNames = m2[3].split(/,/); + var typesToExcludeMap_1 = {}; + var typesToExcludeArr_1 = []; + typeNames.forEach(function (typeName) { + typeName = typeName.trim(); + if (typeName.length === 0) { + return; + } + typesToExcludeMap_1[typeName] = true; + typesToExcludeArr_1.push(typeName); + }); + getAllTopLevelDeclarations(sourceFile_2).forEach(function (declaration) { + if (isDeclaration(declaration)) { + if (typesToExcludeMap_1[declaration.name.text]) { + return; + } + } + else { + // node is ts.VariableStatement + var nodeText = getNodeText(sourceFile_2, declaration); + for (var i = 0; i < typesToExcludeArr_1.length; i++) { + if (nodeText.indexOf(typesToExcludeArr_1[i]) >= 0) { + return; + } + } + } + result.push(replacer_2(getMassagedTopLevelDeclarationText(sourceFile_2, declaration))); + }); + return; + } + result.push(line); + }); + var resultTxt = result.join('\n'); + resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri'); + resultTxt = resultTxt.replace(/\bEvent npmInstall(`extensions/${extension}`)); diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js index 6a65998d3f6..8bd27204e35 100644 --- a/build/npm/preinstall.js +++ b/build/npm/preinstall.js @@ -6,7 +6,7 @@ const path = require('path'); const cp = require('child_process'); -if (process.env['npm_config_disturl'] !== 'https://atom.io/download/atom-shell') { +if (process.env['npm_config_disturl'] !== 'https://atom.io/download/electron') { console.error("You can't use plain npm to install Code's dependencies."); console.error( /^win/.test(process.platform) diff --git a/build/npm/update-all-grammars.js b/build/npm/update-all-grammars.js new file mode 100644 index 00000000000..88b890af730 --- /dev/null +++ b/build/npm/update-all-grammars.js @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const cp = require('child_process'); +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; + +function updateGrammar(location) { + const result = cp.spawnSync(npm, ['run', 'update-grammar'], { + cwd: location, + stdio: 'inherit' + }); + + if (result.error || result.status !== 0) { + process.exit(1); + } +} + +const extensions = [ + // 'bat' Grammar no longer available + 'clojure', + 'coffeescript', + 'cpp', + 'csharp', + 'css', + 'diff', + 'docker', + 'fsharp', + 'gitsyntax', + 'go', + 'groovy', + 'handlebars', + 'hlsl', + 'html', + 'ini', + 'java', + // 'javascript', updated through JavaScript + // 'json', customized + 'less', + 'lua', + 'make', + 'markdown', + 'objective-c', + 'perl', + 'php', + // 'powershell', grammar not ready yet, @daviwil will ping when ready + 'pug', + 'python', + 'r', + 'razor', + 'ruby', + 'rust', + 'scss', + 'shaderlab', + 'shellscript', + // 'sql', customized, PRs pending + 'swift', + 'typescript', + 'vb', + 'xml', + 'yaml' +]; + +extensions.forEach(extension => updateGrammar(`extensions/${extension}`)); + +// run integration tests + +if (process.platform === 'win32') { + cp.spawn('.\scripts\test-integration.bat', [], { env: process.env, stdio: 'inherit' }); +} else { + cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' }); +} \ No newline at end of file diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index 4b0408b89b2..fca60d83242 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -25,19 +25,28 @@ function getOptions(urlString) { } } -function download(url) { -return new Promise((c, e) => { - var content = ''; - var request = https.get(getOptions(url), function (response) { +function download(url, redirectCount) { + return new Promise((c, e) => { + var content = ''; + https.get(getOptions(url), function (response) { response.on('data', function (data) { content += data.toString(); }).on('end', function () { + let count = redirectCount || 0; + if (count < 5 && response.statusCode >= 300 && response.statusCode <= 303 || response.statusCode === 307) { + let location = response.headers['location']; + if (location) { + console.log("Redirected " + url + " to " + location); + download(location, count+1).then(c, e); + return; + } + } c(content); }); }).on('error', function (err) { e(err.message); }); -}); + }); } function getCommitSha(repoId, repoPath) { @@ -46,14 +55,15 @@ function getCommitSha(repoId, repoPath) { try { let lastCommit = JSON.parse(content)[0]; return Promise.resolve({ - commitSha : lastCommit.sha, - commitDate : lastCommit.commit.author.date + commitSha: lastCommit.sha, + commitDate: lastCommit.commit.author.date }); } catch (e) { + console.error("Failed extracting the SHA: " + content); return Promise.resolve(null); } }, function () { - console.err('Failed loading ' + commitInfo); + console.error('Failed loading ' + commitInfo); return Promise.resolve(null); }); } @@ -78,11 +88,23 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) { modifyGrammar(grammar); } return getCommitSha(repoId, repoPath).then(function (info) { + let result = { + information_for_contributors: [ + 'This file has been converted from https://github.com/' + repoId + '/blob/master/' + repoPath, + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.' + ] + }; + if (info) { - grammar.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha; + result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha; } + for (let key in grammar) { + result[key] = grammar[key]; + } + try { - fs.writeFileSync(dest, JSON.stringify(grammar, null, '\t')); + fs.writeFileSync(dest, JSON.stringify(result, null, '\t')); if (info) { console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')'); } else { @@ -97,7 +119,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) { } if (path.basename(process.argv[1]) === 'update-grammar.js') { - for (var i = 3; i < process.argv.length; i+=2) { - exports.update(process.argv[2], process.argv[i], process.argv[i+1]); + for (var i = 3; i < process.argv.length; i += 2) { + exports.update(process.argv[2], process.argv[i], process.argv[i + 1]); } } diff --git a/build/package.json b/build/package.json index 2be49f6f8cd..ccd8c609141 100644 --- a/build/package.json +++ b/build/package.json @@ -2,7 +2,23 @@ "name": "code-oss-dev-build", "version": "1.0.0", "devDependencies": { - "@types/xml2js": "^0.0.33", - "xml2js": "^0.4.17" + "@types/azure": "^0.9.18", + "@types/documentdb": "^1.10.1", + "@types/es6-collections": "^0.5.30", + "@types/es6-promise": "0.0.32", + "@types/mime": "0.0.29", + "@types/node": "^7.0.13", + "@types/xml2js": "^0.0.33", + "azure-storage": "^2.1.0", + "documentdb": "^1.11.0", + "mime": "^1.3.4", + "minimist": "^1.2.0", + "typescript": "^2.2.2", + "xml2js": "^0.4.17" + }, + "scripts": { + "compile": "tsc", + "watch": "tsc --watch", + "postinstall": "npm run compile" } -} \ No newline at end of file +} diff --git a/build/tfs/common/.gitignore b/build/tfs/common/.gitignore new file mode 100644 index 00000000000..e94ecda764e --- /dev/null +++ b/build/tfs/common/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +*.js \ No newline at end of file diff --git a/build/tfs/common/common.sh b/build/tfs/common/common.sh new file mode 100755 index 00000000000..52f53537943 --- /dev/null +++ b/build/tfs/common/common.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +# set agent specific npm cache +if [ -n "$AGENT_WORKFOLDER" ] +then + export npm_config_cache="$AGENT_WORKFOLDER/npm-cache" + echo "Using npm cache: $npm_config_cache" +fi + +SUMMARY="Task;Duration"$'\n' +step() { + START=$SECONDS + TASK=$1; shift + echo "" + echo "*****************************************************************************" + echo "Start: $TASK" + echo "*****************************************************************************" + "$@" + + # Calculate total duration + TOTAL=$(echo "$SECONDS - $START" | bc) + M=$(echo "$TOTAL / 60" | bc) + S=$(echo "$TOTAL % 60" | bc) + DURATION="$(printf "%02d" $M):$(printf "%02d" $S)" + + echo "*****************************************************************************" + echo "End: $TASK, Total: $DURATION" + echo "*****************************************************************************" + SUMMARY="$SUMMARY$TASK;$DURATION"$'\n' +} + +done_steps() { + echo "" + echo "Build Summary" + echo "=============" + echo "${SUMMARY}" | column -t -s';' +} + +trap done_steps EXIT \ No newline at end of file diff --git a/build/tfs/common/enqueue.ts b/build/tfs/common/enqueue.ts new file mode 100644 index 00000000000..61e1171f2eb --- /dev/null +++ b/build/tfs/common/enqueue.ts @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { execSync } from 'child_process'; +import { DocumentClient } from 'documentdb'; +import * as azure from 'azure-storage'; + +interface Asset { + platform: string; + type: string; + url: string; + mooncakeUrl: string; + hash: string; +} + +function queueSigningRequest(quality: string, commit: string): Promise { + const retryOperations = new azure.ExponentialRetryPolicyFilter(); + const queueSvc = azure + .createQueueService(process.env['AZURE_STORAGE_ACCOUNT_2'], process.env['AZURE_STORAGE_ACCESS_KEY_2']) + .withFilter(retryOperations); + + queueSvc.messageEncoder = new azure.QueueMessageEncoder.TextBase64QueueMessageEncoder(); + + const message = `${quality}/${commit}`; + + return new Promise((c, e) => queueSvc.createMessage('sign-darwin', message, err => err ? e(err) : c())); +} + +function isBuildSigned(quality: string, commit: string): Promise { + const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] }); + const collection = 'dbs/builds/colls/' + quality; + const updateQuery = { + query: 'SELECT TOP 1 * FROM c WHERE c.id = @id', + parameters: [{ name: '@id', value: commit }] + }; + + return new Promise((c, e) => { + client.queryDocuments(collection, updateQuery).toArray((err, results) => { + if (err) { return e(err); } + if (results.length !== 1) { return c(false); } + + const [release] = results; + const assets: Asset[] = release.assets; + const isSigned = assets.some(a => a.platform === 'darwin' && a.type === 'archive'); + + c(isSigned); + }); + }); +} + +async function waitForSignedBuild(quality: string, commit: string): Promise { + let retries = 0; + + while (retries < 180) { + if (await isBuildSigned(quality, commit)) { + return; + } + + await new Promise(c => setTimeout(c, 10000)); + retries++; + } + + throw new Error('Timed out waiting for signed build'); +} + +async function main(quality: string): Promise { + const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim(); + + console.log(`Queueing signing request for '${quality}/${commit}'...`); + await queueSigningRequest(quality, commit); + + console.log('Waiting on signed build...'); + await waitForSignedBuild(quality, commit); + + console.log('Found signed build!'); +} + +main(process.argv[2]).catch(err => { + console.error(err); + process.exit(1); +}); \ No newline at end of file diff --git a/build/tfs/common/installDistro.ts b/build/tfs/common/installDistro.ts new file mode 100644 index 00000000000..ec29450f011 --- /dev/null +++ b/build/tfs/common/installDistro.ts @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const cp = require('child_process'); +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; + +function npmInstall(package: string, args: string[]): void { + const result = cp.spawnSync(npm, ['install', package, ...args], { + stdio: 'inherit' + }); + + if (result.error || result.status !== 0) { + process.exit(1); + } +} + +const product = require('../../../product.json'); +const dependencies = product.dependencies || {} as { [name: string]: string; }; +const [, , ...args] = process.argv; + +Object.keys(dependencies).forEach(name => { + const url = dependencies[name]; + npmInstall(url, args); +}); \ No newline at end of file diff --git a/build/tfs/common/publish.ts b/build/tfs/common/publish.ts new file mode 100644 index 00000000000..ecf1148c2ff --- /dev/null +++ b/build/tfs/common/publish.ts @@ -0,0 +1,254 @@ +/*--------------------------------------------------------------------------------------------- + * 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 fs from 'fs'; +import { execSync } from 'child_process'; +import { Readable } from 'stream'; +import * as crypto from 'crypto'; +import * as azure from 'azure-storage'; +import * as mime from 'mime'; +import * as minimist from 'minimist'; +import { DocumentClient, NewDocument } from 'documentdb'; + +if (process.argv.length < 6) { + console.error('Usage: node publish.js '); + process.exit(-1); +} + +function hashStream(hashName: string, stream: Readable): Promise { + return new Promise((c, e) => { + const shasum = crypto.createHash(hashName); + + stream + .on('data', shasum.update.bind(shasum)) + .on('error', e) + .on('close', () => c(shasum.digest('hex'))); + }); +} + +interface Config { + id: string; + frozen: boolean; +} + +function createDefaultConfig(quality: string): Config { + return { + id: quality, + frozen: false + }; +} + +function getConfig(quality: string): Promise { + const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] }); + const collection = 'dbs/builds/colls/config'; + const query = { + query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`, + parameters: [ + { name: '@quality', value: quality } + ] + }; + + return new Promise((c, e) => { + client.queryDocuments(collection, query).toArray((err, results) => { + if (err && err.code !== 409) { return e(err); } + + c(!results || results.length === 0 ? createDefaultConfig(quality) : results[0] as any as Config); + }); + }); +} + +interface Asset { + platform: string; + type: string; + url: string; + mooncakeUrl: string; + hash: string; + sha256hash: string; +} + +function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise { + const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] }); + const collection = 'dbs/builds/colls/' + quality; + const updateQuery = { + query: 'SELECT TOP 1 * FROM c WHERE c.id = @id', + parameters: [{ name: '@id', value: commit }] + }; + + let updateTries = 0; + + function update(): Promise { + updateTries++; + + return new Promise((c, e) => { + client.queryDocuments(collection, updateQuery).toArray((err, results) => { + if (err) { return e(err); } + if (results.length !== 1) { return e(new Error('No documents')); } + + const release = results[0]; + + release.assets = [ + ...release.assets.filter((a: any) => !(a.platform === platform && a.type === type)), + asset + ]; + + if (isUpdate) { + release.updates[platform] = type; + } + + client.replaceDocument(release._self, release, err => { + if (err && err.code === 409 && updateTries < 5) { return c(update()); } + if (err) { return e(err); } + + console.log('Build successfully updated.'); + c(); + }); + }); + }); + } + + return new Promise((c, e) => { + client.createDocument(collection, release, err => { + if (err && err.code === 409) { return c(update()); } + if (err) { return e(err); } + + console.log('Build successfully published.'); + c(); + }); + }); +} + +async function assertContainer(blobService: azure.BlobService, quality: string): Promise { + await new Promise((c, e) => blobService.createContainerIfNotExists(quality, { publicAccessLevel: 'blob' }, err => err ? e(err) : c())); +} + +async function doesAssetExist(blobService: azure.BlobService, quality: string, blobName: string): Promise { + const existsResult = await new Promise((c, e) => blobService.doesBlobExist(quality, blobName, (err, r) => err ? e(err) : c(r))); + return existsResult.exists; +} + +async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise { + const blobOptions = { + contentType: mime.lookup(file), + cacheControl: 'max-age=31536000, public' + }; + + await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c())); +} + +interface PublishOptions { + 'upload-only': boolean; +} + +async function publish(commit: string, quality: string, platform: string, type: string, name: string, version: string, _isUpdate: string, file: string, opts: PublishOptions): Promise { + const isUpdate = _isUpdate === 'true'; + + const queuedBy = process.env['BUILD_QUEUEDBY']; + const sourceBranch = process.env['BUILD_SOURCEBRANCH']; + const isReleased = quality === 'insider' + && /^master$|^refs\/heads\/master$/.test(sourceBranch) + && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy); + + console.log('Publishing...'); + console.log('Quality:', quality); + console.log('Platforn:', platform); + console.log('Type:', type); + console.log('Name:', name); + console.log('Version:', version); + console.log('Commit:', commit); + console.log('Is Update:', isUpdate); + console.log('Is Released:', isReleased); + console.log('File:', file); + + const stream = fs.createReadStream(file); + const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]); + + console.log('SHA1:', sha1hash); + console.log('SHA256:', sha256hash); + + const blobName = commit + '/' + name; + const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']; + + const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']) + .withFilter(new azure.ExponentialRetryPolicyFilter()); + + const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`) + .withFilter(new azure.ExponentialRetryPolicyFilter()); + + await Promise.all([ + assertContainer(blobService, quality), + assertContainer(mooncakeBlobService, quality) + ]); + + const [blobExists, moooncakeBlobExists] = await Promise.all([ + doesAssetExist(blobService, quality, blobName), + doesAssetExist(mooncakeBlobService, quality, blobName) + ]); + + if (blobExists || moooncakeBlobExists) { + console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`); + return; + } + + console.log('Uploading blobs to Azure storage...'); + + await Promise.all([ + uploadBlob(blobService, quality, blobName, file), + uploadBlob(mooncakeBlobService, quality, blobName, file) + ]); + + console.log('Blobs successfully uploaded.'); + + const config = await getConfig(quality); + + console.log('Quality config:', config); + + const asset: Asset = { + platform: platform, + type: type, + url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`, + mooncakeUrl: `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}`, + hash: sha1hash, + sha256hash + }; + + const release = { + id: commit, + timestamp: (new Date()).getTime(), + version, + isReleased: config.frozen ? false : isReleased, + sourceBranch, + queuedBy, + assets: [], + updates: {} as any + }; + + if (!opts['upload-only']) { + release.assets.push(asset); + + if (isUpdate) { + release.updates[platform] = type; + } + } + + await createOrUpdate(commit, quality, platform, type, release, asset, isUpdate); +} + +function main(): void { + const opts = minimist(process.argv.slice(2), { + boolean: ['upload-only'] + }); + + const [quality, platform, type, name, version, _isUpdate, file] = opts._; + const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim(); + + publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => { + console.error(err); + process.exit(1); + }); +} + +main(); diff --git a/build/tfs/darwin/build.sh b/build/tfs/darwin/build.sh new file mode 100755 index 00000000000..1f569cf74f2 --- /dev/null +++ b/build/tfs/darwin/build.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +export VSCODE_MIXIN_PASSWORD="$1" +export AZURE_STORAGE_ACCESS_KEY="$2" +export AZURE_STORAGE_ACCESS_KEY_2="$3" +export MOONCAKE_STORAGE_ACCESS_KEY="$4" +export AZURE_DOCUMENTDB_MASTERKEY="$5" +VSO_PAT="$6" + +echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc + +step "Install dependencies" \ + npm install + +step "Mix in repository from vscode-distro" \ + npm run gulp -- mixin + +step "Install distro dependencies" \ + node build/tfs/common/installDistro.js + +step "Build minified & upload source maps" \ + npm run gulp -- --max_old_space_size=4096 vscode-darwin-min upload-vscode-sourcemaps + +step "Run unit tests" \ + ./scripts/test.sh --build --reporter dot + +step "Run integration tests" \ + ./scripts/test-integration.sh + +(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ + step "Install build dependencies" \ + npm i) + +REPO=`pwd` +ZIP=$REPO/../VSCode-darwin-selfsigned.zip +UNSIGNEDZIP=$REPO/../VSCode-darwin-unsigned.zip +BUILD=$REPO/../VSCode-darwin +PACKAGEJSON=`ls $BUILD/*.app/Contents/Resources/app/package.json` +VERSION=`node -p "require(\"$PACKAGEJSON\").version"` + +rm -rf $UNSIGNEDZIP +(cd $BUILD && \ + step "Create unsigned archive" \ + zip -r -X -y $UNSIGNEDZIP *) + +step "Upload unsigned archive" \ + node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP + +step "Sign build" \ + node build/tfs/common/enqueue.js $VSCODE_QUALITY \ No newline at end of file diff --git a/build/tfs/linux/Dockerfile b/build/tfs/linux/Dockerfile new file mode 100644 index 00000000000..581ea75a950 --- /dev/null +++ b/build/tfs/linux/Dockerfile @@ -0,0 +1,29 @@ +FROM microsoft/vsts-agent:ubuntu-14.04-standard +MAINTAINER Joao Moreno + +RUN dpkg --add-architecture i386 +RUN apt-get update +RUN apt-get install -y build-essential +RUN apt-get install -y gcc-multilib g++-multilib +RUN apt-get install -y zip +RUN apt-get install -y rpm +RUN apt-get install -y createrepo +RUN apt-get install -y python-gtk2 +RUN apt-get install -y jq +RUN apt-get install -y xvfb +RUN apt-get install -y fakeroot +RUN apt-get install -y libgtk2.0-0 libgtk2.0-0:i386 +RUN apt-get install -y libgconf-2-4 libgconf-2-4:i386 +RUN apt-get install -y libnss3 libnss3:i386 +RUN apt-get install -y libasound2 libasound2:i386 +RUN apt-get install -y libxtst6 libxtst6:i386 +RUN apt-get install -y libfuse2 +RUN apt-get install -y libnotify-bin +RUN apt-get install -y libnotify4:i386 +RUN apt-get install -y libx11-dev libx11-dev:i386 +RUN apt-get install -y libxkbfile-dev:i386 +RUN apt-get install -y libxss1 libxss1:i386 +RUN apt-get install -y libx11-xcb-dev libx11-xcb-dev:i386 +RUN apt-get install -y libgl1-mesa-glx:i386 libgl1-mesa-dri:i386 +RUN apt-get install -y libxkbfile-dev +RUN apt-get install -y bc bsdmainutils diff --git a/build/tfs/linux/build-ia32.sh b/build/tfs/linux/build-ia32.sh new file mode 100755 index 00000000000..0b0f1c2a458 --- /dev/null +++ b/build/tfs/linux/build-ia32.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +./build/tfs/linux/build.sh ia32 "$@" \ No newline at end of file diff --git a/build/tfs/linux/build-x64.sh b/build/tfs/linux/build-x64.sh new file mode 100755 index 00000000000..fb5b38e02b3 --- /dev/null +++ b/build/tfs/linux/build-x64.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +./build/tfs/linux/build.sh x64 "$@" \ No newline at end of file diff --git a/build/tfs/linux/build.sh b/build/tfs/linux/build.sh new file mode 100755 index 00000000000..7e50e47c05d --- /dev/null +++ b/build/tfs/linux/build.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +export ARCH="$1" +export VSCODE_MIXIN_PASSWORD="$2" +export AZURE_STORAGE_ACCESS_KEY="$3" +export AZURE_STORAGE_ACCESS_KEY_2="$4" +export MOONCAKE_STORAGE_ACCESS_KEY="$5" +export AZURE_DOCUMENTDB_MASTERKEY="$6" +export LINUX_REPO_PASSWORD="$7" +VSO_PAT="$8" + +echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc + +step "Install dependencies" \ + npm install --arch=$ARCH --unsafe-perm + +step "Mix in repository from vscode-distro" \ + npm run gulp -- mixin + +step "Get Electron" \ + npm run gulp -- "electron-$ARCH" + +step "Install distro dependencies" \ + node build/tfs/common/installDistro.js --arch=$ARCH + +step "Build minified" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-min" + +step "Run unit tests" \ + ./scripts/test.sh --xvfb --build --reporter dot + +step "Build Debian package" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-deb" + +step "Build RPM package" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-rpm" + +(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ + step "Install build dependencies" \ + npm install --unsafe-perm) + +# Variables +PLATFORM_LINUX="linux-$ARCH" +PLATFORM_DEB="linux-deb-$ARCH" +PLATFORM_RPM="linux-rpm-$ARCH" +[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64" +[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64" +REPO="`pwd`" +ROOT="$REPO/.." +BUILDNAME="VSCode-$PLATFORM_LINUX" +BUILD="$ROOT/$BUILDNAME" +BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')" +[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz" +TARBALL_PATH="$ROOT/$TARBALL_FILENAME" +PACKAGEJSON="$BUILD/resources/app/package.json" +VERSION=$(node -p "require(\"$PACKAGEJSON\").version") + +rm -rf $ROOT/code-*.tar.* +(cd $ROOT && \ + step "Create tar.gz archive" \ + tar -czvf $TARBALL_PATH $BUILDNAME) + +step "Publish tar.gz archive" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH + +DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" +DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" + +step "Publish Debian package" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH + +RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" +RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" + +step "Publish RPM package" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH + +if [ -z "$VSCODE_QUALITY" ]; then + echo "VSCODE_QUALITY is not set, skipping repo package publish" +else + if [ "$BUILD_SOURCEBRANCH" = "master" ] || [ "$BUILD_SOURCEBRANCH" = "refs/heads/master" ]; then + if [[ $BUILD_QUEUEDBY = *"Project Collection Service Accounts"* || $BUILD_QUEUEDBY = *"Microsoft.VisualStudio.Services.TFS"* ]]; then + # Get necessary information + pushd $REPO && COMMIT_HASH=$(git rev-parse HEAD) && popd + PACKAGE_NAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/_.*//g')" + DEB_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$DEB_FILENAME" + RPM_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$RPM_FILENAME" + PACKAGE_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\_.*$//g')" + # Write config files needed by API, use eval to force environment variable expansion + DIRNAME=$(dirname $(readlink -f $0)) + pushd $DIRNAME + # Submit to apt repo + if [ "$DEB_ARCH" = "amd64" ]; then + eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json + eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"sourceUrl\": \"$DEB_URL\" }' > apt-addpkg.json + echo "Submitting apt-addpkg.json:" + cat apt-addpkg.json + + step "Publish to repositories" \ + ./repoapi_client.sh -config apt-config.json -addpkg apt-addpkg.json + fi + # Submit to yum repo (disabled as it's manual until signing is automated) + # eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json + # eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"sourceUrl\": \"$RPM_URL\" }' > yum-addpkg.json + # echo "Submitting yum-addpkg.json:" + # cat yum-addpkg.json + # ./repoapi_client.sh -config yum-config.json -addpkg yum-addpkg.json + popd + echo "To check repo publish status run ./repoapi_client.sh -config config.json -check " + fi + fi +fi diff --git a/build/tfs/linux/repoapi_client.sh b/build/tfs/linux/repoapi_client.sh new file mode 100755 index 00000000000..b214ef10726 --- /dev/null +++ b/build/tfs/linux/repoapi_client.sh @@ -0,0 +1,262 @@ +#!/bin/bash -e +# This is a VERY basic script for Create/Delete operations on repos and packages +# +cmd=$1 +urls=urls.txt +defaultPackageFile=new_package.json +defaultRepoFile=new_repo.json + +function Bail +{ + echo "ERROR: $@" + exit 1 +} + +function BailIfFileMissing { + file="$1" + if [ ! -f "$file" ]; then + Bail "File $file does not exist" + fi +} + +function Usage { + echo "USAGE: Manage repos and packages in an apt repository" + echo "$0 -config FILENAME -listrepos | -listpkgs | -addrepo FILENAME | -addpkg FILENAME |" + echo "-addpkgs FILENAME | -check ID | -delrepo REPOID | -delpkg PKGID" + echo -e "\t-config FILENAME : JSON file containing API server name and creds" + echo -e "\t-listrepos : List repositories" + echo -e "\t-listpkgs [REGEX] : List packages, optionally filter by REGEX" + echo -e "\t-addrepo FILENAME : Create a new repo using the specified JSON file" + echo -e "\t-addpkg FILENAME : Add package to repo using the specified JSON file" + echo -e "\t-addpkgs FILENAME : Add packages to repo using urls contained in FILENAME" + echo -e "\t-check ID : Check upload operation by ID" + echo -e "\t-delrepo REPOID : Delete the specified repo by ID" + echo -e "\t-delpkg PKGID : Delete the specified package by ID" + exit 1 +} + +function ParseFromJson { + if [ -z "$secretContents" ]; then + Bail "Unable to parse value because no JSON contents were specified" + elif [ -z "$1" ]; then + Bail "Unable to parse value from JSON because no key was specified" + fi + # Write value directly to stdout to be used by caller + echo $secretContents | jq "$1" | tr -d '"' +} + +function ParseConfigFile { + configFile="$1" + if [ -z "$configFile" ]; then + echo "Must specify -config option" + Usage + fi + BailIfFileMissing "$configFile" + secretContents=$(cat "$configFile") + + server=$(ParseFromJson .server) + protocol=$(ParseFromJson .protocol) + port=$(ParseFromJson .port) + repositoryId=$(ParseFromJson .repositoryId) + user=$(ParseFromJson .username) + pass=$(ParseFromJson .password) + baseurl="$protocol://$user:$pass@$server:$port" +} + +# List Repositories +function ListRepositories +{ + echo "Fetching repo list from $server..." + curl -k "$baseurl/v1/repositories" | sed 's/,/,\n/g' | sed 's/^"/\t"/g' + echo "" +} + +# List packages, using $1 as a regex to filter results +function ListPackages +{ + echo "Fetching package list from $server" + curl -k "$baseurl/v1/packages" | sed 's/{/\n{/g' | egrep "$1" | sed 's/,/,\n/g' | sed 's/^"/\t"/g' + echo "" +} + +# Create a new Repo using the specified JSON file +function AddRepo +{ + repoFile=$1 + if [ -z $repoFile ]; then + Bail "Error: Must specify a JSON-formatted file. Reference $defaultRepoFile.template" + fi + if [ ! -f $repoFile ]; then + Bail "Error: Cannot create repo - $repoFile does not exist" + fi + packageUrl=$(grep "url" $repoFile | head -n 1 | awk '{print $2}' | tr -d ',') + echo "Creating new repo on $server [$packageUrl]" + curl -i -k "$baseurl/v1/repositories" --data @./$repoFile -H "Content-Type: application/json" + echo "" +} + +# Upload a single package using the specified JSON file +function AddPackage +{ + packageFile=$1 + if [ -z $packageFile ]; then + Bail "Error: Must specify a JSON-formatted file. Reference $defaultPackageFile.template" + fi + if [ ! -f $packageFile ]; then + Bail "Error: Cannot add package - $packageFile does not exist" + fi + packageUrl=$(grep "sourceUrl" $packageFile | head -n 1 | awk '{print $2}') + echo "Adding package to $server [$packageUrl]" + curl -i -k "$baseurl/v1/packages" --data @./$packageFile -H "Content-Type: application/json" + echo "" +} + +# Upload a single package by dynamically creating a JSON file using a provided URL +function AddPackageByUrl +{ + url=$(echo "$1") + if [ -z "$url" ]; then + Bail "Unable to publish package because no URL was specified" + fi + tmpFile=$(mktemp) + tmpOut=$(mktemp) + if ! wget -q "$url" -O $tmpFile; then + rm -f $tmpFile $tmpFile + Bail "Unable to download URL $url" + elif dpkg -I $tmpFile > $tmpOut 2> /dev/null; then + echo "File is deb format" + pkgName=$(grep "^\s*Package:" $tmpOut | awk '{print $2}') + pkgVer=$(grep "^\s*Version:" $tmpOut | awk '{print $2}') + elif rpm -qpi $tmpFile > $tmpOut 2> /dev/null; then + echo "File is rpm format" + pkgName=$(egrep "^Name" $tmpOut | tr -d ':' | awk '{print $2}') + pkgVer=$(egrep "^Version" $tmpOut | tr -d ':' | awk '{print $2}') + else + rm -f $tmpFile $tmpOut + Bail "File is not a valid deb/rpm package $url" + fi + + rm -f $tmpFile $tmpOut + if [ -z "$pkgName" ]; then + Bail "Unable to parse package name for $url" + elif [ -z "$pkgVer" ]; then + Bail "Unable to parse package version number for $url" + fi + + # Create Package .json file + escapedUrl=$(echo "$url" | sed 's/\//\\\//g' | sed 's/\&/\\\&/g') + cp $defaultPackageFile.template $defaultPackageFile + sed -i "s/PACKAGENAME/$pkgName/g" $defaultPackageFile + sed -i "s/PACKAGEVERSION/$pkgVer/g" $defaultPackageFile + sed -i "s/PACKAGEURL/$escapedUrl/g" $defaultPackageFile + sed -i "s/REPOSITORYID/$repositoryId/g" $defaultPackageFile + # Perform Upload + AddPackage $defaultPackageFile + # Cleanup + rm -f $defaultPackageFile +} + +# Upload multiple packages by reading urls line-by-line from the specified file +function AddPackages +{ + urlFile=$1 + if [ -z $urlFile ]; then + Bail "Must specify a flat text file containing one or more URLs" + fi + if [ ! -f $urlFile ]; then + Bail "Cannot add packages. File $urlFile does not exist" + fi + for url in $(cat $urlFile); do + if [ -n "$url" ]; then + AddPackageByUrl "$url" + fi + sleep 5 + done +} + +# Check upload by ID +function CheckUpload { + id=$1 + if [ -z "$id" ]; then + Bail "Must specify an ID" + fi + curl -k $baseurl/v1/packages/queue/$id + echo "" +} + +# Delete the specified repo +function DeleteRepo +{ + repoId=$1 + if [ -z $repoId ]; then + Bail "Please specify repository ID. Run -listrepos for a list of IDs" + fi + curl -I -k -X DELETE "$baseurl/v1/repositories/$repoId" +} + +# Delete the specified package +function DeletePackage +{ + packageId=$1 + if [ -z $packageId ]; then + Bail "Please specify package ID. Run -listpkgs for a list of IDs" + fi + echo Removing pkgId $packageId from repo $repositoryId + curl -I -k -X DELETE "$baseurl/v1/packages/$packageId" +} + +# Parse params +# Not using getopts because this uses multi-char flags +operation= +while (( "$#" )); do + if [[ "$1" == "-config" ]]; then + shift + configFile="$1" + elif [[ "$1" == "-listrepos" ]]; then + operation=ListRepositories + elif [[ "$1" == "-listpkgs" ]]; then + operation=ListPackages + if [ -n "$2" ]; then + shift + operand="$1" + fi + elif [[ "$1" == "-addrepo" ]]; then + operation=AddRepo + shift + operand="$1" + elif [[ "$1" == "-addpkg" ]]; then + operation=AddPackage + shift + operand="$1" + elif [[ "$1" == "-addpkgs" ]]; then + operation=AddPackages + shift + operand="$1" + elif [[ "$1" == "-check" ]]; then + operation=CheckUpload + shift + operand="$1" + elif [[ "$1" == "-delrepo" ]]; then + operation=DeleteRepo + shift + operand="$1" + elif [[ "$1" == "-delpkg" ]]; then + operation=DeletePackage + shift + operand="$1" + else + Usage + fi + shift +done + +echo "Performing $operation $operand" +# Parse config file +ParseConfigFile "$configFile" + +# Exit if no operation was specified +if [ -z "operation" ]; then + Usage +fi + +$operation "$operand" diff --git a/build/tfs/win32/1_build.ps1 b/build/tfs/win32/1_build.ps1 new file mode 100644 index 00000000000..0f473ddeff5 --- /dev/null +++ b/build/tfs/win32/1_build.ps1 @@ -0,0 +1,47 @@ +Param( + [string]$arch, + [string]$mixinPassword, + [string]$vsoPAT +) + +. .\scripts\env.ps1 +. .\build\tfs\win32\lib.ps1 + +# Create a _netrc file to download distro dependencies +# In order to get _netrc to work, we need a HOME variable setup +$env:HOME=$env:USERPROFILE +"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII + +# Set the right architecture +$env:npm_config_arch="$arch" + +step "Install dependencies" { + exec { & npm install } +} + +$env:VSCODE_MIXIN_PASSWORD = $mixinPassword +step "Mix in repository from vscode-distro" { + exec { & npm run gulp -- mixin } +} + +step "Get Electron" { + exec { & npm run gulp -- "electron-$global:arch" } +} + +step "Install distro dependencies" { + exec { & node build\tfs\common\installDistro.js } +} + +step "Build minified" { + exec { & npm run gulp -- --max_old_space_size=4096 "vscode-win32-$global:arch-min" } +} + +step "Run unit tests" { + exec { & .\scripts\test.bat --build --reporter dot } +} + +# step "Run integration tests" { +# exec { & .\scripts\test-integration.bat } +# } + +done \ No newline at end of file diff --git a/build/tfs/win32/2_package.ps1 b/build/tfs/win32/2_package.ps1 new file mode 100644 index 00000000000..63d7c9cc412 --- /dev/null +++ b/build/tfs/win32/2_package.ps1 @@ -0,0 +1,11 @@ +Param( + [string]$arch +) + +. .\build\tfs\win32\lib.ps1 + +step "Create archive and setup package" { + exec { & npm run gulp -- --max_old_space_size=4096 "vscode-win32-$global:arch-archive" "vscode-win32-$global:arch-setup" } +} + +done \ No newline at end of file diff --git a/build/tfs/win32/3_upload.ps1 b/build/tfs/win32/3_upload.ps1 new file mode 100644 index 00000000000..f430e0d8c94 --- /dev/null +++ b/build/tfs/win32/3_upload.ps1 @@ -0,0 +1,36 @@ +Param( + [string]$arch, + [string]$storageKey, + [string]$mooncakeStorageKey, + [string]$documentDbKey +) + +. .\build\tfs\win32\lib.ps1 + +$Repo = "$(pwd)" +$Root = "$Repo\.." +$Exe = "$Repo\.build\win32-$arch\setup\VSCodeSetup.exe" +$Zip = "$Repo\.build\win32-$arch\archive\VSCode-win32-$arch.zip" +$Build = "$Root\VSCode-win32-$arch" + +# get version +$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json +$Version = $PackageJson.version +$Quality = "$env:VSCODE_QUALITY" +$env:AZURE_STORAGE_ACCESS_KEY_2 = $storageKey +$env:MOONCAKE_STORAGE_ACCESS_KEY = $mooncakeStorageKey +$env:AZURE_DOCUMENTDB_MASTERKEY = $documentDbKey + +$assetPlatform = if ($arch -eq "ia32") { "win32" } else { "win32-x64" } + +step "Publish archive" { + exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$global:arch-$Version.zip" $Version true $Zip } +} + +if ($arch -eq "ia32") { + step "Publish setup package" { + exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$global:arch-$Version.exe" $Version true $Exe } + } +} + +done \ No newline at end of file diff --git a/build/tfs/win32/lib.ps1 b/build/tfs/win32/lib.ps1 new file mode 100644 index 00000000000..610b4d7fcdf --- /dev/null +++ b/build/tfs/win32/lib.ps1 @@ -0,0 +1,42 @@ +# stop when there's an error +$ErrorActionPreference = 'Stop' + +# set agent specific npm cache +if (Test-Path env:AGENT_WORKFOLDER) { + $env:npm_config_cache = "${env:AGENT_WORKFOLDER}\npm-cache" +} + +# throw when a process exits with something other than 0 +function exec([scriptblock]$cmd, [string]$errorMessage = "Error executing command: " + $cmd) { + & $cmd + if ($LastExitCode -ne 0) { + throw $errorMessage + } +} + +$Summary = @() +function step($Task, $Step) { + echo "" + echo "*****************************************************************************" + echo "Start: $Task" + echo "*****************************************************************************" + echo "" + + $Stopwatch = [Diagnostics.Stopwatch]::StartNew() + Invoke-Command $Step + $Stopwatch.Stop() + $Formatted = "{0:g}" -f $Stopwatch.Elapsed + + echo "*****************************************************************************" + echo "End: $Task, Total: $Formatted" + echo "*****************************************************************************" + + $global:Summary += @{ "$Task" = $Formatted } +} + +function done() { + echo "" + echo "Build Summary" + echo "=============" + $global:Summary | Format-Table @{L="Task";E={$_.Name}}, @{L="Duration";E={$_.Value}} +} \ No newline at end of file diff --git a/build/tsconfig.json b/build/tsconfig.json index 59a73844e14..04f3963055d 100644 --- a/build/tsconfig.json +++ b/build/tsconfig.json @@ -1,13 +1,15 @@ { "compilerOptions": { + "target": "es5", "module": "commonjs", "noImplicitAny": false, "removeComments": false, "preserveConstEnums": true, - "target": "es5", "sourceMap": false, "experimentalDecorators": true, - "noLib": true, "newLine": "LF" - } + }, + "exclude": [ + "node_modules/**" + ] } \ No newline at end of file diff --git a/build/tslint.json b/build/tslint.json new file mode 100644 index 00000000000..e269a87c0e6 --- /dev/null +++ b/build/tslint.json @@ -0,0 +1,13 @@ +{ + "rules": { + "no-unused-expression": true, + "no-duplicate-variable": true, + "no-unused-variable": true, + "curly": true, + "class-name": true, + "semicolon": [ + "always" + ], + "triple-equals": true + } +} \ No newline at end of file diff --git a/build/win32/code.iss b/build/win32/code.iss index 1eb3241d9f4..b7988b383cc 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -14,7 +14,7 @@ AppUpdatesURL=https://code.visualstudio.com/ DefaultDirName={pf}\{#DirName} DefaultGroupName={#NameLong} AllowNoIcons=yes -OutputDir={#RepoDir}\.build\win32\setup +OutputDir={#OutputDir} OutputBaseFilename=VSCodeSetup Compression=lzma SolidCompression=yes @@ -770,6 +770,10 @@ Root: HKCR; Subkey: "{#RegValueName}SourceFile"; ValueType: string; ValueName: " Root: HKCR; Subkey: "{#RegValueName}SourceFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico" Root: HKCR; Subkey: "{#RegValueName}SourceFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1""" +Root: HKCR; Subkey: "Applications\{#ExeBasename}.exe"; ValueType: none; ValueName: ""; Flags: uninsdeletekey +Root: HKCR; Subkey: "Applications\{#ExeBasename}.exe\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico" +Root: HKCR; Subkey: "Applications\{#ExeBasename}.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1""" + Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}\bin')) Root: HKCU; Subkey: "SOFTWARE\Classes\*\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "Open with {#ShellNameShort}"; Tasks: addcontextmenufiles; Flags: uninsdeletekey diff --git a/build/win32/i18n/messages.pt-br.isl b/build/win32/i18n/messages.pt-br.isl new file mode 100644 index 00000000000..7021e814e8f --- /dev/null +++ b/build/win32/i18n/messages.pt-br.isl @@ -0,0 +1,8 @@ +[CustomMessages] +AddContextMenuFiles=Adicione a ação "Abrir com %1" ao menu de contexto de arquivo do Windows Explorer +AddContextMenuFolders=Adicione a ação "Abrir com %1" ao menu de contexto de diretório do Windows Explorer +AssociateWithFiles=Registre %1 como um editor para tipos de arquivos suportados +AddToPath=Adicione em PATH (disponível após reiniciar) +RunAfter=Executar %1 após a instalação +Other=Outros: +SourceFile=Arquivo Fonte %1 \ No newline at end of file diff --git a/extensions/bat/syntaxes/Batch File.tmLanguage b/extensions/bat/syntaxes/Batch File.tmLanguage index 49909636404..7f0a1061423 100644 --- a/extensions/bat/syntaxes/Batch File.tmLanguage +++ b/extensions/bat/syntaxes/Batch File.tmLanguage @@ -68,20 +68,6 @@ match (?i)(%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?\d - - captures - - 1 - - name - variable.parameter.loop.begin.shell - - - name - variable.parameter.loop.dosbatch - match - (?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z] - captures @@ -99,7 +85,21 @@ name variable.other.parsetime.dosbatch match - (%)[^%]+(%) + (%)[^%]+(%)|(%%)[^%]+(%%) + + + captures + + 1 + + name + variable.parameter.loop.begin.shell + + + name + variable.parameter.loop.dosbatch + match + (?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z] captures diff --git a/extensions/bat/test/colorize-fixtures/test.bat b/extensions/bat/test/colorize-fixtures/test.bat index f5ae5d25119..3e215fc5efc 100644 --- a/extensions/bat/test/colorize-fixtures/test.bat +++ b/extensions/bat/test/colorize-fixtures/test.bat @@ -16,13 +16,9 @@ if not exist out node .\node_modules\gulp\bin\gulp.js compile :: Configuration set NODE_ENV=development -set VSCODE_DEV=1 -set ELECTRON_DEFAULT_ERROR_MODE=1 -set ELECTRON_ENABLE_LOGGING=1 -set ELECTRON_ENABLE_STACK_DUMPING=1 -:: Launch Code -.\.build\electron\electron.exe . %* +call echo %%LINE:rem +=%% + popd endlocal \ No newline at end of file diff --git a/extensions/bat/test/colorize-results/test_bat.json b/extensions/bat/test/colorize-results/test_bat.json index f69d64df672..d0f381fc7f3 100644 --- a/extensions/bat/test/colorize-results/test_bat.json +++ b/extensions/bat/test/colorize-results/test_bat.json @@ -95,7 +95,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -139,7 +139,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -161,7 +161,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -216,7 +216,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -264,7 +264,29 @@ } }, { - "c": "set", + "c": "call", + "t": "source.dosbatch keyword.control.statement.dosbatch", + "r": { + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" + } + }, + { + "c": " ", + "t": "source.dosbatch", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "echo", "t": "source.dosbatch keyword.command.dosbatch", "r": { "dark_plus": "keyword: #569CD6", @@ -275,7 +297,7 @@ } }, { - "c": " VSCODE_DEV=1", + "c": " ", "t": "source.dosbatch", "r": { "dark_plus": "default: #D4D4D4", @@ -286,91 +308,14 @@ } }, { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", + "c": "%%LINE:rem +=%%", + "t": "source.dosbatch variable.other.parsetime.dosbatch", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " ELECTRON_DEFAULT_ERROR_MODE=1", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", - "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " ELECTRON_ENABLE_LOGGING=1", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", - "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " ELECTRON_ENABLE_STACK_DUMPING=1", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": ":: Launch Code", - "t": "source.dosbatch comment.line.colons.dosbatch", - "r": { - "dark_plus": "comment: #608B4E", - "light_plus": "comment: #008000", - "dark_vs": "comment: #608B4E", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" - } - }, - { - "c": ".\\.build\\electron\\electron.exe . %*", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/clojure/syntaxes/clojure.tmLanguage.json b/extensions/clojure/syntaxes/clojure.tmLanguage.json index 9f130767d07..437a0c5b5e1 100644 --- a/extensions/clojure/syntaxes/clojure.tmLanguage.json +++ b/extensions/clojure/syntaxes/clojure.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.clojure", "fileTypes": [ "boot", @@ -64,14 +69,11 @@ }, { "include": "#symbol" - }, - { - "include": "#whitespace" } ], "repository": { "comment": { - "begin": ";", + "begin": "(? updateLaunchJsonDecorations(editor), null, context.subscriptions)); context.subscriptions.push(vscode.workspace.onDidChangeTextDocument(event => { @@ -61,11 +64,34 @@ function registerSettingsCompletions(): vscode.Disposable { }); } -function newSimpleCompletionItem(text: string, range: vscode.Range, description?: string): vscode.CompletionItem { +function registerExtensionsCompletions(): vscode.Disposable { + return vscode.languages.registerCompletionItemProvider({ pattern: '**/extensions.json' }, { + provideCompletionItems(document, position, token) { + const location = getLocation(document.getText(), document.offsetAt(position)); + const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position); + if (location.path[0] === 'recommendations') { + const config = parse(document.getText()); + const alreadyEnteredExtensions = config && config.recommendations || []; + if (Array.isArray(alreadyEnteredExtensions)) { + return vscode.extensions.all + .filter(e => !( + e.id.startsWith('vscode.') + || e.id === 'Microsoft.vscode-markdown' + || alreadyEnteredExtensions.indexOf(e.id) > -1 + )) + .map(e => newSimpleCompletionItem(e.id, range, undefined, '"' + e.id + '"')); + } + } + return []; + } + }); +} + +function newSimpleCompletionItem(text: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem { const item = new vscode.CompletionItem(text); item.kind = vscode.CompletionItemKind.Value; item.detail = description; - item.insertText = text; + item.insertText = insertText || text; item.range = range; return item; diff --git a/extensions/configuration-editing/tsconfig.json b/extensions/configuration-editing/tsconfig.json index 3fd4b7cd117..6971f531b11 100644 --- a/extensions/configuration-editing/tsconfig.json +++ b/extensions/configuration-editing/tsconfig.json @@ -8,7 +8,7 @@ ], "strictNullChecks": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } diff --git a/extensions/cpp/OSSREADME.json b/extensions/cpp/OSSREADME.json index 58859a1b776..5137487d2ed 100644 --- a/extensions/cpp/OSSREADME.json +++ b/extensions/cpp/OSSREADME.json @@ -2,7 +2,7 @@ [ { "name": "atom/language-c", - "version": "0.51.3", + "version": "0.0.0", "license": "MIT", "repositoryURL": "https://github.com/atom/language-c", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." diff --git a/extensions/cpp/syntaxes/c++.json b/extensions/cpp/syntaxes/c++.json index 0d20c95fb60..bc627e3a036 100644 --- a/extensions/cpp/syntaxes/c++.json +++ b/extensions/cpp/syntaxes/c++.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.cpp", "fileTypes": [ "cc", @@ -425,6 +430,9 @@ { "match": "\\\\x\\h+", "name": "constant.character.escape.cpp" + }, + { + "include": "source.c#string_placeholder" } ] }, @@ -454,6 +462,5 @@ } ] } - }, - "version": "https://github.com/atom/language-c/commit/a74c2f967d73e802a67fa6e971a8e8dedf076597" + } } \ No newline at end of file diff --git a/extensions/cpp/syntaxes/c.json b/extensions/cpp/syntaxes/c.json index 6cc84cff24d..b83b31ad22e 100644 --- a/extensions/cpp/syntaxes/c.json +++ b/extensions/cpp/syntaxes/c.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.c", "fileTypes": [ "c", @@ -773,7 +778,7 @@ }, "patterns": [ { - "begin": "\\G", + "begin": "\\G(?=.)", "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?)( .*)?)|((\\+).*))$\\n?", + "name": "markup.inserted.diff" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.changed.diff" + } + }, + "match": "^(!).*$\\n?", + "name": "markup.changed.diff" + }, + { + "captures": { + "3": { + "name": "punctuation.definition.deleted.diff" + }, + "6": { + "name": "punctuation.definition.deleted.diff" + } + }, + "match": "^(((<)( .*)?)|((-).*))$\\n?", + "name": "markup.deleted.diff" + }, + { + "begin": "^(#)", + "captures": { + "1": { + "name": "punctuation.definition.comment.diff" + } + }, + "comment": "Git produces unified diffs with embedded comments\"", + "end": "\\n", + "name": "comment.line.number-sign.diff" + }, + { + "match": "^index [0-9a-f]{7,40}\\.\\.[0-9a-f]{7,40}.*$\\n?", + "name": "meta.diff.index.git" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.diff" + }, + "2": { + "name": "meta.toc-list.file-name.diff" + } + }, + "match": "^Index(:) (.+)$\\n?", + "name": "meta.diff.index" + }, + { + "match": "^Only in .*: .*$\\n?", + "name": "meta.diff.only-in" + } + ], + "scopeName": "source.diff", + "uuid": "7E848FF4-708E-11D9-97B4-0011242E4184" +} \ No newline at end of file diff --git a/extensions/diff/test/colorize-results/test_diff.json b/extensions/diff/test/colorize-results/test_diff.json index 5329bcae5c0..26ab2f4fb03 100644 --- a/extensions/diff/test/colorize-results/test_diff.json +++ b/extensions/diff/test/colorize-results/test_diff.json @@ -100,7 +100,7 @@ }, { "c": "-", - "t": "source.diff markup.deleted.diff punctuation.definition.inserted.diff", + "t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff", "r": { "dark_plus": "markup.deleted: #CE9178", "light_plus": "markup.deleted: #A31515", @@ -122,7 +122,7 @@ }, { "c": "-", - "t": "source.diff markup.deleted.diff punctuation.definition.inserted.diff", + "t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff", "r": { "dark_plus": "markup.deleted: #CE9178", "light_plus": "markup.deleted: #A31515", @@ -155,7 +155,7 @@ }, { "c": "-", - "t": "source.diff markup.deleted.diff punctuation.definition.inserted.diff", + "t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff", "r": { "dark_plus": "markup.deleted: #CE9178", "light_plus": "markup.deleted: #A31515", diff --git a/extensions/docker/package.json b/extensions/docker/package.json index 0da40007bc6..e58f0826419 100644 --- a/extensions/docker/package.json +++ b/extensions/docker/package.json @@ -4,7 +4,7 @@ "publisher": "vscode", "engines": { "vscode": "*" }, "scripts": { - "update-grammar": "node ../../build/npm/update-grammar.js docker/docker contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json" + "update-grammar": "node ../../build/npm/update-grammar.js moby/moby contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json" }, "contributes": { "languages": [{ diff --git a/extensions/docker/syntaxes/docker.tmLanguage.json b/extensions/docker/syntaxes/docker.tmLanguage.json index 6ca5dc67b08..d8c2d0fd766 100644 --- a/extensions/docker/syntaxes/docker.tmLanguage.json +++ b/extensions/docker/syntaxes/docker.tmLanguage.json @@ -1,9 +1,25 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/moby/moby/blob/master/contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "Dockerfile" ], "name": "Dockerfile", "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.special-method.dockerfile" + }, + "2": { + "name": "keyword.other.special-method.dockerfile" + } + }, + "match": "^\\s*\\b(FROM)\\b.*?\\b(AS)\\b" + }, { "captures": { "1": { @@ -85,6 +101,5 @@ } ], "scopeName": "source.dockerfile", - "uuid": "a39d8795-59d2-49af-aa00-fe74ee29576e", - "version": "https://github.com/moby/moby/commit/4cb71f80823af345d063cf0ad657e73ce9caa75f" + "uuid": "a39d8795-59d2-49af-aa00-fe74ee29576e" } \ No newline at end of file diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json new file mode 100644 index 00000000000..177d7be2cec --- /dev/null +++ b/extensions/emmet/package.json @@ -0,0 +1,70 @@ +{ + "name": "emmet", + "displayName": "emmet", + "description": "Emmet support for VS Code", + "version": "0.0.1", + "publisher": "vscode", + "engines": { + "vscode": "^1.10.0" + }, + "categories": [ + "Other" + ], + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/vscode-emmet" + }, + "activationEvents": [ + "onLanguage:html", + "onLanguage:jade", + "onLanguage:slim", + "onLanguage:haml", + "onLanguage:xml", + "onLanguage:xsl", + "onLanguage:css", + "onLanguage:scss", + "onLanguage:sass", + "onLanguage:less", + "onLanguage:stylus", + "onLanguage:javascriptreact", + "onLanguage:typescriptreact" + ], + "main": "./out/extension", + "contributes": { + "configuration": { + "type": "object", + "title": "Emmet configuration", + "properties": { + "emmet.suggestExpandedAbbreviation": { + "type": "boolean", + "default": true, + "description": "Shows expanded emmet abbreviations as suggestions" + }, + "emmet.suggestAbbreviations": { + "type": "boolean", + "default": true, + "description": "Shows possible emmet abbreviations as suggestions" + } + } + } + }, + "scripts": { + "vscode:prepublish": "tsc -p ./", + "compile": "tsc -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "node ./node_modules/vscode/bin/test" + }, + "devDependencies": { + "typescript": "^2.0.3", + "vscode": "^1.0.0", + "mocha": "^2.3.3", + "@types/node": "^6.0.40", + "@types/mocha": "^2.2.32" + }, + "dependencies": { + "@emmetio/expand-abbreviation": "^0.5.4", + "@emmetio/extract-abbreviation": "^0.1.1", + "@emmetio/html-matcher": "^0.3.1", + "@emmetio/css-parser": "^0.3.0" + } +} \ No newline at end of file diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts new file mode 100644 index 00000000000..c95bfed3211 --- /dev/null +++ b/extensions/emmet/src/abbreviationActions.ts @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { expand } from '@emmetio/expand-abbreviation'; +import { getSyntax, getProfile, extractAbbreviation } from './util'; + +const field = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`; + +export function wrapWithAbbreviation() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + let rangeToReplace: vscode.Range = editor.selection; + if (rangeToReplace.isEmpty) { + rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, editor.document.lineAt(rangeToReplace.start.line).text.length); + } + let textToReplace = editor.document.getText(rangeToReplace); + let options = { + field: field, + syntax: getSyntax(editor.document), + profile: getProfile(getSyntax(editor.document)), + text: textToReplace + }; + + vscode.window.showInputBox({ prompt: 'Enter Abbreviation' }).then(abbr => { + if (!abbr || !abbr.trim()) { return; } + let expandedText = expand(abbr, options); + editor.insertSnippet(new vscode.SnippetString(expandedText), rangeToReplace); + }); +} + +export function expandAbbreviation() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + let rangeToReplace: vscode.Range = editor.selection; + let abbr = editor.document.getText(rangeToReplace); + if (rangeToReplace.isEmpty) { + [rangeToReplace, abbr] = extractAbbreviation(rangeToReplace.start); + } + + let options = { + field: field, + syntax: getSyntax(editor.document), + profile: getProfile(getSyntax(editor.document)) + }; + + let expandedText = expand(abbr, options); + editor.insertSnippet(new vscode.SnippetString(expandedText), rangeToReplace); +} \ No newline at end of file diff --git a/extensions/emmet/src/balance.ts b/extensions/emmet/src/balance.ts new file mode 100644 index 00000000000..02dd4c902d1 --- /dev/null +++ b/extensions/emmet/src/balance.ts @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode, getNodeOuterSelection, getNodeInnerSelection, isStyleSheet } from './util'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function balanceOut() { + balance(true); +} + +export function balanceIn() { + balance(false); +} + +function balance(out: boolean) { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + if (isStyleSheet(editor.document.languageId)) { + return; + } + let getRangeFunction = out ? getRangeToBalanceOut : getRangeToBalanceIn; + + let rootNode: Node = parse(editor.document.getText()); + + let newSelections: vscode.Selection[] = []; + editor.selections.forEach(selection => { + let range = getRangeFunction(editor.document, selection, rootNode); + if (range) { + newSelections.push(range); + } + }); + + editor.selection = newSelections[0]; + editor.selections = newSelections; +} + +function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): vscode.Selection { + let offset = document.offsetAt(selection.start); + let nodeToBalance = getNode(rootNode, offset); + + let innerSelection = getNodeInnerSelection(document, nodeToBalance); + let outerSelection = getNodeOuterSelection(document, nodeToBalance); + + if (innerSelection.contains(selection) && !innerSelection.isEqual(selection)) { + return innerSelection; + } + if (outerSelection.contains(selection) && !outerSelection.isEqual(selection)) { + return outerSelection; + } + return; +} + +function getRangeToBalanceIn(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): vscode.Selection { + let offset = document.offsetAt(selection.start); + let nodeToBalance: Node = getNode(rootNode, offset); + + if (!nodeToBalance.firstChild) { + return selection; + } + + if (nodeToBalance.firstChild.start === offset && nodeToBalance.firstChild.end === document.offsetAt(selection.end)) { + return getNodeInnerSelection(document, nodeToBalance.firstChild); + } + + return new vscode.Selection(document.positionAt(nodeToBalance.firstChild.start), document.positionAt(nodeToBalance.firstChild.end)); + +} + diff --git a/extensions/emmet/src/editPoint.ts b/extensions/emmet/src/editPoint.ts new file mode 100644 index 00000000000..757dad1b16a --- /dev/null +++ b/extensions/emmet/src/editPoint.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { validate } from './util'; + +export function fetchEditPoint(direction: string): void { + let editor = vscode.window.activeTextEditor; + if (!validate()) { + return; + } + + let newSelections: vscode.Selection[] = []; + editor.selections.forEach(selection => { + let updatedSelection = direction === 'next' ? nextEditPoint(selection.anchor, editor) : prevEditPoint(selection.anchor, editor); + newSelections.push(updatedSelection); + }); + editor.selections = newSelections; +} + +function nextEditPoint(position: vscode.Position, editor: vscode.TextEditor): vscode.Selection { + for (let lineNum = position.line; lineNum < editor.document.lineCount; lineNum++) { + let updatedSelection = findEditPoint(lineNum, editor, position, 'next'); + if (updatedSelection) { + return updatedSelection; + } + } +} + +function prevEditPoint(position: vscode.Position, editor: vscode.TextEditor): vscode.Selection { + for (let lineNum = position.line; lineNum >= 0; lineNum--) { + let updatedSelection = findEditPoint(lineNum, editor, position, 'prev'); + if (updatedSelection) { + return updatedSelection; + } + } +} + + +function findEditPoint(lineNum: number, editor: vscode.TextEditor, position: vscode.Position, direction: string): vscode.Selection { + let line = editor.document.lineAt(lineNum); + + if (lineNum !== position.line && line.isEmptyOrWhitespace) { + editor.selection = new vscode.Selection(lineNum, 0, lineNum, 0); + return; + } + + let lineContent = line.text; + if (lineNum === position.line && direction === 'prev') { + lineContent = lineContent.substr(0, position.character); + } + let emptyAttrIndex = direction === 'next' ? lineContent.indexOf('""', lineNum === position.line ? position.character : 0) : lineContent.lastIndexOf('""'); + let emptyTagIndex = direction === 'next' ? lineContent.indexOf('><', lineNum === position.line ? position.character : 0) : lineContent.lastIndexOf('><'); + + let winner = -1; + + if (emptyAttrIndex > -1 && emptyTagIndex > -1) { + winner = direction === 'next' ? Math.min(emptyAttrIndex, emptyTagIndex) : Math.max(emptyAttrIndex, emptyTagIndex); + } else if (emptyAttrIndex > -1) { + winner = emptyAttrIndex; + } else { + winner = emptyTagIndex; + } + + if (winner > -1) { + return new vscode.Selection(lineNum, winner + 1, lineNum, winner + 1); + } +} diff --git a/extensions/emmet/src/emmetCompletionProvider.ts b/extensions/emmet/src/emmetCompletionProvider.ts new file mode 100644 index 00000000000..9fb7bf46af5 --- /dev/null +++ b/extensions/emmet/src/emmetCompletionProvider.ts @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +import * as vscode from 'vscode'; +import { expand, createSnippetsRegistry } from '@emmetio/expand-abbreviation'; +import { getSyntax, isStyleSheet, getProfile, extractAbbreviation } from './util'; + +const field = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`; +const snippetCompletionsCache = new Map(); + +export class EmmetCompletionItemProvider implements vscode.CompletionItemProvider { + + public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable { + + if (!vscode.workspace.getConfiguration('emmet')['useModules']) { + return Promise.resolve(null); + } + + let currentWord = getCurrentWord(document, position); + let expandedAbbr = getExpandedAbbreviation(document, position); + let abbreviationSuggestions = getAbbreviationSuggestions(getSyntax(document), currentWord, (expandedAbbr && currentWord === expandedAbbr.label)); + let completionItems = expandedAbbr ? [expandedAbbr, ...abbreviationSuggestions] : abbreviationSuggestions; + + return Promise.resolve(new vscode.CompletionList(completionItems, true)); + } +} + +function getExpandedAbbreviation(document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem { + if (!vscode.workspace.getConfiguration('emmet')['suggestExpandedAbbreviation']) { + return; + } + let [rangeToReplace, wordToExpand] = extractAbbreviation(position); + if (!rangeToReplace || !wordToExpand) { + return; + } + let syntax = getSyntax(document); + let expandedWord = expand(wordToExpand, { + field: field, + syntax: syntax, + profile: getProfile(syntax) + }); + + let completionitem = new vscode.CompletionItem(wordToExpand); + completionitem.insertText = new vscode.SnippetString(expandedWord); + completionitem.documentation = removeTabStops(expandedWord); + completionitem.range = rangeToReplace; + completionitem.detail = 'Expand Emmet Abbreviation'; + + // In non stylesheet like syntax, this extension returns expanded abbr plus posssible abbr completions + // To differentiate between the 2, the former is given CompletionItemKind.Value so that it gets a different icon + if (!isStyleSheet(syntax)) { + completionitem.kind = vscode.CompletionItemKind.Value; + } + return completionitem; +} + +function getCurrentWord(document: vscode.TextDocument, position: vscode.Position): string { + let wordAtPosition = document.getWordRangeAtPosition(position); + let currentWord = ''; + if (wordAtPosition && wordAtPosition.start.character < position.character) { + let word = document.getText(wordAtPosition); + currentWord = word.substr(0, position.character - wordAtPosition.start.character); + } + + return currentWord; +} + +function removeTabStops(expandedWord: string): string { + return expandedWord.replace(/\$\{\d+\}/g, '').replace(/\$\{\d+:([^\}]+)\}/g, '$1'); +} +function getAbbreviationSuggestions(syntax: string, prefix: string, skipExactMatch: boolean) { + if (!vscode.workspace.getConfiguration('emmet')['suggestAbbreviations'] || !prefix || isStyleSheet(syntax)) { + return []; + } + + if (!snippetCompletionsCache.has(syntax)) { + let registry = createSnippetsRegistry(syntax); + let completions: vscode.CompletionItem[] = registry.all({ type: 'string' }).map(snippet => { + let expandedWord = expand(snippet.value, { + field: field, + syntax: syntax + }); + + let item = new vscode.CompletionItem(snippet.key); + item.documentation = removeTabStops(expandedWord); + item.detail = 'Complete Emmet Abbreviation'; + item.insertText = snippet.key; + return item; + }); + snippetCompletionsCache.set(syntax, completions); + } + + let snippetCompletions = snippetCompletionsCache.get(syntax); + + snippetCompletions = snippetCompletions.filter(x => x.label.startsWith(prefix) && (!skipExactMatch || x.label !== prefix)); + + return snippetCompletions; + +} + + + diff --git a/extensions/emmet/src/extension.ts b/extensions/emmet/src/extension.ts new file mode 100644 index 00000000000..15a1bfa4a03 --- /dev/null +++ b/extensions/emmet/src/extension.ts @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { EmmetCompletionItemProvider } from './emmetCompletionProvider'; +import { expandAbbreviation, wrapWithAbbreviation } from './abbreviationActions'; +import { removeTag } from './removeTag'; +import { updateTag } from './updateTag'; +import { matchTag } from './matchTag'; +import { balanceOut, balanceIn } from './balance'; +import { splitJoinTag } from './splitJoinTag'; +import { mergeLines } from './mergeLines'; +import { toggleComment } from './toggleComment'; +import { fetchEditPoint } from './editPoint'; +import { fetchSelectItem } from './selectItem'; + +interface ISupportedLanguageMode { + id: string; + triggerCharacters: string[]; +} + +const SUPPORTED_LANGUAGE_MODES: ISupportedLanguageMode[] = [ + { id: 'html', triggerCharacters: ['!', '.'] }, + { id: 'jade', triggerCharacters: ['!', '.'] }, + { id: 'slim', triggerCharacters: ['!', '.'] }, + { id: 'haml', triggerCharacters: ['!', '.'] }, + { id: 'xml', triggerCharacters: ['.'] }, + { id: 'xsl', triggerCharacters: ['.'] }, + + { id: 'css', triggerCharacters: [':'] }, + { id: 'scss', triggerCharacters: [':'] }, + { id: 'sass', triggerCharacters: [':'] }, + { id: 'less', triggerCharacters: [':'] }, + { id: 'stylus', triggerCharacters: [':'] }, + + { id: 'javascriptreact', triggerCharacters: ['.'] }, + { id: 'typescriptreact', triggerCharacters: ['.'] } +]; + +export function activate(context: vscode.ExtensionContext) { + let completionProvider = new EmmetCompletionItemProvider(); + + for (let language of SUPPORTED_LANGUAGE_MODES) { + const selector: vscode.DocumentFilter = { language: language.id, scheme: 'file' }; + const provider = vscode.languages.registerCompletionItemProvider(selector, completionProvider, ...language.triggerCharacters); + + context.subscriptions.push(provider); + } + + context.subscriptions.push(vscode.commands.registerCommand('emmet.wrapWithAbbreviation', () => { + wrapWithAbbreviation(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.expandAbbreviation', () => { + expandAbbreviation(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.removeTag', () => { + removeTag(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.updateTag', () => { + vscode.window.showInputBox({ prompt: 'Enter Tag' }).then(tagName => { + updateTag(tagName); + }); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.matchTag', () => { + matchTag(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.balanceOut', () => { + balanceOut(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.balanceIn', () => { + balanceIn(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.splitJoinTag', () => { + splitJoinTag(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.mergeLines', () => { + mergeLines(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.toggleComment', () => { + toggleComment(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.nextEditPoint', () => { + fetchEditPoint('next'); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.prevEditPoint', () => { + fetchEditPoint('prev'); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.selectNextItem', () => { + fetchSelectItem('next'); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.selectPrevItem', () => { + fetchSelectItem('prev'); + })); + +} + +export function deactivate() { +} diff --git a/extensions/emmet/src/matchTag.ts b/extensions/emmet/src/matchTag.ts new file mode 100644 index 00000000000..e5efc2d8e32 --- /dev/null +++ b/extensions/emmet/src/matchTag.ts @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode } from './util'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function matchTag() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + + let rootNode: Node = parse(editor.document.getText()); + let updatedSelections = []; + editor.selections.forEach(selection => { + let updatedSelection = getUpdatedSelections(editor, editor.document.offsetAt(selection.start), rootNode); + if (updatedSelection) { + updatedSelections.push(updatedSelection); + } + }); + if (updatedSelections.length > 0) { + editor.selections = updatedSelections; + } +} + +function getUpdatedSelections(editor: vscode.TextEditor, offset: number, rootNode: Node): vscode.Selection { + let currentNode = getNode(rootNode, offset); + + // If no closing tag or cursor is between open and close tag, then no-op + if (!currentNode.close || (currentNode.open.end < offset && currentNode.close.start > offset)) { + return; + } + + if (offset <= currentNode.open.end) { + let matchingPosition = editor.document.positionAt(currentNode.close.start); + return new vscode.Selection(matchingPosition, matchingPosition); + } else { + let matchingPosition = editor.document.positionAt(currentNode.open.start); + return new vscode.Selection(matchingPosition, matchingPosition); + } + +} + + diff --git a/extensions/emmet/src/mergeLines.ts b/extensions/emmet/src/mergeLines.ts new file mode 100644 index 00000000000..fd63a2d36d4 --- /dev/null +++ b/extensions/emmet/src/mergeLines.ts @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { isStyleSheet, getNode } from './util'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function mergeLines() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + if (isStyleSheet(editor.document.languageId)) { + return; + } + + let rootNode: Node = parse(editor.document.getText()); + + editor.edit(editBuilder => { + editor.selections.reverse().forEach(selection => { + let [rangeToReplace, textToReplaceWith] = getRangesToReplace(editor.document, selection, rootNode); + editBuilder.replace(rangeToReplace, textToReplaceWith); + }); + }); +} + +function getRangesToReplace(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range, string] { + let startNodeToUpdate: Node; + let endNodeToUpdate: Node; + + if (selection.isEmpty) { + startNodeToUpdate = endNodeToUpdate = getNode(rootNode, document.offsetAt(selection.start)); + } else { + startNodeToUpdate = getNode(rootNode, document.offsetAt(selection.start), true); + endNodeToUpdate = getNode(rootNode, document.offsetAt(selection.end), true); + } + + let rangeToReplace = new vscode.Range(document.positionAt(startNodeToUpdate.start), document.positionAt(endNodeToUpdate.end)); + let textToReplaceWith = document.getText(rangeToReplace).replace(/\r\n|\n/g, '').replace(/>\s*<'); + + return [rangeToReplace, textToReplaceWith]; +} \ No newline at end of file diff --git a/extensions/emmet/src/removeTag.ts b/extensions/emmet/src/removeTag.ts new file mode 100644 index 00000000000..600557fd7a1 --- /dev/null +++ b/extensions/emmet/src/removeTag.ts @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getOpenCloseRange } from './util'; + +export function removeTag() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + + let indentInSpaces = ''; + for (let i = 0; i < editor.options.tabSize; i++) { + indentInSpaces += ' '; + } + + let rangesToRemove = []; + editor.selections.reverse().forEach(selection => { + rangesToRemove = rangesToRemove.concat(getRangeToRemove(editor, selection, indentInSpaces)); + }); + + editor.edit(editBuilder => { + rangesToRemove.forEach(range => { + editBuilder.replace(range, ''); + }); + }); +} + +function getRangeToRemove(editor: vscode.TextEditor, selection: vscode.Selection, indentInSpaces: string): vscode.Range[] { + let offset = editor.document.offsetAt(selection.start); + let [openRange, closeRange] = getOpenCloseRange(editor.document, offset); + if (!openRange.contains(selection.start) && !closeRange.contains(selection.start)) { + return []; + } + let ranges = [openRange]; + if (closeRange) { + for (let i = openRange.start.line + 1; i <= closeRange.start.line; i++) { + let lineContent = editor.document.lineAt(i).text; + if (lineContent.startsWith('\t')) { + ranges.push(new vscode.Range(i, 0, i, 1)); + } else if (lineContent.startsWith(indentInSpaces)) { + ranges.push(new vscode.Range(i, 0, i, indentInSpaces.length)); + } + } + ranges.push(closeRange); + } + return ranges; +} + + diff --git a/extensions/emmet/src/selectItem.ts b/extensions/emmet/src/selectItem.ts new file mode 100644 index 00000000000..b479c0ca74c --- /dev/null +++ b/extensions/emmet/src/selectItem.ts @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { validate, isStyleSheet } from './util'; +import { nextItemHTML, prevItemHTML } from './selectItemHTML'; +import { nextItemStylesheet, prevItemStylesheet } from './selectItemStylesheet'; +import parseStylesheet from '@emmetio/css-parser'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function fetchSelectItem(direction: string): void { + let editor = vscode.window.activeTextEditor; + if (!validate()) { + return; + } + + let nextItem; + let prevItem; + let parseContent; + + if (isStyleSheet(editor.document.languageId)) { + nextItem = nextItemStylesheet; + prevItem = prevItemStylesheet; + parseContent = parseStylesheet; + } else { + nextItem = nextItemHTML; + prevItem = prevItemHTML; + parseContent = parse; + } + + let rootNode: Node = parseContent(editor.document.getText()); + let newSelections: vscode.Selection[] = []; + editor.selections.forEach(selection => { + let updatedSelection = direction === 'next' ? nextItem(selection, editor, rootNode) : prevItem(selection, editor, rootNode); + newSelections.push(updatedSelection ? updatedSelection : selection); + }); + editor.selections = newSelections; +} \ No newline at end of file diff --git a/extensions/emmet/src/selectItemHTML.ts b/extensions/emmet/src/selectItemHTML.ts new file mode 100644 index 00000000000..2c0be704ead --- /dev/null +++ b/extensions/emmet/src/selectItemHTML.ts @@ -0,0 +1,181 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode, getDeepestNode, findNextWord, findPrevWord } from './util'; +import Node from '@emmetio/node'; + +export function nextItemHTML(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let offset = editor.document.offsetAt(selection.active); + let currentNode = getNode(rootNode, offset); + + // Cursor is in the open tag, look for attributes + if (offset < currentNode.open.end) { + let attrSelection = getNextAttribute(selection, editor.document, currentNode); + if (attrSelection) { + return attrSelection; + } + } + + // Get the first child of current node which is right after the cursor + let nextNode = currentNode.firstChild; + while (nextNode && nextNode.start < offset) { + nextNode = nextNode.nextSibling; + } + + // Get next sibling of current node or the parent + while (!nextNode && currentNode) { + nextNode = currentNode.nextSibling; + currentNode = currentNode.parent; + } + + return getSelectionFromNode(nextNode, editor.document); +} + +export function prevItemHTML(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let offset = editor.document.offsetAt(selection.active); + let currentNode = getNode(rootNode, offset); + let prevNode: Node; + + // Cursor is in the open tag after the tag name + if (offset > currentNode.open.start + currentNode.name.length + 1 && offset <= currentNode.open.end) { + prevNode = currentNode; + } + + // Cursor is inside the tag + if (!prevNode && offset > currentNode.open.end) { + if (!currentNode.firstChild) { + // No children, so current node should be selected + prevNode = currentNode; + } else { + // Select the child that appears just before the cursor + prevNode = currentNode.firstChild; + while (prevNode.nextSibling && prevNode.nextSibling.end < offset) { + prevNode = prevNode.nextSibling; + } + if (prevNode) { + prevNode = getDeepestNode(prevNode); + } + } + } + + if (!prevNode && currentNode.previousSibling) { + prevNode = getDeepestNode(currentNode.previousSibling); + } + + if (!prevNode && currentNode.parent) { + prevNode = currentNode.parent; + } + + let attrSelection = getPrevAttribute(selection, editor.document, prevNode); + return attrSelection ? attrSelection : getSelectionFromNode(prevNode, editor.document); +} + +function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection { + if (node && node.open) { + let selectionStart = document.positionAt(node.open.start + 1); + let selectionEnd = node.type === 'comment' ? document.positionAt(node.open.end - 1) : selectionStart.translate(0, node.name.length); + + return new vscode.Selection(selectionStart, selectionEnd); + } +} + +function getNextAttribute(selection: vscode.Selection, document: vscode.TextDocument, node: Node): vscode.Selection { + + if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') { + return; + } + + let selectionStart = document.offsetAt(selection.anchor); + let selectionEnd = document.offsetAt(selection.active); + + for (let i = 0; i < node.attributes.length; i++) { + let attr = node.attributes[i]; + + if (selectionEnd < attr.start) { + // select full attr + return new vscode.Selection(document.positionAt(attr.start), document.positionAt(attr.end)); + } + + if (attr.value.start === attr.value.end) { + // No attr value to select + continue; + } + + if ((selectionStart === attr.start && selectionEnd === attr.end) || selectionEnd < attr.value.start) { + // cursor is in attr name, so select full attr value + return new vscode.Selection(document.positionAt(attr.value.start), document.positionAt(attr.value.end)); + } + + // Fetch the next word in the attr value + + if (attr.value.toString().indexOf(' ') === -1) { + // attr value does not have space, so no next word to find + continue; + } + + let pos = undefined; + if (selectionStart === attr.value.start && selectionEnd === attr.value.end) { + pos = -1; + } + if (pos === undefined && selectionEnd < attr.end) { + pos = selectionEnd - attr.value.start - 1; + } + + if (pos !== undefined) { + let [newSelectionStart, newSelectionEnd] = findNextWord(attr.value.toString(), pos); + if (newSelectionStart >= 0 && newSelectionEnd >= 0) { + newSelectionStart += attr.value.start; + newSelectionEnd += attr.value.start; + return new vscode.Selection(document.positionAt(newSelectionStart), document.positionAt(newSelectionEnd)); + } + } + + } +} + +function getPrevAttribute(selection: vscode.Selection, document: vscode.TextDocument, node: Node): vscode.Selection { + + if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') { + return; + } + + let selectionStart = document.offsetAt(selection.anchor); + let selectionEnd = document.offsetAt(selection.active); + + for (let i = node.attributes.length - 1; i >= 0; i--) { + let attr = node.attributes[i]; + + if (selectionStart <= attr.start) { + continue; + } + + if (attr.value.start === attr.value.end || selectionStart < attr.value.start) { + // select full attr + return new vscode.Selection(document.positionAt(attr.start), document.positionAt(attr.end)); + } + + if (selectionStart === attr.value.start) { + if (selectionEnd >= attr.value.end) { + // select full attr + return new vscode.Selection(document.positionAt(attr.start), document.positionAt(attr.end)); + } + // select attr value + return new vscode.Selection(document.positionAt(attr.value.start), document.positionAt(attr.value.end)); + } + + // Fetch the prev word in the attr value + + let pos = selectionStart > attr.value.end ? attr.value.toString().length : selectionStart - attr.value.start; + let [newSelectionStart, newSelectionEnd] = findPrevWord(attr.value.toString(), pos); + if (newSelectionStart >= 0 && newSelectionEnd >= 0) { + newSelectionStart += attr.value.start; + newSelectionEnd += attr.value.start; + return new vscode.Selection(document.positionAt(newSelectionStart), document.positionAt(newSelectionEnd)); + } + + + } +} \ No newline at end of file diff --git a/extensions/emmet/src/selectItemStylesheet.ts b/extensions/emmet/src/selectItemStylesheet.ts new file mode 100644 index 00000000000..e3144cbf666 --- /dev/null +++ b/extensions/emmet/src/selectItemStylesheet.ts @@ -0,0 +1,137 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode, getDeepestNode, findNextWord, findPrevWord } from './util'; +import Node from '@emmetio/node'; + +export function nextItemStylesheet(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let startOffset = editor.document.offsetAt(selection.anchor); + let endOffset = editor.document.offsetAt(selection.active); + let currentNode = getNode(rootNode, endOffset, true); + + // Full property is selected, so select full property value next + if (currentNode.type === 'property' && startOffset === currentNode.start && endOffset === currentNode.end) { + return getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, true, 'next'); + } + + // Part or whole of propertyValue is selected, so select the next word in the propertyValue + if (currentNode.type === 'property' && startOffset >= currentNode.valueToken.start && endOffset <= currentNode.valueToken.end) { + let singlePropertyValue = getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, false, 'next'); + if (singlePropertyValue) { + return singlePropertyValue; + } + } + + // Cursor is in the selector or in a property + if ((currentNode.type === 'rule' && endOffset < currentNode.selectorToken.end) + || (currentNode.type === 'property' && endOffset < currentNode.valueToken.end)) { + return getSelectionFromNode(currentNode, editor.document); + } + + // Get the first child of current node which is right after the cursor + let nextNode = currentNode.firstChild; + while (nextNode && endOffset >= nextNode.end) { + nextNode = nextNode.nextSibling; + } + + // Get next sibling of current node or the parent + while (!nextNode && currentNode) { + nextNode = currentNode.nextSibling; + currentNode = currentNode.parent; + } + + return getSelectionFromNode(nextNode, editor.document); + +} + +export function prevItemStylesheet(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let startOffset = editor.document.offsetAt(selection.anchor); + let endOffset = editor.document.offsetAt(selection.active); + let currentNode = getNode(rootNode, startOffset); + if (!currentNode) { + currentNode = rootNode; + } + + // Full property value is selected, so select the whole property next + if (currentNode.type === 'property' && startOffset === currentNode.valueToken.start && endOffset === currentNode.valueToken.end) { + return getSelectionFromNode(currentNode, editor.document); + } + + // Part of propertyValue is selected, so select the prev word in the propertyValue + if (currentNode.type === 'property' && startOffset >= currentNode.valueToken.start && endOffset <= currentNode.valueToken.end) { + let singlePropertyValue = getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, false, 'prev'); + if (singlePropertyValue) { + return singlePropertyValue; + } + } + + if (currentNode.type === 'property' || !currentNode.firstChild || (currentNode.type === 'rule' && startOffset <= currentNode.firstChild.start)) { + return getSelectionFromNode(currentNode, editor.document); + } + + // Select the child that appears just before the cursor + let prevNode = currentNode.firstChild; + while (prevNode.nextSibling && prevNode.nextSibling.end <= startOffset) { + prevNode = prevNode.nextSibling; + } + prevNode = getDeepestNode(prevNode); + + return getSelectionFromProperty(prevNode, editor.document, startOffset, endOffset, false, 'prev'); + +} + + +function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection { + if (!node) { + return; + } + + let nodeToSelect = node.type === 'rule' ? node.selectorToken : node; + return new vscode.Selection(document.positionAt(nodeToSelect.start), document.positionAt(nodeToSelect.end)); +} + + +function getSelectionFromProperty(node: Node, document: vscode.TextDocument, selectionStart: number, selectionEnd: number, selectFullValue: boolean, direction: string): vscode.Selection { + if (!node || node.type !== 'property') { + return; + } + + let propertyValue = node.valueToken.stream.substring(node.valueToken.start, node.valueToken.end); + selectFullValue = selectFullValue || (direction === 'prev' && selectionStart === node.valueToken.start && selectionEnd < node.valueToken.end); + + if (selectFullValue) { + return new vscode.Selection(document.positionAt(node.valueToken.start), document.positionAt(node.valueToken.end)); + } + + let pos; + if (direction === 'prev') { + if (selectionStart === node.valueToken.start) { + return; + } + pos = selectionStart > node.valueToken.end ? propertyValue.length : selectionStart - node.valueToken.start; + } + + if (direction === 'next') { + if (selectionEnd === node.valueToken.end && (selectionStart > node.valueToken.start || propertyValue.indexOf(' ') === -1)) { + return; + } + pos = selectionEnd === node.valueToken.end ? -1 : selectionEnd - node.valueToken.start - 1; + } + + + let [newSelectionStart, newSelectionEnd] = direction === 'prev' ? findPrevWord(propertyValue, pos) : findNextWord(propertyValue, pos); + if (!newSelectionStart && !newSelectionEnd) { + return; + } + + newSelectionStart += node.valueToken.start; + newSelectionEnd += node.valueToken.start; + + return new vscode.Selection(document.positionAt(newSelectionStart), document.positionAt(newSelectionEnd)); +} + + + diff --git a/extensions/emmet/src/splitJoinTag.ts b/extensions/emmet/src/splitJoinTag.ts new file mode 100644 index 00000000000..1886ca2472c --- /dev/null +++ b/extensions/emmet/src/splitJoinTag.ts @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { isStyleSheet, getNode } from './util'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function splitJoinTag() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + if (isStyleSheet(editor.document.languageId)) { + return; + } + + let rootNode: Node = parse(editor.document.getText()); + + editor.edit(editBuilder => { + editor.selections.reverse().forEach(selection => { + let [rangeToReplace, textToReplaceWith] = getRangesToReplace(editor.document, selection, rootNode); + editBuilder.replace(rangeToReplace, textToReplaceWith); + }); + }); +} + +function getRangesToReplace(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range, string] { + let offset = document.offsetAt(selection.start); + let nodeToUpdate: Node = getNode(rootNode, offset); + let rangeToReplace: vscode.Range; + let textToReplaceWith: string; + + if (!nodeToUpdate.close) { + // Split Tag + let nodeText = document.getText(new vscode.Range(document.positionAt(nodeToUpdate.start), document.positionAt(nodeToUpdate.end))); + let m = nodeText.match(/(\s*\/)?>$/); + let end = nodeToUpdate.open.end; + let start = m ? end - m[0].length : end; + + rangeToReplace = new vscode.Range(document.positionAt(start), document.positionAt(end)); + textToReplaceWith = `>`; + } else { + // Join Tag + rangeToReplace = new vscode.Range(document.positionAt(nodeToUpdate.open.end - 1), document.positionAt(nodeToUpdate.close.end)); + textToReplaceWith = '/>'; + } + + return [rangeToReplace, textToReplaceWith]; +} \ No newline at end of file diff --git a/extensions/emmet/src/toggleComment.ts b/extensions/emmet/src/toggleComment.ts new file mode 100644 index 00000000000..f87bd831209 --- /dev/null +++ b/extensions/emmet/src/toggleComment.ts @@ -0,0 +1,134 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode, isStyleSheet } from './util'; +import parse from '@emmetio/html-matcher'; +import parseStylesheet from '@emmetio/css-parser'; +import Node from '@emmetio/node'; + + +const startCommentStylesheet = '/*'; +const endCommentStylesheet = '*/'; +const startCommentHTML = ''; + +export function toggleComment() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + + let toggleCommentInternal; + let startComment; + let endComment; + let parseContent; + + if (isStyleSheet(editor.document.languageId)) { + parseContent = parseStylesheet; + toggleCommentInternal = toggleCommentStylesheet; + startComment = startCommentStylesheet; + endComment = endCommentStylesheet; + } else { + parseContent = parse; + toggleCommentInternal = toggleCommentHTML; + startComment = startCommentHTML; + endComment = endCommentHTML; + } + + let rootNode = parseContent(editor.document.getText()); + + editor.edit(editBuilder => { + editor.selections.reverse().forEach(selection => { + let [rangesToUnComment, positionForCommentStart, positionForCommentEnd] = toggleCommentInternal(editor.document, selection, rootNode); + rangesToUnComment.forEach(rangeToDelete => { + editBuilder.delete(rangeToDelete); + }); + if (positionForCommentStart) { + editBuilder.insert(positionForCommentStart, startComment); + } + if (positionForCommentEnd) { + editBuilder.insert(positionForCommentEnd, endComment); + } + }); + }); +} + +function toggleCommentHTML(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Position, vscode.Position] { + let offset = document.offsetAt(selection.start); + let nodeToUpdate = getNode(rootNode, offset); + + let rangesToUnComment = getRangesToUnCommentHTML(nodeToUpdate, document); + if (nodeToUpdate.type === 'comment') { + return [rangesToUnComment, null, null]; + } + + let positionForCommentStart = document.positionAt(nodeToUpdate.start); + let positionForCommentEnd = document.positionAt(nodeToUpdate.end); + return [rangesToUnComment, positionForCommentStart, positionForCommentEnd]; +} + +function getRangesToUnCommentHTML(node: Node, document: vscode.TextDocument): vscode.Range[] { + let rangesToUnComment = []; + + // If current node is commented, then uncomment and return + if (node.type === 'comment') { + rangesToUnComment.push(new vscode.Range(document.positionAt(node.start), document.positionAt(node.start + startCommentHTML.length))); + rangesToUnComment.push(new vscode.Range(document.positionAt(node.end), document.positionAt(node.end - endCommentHTML.length))); + + return rangesToUnComment; + } + + // All children of current node should be uncommented + node.children.forEach(childNode => { + rangesToUnComment = rangesToUnComment.concat(getRangesToUnCommentHTML(childNode, document)); + }); + + return rangesToUnComment; +} + +function toggleCommentStylesheet(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Position, vscode.Position] { + + let selectionStart = document.offsetAt(selection.anchor); + let selectionEnd = document.offsetAt(selection.active); + + // If current node is commented, then uncomment and return + let rangesToUnComment = getRangesToUnCommentStylesheet(rootNode, selectionStart, selectionEnd, document, true); + if (rangesToUnComment.length > 0) { + return [rangesToUnComment, null, null]; + } + + // Uncomment children of current node and then comment the node + let nodeToComment = getNode(rootNode, selectionStart); + rangesToUnComment = getRangesToUnCommentStylesheet(rootNode, nodeToComment.start, nodeToComment.end, document, false); + let positionForCommentStart = document.positionAt(nodeToComment.start); + let positionForCommentEnd = document.positionAt(nodeToComment.end); + + return [rangesToUnComment, positionForCommentStart, positionForCommentEnd]; +} + +function getRangesToUnCommentStylesheet(rootNode: Node, selectionStart: number, selectionEnd: number, document: vscode.TextDocument, selectionInsideComment: boolean): vscode.Range[] { + if (!rootNode.comments || rootNode.comments.length === 0) { + return []; + } + + let rangesToUnComment = []; + rootNode.comments.forEach(comment => { + let foundComment = false; + if (selectionInsideComment) { + foundComment = comment.start <= selectionStart && comment.end >= selectionEnd; + } else { + foundComment = selectionStart <= comment.start && selectionEnd >= comment.end; + } + + if (foundComment) { + rangesToUnComment.push(new vscode.Range(document.positionAt(comment.start), document.positionAt(comment.start + startCommentStylesheet.length))); + rangesToUnComment.push(new vscode.Range(document.positionAt(comment.end), document.positionAt(comment.end - endCommentStylesheet.length))); + } + }); + + return rangesToUnComment; +} \ No newline at end of file diff --git a/extensions/emmet/src/updateTag.ts b/extensions/emmet/src/updateTag.ts new file mode 100644 index 00000000000..43efb2cc285 --- /dev/null +++ b/extensions/emmet/src/updateTag.ts @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { getNode } from './util'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; + +export function updateTag(tagName: string) { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + + let rootNode: Node = parse(editor.document.getText()); + let rangesToUpdate = []; + editor.selections.reverse().forEach(selection => { + rangesToUpdate = rangesToUpdate.concat(getRangesToUpdate(editor, selection, rootNode)); + }); + + editor.edit(editBuilder => { + rangesToUpdate.forEach(range => { + editBuilder.replace(range, tagName); + }); + }); +} + +function getRangesToUpdate(editor: vscode.TextEditor, selection: vscode.Selection, rootNode: Node): vscode.Range[] { + let offset = editor.document.offsetAt(selection.start); + let nodeToUpdate = getNode(rootNode, offset); + + let openStart = editor.document.positionAt(nodeToUpdate.open.start + 1); + let openEnd = openStart.translate(0, nodeToUpdate.name.length); + + let ranges = [new vscode.Range(openStart, openEnd)]; + if (nodeToUpdate.close) { + let closeStart = editor.document.positionAt(nodeToUpdate.close.start + 2); + let closeEnd = editor.document.positionAt(nodeToUpdate.close.end - 1); + ranges.push(new vscode.Range(closeStart, closeEnd)); + } + return ranges; +} + + diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts new file mode 100644 index 00000000000..81085e5b6d6 --- /dev/null +++ b/extensions/emmet/src/util.ts @@ -0,0 +1,215 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; +import * as extract from '@emmetio/extract-abbreviation'; + + +export function validate(allowStylesheet: boolean = true): boolean { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return false; + } + if (!allowStylesheet && isStyleSheet(editor.document.languageId)) { + return false; + } + return true; +} + +export function getSyntax(document: vscode.TextDocument): string { + if (document.languageId === 'jade') { + return 'pug'; + } + if (document.languageId === 'javascriptreact' || document.languageId === 'typescriptreact') { + return 'jsx'; + } + return document.languageId; +} + +export function isStyleSheet(syntax): boolean { + let stylesheetSyntaxes = ['css', 'scss', 'sass', 'less', 'stylus']; + return (stylesheetSyntaxes.indexOf(syntax) > -1); +} + +export function getProfile(syntax: string): any { + let config = vscode.workspace.getConfiguration('emmet')['syntaxProfiles'] || {}; + let options = config[syntax]; + if (!options || typeof options === 'string') { + return {}; + } + let newOptions = {}; + for (let key in options) { + switch (key) { + case 'tag_case': + newOptions['tagCase'] = (options[key] === 'lower' || options[key] === 'upper') ? options[key] : ''; + break; + case 'attr_case': + newOptions['attributeCase'] = (options[key] === 'lower' || options[key] === 'upper') ? options[key] : ''; + break; + case 'attr_quotes': + newOptions['attributeQuotes'] = options[key]; + break; + case 'tag_nl': + newOptions['format'] = (options[key] === 'true' || options[key] === 'false') ? options[key] : 'true'; + break; + case 'indent': + newOptions['attrCase'] = (options[key] === 'true' || options[key] === 'false') ? '\t' : options[key]; + break; + case 'inline_break': + newOptions['inlineBreak'] = options[key]; + break; + case 'self_closing_tag': + if (options[key] === true) { + newOptions['selfClosingStyle'] = 'xml'; break; + } + if (options[key] === false) { + newOptions['selfClosingStyle'] = 'html'; break; + } + newOptions['selfClosingStyle'] = options[key]; + break; + default: + newOptions[key] = options[key]; + break; + } + } + return newOptions; +} + +export function getOpenCloseRange(document: vscode.TextDocument, offset: number): [vscode.Range, vscode.Range] { + let rootNode: Node = parse(document.getText()); + let nodeToUpdate = getNode(rootNode, offset); + let openRange = new vscode.Range(document.positionAt(nodeToUpdate.open.start), document.positionAt(nodeToUpdate.open.end)); + let closeRange = null; + if (nodeToUpdate.close) { + closeRange = new vscode.Range(document.positionAt(nodeToUpdate.close.start), document.positionAt(nodeToUpdate.close.end)); + } + return [openRange, closeRange]; +} + +export function getNode(root: Node, offset: number, includeNodeBoundary: boolean = false) { + let currentNode: Node = root.firstChild; + let foundNode: Node = null; + + while (currentNode) { + if ((currentNode.start < offset && currentNode.end > offset) + || (includeNodeBoundary && (currentNode.start <= offset && currentNode.end >= offset))) { + + foundNode = currentNode; + // Dig deeper + currentNode = currentNode.firstChild; + } else { + currentNode = currentNode.nextSibling; + } + } + + return foundNode; +} + +export function getNodeOuterSelection(document: vscode.TextDocument, node: Node): vscode.Selection { + return new vscode.Selection(document.positionAt(node.start), document.positionAt(node.end)); +} + +export function getNodeInnerSelection(document: vscode.TextDocument, node: Node): vscode.Selection { + return new vscode.Selection(document.positionAt(node.open.end), document.positionAt(node.close.start)); +} + +export function extractAbbreviation(position: vscode.Position): [vscode.Range, string] { + let editor = vscode.window.activeTextEditor; + let currentLine = editor.document.lineAt(position.line).text; + let result = extract(currentLine, position.character, true); + if (!result) { + return [null, '']; + } + + let rangeToReplace = new vscode.Range(position.line, result.location, position.line, result.location + result.abbreviation.length); + return [rangeToReplace, result.abbreviation]; +} + +export function getDeepestNode(node: Node): Node { + if (!node || !node.children || node.children.length === 0) { + return node; + } + + return getDeepestNode(node.children[node.children.length - 1]); +} + +export function findNextWord(propertyValue: string, pos: number): [number, number] { + + let foundSpace = pos === -1; + let foundStart = false; + let foundEnd = false; + + let newSelectionStart; + let newSelectionEnd; + while (pos < propertyValue.length - 1) { + pos++; + if (!foundSpace) { + if (propertyValue[pos] === ' ') { + foundSpace = true; + } + continue; + } + if (foundSpace && !foundStart && propertyValue[pos] === ' ') { + continue; + } + if (!foundStart) { + newSelectionStart = pos; + foundStart = true; + continue; + } + if (propertyValue[pos] === ' ') { + newSelectionEnd = pos; + foundEnd = true; + break; + } + } + + if (foundStart && !foundEnd) { + newSelectionEnd = propertyValue.length; + } + + return [newSelectionStart, newSelectionEnd]; +} + +export function findPrevWord(propertyValue: string, pos: number): [number, number] { + + let foundSpace = pos === propertyValue.length; + let foundStart = false; + let foundEnd = false; + + let newSelectionStart; + let newSelectionEnd; + while (pos > -1) { + pos--; + if (!foundSpace) { + if (propertyValue[pos] === ' ') { + foundSpace = true; + } + continue; + } + if (foundSpace && !foundEnd && propertyValue[pos] === ' ') { + continue; + } + if (!foundEnd) { + newSelectionEnd = pos + 1; + foundEnd = true; + continue; + } + if (propertyValue[pos] === ' ') { + newSelectionStart = pos + 1; + foundStart = true; + break; + } + } + + if (foundEnd && !foundStart) { + newSelectionStart = 0; + } + + return [newSelectionStart, newSelectionEnd]; +} \ No newline at end of file diff --git a/extensions/emmet/tsconfig.json b/extensions/emmet/tsconfig.json new file mode 100644 index 00000000000..06d04868a70 --- /dev/null +++ b/extensions/emmet/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es6", + "lib": [ + "es2016" + ], + "module": "commonjs", + "outDir": "./out" + + }, + "exclude": [ + "node_modules", + ".vscode-test" + ], + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/extensions/extension-editing/src/extension.ts b/extensions/extension-editing/src/extension.ts index cda1ed07ce9..647385b059b 100644 --- a/extensions/extension-editing/src/extension.ts +++ b/extensions/extension-editing/src/extension.ts @@ -74,7 +74,7 @@ namespace ast { const spans: number[] = []; ts.forEachChild(sourceFile, function visit(node: ts.Node) { - const declIdent = (node).name; + const declIdent = (node).name; if (declIdent && declIdent.kind === ts.SyntaxKind.Identifier) { identifiers.push((declIdent).text); spans.push(node.pos, node.end); diff --git a/extensions/extension-editing/tsconfig.json b/extensions/extension-editing/tsconfig.json index 90ac01c2d39..a2b5bcdfddf 100644 --- a/extensions/extension-editing/tsconfig.json +++ b/extensions/extension-editing/tsconfig.json @@ -7,7 +7,7 @@ "module": "commonjs", "outDir": "./out" }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/fsharp/syntaxes/fsharp.json b/extensions/fsharp/syntaxes/fsharp.json index 4fe9eeffc16..f7abe7e8a52 100644 --- a/extensions/fsharp/syntaxes/fsharp.json +++ b/extensions/fsharp/syntaxes/fsharp.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/ionide/ionide-fsgrammar/blob/master/grammar/fsharp.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "fsharp", "scopeName": "source.fsharp", "fileTypes": [ @@ -16,9 +21,6 @@ { "include": "#structure" }, - { - "include": "#attributes" - }, { "include": "#strings" }, @@ -31,6 +33,9 @@ { "include": "#definition" }, + { + "include": "#attributes" + }, { "include": "#method_calls" }, @@ -59,7 +64,7 @@ { "name": "function.anonymous", "begin": "\\b(fun)\\b", - "end": "[(->)\\n]", + "end": "(->)", "beginCaptures": { "1": { "name": "keyword.other.function-definition.fsharp" @@ -139,7 +144,7 @@ "patterns": [ { "name": "binding.fsharp", - "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+private|internal|public)?\\s+(\\([^\\s-]*\\)|[_[:alpha:]]([_[:alpha:]0-9,\\.]|(?<=,)\\s)*)", + "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\([^\\s-]*\\)|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*)", "end": "((``.*``)|(with)|=|$)", "beginCaptures": { "1": { @@ -149,9 +154,12 @@ "name": "keyword.other.function-recursive.fsharp" }, "3": { - "name": "keyword.other.access.fsharp" + "name": "support.function.attribute.fsharp" }, "4": { + "name": "keyword.other.access.fsharp" + }, + "5": { "name": "variable.other.binding.fsharp" } }, @@ -178,7 +186,7 @@ "patterns": [ { "name": "keyword.other.fsharp", - "match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|member|try|finally|and|when|use|use\\!|struct|while)\\b" + "match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|member|try|finally|and|when|use|use\\!|struct|while|mutable)\\b" }, { "name": "meta.preprocessor.fsharp", @@ -195,7 +203,7 @@ "patterns": [ { "name": "entity.name.section.fsharp", - "begin": "\\b(namespace|module)(\\s+public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)", + "begin": "\\b(namespace|module)\\s*(public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)", "end": "(\\s|$)", "beginCaptures": { "1": { @@ -389,7 +397,7 @@ "patterns": [ { "name": "record.fsharp", - "match": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,. ]+)[\\s]*(\\([[:alpha:]0-9'<>^:,. ]+\\))?[\\s]*((with)|(as [[:alpha:]0-9']+)|(=)|(\\(\\)))", + "match": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,._ ]+)[\\s]*(\\([[:alpha:]0-9'<>^:,._ ]+\\))?[\\s]*((with)|(as [[:alpha:]0-9']+)|(=)|(\\(\\)))", "captures": { "1": { "name": "keyword.other.fsharp" @@ -453,6 +461,5 @@ } ] } - }, - "version": "https://github.com/ionide/ionide-fsgrammar/commit/edb05603ec3f2eb3c633f92df1649e82fe870545" + } } \ No newline at end of file diff --git a/extensions/fsharp/test/colorize-results/test_fs.json b/extensions/fsharp/test/colorize-results/test_fs.json index 26bad9ce441..2f161a6fccc 100644 --- a/extensions/fsharp/test/colorize-results/test_fs.json +++ b/extensions/fsharp/test/colorize-results/test_fs.json @@ -51,7 +51,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -117,7 +117,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -293,7 +293,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -392,7 +392,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -590,7 +590,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -744,7 +744,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -766,7 +766,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -865,7 +865,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/git/package.json b/extensions/git/package.json index bd3d175c58a..0ea489cc812 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -172,6 +172,11 @@ "title": "%command.branch%", "category": "Git" }, + { + "command": "git.deleteBranch", + "title": "%command.deleteBranch%", + "category": "Git" + }, { "command": "git.pull", "title": "%command.pull%", @@ -298,6 +303,10 @@ "command": "git.branch", "when": "config.git.enabled && scmProvider == git && gitState == idle" }, + { + "command": "git.deleteBranch", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, { "command": "git.pull", "when": "config.git.enabled && scmProvider == git && gitState == idle" @@ -608,6 +617,16 @@ "type": "boolean", "description": "%config.ignoreLimitWarning%", "default": false + }, + "git.defaultCloneDirectory": { + "type": "string", + "default": null, + "description": "%config.defaultCloneDirectory%" + }, + "git.enableSmartCommit": { + "type": "boolean", + "description": "%config.enableSmartCommit%", + "default": false } } } diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 11c7347fa07..e02a5ed2310 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -21,6 +21,7 @@ "command.undoCommit": "Undo Last Commit", "command.checkout": "Checkout to...", "command.branch": "Create Branch...", + "command.deleteBranch": "Delete Branch...", "command.pull": "Pull", "command.pullRebase": "Pull (Rebase)", "command.push": "Push", @@ -37,5 +38,7 @@ "config.countBadge": "Controls the git badge counter. `all` counts all changes. `tracked` counts only the tracked changes. `off` turns it off.", "config.checkoutType": "Controls what type of branches are listed when running `Checkout to...`. `all` shows all refs, `local` shows only the local branchs, `tags` shows only tags and `remote` shows only remote branches.", "config.ignoreLegacyWarning": "Ignores the legacy Git warning", - "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository" + "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository", + "config.defaultCloneDirectory": "The default location where to clone a git repository", + "config.enableSmartCommit": "Commit all changes when there are not staged changes." } \ No newline at end of file diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 399cfd10a16..eed354dd8a4 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -60,6 +60,23 @@ class CheckoutRemoteHeadItem extends CheckoutItem { } } +class BranchDeleteItem implements QuickPickItem { + + private get shortCommit(): string { return (this.ref.commit || '').substr(0, 8); } + get branchName(): string | undefined { return this.ref.name; } + get label(): string { return this.branchName || ''; } + get description(): string { return this.shortCommit; } + + constructor(private ref: Ref) { } + + async run(model: Model, force?: boolean): Promise { + if (!this.branchName) { + return; + } + await model.deleteBranch(this.branchName, force); + } +} + interface Command { commandId: string; key: string; @@ -132,7 +149,7 @@ export class CommandCenter { return await commands.executeCommand('vscode.open', right); } - return await commands.executeCommand('vscode.diff', left, right, title); + return await commands.executeCommand('vscode.diff', left, right, title, { preview: true }); } private getLeftResource(resource: Resource): Uri | undefined { @@ -202,9 +219,12 @@ export class CommandCenter { return; } + const config = workspace.getConfiguration('git'); + const value = config.get('defaultCloneDirectory') || os.homedir(); + const parentPath = await window.showInputBox({ prompt: localize('parent', "Parent Directory"), - value: os.homedir(), + value, ignoreFocusOut: true }); @@ -530,15 +550,36 @@ export class CommandCenter { getCommitMessage: () => Promise, opts?: CommitOptions ): Promise { + const config = workspace.getConfiguration('git'); + const enableSmartCommit = config.get('enableSmartCommit') === true; + const noStagedChanges = this.model.indexGroup.resources.length === 0; + const noUnstagedChanges = this.model.workingTreeGroup.resources.length === 0; + + // no changes, and the user has not configured to commit all in this case + if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit) { + + // prompt the user if we want to commit all or not + const message = localize('no staged changes', "There are no staged changes to commit.\n\nWould you like to automatically stage all your changes and commit them directly?"); + const yes = localize('yes', "Yes"); + const always = localize('always', "Always"); + const pick = await window.showWarningMessage(message, { modal: true }, yes, always); + + if (pick === always) { + config.update('enableSmartCommit', true, true); + } else if (pick !== yes) { + return false; // do not commit on cancel + } + } + if (!opts) { - opts = { all: this.model.indexGroup.resources.length === 0 }; + opts = { all: noStagedChanges }; } if ( // no changes - (this.model.indexGroup.resources.length === 0 && this.model.workingTreeGroup.resources.length === 0) + (noStagedChanges && noUnstagedChanges) // or no staged changes and not `all` - || (!opts.all && this.model.indexGroup.resources.length === 0) + || (!opts.all && noStagedChanges) ) { window.showInformationMessage(localize('no changes', "There are no changes to commit.")); return false; @@ -584,6 +625,10 @@ export class CommandCenter { @command('git.commitWithInput') async commitWithInput(): Promise { + if (!scm.inputBox.value) { + return; + } + const didCommit = await this.smartCommit(async () => scm.inputBox.value); if (didCommit) { @@ -671,6 +716,43 @@ export class CommandCenter { await this.model.branch(name); } + @command('git.deleteBranch') + async deleteBranch(name: string, force?: boolean): Promise { + let run: (force?: boolean) => Promise; + if (typeof name === 'string') { + run = force => this.model.deleteBranch(name, force); + } else { + const currentHead = this.model.HEAD && this.model.HEAD.name; + const heads = this.model.refs.filter(ref => ref.type === RefType.Head && ref.name !== currentHead) + .map(ref => new BranchDeleteItem(ref)); + + const placeHolder = localize('select branch to delete', 'Select a branch to delete'); + const choice = await window.showQuickPick(heads, { placeHolder }); + + if (!choice || !choice.branchName) { + return; + } + name = choice.branchName; + run = force => choice.run(this.model, force); + } + + try { + await run(force); + } catch (err) { + if (err.gitErrorCode !== GitErrorCodes.BranchNotFullyMerged) { + throw err; + } + + const message = localize('confirm force delete branch', "The branch '{0}' is not fully merged. Delete anyway?", name); + const yes = localize('delete branch', "Delete Branch"); + const pick = await window.showWarningMessage(message, yes); + + if (pick === yes) { + await run(true); + } + } + } + @command('git.pull') async pull(): Promise { const remotes = this.model.remotes; diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 4adc617a3eb..9ef482def93 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -273,7 +273,8 @@ export const GitErrorCodes = { CantCreatePipe: 'CantCreatePipe', CantAccessRemote: 'CantAccessRemote', RepositoryNotFound: 'RepositoryNotFound', - RepositoryIsLocked: 'RepositoryIsLocked' + RepositoryIsLocked: 'RepositoryIsLocked', + BranchNotFullyMerged: 'BranchNotFullyMerged' }; function getGitErrorCode(stderr: string): string | undefined { @@ -291,6 +292,8 @@ function getGitErrorCode(stderr: string): string | undefined { return GitErrorCodes.RepositoryNotFound; } else if (/unable to access/.test(stderr)) { return GitErrorCodes.CantAccessRemote; + } else if (/branch '.+' is not fully merged/.test(stderr)) { + return GitErrorCodes.BranchNotFullyMerged; } return void 0; @@ -386,7 +389,7 @@ export class Git { options.env = assign({}, process.env, this.env, options.env || {}, { VSCODE_GIT_COMMAND: args[0], - LC_ALL: 'en_US', + LC_ALL: 'en_US.UTF-8', LANG: 'en_US.UTF-8' }); @@ -650,6 +653,11 @@ export class Repository { await this.run(args); } + async deleteBranch(name: string, force?: boolean): Promise { + const args = ['branch', force ? '-D' : '-d', name]; + await this.run(args); + } + async clean(paths: string[]): Promise { const pathsByGroup = groupBy(paths, p => path.dirname(p)); const groups = Object.keys(pathsByGroup).map(k => pathsByGroup[k]); @@ -954,4 +962,4 @@ export class Repository { return { hash: match[1], message: match[2] }; } -} \ No newline at end of file +} diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index edc5f6c19cc..f75ed0fef00 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -13,7 +13,6 @@ import { CommandCenter } from './commands'; import { StatusBarCommands } from './statusbar'; import { GitContentProvider } from './contentProvider'; import { AutoFetcher } from './autofetch'; -import { MergeDecorator } from './merge'; import { Askpass } from './askpass'; import { toDisposable } from './util'; import TelemetryReporter from 'vscode-extension-telemetry'; @@ -58,14 +57,12 @@ async function init(context: ExtensionContext, disposables: Disposable[]): Promi const provider = new GitSCMProvider(model, commandCenter, statusBarCommands); const contentProvider = new GitContentProvider(model); const autoFetcher = new AutoFetcher(model); - const mergeDecorator = new MergeDecorator(model); disposables.push( commandCenter, provider, contentProvider, autoFetcher, - mergeDecorator, model ); diff --git a/extensions/git/src/merge.ts b/extensions/git/src/merge.ts deleted file mode 100644 index 457e966d89a..00000000000 --- a/extensions/git/src/merge.ts +++ /dev/null @@ -1,96 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { window, workspace, Disposable, TextEditor, TextDocument, Range } from 'vscode'; -import { Model, Status } from './model'; -import { filterEvent } from './util'; -import { debounce } from './decorators'; -import { iterate } from './iterators'; - -function* lines(document: TextDocument): IterableIterator { - for (let i = 0; i < document.lineCount; i++) { - yield document.lineAt(i).text; - } -} - -const pattern = /^<<<<<<<|^=======|^>>>>>>>/; - -function decorate(document: TextDocument): Range[] { - return iterate(lines(document)) - .map((line, i) => pattern.test(line) ? i : null) - .filter(i => i !== null) - .map((i: number) => new Range(i, 1, i, 1)) - .toArray(); -} - -class TextEditorMergeDecorator { - - private static DecorationType = window.createTextEditorDecorationType({ - backgroundColor: 'rgba(255, 139, 0, 0.3)', - isWholeLine: true, - dark: { - backgroundColor: 'rgba(235, 59, 0, 0.3)' - } - }); - - private uri: string; - private disposables: Disposable[] = []; - - constructor( - private model: Model, - private editor: TextEditor - ) { - this.uri = this.editor.document.uri.toString(); - - const onDidChange = filterEvent(workspace.onDidChangeTextDocument, e => e.document && e.document.uri.toString() === this.uri); - onDidChange(this.redecorate, this, this.disposables); - model.onDidChange(this.redecorate, this, this.disposables); - - this.redecorate(); - } - - @debounce(300) - private redecorate(): void { - let decorations: Range[] = []; - - if (window.visibleTextEditors.every(e => e !== this.editor)) { - this.dispose(); - return; - } - - if (this.model.mergeGroup.resources.some(r => r.type === Status.BOTH_MODIFIED && r.resourceUri.toString() === this.uri)) { - decorations = decorate(this.editor.document); - } - - this.editor.setDecorations(TextEditorMergeDecorator.DecorationType, decorations); - } - - dispose(): void { - this.disposables.forEach(d => d.dispose()); - } -} - -export class MergeDecorator { - - private textEditorDecorators: TextEditorMergeDecorator[] = []; - private disposables: Disposable[] = []; - - constructor(private model: Model) { - window.onDidChangeVisibleTextEditors(this.onDidChangeVisibleTextEditors, this, this.disposables); - this.onDidChangeVisibleTextEditors(window.visibleTextEditors); - } - - private onDidChangeVisibleTextEditors(editors: TextEditor[]): void { - this.textEditorDecorators.forEach(d => d.dispose()); - this.textEditorDecorators = editors.map(e => new TextEditorMergeDecorator(this.model, e)); - } - - dispose(): void { - this.textEditorDecorators.forEach(d => d.dispose()); - this.disposables.forEach(d => d.dispose()); - } -} diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index 1d74a87d3a3..aba4a4251d6 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -7,9 +7,8 @@ import { Uri, Command, EventEmitter, Event, SourceControlResourceState, SourceControlResourceDecorations, Disposable, ProgressLocation, window, workspace } from 'vscode'; import { Git, Repository, Ref, Branch, Remote, PushOptions, Commit, GitErrorCodes } from './git'; -import { anyEvent, eventToPromise, filterEvent, mapEvent, EmptyDisposable, combinedDisposable, dispose } from './util'; +import { anyEvent, eventToPromise, filterEvent, EmptyDisposable, combinedDisposable, dispose } from './util'; import { memoize, throttle, debounce } from './decorators'; -import { watch } from './watch'; import * as path from 'path'; import * as nls from 'vscode-nls'; @@ -211,7 +210,8 @@ export enum Operation { Init = 1 << 12, Show = 1 << 13, Stage = 1 << 14, - GetCommitTemplate = 1 << 15 + GetCommitTemplate = 1 << 15, + DeleteBranch = 1 << 16 } // function getOperationName(operation: Operation): string { @@ -454,6 +454,10 @@ export class Model implements Disposable { await this.run(Operation.Branch, () => this.repository.branch(name, true)); } + async deleteBranch(name: string, force?: boolean): Promise { + await this.run(Operation.DeleteBranch, () => this.repository.deleteBranch(name, force)); + } + async checkout(treeish: string): Promise { await this.run(Operation.Checkout, () => this.repository.checkout(treeish, [])); } @@ -582,11 +586,7 @@ export class Model implements Disposable { const repositoryRoot = await this._git.getRepositoryRoot(this.workspaceRoot.fsPath); this.repository = this._git.open(repositoryRoot); - const dotGitPath = path.join(repositoryRoot, '.git'); - const { event: onRawGitChange, disposable: watcher } = watch(dotGitPath); - disposables.push(watcher); - - const onGitChange = mapEvent(onRawGitChange, ({ filename }) => Uri.file(path.join(dotGitPath, filename))); + const onGitChange = filterEvent(this.onWorkspaceChange, uri => /\/\.git\//.test(uri.fsPath)); const onRelevantGitChange = filterEvent(onGitChange, uri => !/\/\.git\/index\.lock$/.test(uri.fsPath)); onRelevantGitChange(this.onFSChange, this, disposables); onRelevantGitChange(this._onDidChangeRepository.fire, this._onDidChangeRepository, disposables); diff --git a/extensions/git/src/statusbar.ts b/extensions/git/src/statusbar.ts index b12dd9664c4..c609d570b9d 100644 --- a/extensions/git/src/statusbar.ts +++ b/extensions/git/src/statusbar.ts @@ -127,7 +127,6 @@ class SyncStatusBar { if (this.state.isSyncRunning) { icon = '$(sync~spin)'; - text = ''; command = ''; tooltip = localize('syncing changes', "Synchronizing changes..."); } diff --git a/extensions/git/src/watch.ts b/extensions/git/src/watch.ts deleted file mode 100644 index a3a51a8aea7..00000000000 --- a/extensions/git/src/watch.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { EventEmitter, Event, Disposable } from 'vscode'; -import * as fs from 'fs'; - -export interface FSEvent { - eventType: string; - filename: string; -} - -export function watch(path: string): { event: Event; disposable: Disposable; } { - const emitter = new EventEmitter(); - const event = emitter.event; - const watcher = fs.watch(path, (eventType, filename) => emitter.fire({ eventType, filename })); - const disposable = new Disposable(() => watcher.close()); - - return { event, disposable }; -} diff --git a/extensions/git/tsconfig.json b/extensions/git/tsconfig.json index bed30f8826c..254c9e67459 100644 --- a/extensions/git/tsconfig.json +++ b/extensions/git/tsconfig.json @@ -9,7 +9,7 @@ "strictNullChecks": true, "experimentalDecorators": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/gitsyntax/package.json b/extensions/gitsyntax/package.json index 8ce5bd1ba32..bc1a1810f91 100644 --- a/extensions/gitsyntax/package.json +++ b/extensions/gitsyntax/package.json @@ -10,6 +10,9 @@ "categories": [ "Other" ], + "scripts": { + "update-grammar": "node ../../build/npm/update-grammar.js textmate/git.tmbundle Syntaxes/Git%20Commit%20Message.tmLanguage ./syntaxes/git-commit.tmLanguage.json Syntaxes/Git%20Rebase%20Message.tmLanguage ./syntaxes/git-rebase.tmLanguage.json" + }, "contributes": { "languages": [ { @@ -40,12 +43,12 @@ { "language": "git-commit", "scopeName": "text.git-commit", - "path": "./syntaxes/git-commit.tmLanguage" + "path": "./syntaxes/git-commit.tmLanguage.json" }, { "language": "git-rebase", "scopeName": "text.git-rebase", - "path": "./syntaxes/git-rebase.tmLanguage" + "path": "./syntaxes/git-rebase.tmLanguage.json" } ] } diff --git a/extensions/gitsyntax/syntaxes/git-commit.tmLanguage b/extensions/gitsyntax/syntaxes/git-commit.tmLanguage deleted file mode 100644 index 705fc0a36f9..00000000000 --- a/extensions/gitsyntax/syntaxes/git-commit.tmLanguage +++ /dev/null @@ -1,221 +0,0 @@ - - - - - fileTypes - - COMMIT_EDITMSG - MERGE_MSG - - foldingStartMarker - ^\+\+\+ - foldingStopMarker - ^--- - name - Git Commit Message - patterns - - - begin - \A(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - name - meta.scope.message.git-commit - patterns - - - begin - \A(?=#) - end - ^(?!#) - patterns - - - include - #comment - - - - - begin - ^(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - patterns - - - begin - \G - end - ^(?!\G) - name - meta.scope.subject.git-commit - patterns - - - captures - - 1 - - name - keyword.other.$2.git-commit - - - match - \G((fixup|squash)!)\s* - - - match - .{66,}$ - name - invalid.illegal.line-too-long.git-commit - - - match - .{51,}$ - name - invalid.deprecated.line-too-long.git-commit - - - - - begin - ^(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - patterns - - - include - #comment - - - - - - - - - begin - ^(?=# Please enter the commit message) - end - \z - name - meta.scope.metadata.git-commit - patterns - - - include - #metadata - - - - - repository - - comment - - begin - ^(#) - captures - - 1 - - name - punctuation.definition.comment.git-commit - - - end - \n - name - comment.line.number-sign.git-commit - - metadata - - patterns - - - begin - (?=^# Changes to be committed:) - end - (?!\G)((?=^# \w)|(?!^#)) - patterns - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.git-commit - - - contentName - comment.line.number-sign.git-commit - end - (?!\G)^ - patterns - - - match - \G# - name - punctuation.definition.comment.git-commit - - - match - ((modified|renamed):.*)$\n? - name - markup.changed.git-commit - - - match - (new file:.*)$\n? - name - markup.inserted.git-commit - - - match - (deleted:.*)$\n? - name - markup.deleted.git-commit - - - - - - - include - #comment - - - begin - (?=diff\ \-\-git) - comment - diff presented at the end of the commit message when using commit -v. - contentName - source.diff - end - \z - name - meta.embedded.diff.git-commit - patterns - - - include - source.diff - - - - - - - scopeName - text.git-commit - uuid - BFE83C06-8508-44BE-A975-95A57BF619A7 - - diff --git a/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json b/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json new file mode 100644 index 00000000000..ffe1561f727 --- /dev/null +++ b/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json @@ -0,0 +1,147 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Commit%20Message.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "fileTypes": [ + "COMMIT_EDITMSG", + "MERGE_MSG" + ], + "foldingStartMarker": "^\\+\\+\\+", + "foldingStopMarker": "^---", + "name": "Git Commit Message", + "patterns": [ + { + "begin": "\\A(?!# Please enter the commit message)", + "end": "^(?=# Please enter the commit message)", + "name": "meta.scope.message.git-commit", + "patterns": [ + { + "begin": "\\A(?=#)", + "end": "^(?!#)", + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "begin": "^(?!# Please enter the commit message)", + "end": "^(?=# Please enter the commit message)", + "patterns": [ + { + "begin": "\\G", + "end": "^(?!\\G)", + "name": "meta.scope.subject.git-commit", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.$2.git-commit" + } + }, + "match": "\\G((fixup|squash)!)\\s*" + }, + { + "match": ".{73,}$", + "name": "invalid.illegal.line-too-long.git-commit" + }, + { + "match": ".{51,}$", + "name": "invalid.deprecated.line-too-long.git-commit" + } + ] + }, + { + "begin": "^(?!# Please enter the commit message)", + "end": "^(?=# Please enter the commit message)", + "patterns": [ + { + "include": "#comment" + } + ] + } + ] + } + ] + }, + { + "begin": "^(?=# Please enter the commit message)", + "end": "\\z", + "name": "meta.scope.metadata.git-commit", + "patterns": [ + { + "include": "#metadata" + } + ] + } + ], + "repository": { + "comment": { + "begin": "^(#)", + "captures": { + "1": { + "name": "punctuation.definition.comment.git-commit" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.git-commit" + }, + "metadata": { + "patterns": [ + { + "begin": "(?=^# Changes to be committed:)", + "end": "(?!\\G)((?=^# \\w)|(?!^#))", + "patterns": [ + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.git-commit" + } + }, + "contentName": "comment.line.number-sign.git-commit", + "end": "(?!\\G)^", + "patterns": [ + { + "match": "\\G#", + "name": "punctuation.definition.comment.git-commit" + }, + { + "match": "((modified|renamed):.*)$\\n?", + "name": "markup.changed.git-commit" + }, + { + "match": "(new file:.*)$\\n?", + "name": "markup.inserted.git-commit" + }, + { + "match": "(deleted:.*)$\\n?", + "name": "markup.deleted.git-commit" + } + ] + } + ] + }, + { + "include": "#comment" + }, + { + "begin": "(?=diff\\ \\-\\-git)", + "comment": "diff presented at the end of the commit message when using commit -v.", + "contentName": "source.diff", + "end": "\\z", + "name": "meta.embedded.diff.git-commit", + "patterns": [ + { + "include": "source.diff" + } + ] + } + ] + } + }, + "scopeName": "text.git-commit", + "uuid": "BFE83C06-8508-44BE-A975-95A57BF619A7" +} \ No newline at end of file diff --git a/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage b/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage deleted file mode 100644 index a53ee1533fd..00000000000 --- a/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage +++ /dev/null @@ -1,57 +0,0 @@ - - - - - fileTypes - - git-rebase-todo - - name - Git Rebase Message - patterns - - - captures - - 1 - - name - punctuation.definition.comment.git-rebase - - - match - ^\s*(#).*$\n? - name - comment.line.number-sign.git-rebase - - - captures - - 1 - - name - support.function.git-rebase - - 2 - - name - constant.sha.git-rebase - - 3 - - name - meta.commit-message.git-rebase - - - match - ^\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|d|drop|x|exec)\s+([0-9a-f]+)\s+(.*)$ - name - meta.commit-command.git-rebase - - - scopeName - text.git-rebase - uuid - 7F1CC209-5F6D-486A-8180-09FA282381A1 - - diff --git a/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json b/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json new file mode 100644 index 00000000000..15bac0d8d09 --- /dev/null +++ b/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json @@ -0,0 +1,39 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Rebase%20Message.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "fileTypes": [ + "git-rebase-todo" + ], + "name": "Git Rebase Message", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.git-rebase" + } + }, + "match": "^\\s*(#).*$\\n?", + "name": "comment.line.number-sign.git-rebase" + }, + { + "captures": { + "1": { + "name": "support.function.git-rebase" + }, + "2": { + "name": "constant.sha.git-rebase" + }, + "3": { + "name": "meta.commit-message.git-rebase" + } + }, + "match": "^\\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|exec|x|drop|d)\\s+([0-9a-f]+)\\s+(.*)$", + "name": "meta.commit-command.git-rebase" + } + ], + "scopeName": "text.git-rebase", + "uuid": "7F1CC209-5F6D-486A-8180-09FA282381A1" +} \ No newline at end of file diff --git a/extensions/go/syntaxes/go.json b/extensions/go/syntaxes/go.json index 0cfcf1940ad..098c8710482 100644 --- a/extensions/go/syntaxes/go.json +++ b/extensions/go/syntaxes/go.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-go/blob/master/grammars/go.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.go", "name": "Go", "comment": "Go language", @@ -227,7 +232,7 @@ ] }, { - "match": "(? - - - - fileTypes - - groovy - gvy - - foldingStartMarker - (\{\s*$|^\s*// \{\{\{) - foldingStopMarker - ^\s*(\}|// \}\}\}$) - keyEquivalent - ^~G - name - Groovy - patterns - - - captures - - 1 - - name - punctuation.definition.comment.groovy - - - match - ^(#!).+$\n - name - comment.line.hashbang.groovy - - - captures - - 1 - - name - keyword.other.package.groovy - - 2 - - name - storage.modifier.package.groovy - - 3 - - name - punctuation.terminator.groovy - - - match - ^\s*(package)\b(?:\s*([^ ;$]+)\s*(;)?)? - name - meta.package.groovy - - - begin - (import static)\b\s* - beginCaptures - - 1 - - name - keyword.other.import.static.groovy - - - captures - - 1 - - name - keyword.other.import.groovy - - 2 - - name - storage.modifier.import.groovy - - 3 - - name - punctuation.terminator.groovy - - - contentName - storage.modifier.import.groovy - end - \s*(?:$|(?=%>)(;)) - endCaptures - - 1 - - name - punctuation.terminator.groovy - - - name - meta.import.groovy - patterns - - - match - \. - name - punctuation.separator.groovy - - - match - \s - name - invalid.illegal.character_not_allowed_here.groovy - - - - - begin - (import)\b\s* - beginCaptures - - 1 - - name - keyword.other.import.groovy - - - captures - - 1 - - name - keyword.other.import.groovy - - 2 - - name - storage.modifier.import.groovy - - 3 - - name - punctuation.terminator.groovy - - - contentName - storage.modifier.import.groovy - end - \s*(?:$|(?=%>)|(;)) - endCaptures - - 1 - - name - punctuation.terminator.groovy - - - name - meta.import.groovy - patterns - - - match - \. - name - punctuation.separator.groovy - - - match - \s - name - invalid.illegal.character_not_allowed_here.groovy - - - - - captures - - 1 - - name - keyword.other.import.groovy - - 2 - - name - keyword.other.import.static.groovy - - 3 - - name - storage.modifier.import.groovy - - 4 - - name - punctuation.terminator.groovy - - - match - ^\s*(import)(?:\s+(static)\s+)\b(?:\s*([^ ;$]+)\s*(;)?)? - name - meta.import.groovy - - - include - #groovy - - - repository - - annotations - - patterns - - - begin - (?<!\.)(@[^ (]+)(\() - beginCaptures - - 1 - - name - storage.type.annotation.groovy - - 2 - - name - punctuation.definition.annotation-arguments.begin.groovy - - - end - (\)) - endCaptures - - 1 - - name - punctuation.definition.annotation-arguments.end.groovy - - - name - meta.declaration.annotation.groovy - patterns - - - captures - - 1 - - name - constant.other.key.groovy - - 2 - - name - keyword.operator.assignment.groovy - - - match - (\w*)\s*(=) - - - include - #values - - - match - , - name - punctuation.definition.seperator.groovy - - - - - match - (?<!\.)@\S+ - name - storage.type.annotation.groovy - - - - anonymous-classes-and-new - - begin - \bnew\b - beginCaptures - - 0 - - name - keyword.control.new.groovy - - - end - (?<=\)|\])(?!\s*{)|(?<=})|(?=[;])|$ - patterns - - - begin - (\w+)\s*(?=\[) - beginCaptures - - 1 - - name - storage.type.groovy - - - end - }|(?=\s*(?:,|;|\)))|$ - patterns - - - begin - \[ - end - \] - patterns - - - include - #groovy - - - - - begin - { - end - (?=}) - patterns - - - include - #groovy - - - - - - - begin - (?=\w.*\(?) - end - (?<=\))|$ - patterns - - - include - #object-types - - - begin - \( - beginCaptures - - 1 - - name - storage.type.groovy - - - end - \) - patterns - - - include - #groovy - - - - - - - begin - { - end - } - name - meta.inner-class.groovy - patterns - - - include - #class-body - - - - - - braces - - begin - \{ - end - \} - patterns - - - include - #groovy-code - - - - class - - begin - (?=\w?[\w\s]*(?:class|(?:@)?interface|enum)\s+\w+) - end - } - endCaptures - - 0 - - name - punctuation.section.class.end.groovy - - - name - meta.definition.class.groovy - patterns - - - include - #storage-modifiers - - - include - #comments - - - captures - - 1 - - name - storage.modifier.groovy - - 2 - - name - entity.name.type.class.groovy - - - match - (class|(?:@)?interface|enum)\s+(\w+) - name - meta.class.identifier.groovy - - - begin - extends - beginCaptures - - 0 - - name - storage.modifier.extends.groovy - - - end - (?={|implements) - name - meta.definition.class.inherited.classes.groovy - patterns - - - include - #object-types-inherited - - - include - #comments - - - - - begin - (implements)\s - beginCaptures - - 1 - - name - storage.modifier.implements.groovy - - - end - (?=\s*extends|\{) - name - meta.definition.class.implemented.interfaces.groovy - patterns - - - include - #object-types-inherited - - - include - #comments - - - - - begin - { - end - (?=}) - name - meta.class.body.groovy - patterns - - - include - #class-body - - - - - - class-body - - patterns - - - include - #enum-values - - - include - #constructors - - - include - #groovy - - - - closures - - begin - \{(?=.*?->) - end - \} - patterns - - - begin - (?<=\{)(?=[^\}]*?->) - end - -> - endCaptures - - 0 - - name - keyword.operator.groovy - - - patterns - - - begin - (?!->) - end - (?=->) - name - meta.closure.parameters.groovy - patterns - - - begin - (?!,|->) - end - (?=,|->) - name - meta.closure.parameter.groovy - patterns - - - begin - = - beginCaptures - - 0 - - name - keyword.operator.assignment.groovy - - - end - (?=,|->) - name - meta.parameter.default.groovy - patterns - - - include - #groovy-code - - - - - include - #parameters - - - - - - - - - begin - (?=[^}]) - end - (?=\}) - patterns - - - include - #groovy-code - - - - - - comment-block - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.groovy - - - end - \*/ - name - comment.block.groovy - - comments - - patterns - - - captures - - 0 - - name - punctuation.definition.comment.groovy - - - match - /\*\*/ - name - comment.block.empty.groovy - - - include - text.html.javadoc - - - include - #comment-block - - - captures - - 1 - - name - punctuation.definition.comment.groovy - - - match - (//).*$\n? - name - comment.line.double-slash.groovy - - - - constants - - patterns - - - match - \b([A-Z][A-Z0-9_]+)\b - name - constant.other.groovy - - - match - \b(true|false|null)\b - name - constant.language.groovy - - - - constructors - - applyEndPatternLast - 1 - begin - (?<=;|^)(?=\s*(?:(?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)\s+)*[A-Z]\w*\() - end - } - patterns - - - include - #method-content - - - - enum-values - - patterns - - - begin - (?<=;|^)\s*\b([A-Z0-9_]+)(?=\s*(?:,|;|}|\(|$)) - beginCaptures - - 1 - - name - constant.enum.name.groovy - - - end - ,|;|(?=})|^(?!\s*\w+\s*(?:,|$)) - patterns - - - begin - \( - end - \) - name - meta.enum.value.groovy - patterns - - - match - , - name - punctuation.definition.seperator.parameter.groovy - - - include - #groovy-code - - - - - - - - groovy - - patterns - - - include - #comments - - - include - #class - - - include - #variables - - - include - #methods - - - include - #annotations - - - include - #groovy-code - - - - groovy-code - - patterns - - - include - #groovy-code-minus-map-keys - - - include - #map-keys - - - - groovy-code-minus-map-keys - - comment - In some situations, maps can't be declared without enclosing []'s, - therefore we create a collection of everything but that - patterns - - - include - #comments - - - include - #annotations - - - include - #support-functions - - - include - #keyword-language - - - include - #values - - - include - #anonymous-classes-and-new - - - include - #keyword-operator - - - include - #types - - - include - #storage-modifiers - - - include - #parens - - - include - #closures - - - include - #braces - - - - keyword - - patterns - - - include - #keyword-operator - - - include - #keyword-language - - - - keyword-language - - patterns - - - match - \b(try|catch|finally|throw)\b - name - keyword.control.exception.groovy - - - match - \b((?<!\.)(?:return|break|continue|default|do|while|for|switch|if|else))\b - name - keyword.control.groovy - - - begin - \bcase\b - beginCaptures - - 0 - - name - keyword.control.groovy - - - end - : - endCaptures - - 0 - - name - punctuation.definition.case-terminator.groovy - - - name - meta.case.groovy - patterns - - - include - #groovy-code-minus-map-keys - - - - - begin - \b(assert)\s - beginCaptures - - 1 - - name - keyword.control.assert.groovy - - - end - $|;|} - name - meta.declaration.assertion.groovy - patterns - - - match - : - name - keyword.operator.assert.expression-seperator.groovy - - - include - #groovy-code-minus-map-keys - - - - - match - \b(throws)\b - name - keyword.other.throws.groovy - - - - keyword-operator - - patterns - - - match - \b(as)\b - name - keyword.operator.as.groovy - - - match - \b(in)\b - name - keyword.operator.in.groovy - - - match - \?\: - name - keyword.operator.elvis.groovy - - - match - \*\: - name - keyword.operator.spreadmap.groovy - - - match - \.\. - name - keyword.operator.range.groovy - - - match - \-> - name - keyword.operator.arrow.groovy - - - match - << - name - keyword.operator.leftshift.groovy - - - match - (?<=\S)\.(?=\S) - name - keyword.operator.navigation.groovy - - - match - (?<=\S)\?\.(?=\S) - name - keyword.operator.safe-navigation.groovy - - - begin - \? - beginCaptures - - 0 - - name - keyword.operator.ternary.groovy - - - end - (?=$|\)|}|]) - name - meta.evaluation.ternary.groovy - patterns - - - match - : - name - keyword.operator.ternary.expression-seperator.groovy - - - include - #groovy-code-minus-map-keys - - - - - match - ==~ - name - keyword.operator.match.groovy - - - match - =~ - name - keyword.operator.find.groovy - - - match - \b(instanceof)\b - name - keyword.operator.instanceof.groovy - - - match - (===|==|!=|<=|>=|<=>|<>|<|>|<<) - name - keyword.operator.comparison.groovy - - - match - = - name - keyword.operator.assignment.groovy - - - match - (\-\-|\+\+) - name - keyword.operator.increment-decrement.groovy - - - match - (\-|\+|\*|\/|%) - name - keyword.operator.arithmetic.groovy - - - match - (!|&&|\|\|) - name - keyword.operator.logical.groovy - - - - language-variables - - patterns - - - match - \b(this|super)\b - name - variable.language.groovy - - - - map-keys - - patterns - - - captures - - 1 - - name - constant.other.key.groovy - - 2 - - name - punctuation.definition.seperator.key-value.groovy - - - match - (\w+)\s*(:) - - - - method-call - - begin - ([\w$]+)(\() - beginCaptures - - 1 - - name - meta.method.groovy - - 2 - - name - punctuation.definition.method-parameters.begin.groovy - - - end - \) - endCaptures - - 0 - - name - punctuation.definition.method-parameters.end.groovy - - - name - meta.method-call.groovy - patterns - - - match - , - name - punctuation.definition.seperator.parameter.groovy - - - include - #groovy-code - - - - method-content - - patterns - - - match - \s - - - include - #annotations - - - begin - (?=(?:\w|<)[^\(]*\s+(?:[\w$]|<)+\s*\() - end - (?=[\w$]+\s*\() - name - meta.method.return-type.java - patterns - - - include - #storage-modifiers - - - include - #types - - - - - begin - ([\w$]+)\s*\( - beginCaptures - - 1 - - name - entity.name.function.java - - - end - \) - name - meta.definition.method.signature.java - patterns - - - begin - (?=[^)]) - end - (?=\)) - name - meta.method.parameters.groovy - patterns - - - begin - (?=[^,)]) - end - (?=,|\)) - name - meta.method.parameter.groovy - patterns - - - match - , - name - punctuation.definition.separator.groovy - - - begin - = - beginCaptures - - 0 - - name - keyword.operator.assignment.groovy - - - end - (?=,|\)) - name - meta.parameter.default.groovy - patterns - - - include - #groovy-code - - - - - include - #parameters - - - - - - - - - begin - (?=<) - end - (?=\s) - name - meta.method.paramerised-type.groovy - patterns - - - begin - < - end - > - name - storage.type.parameters.groovy - patterns - - - include - #types - - - match - , - name - punctuation.definition.seperator.groovy - - - - - - - begin - throws - beginCaptures - - 0 - - name - storage.modifier.groovy - - - end - (?={|;)|^(?=\s*(?:[^{\s]|$)) - name - meta.throwables.groovy - patterns - - - include - #object-types - - - - - begin - { - end - (?=}) - name - meta.method.body.java - patterns - - - include - #groovy-code - - - - - - methods - - applyEndPatternLast - 1 - begin - (?x:(?<=;|^|{)(?=\s* - (?: - (?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final) # visibility/modifier - | - (?:def) - | - (?: - (?: - (?:void|boolean|byte|char|short|int|float|long|double) - | - (?:@?(?:[a-zA-Z]\w*\.)*[A-Z]+\w*) # object type - ) - [\[\]]* - (?:<.*>)? - ) - - ) - \s+ - ([^=]+\s+)?\w+\s*\( - )) - end - }|(?=[^{]) - name - meta.definition.method.groovy - patterns - - - include - #method-content - - - - nest_curly - - begin - \{ - captures - - 0 - - name - punctuation.section.scope.groovy - - - end - \} - patterns - - - include - #nest_curly - - - - numbers - - patterns - - - match - ((0(x|X)[0-9a-fA-F]*)|(\+|-)?\b(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDdg]|UL|ul)?\b - name - constant.numeric.groovy - - - - object-types - - patterns - - - begin - \b((?:[a-z]\w*\.)*(?:[A-Z]+\w*[a-z]+\w*|UR[LI]))< - end - >|[^\w\s,\?<\[\]] - name - storage.type.generic.groovy - patterns - - - include - #object-types - - - begin - < - comment - This is just to support <>'s with no actual type prefix - end - >|[^\w\s,\[\]<] - name - storage.type.generic.groovy - - - - - begin - \b((?:[a-z]\w*\.)*[A-Z]+\w*[a-z]+\w*)(?=\[) - end - (?=[^\]\s]) - name - storage.type.object.array.groovy - patterns - - - begin - \[ - end - \] - patterns - - - include - #groovy - - - - - - - match - \b(?:[a-zA-Z]\w*\.)*(?:[A-Z]+\w*[a-z]+\w*|UR[LI])\b - name - storage.type.groovy - - - - object-types-inherited - - patterns - - - begin - \b((?:[a-zA-Z]\w*\.)*[A-Z]+\w*[a-z]+\w*)< - end - >|[^\w\s,\?<\[\]] - name - entity.other.inherited-class.groovy - patterns - - - include - #object-types-inherited - - - begin - < - comment - This is just to support <>'s with no actual type prefix - end - >|[^\w\s,\[\]<] - name - storage.type.generic.groovy - - - - - captures - - 1 - - name - keyword.operator.dereference.groovy - - - match - \b(?:[a-zA-Z]\w*(\.))*[A-Z]+\w*[a-z]+\w*\b - name - entity.other.inherited-class.groovy - - - - parameters - - patterns - - - include - #annotations - - - include - #storage-modifiers - - - include - #types - - - match - \w+ - name - variable.parameter.method.groovy - - - - parens - - begin - \( - end - \) - patterns - - - include - #groovy-code - - - - primitive-arrays - - patterns - - - match - \b(?:void|boolean|byte|char|short|int|float|long|double)(\[\])*\b - name - storage.type.primitive.array.groovy - - - - primitive-types - - patterns - - - match - \b(?:void|boolean|byte|char|short|int|float|long|double)\b - name - storage.type.primitive.groovy - - - - regexp - - patterns - - - begin - /(?=[^/]+/([^>]|$)) - beginCaptures - - 0 - - name - punctuation.definition.string.regexp.begin.groovy - - - end - / - endCaptures - - 0 - - name - punctuation.definition.string.regexp.end.groovy - - - name - string.regexp.groovy - patterns - - - match - \\. - name - constant.character.escape.groovy - - - - - begin - ~" - beginCaptures - - 0 - - name - punctuation.definition.string.regexp.begin.groovy - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.regexp.end.groovy - - - name - string.regexp.compiled.groovy - patterns - - - match - \\. - name - constant.character.escape.groovy - - - - - - storage-modifiers - - patterns - - - match - \b(private|protected|public)\b - name - storage.modifier.access-control.groovy - - - match - \b(static)\b - name - storage.modifier.static.groovy - - - match - \b(final)\b - name - storage.modifier.final.groovy - - - match - \b(native|synchronized|abstract|threadsafe|transient)\b - name - storage.modifier.other.groovy - - - - string-quoted-double - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.groovy - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.groovy - - - name - string.quoted.double.groovy - patterns - - - include - #string-quoted-double-contents - - - - string-quoted-double-contents - - patterns - - - match - \\. - name - constant.character.escape.groovy - - - applyEndPatternLast - 1 - begin - \$\w - end - (?=\W) - name - variable.other.interpolated.groovy - patterns - - - match - \w - name - variable.other.interpolated.groovy - - - match - \. - name - keyword.other.dereference.groovy - - - - - begin - \$\{ - captures - - 0 - - name - punctuation.section.embedded.groovy - - - end - \} - name - source.groovy.embedded.source - patterns - - - include - #nest_curly - - - - - - string-quoted-double-multiline - - begin - """ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.groovy - - - end - """ - endCaptures - - 0 - - name - punctuation.definition.string.end.groovy - - - name - string.quoted.double.multiline.groovy - patterns - - - include - #string-quoted-double-contents - - - - string-quoted-single - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.groovy - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.groovy - - - name - string.quoted.single.groovy - patterns - - - include - #string-quoted-single-contents - - - - string-quoted-single-contents - - patterns - - - match - \\. - name - constant.character.escape.groovy - - - - string-quoted-single-multiline - - begin - ''' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.groovy - - - end - ''' - endCaptures - - 0 - - name - punctuation.definition.string.end.groovy - - - name - string.quoted.single.multiline.groovy - patterns - - - include - #string-quoted-single-contents - - - - strings - - patterns - - - include - #string-quoted-double-multiline - - - include - #string-quoted-single-multiline - - - include - #string-quoted-double - - - include - #string-quoted-single - - - include - #regexp - - - - structures - - begin - \[ - beginCaptures - - 0 - - name - punctuation.definition.structure.begin.groovy - - - end - \] - endCaptures - - 0 - - name - punctuation.definition.structure.end.groovy - - - name - meta.structure.groovy - patterns - - - include - #groovy-code - - - match - , - name - punctuation.definition.separator.groovy - - - - support-functions - - patterns - - - match - (?x)\b(?:sprintf|print(?:f|ln)?)\b - name - support.function.print.groovy - - - match - (?x)\b(?:shouldFail|fail(?:NotEquals)?|ass(?:ume|ert(?:S(?:cript|ame)|N(?:ot(?:Same| - Null)|ull)|Contains|T(?:hat|oString|rue)|Inspect|Equals|False|Length| - ArrayEquals)))\b - name - support.function.testing.groovy - - - - types - - patterns - - - match - \b(def)\b - name - storage.type.def.groovy - - - include - #primitive-types - - - include - #primitive-arrays - - - include - #object-types - - - - values - - patterns - - - include - #language-variables - - - include - #strings - - - include - #numbers - - - include - #constants - - - include - #types - - - include - #structures - - - include - #method-call - - - - variables - - applyEndPatternLast - 1 - patterns - - - begin - (?x:(?= - (?: - (?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final) # visibility/modifier - | - (?:def) - | - (?:void|boolean|byte|char|short|int|float|long|double) - | - (?:(?:[a-z]\w*\.)*[A-Z]+\w*) # object type - ) - \s+ - [\w\d_<>\[\],\s]+ - (?:=|$) - - )) - end - ;|$ - name - meta.definition.variable.groovy - patterns - - - match - \s - - - captures - - 1 - - name - constant.variable.groovy - - - match - ([A-Z_0-9]+)\s+(?=\=) - - - captures - - 1 - - name - meta.definition.variable.name.groovy - - - match - (\w[^\s,]*)\s+(?=\=) - - - begin - = - beginCaptures - - 0 - - name - keyword.operator.assignment.groovy - - - end - $ - patterns - - - include - #groovy-code - - - - - captures - - 1 - - name - meta.definition.variable.name.groovy - - - match - (\w[^\s=]*)(?=\s*($|;)) - - - include - #groovy-code - - - - - - - scopeName - source.groovy - uuid - B3A64888-EBBB-4436-8D9E-F1169C5D7613 - - \ No newline at end of file diff --git a/extensions/groovy/syntaxes/groovy.tmLanguage.json b/extensions/groovy/syntaxes/groovy.tmLanguage.json new file mode 100644 index 00000000000..3dc8af7d0a1 --- /dev/null +++ b/extensions/groovy/syntaxes/groovy.tmLanguage.json @@ -0,0 +1,1390 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/groovy.tmbundle/blob/master/Syntaxes/Groovy.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "fileTypes": [ + "groovy", + "gvy" + ], + "foldingStartMarker": "(\\{\\s*$|^\\s*// \\{\\{\\{)", + "foldingStopMarker": "^\\s*(\\}|// \\}\\}\\}$)", + "keyEquivalent": "^~G", + "name": "Groovy", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.groovy" + } + }, + "match": "^(#!).+$\\n", + "name": "comment.line.hashbang.groovy" + }, + { + "captures": { + "1": { + "name": "keyword.other.package.groovy" + }, + "2": { + "name": "storage.modifier.package.groovy" + }, + "3": { + "name": "punctuation.terminator.groovy" + } + }, + "match": "^\\s*(package)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?", + "name": "meta.package.groovy" + }, + { + "begin": "(import static)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.other.import.static.groovy" + } + }, + "captures": { + "1": { + "name": "keyword.other.import.groovy" + }, + "2": { + "name": "storage.modifier.import.groovy" + }, + "3": { + "name": "punctuation.terminator.groovy" + } + }, + "contentName": "storage.modifier.import.groovy", + "end": "\\s*(?:$|(?=%>)(;))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.groovy" + } + }, + "name": "meta.import.groovy", + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.groovy" + }, + { + "match": "\\s", + "name": "invalid.illegal.character_not_allowed_here.groovy" + } + ] + }, + { + "begin": "(import)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.other.import.groovy" + } + }, + "captures": { + "1": { + "name": "keyword.other.import.groovy" + }, + "2": { + "name": "storage.modifier.import.groovy" + }, + "3": { + "name": "punctuation.terminator.groovy" + } + }, + "contentName": "storage.modifier.import.groovy", + "end": "\\s*(?:$|(?=%>)|(;))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.groovy" + } + }, + "name": "meta.import.groovy", + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.groovy" + }, + { + "match": "\\s", + "name": "invalid.illegal.character_not_allowed_here.groovy" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.other.import.groovy" + }, + "2": { + "name": "keyword.other.import.static.groovy" + }, + "3": { + "name": "storage.modifier.import.groovy" + }, + "4": { + "name": "punctuation.terminator.groovy" + } + }, + "match": "^\\s*(import)(?:\\s+(static)\\s+)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?", + "name": "meta.import.groovy" + }, + { + "include": "#groovy" + } + ], + "repository": { + "annotations": { + "patterns": [ + { + "begin": "(?)", + "end": "\\}", + "patterns": [ + { + "begin": "(?<=\\{)(?=[^\\}]*?->)", + "end": "->", + "endCaptures": { + "0": { + "name": "keyword.operator.groovy" + } + }, + "patterns": [ + { + "begin": "(?!->)", + "end": "(?=->)", + "name": "meta.closure.parameters.groovy", + "patterns": [ + { + "begin": "(?!,|->)", + "end": "(?=,|->)", + "name": "meta.closure.parameter.groovy", + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.groovy" + } + }, + "end": "(?=,|->)", + "name": "meta.parameter.default.groovy", + "patterns": [ + { + "include": "#groovy-code" + } + ] + }, + { + "include": "#parameters" + } + ] + } + ] + } + ] + }, + { + "begin": "(?=[^}])", + "end": "(?=\\})", + "patterns": [ + { + "include": "#groovy-code" + } + ] + } + ] + }, + "comment-block": { + "begin": "/\\*", + "captures": { + "0": { + "name": "punctuation.definition.comment.groovy" + } + }, + "end": "\\*/", + "name": "comment.block.groovy" + }, + "comments": { + "patterns": [ + { + "captures": { + "0": { + "name": "punctuation.definition.comment.groovy" + } + }, + "match": "/\\*\\*/", + "name": "comment.block.empty.groovy" + }, + { + "include": "text.html.javadoc" + }, + { + "include": "#comment-block" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.groovy" + } + }, + "match": "(//).*$\\n?", + "name": "comment.line.double-slash.groovy" + } + ] + }, + "constants": { + "patterns": [ + { + "match": "\\b([A-Z][A-Z0-9_]+)\\b", + "name": "constant.other.groovy" + }, + { + "match": "\\b(true|false|null)\\b", + "name": "constant.language.groovy" + } + ] + }, + "constructors": { + "applyEndPatternLast": 1, + "begin": "(?<=;|^)(?=\\s*(?:(?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)\\s+)*[A-Z]\\w*\\()", + "end": "}", + "patterns": [ + { + "include": "#method-content" + } + ] + }, + "enum-values": { + "patterns": [ + { + "begin": "(?<=;|^)\\s*\\b([A-Z0-9_]+)(?=\\s*(?:,|;|}|\\(|$))", + "beginCaptures": { + "1": { + "name": "constant.enum.name.groovy" + } + }, + "end": ",|;|(?=})|^(?!\\s*\\w+\\s*(?:,|$))", + "patterns": [ + { + "begin": "\\(", + "end": "\\)", + "name": "meta.enum.value.groovy", + "patterns": [ + { + "match": ",", + "name": "punctuation.definition.seperator.parameter.groovy" + }, + { + "include": "#groovy-code" + } + ] + } + ] + } + ] + }, + "groovy": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#class" + }, + { + "include": "#variables" + }, + { + "include": "#methods" + }, + { + "include": "#annotations" + }, + { + "include": "#groovy-code" + } + ] + }, + "groovy-code": { + "patterns": [ + { + "include": "#groovy-code-minus-map-keys" + }, + { + "include": "#map-keys" + } + ] + }, + "groovy-code-minus-map-keys": { + "comment": "In some situations, maps can't be declared without enclosing []'s, \n\t\t\t\ttherefore we create a collection of everything but that", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#annotations" + }, + { + "include": "#support-functions" + }, + { + "include": "#keyword-language" + }, + { + "include": "#values" + }, + { + "include": "#anonymous-classes-and-new" + }, + { + "include": "#keyword-operator" + }, + { + "include": "#types" + }, + { + "include": "#storage-modifiers" + }, + { + "include": "#parens" + }, + { + "include": "#closures" + }, + { + "include": "#braces" + } + ] + }, + "keyword": { + "patterns": [ + { + "include": "#keyword-operator" + }, + { + "include": "#keyword-language" + } + ] + }, + "keyword-language": { + "patterns": [ + { + "match": "\\b(try|catch|finally|throw)\\b", + "name": "keyword.control.exception.groovy" + }, + { + "match": "\\b((?", + "name": "keyword.operator.arrow.groovy" + }, + { + "match": "<<", + "name": "keyword.operator.leftshift.groovy" + }, + { + "match": "(?<=\\S)\\.(?=\\S)", + "name": "keyword.operator.navigation.groovy" + }, + { + "match": "(?<=\\S)\\?\\.(?=\\S)", + "name": "keyword.operator.safe-navigation.groovy" + }, + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.groovy" + } + }, + "end": "(?=$|\\)|}|])", + "name": "meta.evaluation.ternary.groovy", + "patterns": [ + { + "match": ":", + "name": "keyword.operator.ternary.expression-seperator.groovy" + }, + { + "include": "#groovy-code-minus-map-keys" + } + ] + }, + { + "match": "==~", + "name": "keyword.operator.match.groovy" + }, + { + "match": "=~", + "name": "keyword.operator.find.groovy" + }, + { + "match": "\\b(instanceof)\\b", + "name": "keyword.operator.instanceof.groovy" + }, + { + "match": "(===|==|!=|<=|>=|<=>|<>|<|>|<<)", + "name": "keyword.operator.comparison.groovy" + }, + { + "match": "=", + "name": "keyword.operator.assignment.groovy" + }, + { + "match": "(\\-\\-|\\+\\+)", + "name": "keyword.operator.increment-decrement.groovy" + }, + { + "match": "(\\-|\\+|\\*|\\/|%)", + "name": "keyword.operator.arithmetic.groovy" + }, + { + "match": "(!|&&|\\|\\|)", + "name": "keyword.operator.logical.groovy" + } + ] + }, + "language-variables": { + "patterns": [ + { + "match": "\\b(this|super)\\b", + "name": "variable.language.groovy" + } + ] + }, + "map-keys": { + "patterns": [ + { + "captures": { + "1": { + "name": "constant.other.key.groovy" + }, + "2": { + "name": "punctuation.definition.seperator.key-value.groovy" + } + }, + "match": "(\\w+)\\s*(:)" + } + ] + }, + "method-call": { + "begin": "([\\w$]+)(\\()", + "beginCaptures": { + "1": { + "name": "meta.method.groovy" + }, + "2": { + "name": "punctuation.definition.method-parameters.begin.groovy" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.method-parameters.end.groovy" + } + }, + "name": "meta.method-call.groovy", + "patterns": [ + { + "match": ",", + "name": "punctuation.definition.seperator.parameter.groovy" + }, + { + "include": "#groovy-code" + } + ] + }, + "method-content": { + "patterns": [ + { + "match": "\\s" + }, + { + "include": "#annotations" + }, + { + "begin": "(?=(?:\\w|<)[^\\(]*\\s+(?:[\\w$]|<)+\\s*\\()", + "end": "(?=[\\w$]+\\s*\\()", + "name": "meta.method.return-type.java", + "patterns": [ + { + "include": "#storage-modifiers" + }, + { + "include": "#types" + } + ] + }, + { + "begin": "([\\w$]+)\\s*\\(", + "beginCaptures": { + "1": { + "name": "entity.name.function.java" + } + }, + "end": "\\)", + "name": "meta.definition.method.signature.java", + "patterns": [ + { + "begin": "(?=[^)])", + "end": "(?=\\))", + "name": "meta.method.parameters.groovy", + "patterns": [ + { + "begin": "(?=[^,)])", + "end": "(?=,|\\))", + "name": "meta.method.parameter.groovy", + "patterns": [ + { + "match": ",", + "name": "punctuation.definition.separator.groovy" + }, + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.groovy" + } + }, + "end": "(?=,|\\))", + "name": "meta.parameter.default.groovy", + "patterns": [ + { + "include": "#groovy-code" + } + ] + }, + { + "include": "#parameters" + } + ] + } + ] + } + ] + }, + { + "begin": "(?=<)", + "end": "(?=\\s)", + "name": "meta.method.paramerised-type.groovy", + "patterns": [ + { + "begin": "<", + "end": ">", + "name": "storage.type.parameters.groovy", + "patterns": [ + { + "include": "#types" + }, + { + "match": ",", + "name": "punctuation.definition.seperator.groovy" + } + ] + } + ] + }, + { + "begin": "throws", + "beginCaptures": { + "0": { + "name": "storage.modifier.groovy" + } + }, + "end": "(?={|;)|^(?=\\s*(?:[^{\\s]|$))", + "name": "meta.throwables.groovy", + "patterns": [ + { + "include": "#object-types" + } + ] + }, + { + "begin": "{", + "end": "(?=})", + "name": "meta.method.body.java", + "patterns": [ + { + "include": "#groovy-code" + } + ] + } + ] + }, + "methods": { + "applyEndPatternLast": 1, + "begin": "(?x:(?<=;|^|{)(?=\\s*\n (?:\n (?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final) # visibility/modifier\n |\n (?:def)\n |\n (?:\n (?:\n (?:void|boolean|byte|char|short|int|float|long|double)\n |\n (?:@?(?:[a-zA-Z]\\w*\\.)*[A-Z]+\\w*) # object type\n )\n [\\[\\]]*\n (?:<.*>)?\n ) \n \n )\n \\s+\n ([^=]+\\s+)?\\w+\\s*\\(\n\t\t\t))", + "end": "}|(?=[^{])", + "name": "meta.definition.method.groovy", + "patterns": [ + { + "include": "#method-content" + } + ] + }, + "nest_curly": { + "begin": "\\{", + "captures": { + "0": { + "name": "punctuation.section.scope.groovy" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#nest_curly" + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "((0(x|X)[0-9a-fA-F]*)|(\\+|-)?\\b(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFfUuDdg]|UL|ul)?\\b", + "name": "constant.numeric.groovy" + } + ] + }, + "object-types": { + "patterns": [ + { + "begin": "\\b((?:[a-z]\\w*\\.)*(?:[A-Z]+\\w*[a-z]+\\w*|UR[LI]))<", + "end": ">|[^\\w\\s,\\?<\\[\\]]", + "name": "storage.type.generic.groovy", + "patterns": [ + { + "include": "#object-types" + }, + { + "begin": "<", + "comment": "This is just to support <>'s with no actual type prefix", + "end": ">|[^\\w\\s,\\[\\]<]", + "name": "storage.type.generic.groovy" + } + ] + }, + { + "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*[a-z]+\\w*)(?=\\[)", + "end": "(?=[^\\]\\s])", + "name": "storage.type.object.array.groovy", + "patterns": [ + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#groovy" + } + ] + } + ] + }, + { + "match": "\\b(?:[a-zA-Z]\\w*\\.)*(?:[A-Z]+\\w*[a-z]+\\w*|UR[LI])\\b", + "name": "storage.type.groovy" + } + ] + }, + "object-types-inherited": { + "patterns": [ + { + "begin": "\\b((?:[a-zA-Z]\\w*\\.)*[A-Z]+\\w*[a-z]+\\w*)<", + "end": ">|[^\\w\\s,\\?<\\[\\]]", + "name": "entity.other.inherited-class.groovy", + "patterns": [ + { + "include": "#object-types-inherited" + }, + { + "begin": "<", + "comment": "This is just to support <>'s with no actual type prefix", + "end": ">|[^\\w\\s,\\[\\]<]", + "name": "storage.type.generic.groovy" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.dereference.groovy" + } + }, + "match": "\\b(?:[a-zA-Z]\\w*(\\.))*[A-Z]+\\w*[a-z]+\\w*\\b", + "name": "entity.other.inherited-class.groovy" + } + ] + }, + "parameters": { + "patterns": [ + { + "include": "#annotations" + }, + { + "include": "#storage-modifiers" + }, + { + "include": "#types" + }, + { + "match": "\\w+", + "name": "variable.parameter.method.groovy" + } + ] + }, + "parens": { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#groovy-code" + } + ] + }, + "primitive-arrays": { + "patterns": [ + { + "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)(\\[\\])*\\b", + "name": "storage.type.primitive.array.groovy" + } + ] + }, + "primitive-types": { + "patterns": [ + { + "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)\\b", + "name": "storage.type.primitive.groovy" + } + ] + }, + "regexp": { + "patterns": [ + { + "begin": "/(?=[^/]+/([^>]|$))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.regexp.begin.groovy" + } + }, + "end": "/", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.regexp.end.groovy" + } + }, + "name": "string.regexp.groovy", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.groovy" + } + ] + }, + { + "begin": "~\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.regexp.begin.groovy" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.regexp.end.groovy" + } + }, + "name": "string.regexp.compiled.groovy", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.groovy" + } + ] + } + ] + }, + "storage-modifiers": { + "patterns": [ + { + "match": "\\b(private|protected|public)\\b", + "name": "storage.modifier.access-control.groovy" + }, + { + "match": "\\b(static)\\b", + "name": "storage.modifier.static.groovy" + }, + { + "match": "\\b(final)\\b", + "name": "storage.modifier.final.groovy" + }, + { + "match": "\\b(native|synchronized|abstract|threadsafe|transient)\\b", + "name": "storage.modifier.other.groovy" + } + ] + }, + "string-quoted-double": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.groovy" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.groovy" + } + }, + "name": "string.quoted.double.groovy", + "patterns": [ + { + "include": "#string-quoted-double-contents" + } + ] + }, + "string-quoted-double-contents": { + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.groovy" + }, + { + "applyEndPatternLast": 1, + "begin": "\\$\\w", + "end": "(?=\\W)", + "name": "variable.other.interpolated.groovy", + "patterns": [ + { + "match": "\\w", + "name": "variable.other.interpolated.groovy" + }, + { + "match": "\\.", + "name": "keyword.other.dereference.groovy" + } + ] + }, + { + "begin": "\\$\\{", + "captures": { + "0": { + "name": "punctuation.section.embedded.groovy" + } + }, + "end": "\\}", + "name": "source.groovy.embedded.source", + "patterns": [ + { + "include": "#nest_curly" + } + ] + } + ] + }, + "string-quoted-double-multiline": { + "begin": "\"\"\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.groovy" + } + }, + "end": "\"\"\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.groovy" + } + }, + "name": "string.quoted.double.multiline.groovy", + "patterns": [ + { + "include": "#string-quoted-double-contents" + } + ] + }, + "string-quoted-single": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.groovy" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.groovy" + } + }, + "name": "string.quoted.single.groovy", + "patterns": [ + { + "include": "#string-quoted-single-contents" + } + ] + }, + "string-quoted-single-contents": { + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.groovy" + } + ] + }, + "string-quoted-single-multiline": { + "begin": "'''", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.groovy" + } + }, + "end": "'''", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.groovy" + } + }, + "name": "string.quoted.single.multiline.groovy", + "patterns": [ + { + "include": "#string-quoted-single-contents" + } + ] + }, + "strings": { + "patterns": [ + { + "include": "#string-quoted-double-multiline" + }, + { + "include": "#string-quoted-single-multiline" + }, + { + "include": "#string-quoted-double" + }, + { + "include": "#string-quoted-single" + }, + { + "include": "#regexp" + } + ] + }, + "structures": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.structure.begin.groovy" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.structure.end.groovy" + } + }, + "name": "meta.structure.groovy", + "patterns": [ + { + "include": "#groovy-code" + }, + { + "match": ",", + "name": "punctuation.definition.separator.groovy" + } + ] + }, + "support-functions": { + "patterns": [ + { + "match": "(?x)\\b(?:sprintf|print(?:f|ln)?)\\b", + "name": "support.function.print.groovy" + }, + { + "match": "(?x)\\b(?:shouldFail|fail(?:NotEquals)?|ass(?:ume|ert(?:S(?:cript|ame)|N(?:ot(?:Same|\n\t\t\t\t\tNull)|ull)|Contains|T(?:hat|oString|rue)|Inspect|Equals|False|Length|\n\t\t\t\t\tArrayEquals)))\\b", + "name": "support.function.testing.groovy" + } + ] + }, + "types": { + "patterns": [ + { + "match": "\\b(def)\\b", + "name": "storage.type.def.groovy" + }, + { + "include": "#primitive-types" + }, + { + "include": "#primitive-arrays" + }, + { + "include": "#object-types" + } + ] + }, + "values": { + "patterns": [ + { + "include": "#language-variables" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#constants" + }, + { + "include": "#types" + }, + { + "include": "#structures" + }, + { + "include": "#method-call" + } + ] + }, + "variables": { + "applyEndPatternLast": 1, + "patterns": [ + { + "begin": "(?x:(?=\n (?:\n (?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final) # visibility/modifier\n |\n (?:def)\n |\n (?:void|boolean|byte|char|short|int|float|long|double)\n |\n (?:(?:[a-z]\\w*\\.)*[A-Z]+\\w*) # object type\n )\n \\s+\n [\\w\\d_<>\\[\\],\\s]+\n (?:=|$)\n \n \t\t\t))", + "end": ";|$", + "name": "meta.definition.variable.groovy", + "patterns": [ + { + "match": "\\s" + }, + { + "captures": { + "1": { + "name": "constant.variable.groovy" + } + }, + "match": "([A-Z_0-9]+)\\s+(?=\\=)" + }, + { + "captures": { + "1": { + "name": "meta.definition.variable.name.groovy" + } + }, + "match": "(\\w[^\\s,]*)\\s+(?=\\=)" + }, + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.groovy" + } + }, + "end": "$", + "patterns": [ + { + "include": "#groovy-code" + } + ] + }, + { + "captures": { + "1": { + "name": "meta.definition.variable.name.groovy" + } + }, + "match": "(\\w[^\\s=]*)(?=\\s*($|;))" + }, + { + "include": "#groovy-code" + } + ] + } + ] + } + }, + "scopeName": "source.groovy", + "uuid": "B3A64888-EBBB-4436-8D9E-F1169C5D7613" +} \ No newline at end of file diff --git a/extensions/groovy/test/colorize-results/test_groovy.json b/extensions/groovy/test/colorize-results/test_groovy.json index 7e74addd23e..ee78a65becc 100644 --- a/extensions/groovy/test/colorize-results/test_groovy.json +++ b/extensions/groovy/test/colorize-results/test_groovy.json @@ -29,7 +29,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -150,7 +150,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -205,7 +205,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -260,7 +260,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -282,7 +282,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -304,7 +304,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -436,7 +436,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -524,7 +524,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -623,7 +623,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -1437,7 +1437,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1481,7 +1481,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1492,7 +1492,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1569,7 +1569,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1602,7 +1602,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1679,7 +1679,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1712,7 +1712,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2207,7 +2207,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -2405,7 +2405,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -2482,7 +2482,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2504,7 +2504,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -2658,7 +2658,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -3274,7 +3274,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -3307,7 +3307,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3318,7 +3318,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3340,7 +3340,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3362,7 +3362,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3373,7 +3373,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3395,7 +3395,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3472,7 +3472,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3505,7 +3505,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3549,7 +3549,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -3582,7 +3582,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3604,7 +3604,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3615,7 +3615,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3670,7 +3670,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3791,7 +3791,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -3879,7 +3879,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -3978,7 +3978,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -4000,7 +4000,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -4121,7 +4121,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -4143,7 +4143,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -4187,7 +4187,7 @@ "light_plus": "storage.type.primitive.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.groovy: #4EC9B0" } }, { @@ -4209,7 +4209,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -4231,7 +4231,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -4253,7 +4253,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4297,7 +4297,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4429,7 +4429,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -4528,7 +4528,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -4583,7 +4583,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4649,7 +4649,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4715,7 +4715,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4737,7 +4737,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4803,7 +4803,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4869,7 +4869,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4902,7 +4902,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -5012,7 +5012,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -5089,7 +5089,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -5298,7 +5298,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5771,7 +5771,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -5826,7 +5826,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6057,7 +6057,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6453,7 +6453,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6596,7 +6596,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -6981,7 +6981,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7124,7 +7124,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -7432,7 +7432,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -7476,7 +7476,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -7564,7 +7564,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -7652,7 +7652,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -7696,7 +7696,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -7784,7 +7784,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -7839,7 +7839,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7872,7 +7872,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7916,7 +7916,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -8048,7 +8048,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -8125,7 +8125,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -8180,7 +8180,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8246,7 +8246,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -8334,7 +8334,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -8378,7 +8378,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -8510,7 +8510,7 @@ "light_plus": "meta.definition.variable.name: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.definition.variable.name: #9CDCFE" } }, { @@ -8554,7 +8554,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8587,7 +8587,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8851,7 +8851,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -8873,7 +8873,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8906,7 +8906,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9005,7 +9005,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -9148,7 +9148,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -9192,7 +9192,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -9214,7 +9214,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -9478,7 +9478,7 @@ "light_plus": "storage.type.annotation.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.annotation.groovy: #4EC9B0" } }, { @@ -9489,7 +9489,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -9511,7 +9511,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -9566,7 +9566,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -9654,7 +9654,7 @@ "light_plus": "storage.type.object.array.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.object.array.groovy: #4EC9B0" } }, { @@ -9830,7 +9830,7 @@ "light_plus": "storage.type.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.groovy: #4EC9B0" } }, { @@ -9918,7 +9918,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10083,7 +10083,7 @@ "light_plus": "storage.type.annotation.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.annotation.groovy: #4EC9B0" } }, { @@ -10094,7 +10094,7 @@ "light_plus": "storage.type.primitive.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.groovy: #4EC9B0" } }, { @@ -10116,7 +10116,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -10138,7 +10138,7 @@ "light_plus": "storage.type.primitive.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.groovy: #4EC9B0" } }, { @@ -10160,7 +10160,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10193,7 +10193,7 @@ "light_plus": "storage.type.primitive.groovy: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.groovy: #4EC9B0" } }, { @@ -10215,7 +10215,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10303,7 +10303,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json index 6e67c3153de..e8bac905a69 100644 --- a/extensions/grunt/package.json +++ b/extensions/grunt/package.json @@ -7,13 +7,12 @@ "engines": { "vscode": "*" }, - "enableProposedApi": true, "categories": [ "Other" ], "scripts": { - "compile": "gulp compile-extension:gulp", - "watch": "gulp watch-extension:gulp" + "compile": "gulp compile-extension:grunt", + "watch": "gulp watch-extension:grunt" }, "dependencies": { "vscode-nls": "^2.0.2" @@ -23,9 +22,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { diff --git a/extensions/grunt/src/main.ts b/extensions/grunt/src/main.ts index ff551f904ec..a90eff6c933 100644 --- a/extensions/grunt/src/main.ts +++ b/extensions/grunt/src/main.ts @@ -139,8 +139,8 @@ async function getGruntTasks(): Promise { if (matches && matches.length === 2) { let taskName = matches[1]; let task = taskName.indexOf(' ') === -1 - ? new vscode.ShellTask(`grunt: ${taskName}`, `${command} ${taskName}`) - : new vscode.ShellTask(`grunt: ${taskName}`, `${command} "${taskName}"`); + ? new vscode.ShellTask(taskName, `${command} ${taskName}`) + : new vscode.ShellTask(taskName, `${command} "${taskName}"`); task.identifier = `grunt.${taskName}`; result.push(task); let lowerCaseTaskName = taskName.toLowerCase(); diff --git a/extensions/grunt/tsconfig.json b/extensions/grunt/tsconfig.json index d815a565579..e804fa3acd7 100644 --- a/extensions/grunt/tsconfig.json +++ b/extensions/grunt/tsconfig.json @@ -12,8 +12,7 @@ "noUnusedLocals": true, "noUnusedParameters": true }, - "exclude": [ - "node_modules", - "out" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json index f2eb59ef074..5ec491853fe 100644 --- a/extensions/gulp/package.json +++ b/extensions/gulp/package.json @@ -7,7 +7,6 @@ "engines": { "vscode": "*" }, - "enableProposedApi": true, "categories": [ "Other" ], @@ -23,9 +22,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { diff --git a/extensions/gulp/src/main.ts b/extensions/gulp/src/main.ts index e4bbba3b422..c75a8ce5d9c 100644 --- a/extensions/gulp/src/main.ts +++ b/extensions/gulp/src/main.ts @@ -103,6 +103,7 @@ async function getGulpTasks(): Promise { let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot }); if (stderr) { channel.appendLine(stderr); + channel.show(true); } let result: vscode.Task[] = []; if (stdout) { @@ -113,7 +114,7 @@ async function getGulpTasks(): Promise { if (line.length === 0) { continue; } - let task = new vscode.ShellTask(`gulp: ${line}`, `${gulpCommand} ${line}`); + let task = new vscode.ShellTask(line, `${gulpCommand} ${line}`); task.identifier = `gulp.${line}`; result.push(task); let lowerCaseLine = line.toLowerCase(); diff --git a/extensions/gulp/tsconfig.json b/extensions/gulp/tsconfig.json index d815a565579..e804fa3acd7 100644 --- a/extensions/gulp/tsconfig.json +++ b/extensions/gulp/tsconfig.json @@ -12,8 +12,7 @@ "noUnusedLocals": true, "noUnusedParameters": true }, - "exclude": [ - "node_modules", - "out" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json b/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json index 9e3579d90c2..e915b691d7f 100644 --- a/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json +++ b/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/daaain/Handlebars/blob/master/grammars/Handlebars.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "Handlebars", "repository": { "html_tags": { @@ -849,6 +854,5 @@ "template", "tmpl" ], - "uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484", - "version": "https://github.com/daaain/Handlebars/commit/4e8244410815da73f93375532939d48bd5a9bb93" + "uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484" } \ No newline at end of file diff --git a/extensions/handlebars/test/colorize-results/test_handlebars.json b/extensions/handlebars/test/colorize-results/test_handlebars.json index cdf6cca84cc..a14353771e5 100644 --- a/extensions/handlebars/test/colorize-results/test_handlebars.json +++ b/extensions/handlebars/test/colorize-results/test_handlebars.json @@ -150,7 +150,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -161,7 +161,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -172,7 +172,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -227,7 +227,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -249,7 +249,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -260,7 +260,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -315,7 +315,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -326,7 +326,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -359,7 +359,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -436,7 +436,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -546,7 +546,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -568,7 +568,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -579,7 +579,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -590,7 +590,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -634,7 +634,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -656,7 +656,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -667,7 +667,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -832,7 +832,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -997,7 +997,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1019,7 +1019,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1030,7 +1030,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1085,7 +1085,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1096,7 +1096,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1107,7 +1107,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1437,7 +1437,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1470,7 +1470,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1602,7 +1602,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1613,7 +1613,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1624,7 +1624,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1668,7 +1668,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1712,7 +1712,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1723,7 +1723,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1844,7 +1844,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1855,7 +1855,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1921,7 +1921,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { diff --git a/extensions/handlebars/test/colorize-results/test_hbs.json b/extensions/handlebars/test/colorize-results/test_hbs.json index c359f0eabc5..466499b590c 100644 --- a/extensions/handlebars/test/colorize-results/test_hbs.json +++ b/extensions/handlebars/test/colorize-results/test_hbs.json @@ -194,7 +194,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -216,7 +216,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -227,7 +227,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -359,7 +359,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -403,7 +403,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -414,7 +414,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -425,7 +425,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string.quoted.double.handlebars: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -458,7 +458,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -469,7 +469,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -480,7 +480,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -601,7 +601,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -612,7 +612,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -623,7 +623,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -678,7 +678,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -733,7 +733,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -744,7 +744,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -755,7 +755,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -777,7 +777,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -788,7 +788,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -799,7 +799,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -821,7 +821,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -832,7 +832,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -843,7 +843,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1052,7 +1052,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1074,7 +1074,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1085,7 +1085,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1140,7 +1140,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1151,7 +1151,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1184,7 +1184,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1195,7 +1195,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1206,7 +1206,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1261,7 +1261,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1415,7 +1415,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1437,7 +1437,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name: #9CDCFE", "light_vs": "entity.other.attribute-name: #FF0000", - "hc_black": "entity.other.attribute-name: #9CDCFE" + "hc_black": "variable: #9CDCFE" } }, { @@ -1525,7 +1525,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1635,7 +1635,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1668,7 +1668,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1690,7 +1690,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1712,7 +1712,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name: #9CDCFE", "light_vs": "entity.other.attribute-name: #FF0000", - "hc_black": "entity.other.attribute-name: #9CDCFE" + "hc_black": "variable: #9CDCFE" } }, { @@ -1800,7 +1800,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { @@ -1822,7 +1822,7 @@ "light_plus": "support.constant.handlebars: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.handlebars: #DCDCAA" } }, { diff --git a/extensions/hlsl/syntaxes/hlsl.json b/extensions/hlsl/syntaxes/hlsl.json index 91dcf2b2520..20565922c53 100644 --- a/extensions/hlsl/syntaxes/hlsl.json +++ b/extensions/hlsl/syntaxes/hlsl.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/tgjones/shaders-tmLanguage/blob/master/grammars/hlsl.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.hlsl", "name": "HLSL", "fileTypes": [ @@ -213,6 +218,5 @@ } ] } - ], - "version": "https://github.com/tgjones/shaders-tmLanguage/commit/cd1ef40f549f9ce2b9e6b73498688de114a85382" + ] } \ No newline at end of file diff --git a/extensions/hlsl/test/colorize-results/test_hlsl.json b/extensions/hlsl/test/colorize-results/test_hlsl.json index 0f245f64b56..06022858d4a 100644 --- a/extensions/hlsl/test/colorize-results/test_hlsl.json +++ b/extensions/hlsl/test/colorize-results/test_hlsl.json @@ -73,7 +73,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -117,7 +117,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -183,7 +183,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -249,7 +249,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/html/server/npm-shrinkwrap.json b/extensions/html/server/npm-shrinkwrap.json index 82254c66b11..ee83f51e71e 100644 --- a/extensions/html/server/npm-shrinkwrap.json +++ b/extensions/html/server/npm-shrinkwrap.json @@ -3,14 +3,21 @@ "version": "1.0.0", "dependencies": { "vscode-css-languageservice": { - "version": "2.0.2", + "version": "2.1.0", "from": "vscode-css-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.0.2.tgz" + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.0.tgz", + "dependencies": { + "vscode-languageserver-types": { + "version": "3.2.0", + "from": "vscode-languageserver-types@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.2.0.tgz" + } + } }, "vscode-html-languageservice": { - "version": "2.0.4", + "version": "2.0.5", "from": "vscode-html-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.4.tgz" + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.5.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", diff --git a/extensions/html/server/package.json b/extensions/html/server/package.json index a80e9b214ba..5284d547143 100644 --- a/extensions/html/server/package.json +++ b/extensions/html/server/package.json @@ -8,8 +8,8 @@ "node": "*" }, "dependencies": { - "vscode-css-languageservice": "^2.0.2", - "vscode-html-languageservice": "^2.0.4", + "vscode-css-languageservice": "^2.1.0", + "vscode-html-languageservice": "^2.0.5", "vscode-languageserver": "^3.1.0-alpha.1", "vscode-nls": "^2.0.2", "vscode-uri": "^1.0.0" diff --git a/extensions/html/server/src/modes/javascriptMode.ts b/extensions/html/server/src/modes/javascriptMode.ts index 0340f1be6b2..b9cd9075b20 100644 --- a/extensions/html/server/src/modes/javascriptMode.ts +++ b/extensions/html/server/src/modes/javascriptMode.ts @@ -30,9 +30,10 @@ export function getJavascriptMode(documentRegions: LanguageModelCache compilerOptions, getScriptFileNames: () => [FILE_NAME, JQUERY_D_TS], + getScriptKind: () => ts.ScriptKind.JS, getScriptVersion: (fileName: string) => { if (fileName === FILE_NAME) { return String(scriptFileVersion); @@ -70,8 +71,9 @@ export function getJavascriptMode(documentRegions: LanguageModelCache { + const syntaxDiagnostics = jsLanguageService.getSyntacticDiagnostics(FILE_NAME); + const semanticDiagnostics = jsLanguageService.getSemanticDiagnostics(FILE_NAME); + return syntaxDiagnostics.concat(semanticDiagnostics).map((diag): Diagnostic => { return { range: convertRange(currentTextDocument, diag), severity: DiagnosticSeverity.Error, diff --git a/extensions/html/syntaxes/html.json b/extensions/html/syntaxes/html.json index 66eacb26486..4192c824703 100644 --- a/extensions/html/syntaxes/html.json +++ b/extensions/html/syntaxes/html.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/html.tmbundle/blob/master/Syntaxes/HTML.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "html", "htm", @@ -339,7 +344,7 @@ }, { "begin": "\\G", - "end": "(?i:(?=/?>|type\\s*=\\s*('|\"|)(?!text/(javascript|ecmascript)|application/((x-)?javascript|ecmascript))\\b))", + "end": "(?i:(?=/?>|type(?=[\\s=])(?!\\s*=\\s*('|\"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\\s\"'>])))", "name": "meta.tag.metadata.script.html", "patterns": [ { @@ -347,6 +352,48 @@ } ] }, + { + "begin": "(?=(?i:type\\s*=\\s*('|\"|)(text/(x-handlebars|(x-(handlebars-)?|ng-)?template|html)[\\s\"'>])))", + "end": "((<))(?=/(?i:script))", + "endCaptures": { + "0": { + "name": "meta.tag.metadata.script.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "text.html.basic" + } + }, + "patterns": [ + { + "begin": "\\G", + "end": "(>)|(?=/>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.script.html", + "patterns": [ + { + "include": "#tag-stuff" + } + ] + }, + { + "begin": "(?!\\G)", + "end": "(?= + + + + + + \ No newline at end of file diff --git a/extensions/html/test/colorize-results/12750_html.json b/extensions/html/test/colorize-results/12750_html.json index 0e544efdcf8..88c372b5581 100644 --- a/extensions/html/test/colorize-results/12750_html.json +++ b/extensions/html/test/colorize-results/12750_html.json @@ -117,7 +117,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -139,7 +139,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -304,7 +304,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -326,7 +326,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { diff --git a/extensions/html/test/colorize-results/25920_html.json b/extensions/html/test/colorize-results/25920_html.json new file mode 100644 index 00000000000..697937acdbd --- /dev/null +++ b/extensions/html/test/colorize-results/25920_html.json @@ -0,0 +1,1036 @@ +[ + { + "c": "<", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "html", + "t": "text.html.basic meta.tag.structure.any.html entity.name.tag.structure.any.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "type", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "text/html", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "\t", + "t": "text.html.basic meta.embedded.block.html text.html.basic", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "div", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "class", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "foo", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html meta.scope.between-tag-pair.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "div", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html text.html.basic", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "type", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "module", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "\t", + "t": "text.html.basic meta.embedded.block.html source.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "var", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js storage.type.js", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "x", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js meta.var-single-variable.expr.js meta.definition.variable.js variable.other.readwrite.js", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js meta.var-single-variable.expr.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js keyword.operator.assignment.js", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "9", + "t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js constant.numeric.decimal.js", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #09885A", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #09885A", + "hc_black": "constant.numeric: #B5CEA8" + } + }, + { + "c": ";", + "t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html source.js", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "type", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "text/ng-template", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "\t", + "t": "text.html.basic meta.embedded.block.html text.html.basic", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "div", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "class", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "foo", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html meta.scope.between-tag-pair.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "div", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html text.html.basic", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "<", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "body", + "t": "text.html.basic meta.tag.structure.any.html entity.name.tag.structure.any.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": " ", + "t": "text.html.basic meta.tag.structure.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "class", + "t": "text.html.basic meta.tag.structure.any.html entity.other.attribute-name.html", + "r": { + "dark_plus": "entity.other.attribute-name: #9CDCFE", + "light_plus": "entity.other.attribute-name: #FF0000", + "dark_vs": "entity.other.attribute-name: #9CDCFE", + "light_vs": "entity.other.attribute-name: #FF0000", + "hc_black": "entity.other.attribute-name: #9CDCFE" + } + }, + { + "c": "=", + "t": "text.html.basic meta.tag.structure.any.html", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "'", + "t": "text.html.basic meta.tag.structure.any.html string.quoted.single.html punctuation.definition.string.begin.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "bar", + "t": "text.html.basic meta.tag.structure.any.html string.quoted.single.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": "'", + "t": "text.html.basic meta.tag.structure.any.html string.quoted.single.html punctuation.definition.string.end.html", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.html: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.html: #0000FF", + "hc_black": "string: #CE9178" + } + }, + { + "c": ">", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "", + "t": "text.html.basic meta.tag.structure.any.html punctuation.definition.tag.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + } +] \ No newline at end of file diff --git a/extensions/html/test/colorize-results/test_html.json b/extensions/html/test/colorize-results/test_html.json index b9b6fbc789b..987bfae286c 100644 --- a/extensions/html/test/colorize-results/test_html.json +++ b/extensions/html/test/colorize-results/test_html.json @@ -645,7 +645,7 @@ "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -711,7 +711,7 @@ "light_plus": "constant.other.color.rgb-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "constant.other.color.rgb-value: #0451A5", - "hc_black": "constant.other.color.rgb-value: #B5CEA8" + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -722,7 +722,7 @@ "light_plus": "constant.other.color.rgb-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "constant.other.color.rgb-value: #0451A5", - "hc_black": "constant.other.color.rgb-value: #B5CEA8" + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1481,7 +1481,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1569,7 +1569,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1591,7 +1591,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1635,7 +1635,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1723,7 +1723,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1778,7 +1778,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1789,7 +1789,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1921,7 +1921,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2108,7 +2108,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2130,7 +2130,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { diff --git a/extensions/ini/package.json b/extensions/ini/package.json index b6a9b6c37d0..bfb7bb52215 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -3,6 +3,9 @@ "version": "0.1.0", "publisher": "vscode", "engines": { "vscode": "*" }, + "scripts": { + "update-grammar": "node ../../build/npm/update-grammar.js textmate/ini.tmbundle Syntaxes/Ini.plist ./syntaxes/ini.tmLanguage.json" + }, "contributes": { "languages": [{ "id": "ini", @@ -19,12 +22,12 @@ }], "grammars": [{ "language": "ini", - "scopeName": "source.properties", - "path": "./syntaxes/properties.plist" + "scopeName": "source.ini", + "path": "./syntaxes/ini.tmLanguage.json" },{ "language": "properties", - "scopeName": "source.properties", - "path": "./syntaxes/properties.plist" + "scopeName": "source.ini", + "path": "./syntaxes/ini.tmLanguage.json" }] } } diff --git a/extensions/ini/syntaxes/ini.tmLanguage.json b/extensions/ini/syntaxes/ini.tmLanguage.json new file mode 100644 index 00000000000..34679c1bee0 --- /dev/null +++ b/extensions/ini/syntaxes/ini.tmLanguage.json @@ -0,0 +1,118 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/ini.tmbundle/blob/master/Syntaxes/Ini.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "fileTypes": [ + "ini", + "conf" + ], + "keyEquivalent": "^~I", + "name": "Ini", + "patterns": [ + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ini" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ini" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.ini" + } + ] + }, + { + "begin": "(^[ \\t]+)?(?=;)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ini" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": ";", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ini" + } + }, + "end": "\\n", + "name": "comment.line.semicolon.ini" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.other.definition.ini" + }, + "2": { + "name": "punctuation.separator.key-value.ini" + } + }, + "match": "\\b([a-zA-Z0-9_.-]+)\\b\\s*(=)" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.ini" + }, + "3": { + "name": "punctuation.definition.entity.ini" + } + }, + "match": "^(\\[)(.*?)(\\])", + "name": "entity.name.section.group-title.ini" + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ini" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ini" + } + }, + "name": "string.quoted.single.ini", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.ini" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ini" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ini" + } + }, + "name": "string.quoted.double.ini" + } + ], + "scopeName": "source.ini", + "uuid": "77DC23B6-8A90-11D9-BAA4-000A9584EC8C" +} \ No newline at end of file diff --git a/extensions/ini/syntaxes/properties.plist b/extensions/ini/syntaxes/properties.plist deleted file mode 100644 index 11436566bd5..00000000000 --- a/extensions/ini/syntaxes/properties.plist +++ /dev/null @@ -1,181 +0,0 @@ - - - - - fileTypes - - ini - conf - - keyEquivalent - ^~I - name - Ini - patterns - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.number-sign.ini - - - - - begin - (^[ \t]+)?(?=;) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - ; - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.semicolon.ini - - - - - captures - - 1 - - name - keyword.other.definition.ini - - 2 - - name - punctuation.separator.key-value.ini - - - match - \b([a-zA-Z0-9_.-]+)\b\s*(=) - - - captures - - 1 - - name - punctuation.definition.entity.ini - - 3 - - name - punctuation.definition.entity.ini - - - match - ^(\[)(.*?)(\]) - name - entity.name.section.group-title.ini - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.single.ini - patterns - - - match - \\. - name - constant.character.escape.ini - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.double.ini - - - scopeName - source.properties - uuid - 77DC23B6-8A90-11D9-BAA4-000A9584EC8C - - \ No newline at end of file diff --git a/extensions/ini/test/colorize-results/test_ini.json b/extensions/ini/test/colorize-results/test_ini.json index f30cdc53892..5b001c68246 100644 --- a/extensions/ini/test/colorize-results/test_ini.json +++ b/extensions/ini/test/colorize-results/test_ini.json @@ -1,7 +1,7 @@ [ { "c": ";", - "t": "source.properties comment.line.semicolon.ini punctuation.definition.comment.ini", + "t": "source.ini comment.line.semicolon.ini punctuation.definition.comment.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -12,7 +12,7 @@ }, { "c": " last modified 1 April 2001 by John Doe", - "t": "source.properties comment.line.semicolon.ini", + "t": "source.ini comment.line.semicolon.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -23,7 +23,7 @@ }, { "c": "[", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -34,7 +34,7 @@ }, { "c": "owner", - "t": "source.properties entity.name.section.group-title.ini", + "t": "source.ini entity.name.section.group-title.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -45,7 +45,7 @@ }, { "c": "]", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -56,7 +56,7 @@ }, { "c": "name", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -67,7 +67,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -78,7 +78,7 @@ }, { "c": "John Doe", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -89,7 +89,7 @@ }, { "c": "organization", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -100,7 +100,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -111,7 +111,7 @@ }, { "c": "Acme Widgets Inc.", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -122,7 +122,7 @@ }, { "c": "[", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -133,7 +133,7 @@ }, { "c": "database", - "t": "source.properties entity.name.section.group-title.ini", + "t": "source.ini entity.name.section.group-title.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -144,7 +144,7 @@ }, { "c": "]", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": ";", - "t": "source.properties comment.line.semicolon.ini punctuation.definition.comment.ini", + "t": "source.ini comment.line.semicolon.ini punctuation.definition.comment.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -166,7 +166,7 @@ }, { "c": " use IP address in case network name resolution is not working", - "t": "source.properties comment.line.semicolon.ini", + "t": "source.ini comment.line.semicolon.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -177,7 +177,7 @@ }, { "c": "server", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -188,7 +188,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -199,7 +199,7 @@ }, { "c": "192.0.2.62", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -210,7 +210,7 @@ }, { "c": "port", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -221,7 +221,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -232,7 +232,7 @@ }, { "c": "143", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -243,7 +243,7 @@ }, { "c": "file", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -254,7 +254,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -265,7 +265,7 @@ }, { "c": "\"", - "t": "source.properties string.quoted.double.ini punctuation.definition.string.begin.ini", + "t": "source.ini string.quoted.double.ini punctuation.definition.string.begin.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -276,7 +276,7 @@ }, { "c": "payroll.dat", - "t": "source.properties string.quoted.double.ini", + "t": "source.ini string.quoted.double.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -287,7 +287,7 @@ }, { "c": "\"", - "t": "source.properties string.quoted.double.ini punctuation.definition.string.end.ini", + "t": "source.ini string.quoted.double.ini punctuation.definition.string.end.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", diff --git a/extensions/jake/package.json b/extensions/jake/package.json new file mode 100644 index 00000000000..ee5a916ade5 --- /dev/null +++ b/extensions/jake/package.json @@ -0,0 +1,45 @@ +{ + "name": "jake", + "publisher": "vscode", + "description": "Extension to add Jake capabilities to VSCode.", + "displayName": "Jake support for VSCode", + "version": "0.0.1", + "engines": { + "vscode": "*" + }, + "categories": [ + "Other" + ], + "scripts": { + "compile": "gulp compile-extension:jake", + "watch": "gulp watch-extension:jake" + }, + "dependencies": { + "vscode-nls": "^2.0.2" + }, + "devDependencies": { + "@types/node": "^7.0.18" + }, + "main": "./out/main", + "activationEvents": [ + "onCommand:workbench.action.tasks.runTask" + ], + "contributes": { + "configuration": { + "id": "jake", + "type": "object", + "title": "Jake", + "properties": { + "jake.autoDetect": { + "type": "string", + "enum": [ + "off", + "on" + ], + "default": "on", + "description": "%config.jake.autoDetect%" + } + } + } + } +} \ No newline at end of file diff --git a/extensions/jake/package.nls.json b/extensions/jake/package.nls.json new file mode 100644 index 00000000000..c6ca7464a75 --- /dev/null +++ b/extensions/jake/package.nls.json @@ -0,0 +1,3 @@ +{ + "config.jake.autoDetect": "Controls whether auto detection of Jake tasks is on or off. Default is on." +} \ No newline at end of file diff --git a/extensions/jake/src/main.ts b/extensions/jake/src/main.ts new file mode 100644 index 00000000000..25d93a29780 --- /dev/null +++ b/extensions/jake/src/main.ts @@ -0,0 +1,151 @@ +/*--------------------------------------------------------------------------------------------- + * 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 fs from 'fs'; +import * as cp from 'child_process'; +import * as vscode from 'vscode'; +import * as nls from 'vscode-nls'; + +const localize = nls.config(process.env.VSCODE_NLS_CONFIG)(); + +type AutoDetect = 'on' | 'off'; +let taskProvider: vscode.Disposable | undefined; + +export function activate(_context: vscode.ExtensionContext): void { + let workspaceRoot = vscode.workspace.rootPath; + if (!workspaceRoot) { + return; + } + let pattern = path.join(workspaceRoot, '{Jakefile,Jakefile.js}'); + let jakePromise: Thenable | undefined = undefined; + let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern); + fileWatcher.onDidChange(() => jakePromise = undefined); + fileWatcher.onDidCreate(() => jakePromise = undefined); + fileWatcher.onDidDelete(() => jakePromise = undefined); + + function onConfigurationChanged() { + let autoDetect = vscode.workspace.getConfiguration('jake').get('autoDetect'); + if (taskProvider && autoDetect === 'off') { + jakePromise = undefined; + taskProvider.dispose(); + taskProvider = undefined; + } else if (!taskProvider && autoDetect === 'on') { + taskProvider = vscode.workspace.registerTaskProvider({ + provideTasks: () => { + if (!jakePromise) { + jakePromise = getJakeTasks(); + } + return jakePromise; + } + }); + } + } + vscode.workspace.onDidChangeConfiguration(onConfigurationChanged); + onConfigurationChanged(); +} + +export function deactivate(): void { + if (taskProvider) { + taskProvider.dispose(); + } +} + +function exists(file: string): Promise { + return new Promise((resolve, _reject) => { + fs.exists(file, (value) => { + resolve(value); + }); + }); +} + +function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: string; stderr: string }> { + return new Promise<{ stdout: string; stderr: string }>((resolve, reject) => { + cp.exec(command, options, (error, stdout, stderr) => { + if (error) { + reject({ error, stdout, stderr }); + } + resolve({ stdout, stderr }); + }); + }); +} + +async function getJakeTasks(): Promise { + let workspaceRoot = vscode.workspace.rootPath; + let emptyTasks: vscode.Task[] = []; + if (!workspaceRoot) { + return emptyTasks; + } + let jakefile = path.join(workspaceRoot, 'Jakefile'); + if (!await exists(jakefile)) { + jakefile = path.join(workspaceRoot, 'Jakefile.js'); + if (! await exists(jakefile)) { + return emptyTasks; + } + } + + let jakeCommand: string; + let platform = process.platform; + if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'jake.cmd'))) { + jakeCommand = path.join('.', 'node_modules', '.bin', 'jake.cmd'); + } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'jake'))) { + jakeCommand = path.join('.', 'node_modules', '.bin', 'jake'); + } else { + jakeCommand = 'jake'; + } + + let commandLine = `${jakeCommand} --tasks`; + let channel = vscode.window.createOutputChannel('tasks'); + try { + let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot }); + if (stderr) { + channel.appendLine(stderr); + channel.show(true); + } + let result: vscode.Task[] = []; + if (stdout) { + let buildTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; + let testTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; + let lines = stdout.split(/\r{0,1}\n/); + for (let line of lines) { + if (line.length === 0) { + continue; + } + let regExp = /^jake\s+([^\s]+)\s/g; + let matches = regExp.exec(line); + if (matches && matches.length === 2) { + let taskName = matches[1]; + let task = new vscode.ShellTask(taskName, `${jakeCommand} ${taskName}`); + task.identifier = `jake.${taskName}`; + result.push(task); + let lowerCaseLine = line.toLowerCase(); + if (lowerCaseLine === 'build') { + buildTask = { task, rank: 2 }; + } else if (lowerCaseLine.indexOf('build') !== -1 && buildTask.rank < 1) { + buildTask = { task, rank: 1 }; + } else if (lowerCaseLine === 'test') { + testTask = { task, rank: 2 }; + } else if (lowerCaseLine.indexOf('test') !== -1 && testTask.rank < 1) { + testTask = { task, rank: 1 }; + } + } + } + if (buildTask.task) { + buildTask.task.group = vscode.TaskGroup.Build; + } + if (testTask.task) { + testTask.task.group = vscode.TaskGroup.Test; + } + } + return result; + } catch (err) { + if (err.stderr) { + channel.appendLine(err.stderr); + } + channel.appendLine(localize('execFailed', 'Auto detecting Jake failed with error: {0}', err.error ? err.error.toString() : 'unknown')); + return emptyTasks; + } +} \ No newline at end of file diff --git a/extensions/jake/src/typings/refs.d.ts b/extensions/jake/src/typings/refs.d.ts new file mode 100644 index 00000000000..954bab971e3 --- /dev/null +++ b/extensions/jake/src/typings/refs.d.ts @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/// +/// +/// diff --git a/extensions/jake/tsconfig.json b/extensions/jake/tsconfig.json new file mode 100644 index 00000000000..e804fa3acd7 --- /dev/null +++ b/extensions/jake/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es2016" + ], + "outDir": "./out", + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/extensions/java/OSSREADME.json b/extensions/java/OSSREADME.json index 6a2da0d287b..c87e957510b 100644 --- a/extensions/java/OSSREADME.json +++ b/extensions/java/OSSREADME.json @@ -1,42 +1,9 @@ // ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: [{ - "name": "textmate/java.tmbundle", + "name": "atom/language-java", "version": "0.0.0", - "license": "TextMate Bundle License", - "repositoryURL": "https://github.com/textmate/java.tmbundle", - "licenseDetail": [ - "Copyright (c) textmate-java.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ] -},{ - "name": "textmate/javadoc.tmbundle", - "version": "0.0.0", - "license": "TextMate Bundle License", - "repositoryURL": "https://github.com/textmate/javadoc.tmbundle", - "licenseDetail": [ - "Copyright (c) textmate-javadoc.tmbundle project authors", - "", - "If not otherwise specified (see below), files in this repository fall under the following license:", - "", - "Permission to copy, use, modify, sell and distribute this", - "software is granted. This software is provided \"as is\" without", - "express or implied warranty, and with no claim as to its", - "suitability for any purpose.", - "", - "An exception is made for files in readable text which contain their own license information,", - "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", - "to the base-name name of the original file, and an extension of txt, html, or similar. For example", - "\"tidy\" is accompanied by \"tidy-license.txt\"." - ] + "license": "MIT", + "repositoryURL": "https://github.com/atom/language-java", + "description": "The file syntaxes/java.tmLanguage.json was derived from the Atom package https://github.com/atom/language-java which was originally converted from the TextMate bundle https://github.com/textmate/java.tmbundle." + }] diff --git a/extensions/java/package.json b/extensions/java/package.json index ee0e7e616ab..d8c9375f0c3 100644 --- a/extensions/java/package.json +++ b/extensions/java/package.json @@ -4,7 +4,7 @@ "publisher": "vscode", "engines": { "vscode": "*" }, "scripts": { - "update-grammar": "node ../../build/npm/update-grammar.js textmate/java.tmbundle Syntaxes/Java.plist ./syntaxes/java.tmLanguage.json && node ../../build/npm/update-grammar.js textmate/javadoc.tmbundle Syntaxes/JavaDoc.tmLanguage ./syntaxes/javadoc.tmLanguage.json" + "update-grammar": "node ../../build/npm/update-grammar.js atom/language-java grammars/java.cson ./syntaxes/java.tmLanguage.json" }, "contributes": { "languages": [{ @@ -17,9 +17,6 @@ "language": "java", "scopeName": "source.java", "path": "./syntaxes/java.tmLanguage.json" - },{ - "scopeName": "text.html.javadoc", - "path": "./syntaxes/javadoc.tmLanguage.json" }] } } \ No newline at end of file diff --git a/extensions/java/syntaxes/java.tmLanguage.json b/extensions/java/syntaxes/java.tmLanguage.json index f0fcef2d065..654bf8e2ba8 100644 --- a/extensions/java/syntaxes/java.tmLanguage.json +++ b/extensions/java/syntaxes/java.tmLanguage.json @@ -1,99 +1,103 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-java/blob/master/grammars/java.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "scopeName": "source.java", + "name": "Java", "fileTypes": [ "java", "bsh" ], - "keyEquivalent": "^~J", - "name": "Java", "patterns": [ { - "captures": { + "begin": "\\b(package)\\b\\s*", + "beginCaptures": { "1": { "name": "keyword.other.package.java" - }, - "2": { - "name": "storage.modifier.package.java" - }, - "3": { + } + }, + "end": "\\s*(;)", + "endCaptures": { + "1": { "name": "punctuation.terminator.java" } }, - "match": "^\\s*(package)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?", - "name": "meta.package.java" + "name": "meta.package.java", + "contentName": "storage.modifier.package.java", + "patterns": [ + { + "include": "#comments" + }, + { + "match": "(?<=\\.)\\s*\\.|\\.(?=\\s*;)", + "name": "invalid.illegal.character_not_allowed_here.java" + }, + { + "match": "(?", + "endCaptures": { + "0": { + "name": "punctuation.bracket.angle.java" + } + }, + "patterns": [ + { + "match": "\\b(extends|super)\\b", + "name": "storage.modifier.$1.java" }, { - "match": "\\b0[xX]\\h([\\h_]*\\h)?[lL]?(?!\\w|\\.)", - "name": "constant.numeric.hex.java" - }, - { - "match": "\\b0[0-7_]*[0-7][lL]?\\b", - "name": "constant.numeric.octal.java" - }, - { - "match": "\\b0[bB][01]([01_]*[01])?[lL]?\\b", - "name": "constant.numeric.binary.java" - }, - { - "match": "\\b(0|[1-9]([0-9_]*[0-9])?)[lL]?(?!\\w|\\.)", - "name": "constant.numeric.integer.java" - }, - { - "match": "(?x)\n\t\t\t\t\t\t(?\n\t\t\t\t\t\t\t0[xX]\t\t\t\t\t\t\t\t\t# Start literal\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=\\h)\\.\t\t\t\t\t\t\t# A number must exist on\n\t\t\t\t\t\t | \\.(?=\\h)\t\t\t\t\t\t\t# one side of the decimal\n\t\t\t\t\t\t | (?<=\\h)\t\t\t\t\t\t\t\t# Decimal not required\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t[pP]\t\t\t\t\t\t\t\t\t# Exponent Indicator\n\t\t\t\t\t\t\t[+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t\t# Signed Integer\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t", - "name": "constant.numeric.hex-float.java" - }, - { - "match": "(?x)\n\t\t\t\t\t\t(?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(0|[1-9]([0-9_]*[0-9])?)\t\t\t\t# Leading digits\n\t\t\t\t\t\t\t\t(?=[eEfFdD.])\t\t\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=[0-9])(?=[eEfFdD])\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[0-9]([0-9_]*[0-9])?\t\t\t\t\t# Numbers after .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[eE][+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t# Exponent\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t", - "name": "constant.numeric.float.java" - }, - { + "match": "([a-zA-Z$_][a-zA-Z0-9$_]*)(?=\\s*<)", "captures": { "1": { - "name": "keyword.operator.dereference.java" + "name": "storage.type.java" } - }, - "match": "(\\.)?\\b([A-Z][A-Z0-9_]+)(?!<|\\.class|\\s*\\w+\\s*=)\\b", - "name": "constant.other.java" + } + }, + { + "match": "[a-zA-Z$_][a-zA-Z0-9$_]*", + "name": "storage.type.generic.java" + }, + { + "match": "\\?", + "name": "storage.type.generic.wildcard.java" + }, + { + "match": "&", + "name": "punctuation.separator.types.java" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.java" + }, + { + "include": "#parens" + }, + { + "include": "#generics" + }, + { + "include": "#comments" } ] }, "enums": { - "begin": "^(?=\\s*[A-Z0-9_]+\\s*({|\\(|,))", - "end": "(?=;|})", + "begin": "^\\s*(enum)\\s+(\\w+)", + "beginCaptures": { + "1": { + "name": "storage.modifier.java" + }, + "2": { + "name": "entity.name.type.enum.java" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.enum.end.bracket.curly.java" + } + }, + "name": "meta.enum.java", "patterns": [ { - "begin": "\\w+", + "begin": "{", "beginCaptures": { "0": { - "name": "constant.other.enum.java" + "name": "punctuation.section.enum.begin.bracket.curly.java" } }, - "end": "(?=,|;|})", - "name": "meta.enum.java", + "end": "(?=})", "patterns": [ { - "include": "#parens" + "match": "\\w+", + "name": "constant.other.enum.java" }, { - "begin": "{", - "beginCaptures": { - "0": { - "name": "punctuation.section.enum.begin.java" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.section.enum.end.java" - } - }, - "patterns": [ - { - "include": "#class-body" - } - ] + "include": "#class-body" } ] }, { "include": "#comments" + } + ] + }, + "function-call": { + "begin": "([A-Za-z_$][\\w$]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.java" }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, + "name": "meta.function-call.java", + "patterns": [ { - "include": "#annotations" + "include": "#code" } ] }, "keywords": { "patterns": [ { - "match": "\\b(try|catch|finally|throw)\\b", - "name": "keyword.control.catch-exception.java" + "match": "\\bthrow\\b", + "name": "keyword.control.throw.java" }, { "match": "\\?|:", @@ -604,7 +856,7 @@ }, { "match": "\\b(instanceof)\\b", - "name": "keyword.operator.java" + "name": "keyword.operator.instanceof.java" }, { "match": "(<<|>>>?|~|\\^)", @@ -641,39 +893,38 @@ { "match": "(\\||&)", "name": "keyword.operator.bitwise.java" - }, + } + ] + }, + "lambda-expression": { + "patterns": [ { - "match": "(?<=\\S)\\.(?=\\S)", - "name": "keyword.operator.dereference.java" - }, - { - "match": ";", - "name": "punctuation.terminator.java" + "match": "->", + "name": "storage.type.function.arrow.java" } ] }, "method-call": { - "begin": "([\\w$]+)(\\()", + "begin": "(\\.)\\s*([A-Za-z_$][\\w$]*)\\s*(\\()", "beginCaptures": { "1": { - "name": "meta.method.java" + "name": "punctuation.separator.period.java" }, "2": { - "name": "punctuation.definition.method-parameters.begin.java" + "name": "entity.name.function.java" + }, + "3": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" } }, "end": "\\)", "endCaptures": { "0": { - "name": "punctuation.definition.method-parameters.end.java" + "name": "punctuation.definition.parameters.end.bracket.round.java" } }, "name": "meta.method-call.java", "patterns": [ - { - "match": ",", - "name": "punctuation.definition.seperator.parameter.java" - }, { "include": "#code" } @@ -684,7 +935,7 @@ "end": "(})|(?=;)", "endCaptures": { "1": { - "name": "punctuation.section.method.end.java" + "name": "punctuation.section.method.end.bracket.curly.java" } }, "name": "meta.method.java", @@ -693,49 +944,47 @@ "include": "#storage-modifiers" }, { - "begin": "(\\w+)\\s*\\(", + "begin": "(\\w+)\\s*(\\()", "beginCaptures": { "1": { "name": "entity.name.function.java" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" } }, "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, "name": "meta.method.identifier.java", "patterns": [ { "include": "#parameters" }, { - "include": "#comments" + "include": "#parens" + }, + { + "include": "#comments-inline" } ] }, { - "begin": "<", - "end": ">", - "name": "storage.type.token.java", - "patterns": [ - { - "include": "#object-types" - }, - { - "begin": "<", - "comment": "This is just to support <>'s with no actual type prefix", - "end": ">|[^\\w\\s,\\[\\]<]", - "name": "storage.type.generic.java" - } - ] + "include": "#generics" }, { "begin": "(?=\\w.*\\s+\\w+\\s*\\()", - "end": "(?=\\w+\\s*\\()", + "end": "(?=\\s+\\w+\\s*\\()", "name": "meta.method.return-type.java", "patterns": [ { "include": "#all-types" }, { - "include": "#comments" + "include": "#parens" } ] }, @@ -746,11 +995,11 @@ "begin": "{", "beginCaptures": { "0": { - "name": "punctuation.section.method.begin.java" + "name": "punctuation.section.method.begin.bracket.curly.java" } }, "end": "(?=})", - "name": "meta.method.body.java", + "contentName": "meta.method.body.java", "patterns": [ { "include": "#code" @@ -762,136 +1011,251 @@ } ] }, + "numbers": { + "patterns": [ + { + "match": "(?x)\n\\b(?|[^\\w\\s,\\?<\\[\\]]", - "name": "storage.type.generic.java", - "patterns": [ - { - "include": "#object-types" - }, - { - "begin": "<", - "comment": "This is just to support <>'s with no actual type prefix", - "end": ">|[^\\w\\s,\\[\\]<]", - "name": "storage.type.generic.java" - } - ] + "include": "#generics" }, { - "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)(?=\\[)", - "end": "(?=[^\\]\\s])", - "name": "storage.type.object.array.java", - "patterns": [ - { - "begin": "\\[", - "end": "\\]", - "patterns": [ - { - "include": "#code" - } - ] - } - ] - }, - { - "captures": { + "begin": "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*([A-Z]\\w*)\\s*(?=\\[)", + "beginCaptures": { "1": { - "name": "keyword.operator.dereference.java" + "name": "punctuation.separator.period.java" + }, + "2": { + "name": "storage.type.object.array.java" } }, - "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*\\b", - "name": "storage.type.java" + "end": "(?!\\s*\\[)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#parens" + } + ] + }, + { + "begin": "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*\\s*(?=<)", + "beginCaptures": { + "0": { + "name": "storage.type.java" + }, + "1": { + "name": "punctuation.separator.period.java" + } + }, + "end": "(?<=>)", + "patterns": [ + { + "include": "#generics" + } + ] + }, + { + "match": "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*\\b", + "name": "storage.type.java", + "captures": { + "1": { + "name": "punctuation.separator.period.java" + } + } } ] }, "object-types-inherited": { "patterns": [ { - "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)<", - "end": ">|[^\\w\\s,<]", - "name": "entity.other.inherited-class.java", - "patterns": [ - { - "include": "#object-types" - }, - { - "begin": "<", - "comment": "This is just to support <>'s with no actual type prefix", - "end": ">|[^\\w\\s,<]", - "name": "storage.type.generic.java" - } - ] + "include": "#generics" }, { + "match": "\\b(?:[A-Z]\\w*\\s*(\\.)\\s*)*[A-Z]\\w*\\b", + "name": "entity.other.inherited-class.java", "captures": { "1": { - "name": "keyword.operator.dereference.java" + "name": "punctuation.separator.period.java" } - }, - "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*", - "name": "entity.other.inherited-class.java" + } + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.java" } ] }, + "objects": { + "match": "(?\\[\\],][\\w<>\\[\\],?\\s]*)?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|;)\n))", + "end": "(?=;)", + "name": "meta.definition.variable.java", "patterns": [ { - "begin": "(?x:(?=\n (?:\n (?:private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final) # visibility/modifier\n |\n (?:def)\n |\n (?:void|boolean|byte|char|short|int|float|long|double)\n |\n (?:(?:[a-z]\\w*\\.)*[A-Z]+\\w*) # object type\n )\n \\s+\n (?!private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double)\n [\\w\\d_<>\\[\\],\\?][\\w\\d_<>\\[\\],\\? \\t]*\n (?:=|$)\n \n\t\t\t\t\t))", + "match": "([A-Za-z$_][\\w$]*)(?=\\s*(\\[\\])*\\s*(;|=|,))", + "captures": { + "1": { + "name": "variable.other.definition.java" + } + } + }, + { + "include": "#all-types" + }, + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.java" + } + }, "end": "(?=;)", - "name": "meta.definition.variable.java", "patterns": [ - { - "match": "\\s" - }, - { - "captures": { - "1": { - "name": "constant.other.variable.java" - } - }, - "match": "([A-Z_0-9]+)\\s+(?=\\=)" - }, - { - "captures": { - "1": { - "name": "meta.definition.variable.name.java" - } - }, - "match": "(\\w[^\\s,]*)\\s+(?=\\=)" - }, - { - "begin": "=", - "beginCaptures": { - "0": { - "name": "keyword.operator.assignment.java" - } - }, - "end": "(?=;)", - "patterns": [ - { - "include": "#code" - } - ] - }, - { - "captures": { - "1": { - "name": "meta.definition.variable.name.java" - } - }, - "match": "(\\w[^\\s=]*)(?=\\s*;)" - }, { "include": "#code" } ] + }, + { + "include": "#code" + } + ] + }, + "member-variables": { + "begin": "(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)", + "end": "(?=;)", + "patterns": [ + { + "include": "#storage-modifiers" + }, + { + "include": "#variables" } ] } - }, - "scopeName": "source.java", - "uuid": "2B449DF6-6B1D-11D9-94EC-000D93589AF6", - "version": "https://github.com/textmate/java.tmbundle/commit/faffa518d0b22b68b4e5e6b4c939722522b97d40" + } } \ No newline at end of file diff --git a/extensions/java/syntaxes/javadoc.tmLanguage.json b/extensions/java/syntaxes/javadoc.tmLanguage.json deleted file mode 100644 index a47e5c98d04..00000000000 --- a/extensions/java/syntaxes/javadoc.tmLanguage.json +++ /dev/null @@ -1,432 +0,0 @@ -{ - "fileTypes": [], - "name": "JavaDoc", - "patterns": [ - { - "begin": "(/\\*\\*)\\s*$", - "beginCaptures": { - "1": { - "name": "punctuation.definition.comment.begin.javadoc" - } - }, - "contentName": "text.html", - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.end.javadoc" - } - }, - "name": "comment.block.documentation.javadoc", - "patterns": [ - { - "include": "#inline" - }, - { - "begin": "((\\@)param)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.param.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.param.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)return)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.return.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.return.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)throws)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.throws.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.throws.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)exception)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.exception.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.exception.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)author)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.author.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.author.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)version)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.version.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.version.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)see)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.see.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.see.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)since)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.since.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.since.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)serial)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.serial.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.serial.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)serialField)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.serialField.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.serialField.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)serialData)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.serialData.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.serialData.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "begin": "((\\@)deprecated)", - "beginCaptures": { - "1": { - "name": "keyword.other.documentation.deprecated.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "end": "(?=^\\s*\\*?\\s*@|\\*/)", - "name": "meta.documentation.tag.deprecated.javadoc", - "patterns": [ - { - "include": "#inline" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.other.documentation.custom.javadoc" - }, - "2": { - "name": "punctuation.definition.keyword.javadoc" - } - }, - "match": "((\\@)\\S+)\\s" - } - ] - } - ], - "repository": { - "inline": { - "patterns": [ - { - "include": "#inline-formatting" - }, - { - "comment": "This prevents < characters in commented source from starting\n\t\t\t\t\t\t\t\ta tag that will not end. List of allowed tags taken from\n\t\t\t\t\t\t\t\tjava checkstyle.", - "match": "<(?!/?(a|abbr|acronym|address|area|b|bdo|big|blockquote|br|caption|cite|code|colgroup|dd|del|div|dfn|dl|dt|em|fieldset|font|h1toh6|hr|i|img|ins|kbd|li|ol|p|pre|q|samp|small|span|strong|sub|sup|table|tbody|td|tfoot|th|thread|tr|tt|u|ul)\\b[^>]*>)" - }, - { - "include": "text.html.basic" - }, - { - "match": "((https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt)://|mailto:)[-:@a-zA-Z0-9_.,~%+/?=&#;]+(?Note:

Hello", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -452,7 +463,7 @@ }, { "c": "\t * ", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -462,107 +473,8 @@ } }, { - "c": "<", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.tag.block.any.html punctuation.definition.tag.begin.html", - "r": { - "dark_plus": "punctuation.definition.tag: #808080", - "light_plus": "punctuation.definition.tag: #800000", - "dark_vs": "punctuation.definition.tag: #808080", - "light_vs": "punctuation.definition.tag: #800000", - "hc_black": "punctuation.definition.tag: #808080" - } - }, - { - "c": "p", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.tag.block.any.html entity.name.tag.block.any.html", - "r": { - "dark_plus": "entity.name.tag: #569CD6", - "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", - "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" - } - }, - { - "c": ">", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.tag.block.any.html punctuation.definition.tag.end.html", - "r": { - "dark_plus": "punctuation.definition.tag: #808080", - "light_plus": "punctuation.definition.tag: #800000", - "dark_vs": "punctuation.definition.tag: #808080", - "light_vs": "punctuation.definition.tag: #800000", - "hc_black": "punctuation.definition.tag: #808080" - } - }, - { - "c": "Note:", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html", - "r": { - "dark_plus": "comment: #608B4E", - "light_plus": "comment: #008000", - "dark_vs": "comment: #608B4E", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" - } - }, - { - "c": "", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.tag.block.any.html punctuation.definition.tag.end.html", - "r": { - "dark_plus": "punctuation.definition.tag: #808080", - "light_plus": "punctuation.definition.tag: #800000", - "dark_vs": "punctuation.definition.tag: #808080", - "light_vs": "punctuation.definition.tag: #800000", - "hc_black": "punctuation.definition.tag: #808080" - } - }, - { - "c": " Hello", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html", - "r": { - "dark_plus": "comment: #608B4E", - "light_plus": "comment: #008000", - "dark_vs": "comment: #608B4E", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" - } - }, - { - "c": "\t * ", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html", - "r": { - "dark_plus": "comment: #608B4E", - "light_plus": "comment: #008000", - "dark_vs": "comment: #608B4E", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" - } - }, - { - "c": "@", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc punctuation.definition.keyword.javadoc", + "c": "@param", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java keyword.other.documentation.javadoc.java", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -572,19 +484,8 @@ } }, { - "c": "param", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc", - "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " args", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.documentation.tag.param.javadoc", + "c": " ", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -593,9 +494,20 @@ "hc_black": "comment: #7CA668" } }, + { + "c": "args", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java variable.parameter.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "comment: #608B4E", + "light_vs": "comment: #008000", + "hc_black": "variable: #9CDCFE" + } + }, { "c": "\t ", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc text.html meta.documentation.tag.param.javadoc", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -606,7 +518,7 @@ }, { "c": "*/", - "t": "source.java meta.class.java meta.class.body.java comment.block.documentation.javadoc punctuation.definition.comment.end.javadoc", + "t": "source.java meta.class.java meta.class.body.java comment.block.javadoc.java punctuation.definition.comment.java", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -650,18 +562,18 @@ }, { "c": "void", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -678,12 +590,12 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { "c": "(", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.begin.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -694,13 +606,13 @@ }, { "c": "int", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { @@ -722,12 +634,12 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { "c": ")", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -749,7 +661,7 @@ }, { "c": "{", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.method.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.begin.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,18 +683,40 @@ }, { "c": "double", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { - "c": " b ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "b", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +727,7 @@ }, { "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -804,7 +738,7 @@ }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -815,7 +749,7 @@ }, { "c": "0.0", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.float.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -848,18 +782,40 @@ }, { "c": "double", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { - "c": " c ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "c", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -870,7 +826,7 @@ }, { "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -881,7 +837,7 @@ }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -892,7 +848,7 @@ }, { "c": "10e3", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.float.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -925,18 +881,40 @@ }, { "c": "long", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { - "c": " l ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "l", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -947,7 +925,7 @@ }, { "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -958,7 +936,7 @@ }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -969,7 +947,7 @@ }, { "c": "134l", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.integer.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1002,7 +980,7 @@ }, { "c": "}", - "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1085,12 +1063,12 @@ "light_plus": "storage.type.annotation.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.annotation.java: #4EC9B0" } }, { "c": "(", - "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation-arguments.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation-arguments.begin.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1178,7 +1156,7 @@ }, { "c": ")", - "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation-arguments.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation-arguments.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1222,18 +1200,18 @@ }, { "c": "long", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1250,12 +1228,12 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { "c": "(", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.begin.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1266,13 +1244,13 @@ }, { "c": "long", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { @@ -1294,12 +1272,12 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { "c": ")", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1288,7 @@ }, { "c": "{", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.method.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.begin.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1338,51 +1316,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" - } - }, - { - "c": " (", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "int", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.primitive.array.java", - "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" - } - }, - { - "c": " i ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", - "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1396,9 +1330,86 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.bracket.round.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "int", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.primitive.java", + "r": { + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type.primitive.java: #4EC9B0" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "i", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "=", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "0", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.integer.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1453,7 +1464,7 @@ }, { "c": "9", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.integer.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1496,7 +1507,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.bracket.round.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", "r": { "dark_plus": "default: #D4D4D4", @@ -1508,7 +1530,7 @@ }, { "c": "{", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.block.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.block.begin.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1530,51 +1552,40 @@ }, { "c": "System", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java variable.other.object.java", "r": { - "dark_plus": "storage.type.java: #4EC9B0", - "light_plus": "storage.type.java: #267F99", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" } }, { "c": ".", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.dereference.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.separator.period.java", "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "out", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java variable.other.object.property.java", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { "c": ".", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.dereference.java", - "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" - } - }, - { - "c": "println", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java meta.method.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java punctuation.separator.period.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1583,9 +1594,20 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "println", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java entity.name.function.java", + "r": { + "dark_plus": "entity.name.function: #DCDCAA", + "light_plus": "entity.name.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.function: #DCDCAA" + } + }, { "c": "(", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java punctuation.definition.method-parameters.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java punctuation.definition.parameters.begin.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1662,7 +1684,7 @@ }, { "c": ")", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java punctuation.definition.method-parameters.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.method-call.java punctuation.definition.parameters.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1695,7 +1717,7 @@ }, { "c": "}", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.block.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.block.end.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1723,7 +1745,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1739,7 +1761,7 @@ }, { "c": "10", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.integer.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1772,7 +1794,7 @@ }, { "c": "}", - "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1833,7 +1855,7 @@ "light_plus": "storage.type.annotation.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.annotation.java: #4EC9B0" } }, { @@ -1871,18 +1893,18 @@ }, { "c": "void", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.return-type.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1899,12 +1921,23 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", + "hc_black": "entity.name.function: #DCDCAA" + } + }, + { + "c": "(", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.begin.bracket.round.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } }, { - "c": "()", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java", + "c": ")", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.identifier.java punctuation.definition.parameters.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1926,7 +1959,7 @@ }, { "c": "{", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java punctuation.section.method.begin.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.begin.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1948,18 +1981,40 @@ }, { "c": "int", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.primitive.array.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.primitive.java", "r": { - "dark_plus": "storage.type.primitive.array.java: #4EC9B0", - "light_plus": "storage.type.primitive.array.java: #267F99", + "dark_plus": "storage.type.primitive.java: #4EC9B0", + "light_plus": "storage.type.primitive.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.primitive.java: #4EC9B0" } }, { - "c": " hex ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "hex", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1970,7 +2025,7 @@ }, { "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1981,7 +2036,7 @@ }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1992,7 +2047,7 @@ }, { "c": "0x5", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.hex.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java constant.numeric.hex.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2024,41 +2079,74 @@ } }, { - "c": "Vector<", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.generic.java", - "r": { - "dark_plus": "storage.type.generic.java: #4EC9B0", - "light_plus": "storage.type.generic.java: #267F99", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" - } - }, - { - "c": "Number", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.generic.java storage.type.java", + "c": "Vector", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.java", "r": { "dark_plus": "storage.type.java: #4EC9B0", "light_plus": "storage.type.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.java: #4EC9B0" } }, { - "c": ">", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.generic.java", + "c": "<", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java punctuation.bracket.angle.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "Number", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java storage.type.generic.java", "r": { "dark_plus": "storage.type.generic.java: #4EC9B0", "light_plus": "storage.type.generic.java: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.generic.java: #4EC9B0" } }, { - "c": " v ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": ">", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java punctuation.bracket.angle.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "v", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java variable.other.definition.java", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": " ", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2069,7 +2157,7 @@ }, { "c": "=", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.operator.assignment.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.operator.assignment.java", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2080,7 +2168,7 @@ }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2091,18 +2179,18 @@ }, { "c": "new", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java keyword.control.new.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java keyword.control.new.java", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { "c": " ", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2113,18 +2201,29 @@ }, { "c": "Vector", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java storage.type.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java meta.function-call.java entity.name.function.java", "r": { - "dark_plus": "storage.type.java: #4EC9B0", - "light_plus": "storage.type.java: #267F99", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "dark_plus": "entity.name.function: #DCDCAA", + "light_plus": "entity.name.function: #795E26", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.function: #DCDCAA" } }, { - "c": "()", - "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java", + "c": "(", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java meta.function-call.java punctuation.definition.parameters.begin.bracket.round.java", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java meta.definition.variable.java meta.function-call.java punctuation.definition.parameters.end.bracket.round.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2157,7 +2256,7 @@ }, { "c": "}", - "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.java", + "t": "source.java meta.class.java meta.class.body.java meta.method.java punctuation.section.method.end.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2168,7 +2267,7 @@ }, { "c": "}", - "t": "source.java meta.class.java punctuation.section.class.end.java", + "t": "source.java meta.class.java punctuation.section.class.end.bracket.curly.java", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", diff --git a/extensions/javascript/package.json b/extensions/javascript/package.json index aeb014688ae..b8c76ba64aa 100644 --- a/extensions/javascript/package.json +++ b/extensions/javascript/package.json @@ -41,7 +41,8 @@ ], "extensions": [ ".js", - ".es6" + ".es6", + ".mjs" ], "filenames": [ "jakefile" diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index bda3bd858cd..8856e46770c 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json @@ -1,9 +1,16 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "JavaScript (with React support)", "scopeName": "source.js", "fileTypes": [ ".js", - ".jsx" + ".jsx", + ".es6", + ".mjs" ], "uuid": "805375ec-d614-41f5-8993-5843fe63ea82", "patterns": [ @@ -72,7 +79,7 @@ "name": "storage.type.js" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -101,7 +108,7 @@ "name": "meta.definition.variable.js entity.name.function.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -116,7 +123,7 @@ "name": "meta.definition.variable.js variable.other.constant.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -131,7 +138,7 @@ "name": "meta.definition.variable.js variable.other.readwrite.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -158,7 +165,7 @@ { "name": "meta.object-binding-pattern-variable.js", "begin": "(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", + "end": "(?=$|^|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { "include": "#comment" @@ -2017,7 +2067,7 @@ "name": "punctuation.definition.typeparameters.begin.js" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.js" @@ -2052,7 +2102,7 @@ "name": "keyword.operator.assignment.js" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2691,7 +2741,7 @@ "name": "keyword.control.as.js" } }, - "end": "(?=$|[;,:})\\]])", + "end": "(?=$|^|[;,:})\\]])", "patterns": [ { "include": "#type" @@ -2776,7 +2826,7 @@ }, { "name": "meta.arrow.js", - "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -3356,25 +3406,17 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.js" + }, + "2": { + "name": "comment.line.double-slash.js punctuation.definition.comment.js" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.js", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.js" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.tsx" } ] }, @@ -3386,7 +3428,7 @@ "name": "punctuation.definition.comment.js" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.js", @@ -4006,8 +4048,8 @@ }, "jsx-tag-without-attributes": { "name": "meta.tag.without-attributes.js", - "begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?)", - "end": "()", + "begin": "(<)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", + "end": "()", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.js" @@ -4016,6 +4058,9 @@ "name": "entity.name.tag.js" }, "3": { + "name": "support.class.component.js" + }, + "4": { "name": "punctuation.definition.tag.end.js" } }, @@ -4027,6 +4072,9 @@ "name": "entity.name.tag.js" }, "3": { + "name": "support.class.component.js" + }, + "4": { "name": "punctuation.definition.tag.end.js" } }, @@ -4039,7 +4087,7 @@ }, "jsx-tag-in-expression": { "begin": "(?x)\n (?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", - "end": "(/>)|(?:())", + "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.js" @@ -4054,6 +4102,9 @@ "name": "entity.name.tag.js" }, "4": { + "name": "support.class.component.js" + }, + "5": { "name": "punctuation.definition.tag.end.js" } }, @@ -4065,7 +4116,7 @@ }, "jsx-child-tag": { "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", - "end": "(/>)|(?:())", + "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.js" @@ -4080,6 +4131,9 @@ "name": "entity.name.tag.js" }, "4": { + "name": "support.class.component.js" + }, + "5": { "name": "punctuation.definition.tag.end.js" } }, @@ -4095,13 +4149,16 @@ "end": "(?=(/>)|(?:()))", "patterns": [ { - "begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?)", + "begin": "(?x)\n (<)\\s*\n ((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.js" }, "2": { "name": "entity.name.tag.js" + }, + "3": { + "name": "support.class.component.js" } }, "end": "(?=[/]?>)", @@ -4170,6 +4227,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986" + } } \ No newline at end of file diff --git a/extensions/javascript/test/colorize-results/test6916_js.json b/extensions/javascript/test/colorize-results/test6916_js.json index 92e3ffc82eb..a3e9cc286fc 100644 --- a/extensions/javascript/test/colorize-results/test6916_js.json +++ b/extensions/javascript/test/colorize-results/test6916_js.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -51,7 +51,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -95,7 +95,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -139,7 +139,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -183,7 +183,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -227,7 +227,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -249,7 +249,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -271,7 +271,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -293,7 +293,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -359,7 +359,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -425,7 +425,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -447,7 +447,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -469,7 +469,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/javascript/test/colorize-results/test_js.json b/extensions/javascript/test/colorize-results/test_js.json index afcb74133d9..4d2acf6739f 100644 --- a/extensions/javascript/test/colorize-results/test_js.json +++ b/extensions/javascript/test/colorize-results/test_js.json @@ -95,7 +95,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -139,7 +139,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -282,7 +282,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -381,7 +381,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -425,7 +425,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -524,7 +524,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -568,7 +568,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -667,7 +667,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -711,7 +711,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -810,7 +810,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -854,7 +854,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -876,7 +876,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -898,7 +898,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -942,7 +942,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -953,7 +953,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1030,7 +1030,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1107,7 +1107,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1140,7 +1140,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1305,7 +1305,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1327,7 +1327,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1349,7 +1349,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1448,7 +1448,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1569,7 +1569,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1591,7 +1591,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1635,7 +1635,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1679,7 +1679,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1778,7 +1778,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1800,7 +1800,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2009,7 +2009,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2130,7 +2130,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -2141,7 +2141,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -2251,7 +2251,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2273,7 +2273,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2372,7 +2372,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -2383,7 +2383,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -2493,7 +2493,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2515,7 +2515,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2537,7 +2537,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2559,7 +2559,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2592,7 +2592,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2636,7 +2636,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2658,7 +2658,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2680,7 +2680,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2779,7 +2779,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2801,7 +2801,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2977,7 +2977,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2999,7 +2999,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3054,7 +3054,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3076,7 +3076,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3142,7 +3142,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3219,7 +3219,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3274,7 +3274,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3351,7 +3351,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3395,7 +3395,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3417,7 +3417,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -3450,7 +3450,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3494,7 +3494,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3527,7 +3527,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3593,7 +3593,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3615,7 +3615,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3670,7 +3670,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3692,7 +3692,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3714,7 +3714,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3791,7 +3791,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3813,7 +3813,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/javascript/test/colorize-results/test_jsx.json b/extensions/javascript/test/colorize-results/test_jsx.json index eaf452df0d2..55e2c440d3b 100644 --- a/extensions/javascript/test/colorize-results/test_jsx.json +++ b/extensions/javascript/test/colorize-results/test_jsx.json @@ -29,7 +29,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -73,7 +73,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -95,7 +95,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -139,7 +139,7 @@ "light_plus": "meta.object-literal.key entity.name.function: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key entity.name.function: #9CDCFE" } }, { @@ -150,7 +150,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -249,7 +249,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -293,7 +293,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -304,7 +304,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -403,7 +403,7 @@ "light_plus": "meta.object-literal.key entity.name.function: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key entity.name.function: #9CDCFE" } }, { @@ -414,7 +414,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -469,7 +469,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -529,7 +529,7 @@ }, { "c": " Prevent following the link.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -557,7 +557,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -579,7 +579,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -628,7 +628,7 @@ }, { "c": " Invert the chosen default.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -661,7 +661,7 @@ }, { "c": " This will trigger an intelligent re-render of the component.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -711,7 +711,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -755,7 +755,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -766,7 +766,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -821,7 +821,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -843,7 +843,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -931,7 +931,7 @@ "light_plus": "meta.object-literal.key entity.name.function: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key entity.name.function: #9CDCFE" } }, { @@ -942,7 +942,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -1046,7 +1046,7 @@ }, { "c": " Default to the default message.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -1096,7 +1096,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1184,7 +1184,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1222,7 +1222,7 @@ }, { "c": " If toggled, show the alternate message.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -1250,7 +1250,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1316,7 +1316,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1338,7 +1338,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1393,7 +1393,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1481,7 +1481,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -1536,7 +1536,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1679,7 +1679,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1899,7 +1899,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2108,7 +2108,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2130,7 +2130,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2157,13 +2157,13 @@ }, { "c": "ToggleText", - "t": "source.js meta.tag.js entity.name.tag.js", + "t": "source.js meta.tag.js entity.name.tag.js support.class.component.js", "r": { - "dark_plus": "entity.name.tag: #569CD6", - "light_plus": "entity.name.tag: #800000", + "dark_plus": "support.class: #4EC9B0", + "light_plus": "support.class: #267F99", "dark_vs": "entity.name.tag: #569CD6", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "support.class: #4EC9B0" } }, { @@ -2350,7 +2350,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -2372,7 +2372,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { diff --git a/extensions/javascript/tsconfig.json b/extensions/javascript/tsconfig.json index 551261ed46d..4445bb27fd7 100644 --- a/extensions/javascript/tsconfig.json +++ b/extensions/javascript/tsconfig.json @@ -7,7 +7,7 @@ "es2015" ] }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/json/server/npm-shrinkwrap.json b/extensions/json/server/npm-shrinkwrap.json index 4571e4d6bcc..d199f7b2a0f 100644 --- a/extensions/json/server/npm-shrinkwrap.json +++ b/extensions/json/server/npm-shrinkwrap.json @@ -8,14 +8,14 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-1.0.2.tgz" }, "debug": { - "version": "2.6.0", + "version": "2.6.6", "from": "debug@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz" + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.6.tgz" }, "extend": { - "version": "3.0.0", + "version": "3.0.1", "from": "extend@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz" }, "http-proxy-agent": { "version": "0.2.7", @@ -28,24 +28,24 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-0.3.6.tgz" }, "jsonc-parser": { - "version": "0.4.1", - "from": "jsonc-parser@0.4.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-0.4.1.tgz" + "version": "0.4.2", + "from": "jsonc-parser@0.4.2", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-0.4.2.tgz" }, "ms": { - "version": "0.7.2", - "from": "ms@0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz" + "version": "0.7.3", + "from": "ms@0.7.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz" }, "request-light": { - "version": "0.2.0", - "from": "request-light@0.2.0", - "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.2.0.tgz" + "version": "0.2.1", + "from": "request-light@0.2.1", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.2.1.tgz" }, "vscode-json-languageservice": { - "version": "2.0.8", + "version": "2.0.9", "from": "vscode-json-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.8.tgz" + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.9.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", diff --git a/extensions/json/server/package.json b/extensions/json/server/package.json index 4b0a98a80a2..6c643c0f542 100644 --- a/extensions/json/server/package.json +++ b/extensions/json/server/package.json @@ -8,9 +8,9 @@ "node": "*" }, "dependencies": { - "jsonc-parser": "^0.4.1", - "request-light": "^0.2.0", - "vscode-json-languageservice": "^2.0.8", + "jsonc-parser": "^0.4.2", + "request-light": "^0.2.1", + "vscode-json-languageservice": "^2.0.9", "vscode-languageserver": "^3.1.0-alpha.1", "vscode-nls": "^2.0.2" }, diff --git a/extensions/json/server/src/jsonServerMain.ts b/extensions/json/server/src/jsonServerMain.ts index 09a0dc199a7..f81721cde4a 100644 --- a/extensions/json/server/src/jsonServerMain.ts +++ b/extensions/json/server/src/jsonServerMain.ts @@ -111,7 +111,8 @@ let schemaRequestService = (uri: string): Thenable => { } }); } - return xhr({ url: uri, followRedirects: 5 }).then(response => { + let headers = { 'Accept-Encoding': 'gzip, deflate' }; + return xhr({ url: uri, followRedirects: 5, headers }).then(response => { return response.responseText; }, (error: XHRResponse) => { return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString()); diff --git a/extensions/json/server/tsconfig.json b/extensions/json/server/tsconfig.json index c2a86a0af35..deecf69b8b4 100644 --- a/extensions/json/server/tsconfig.json +++ b/extensions/json/server/tsconfig.json @@ -9,7 +9,7 @@ "es5", "es2015.promise" ] }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/json/syntaxes/JSON.tmLanguage b/extensions/json/syntaxes/JSON.tmLanguage index 9d6a24cc16a..507eb03ec93 100644 --- a/extensions/json/syntaxes/JSON.tmLanguage +++ b/extensions/json/syntaxes/JSON.tmLanguage @@ -98,7 +98,7 @@ begin - /\*\* + /\*\*(?!/) captures 0 diff --git a/extensions/less/syntaxes/less.tmLanguage.json b/extensions/less/syntaxes/less.tmLanguage.json index f9605e2f845..cd1543fd7d3 100644 --- a/extensions/less/syntaxes/less.tmLanguage.json +++ b/extensions/less/syntaxes/less.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-less/blob/master/grammars/less.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "Less", "scopeName": "source.css.less", "fileTypes": [ @@ -146,12 +151,7 @@ "name": "comment.block.css" }, { - "match": "[+-]?\\d*\\.?\\d+", - "name": "constant.numeric.css" - }, - { - "match": "(?<=[\\d])(ch|cm|deg|dpi|dpcm|dppx|em|ex|grad|in|mm|ms|pc|pt|px|rad|rem|turn|s|vh|vmin|vw)\\b|%", - "name": "keyword.other.unit.css" + "include": "source.css#numeric-values" }, { "captures": { @@ -209,7 +209,7 @@ "include": "#brace_round" }, { - "include": "#commas" + "include": "source.css#commas" }, { "include": "#strings" @@ -241,8 +241,7 @@ "name": "meta.at-rule.media.css" }, { - "match": "\\b(width|scan|resolution|orientation|monochrome|min-width|min-resolution|min-monochrome|min-height|min-device-width|min-device-height|min-device-aspect-ratio|min-color-index|min-color|min-aspect-ratio|max-width|max-resolution|max-monochrome|max-height|max-device-width|max-device-height|max-device-aspect-ratio|max-color-index|max-color|max-aspect-ratio|height|grid|device-width|device-height|device-aspect-ratio|color-index|color|aspect-ratio)\\b", - "name": "support.type.property-name.media-feature.media.css" + "include": "source.css#media-features" }, { "match": "\\b(tv|tty|screen|projection|print|handheld|embossed|braille|aural|all)\\b", @@ -282,13 +281,13 @@ ] }, { + "match": "(@|\\-\\-)[\\w-]+(?=\\s*)", + "name": "variable.other.less", "captures": { "1": { "name": "punctuation.definition.variable.less" } - }, - "match": "(?:@|\\-\\-)[a-zA-Z0-9_-][\\w-]*(?=\\s*)", - "name": "variable.other.less" + } }, { "include": "#variable_interpolation" @@ -309,19 +308,22 @@ "name": "meta.property-list.css", "patterns": [ { - "include": "#pseudo_elements" + "include": "source.css#pseudo-elements" }, { - "include": "#pseudo_classes" + "include": "source.css#pseudo-classes" + }, + { + "include": "source.css#tag-names" + }, + { + "include": "source.css#commas" }, { "include": "#variable_interpolation" }, { - "include": "#property_names" - }, - { - "include": "#property_names_svg" + "include": "source.css#property-names" }, { "include": "#property_values" @@ -344,22 +346,17 @@ "name": "keyword.control.logical.operator.less" }, { - "match": "(?x)\n(? { + const source = event.target.dataset.source; + unloadedStyles.push(source); + }; + + window.addEventListener('DOMContentLoaded', () => { + for (const link of document.getElementsByClassName('code-user-style')) { + if (link.dataset.source) { + link.onerror = onStyleLoadError; + } + } + }) + + window.addEventListener('load', () => { + if (!unloadedStyles.length) { + return; + } + const args = [unloadedStyles]; + window.parent.postMessage({ + command: 'did-click-link', + data: `command:_markdown.onPreviewStyleLoadError?${encodeURIComponent(JSON.stringify(args))}` + }, 'file://'); + }); +}()); \ No newline at end of file diff --git a/extensions/markdown/media/main.js b/extensions/markdown/media/main.js index 1718be3f453..1b7ac343e09 100644 --- a/extensions/markdown/media/main.js +++ b/extensions/markdown/media/main.js @@ -145,7 +145,7 @@ var marker = new ActiveLineMarker(); const settings = JSON.parse(document.getElementById('vscode-markdown-preview-data').getAttribute('data-settings')); - window.addEventListener('load', () => { + function onLoad() { if (settings.scrollPreviewWithEditorSelection) { const initialLine = +settings.line; if (!isNaN(initialLine)) { @@ -155,7 +155,14 @@ }, 0); } } - }); + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', onLoad); + } else { + onLoad(); + } + window.addEventListener('resize', () => { scrollDisabled = true; diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json index c0917c8bcba..4ffa3bd6b39 100644 --- a/extensions/markdown/package.json +++ b/extensions/markdown/package.json @@ -143,7 +143,7 @@ }, "markdown.preview.fontFamily": { "type": "string", - "default": "-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', 'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif", + "default": "system-ui, 'Segoe WPC', 'Segoe UI', 'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif", "description": "%markdown.preview.fontFamily.desc%" }, "markdown.preview.fontSize": { @@ -204,7 +204,7 @@ "update-grammar": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ./syntaxes/gulpfile.js" }, "dependencies": { - "highlight.js": "^9.3.0", + "highlight.js": "^9.11.0", "markdown-it": "^8.3.1", "markdown-it-named-headers": "0.0.4", "vscode-extension-telemetry": "^0.0.7", diff --git a/extensions/markdown/src/documentLinkProvider.ts b/extensions/markdown/src/documentLinkProvider.ts index 2b2bde5d535..4cf4055c940 100644 --- a/extensions/markdown/src/documentLinkProvider.ts +++ b/extensions/markdown/src/documentLinkProvider.ts @@ -10,7 +10,7 @@ import * as path from 'path'; export default class MarkdownDocumentLinkProvider implements vscode.DocumentLinkProvider { - private _linkPattern = /(\[[^\]]*\]\(\s*?)([^\s\)]+?)(\s+[^\)]+)?\)/g; + private _linkPattern = /(\[[^\]]*\]\(\s*?)(((((?=.*\)\)+)|(?=.*\)\]+))[^\s\)]+?)|([^\s]+)))\)/g; constructor() { } diff --git a/extensions/markdown/src/documentSymbolProvider.ts b/extensions/markdown/src/documentSymbolProvider.ts index e35e690d624..dec81619648 100644 --- a/extensions/markdown/src/documentSymbolProvider.ts +++ b/extensions/markdown/src/documentSymbolProvider.ts @@ -19,7 +19,7 @@ export default class MDDocumentSymbolProvider implements vscode.DocumentSymbolPr provideDocumentSymbols(document: vscode.TextDocument): vscode.ProviderResult { const toc = new TableOfContentsProvider(this.engine, document); return toc.getToc().map(entry => { - return new vscode.SymbolInformation(entry.text, vscode.SymbolKind.Module, '', entry.location); + return new vscode.SymbolInformation(entry.text, vscode.SymbolKind.Namespace, '', entry.location); }); } } \ No newline at end of file diff --git a/extensions/markdown/src/extension.ts b/extensions/markdown/src/extension.ts index e454e22879b..4deb344b9f2 100644 --- a/extensions/markdown/src/extension.ts +++ b/extensions/markdown/src/extension.ts @@ -15,6 +15,8 @@ import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from ' import { MDDocumentContentProvider, getMarkdownUri, isMarkdownFile } from './previewContentProvider'; import { TableOfContentsProvider } from './tableOfContentsProvider'; import { Logger } from "./logger"; +import * as nls from 'vscode-nls'; +const localize = nls.loadMessageBundle(); interface IPackageInfo { name: string; @@ -59,7 +61,7 @@ export function activate(context: vscode.ExtensionContext) { continue; } - let styles = contributes['markdown.preview'] && contributes['markdown.preview'].styles; + let styles = contributes['markdown.previewStyles']; if (styles) { if (!Array.isArray(styles)) { styles = [styles]; @@ -73,7 +75,7 @@ export function activate(context: vscode.ExtensionContext) { } } - let scripts = contributes['markdown.preview'] && contributes['markdown.preview'].scripts; + let scripts = contributes['markdown.previewScripts']; if (scripts) { if (!Array.isArray(scripts)) { scripts = [scripts]; @@ -166,6 +168,10 @@ export function activate(context: vscode.ExtensionContext) { previewSecuritySelector.showSecutitySelectorForWorkspace(resource ? vscode.Uri.parse(resource).query : undefined); })); + context.subscriptions.push(vscode.commands.registerCommand('_markdown.onPreviewStyleLoadError', (resources: string[]) => { + vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'markdown.styles': {0}", resources.join(', '))); + })); + context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(document => { if (isMarkdownFile(document)) { const uri = getMarkdownUri(document.uri); diff --git a/extensions/markdown/src/previewContentProvider.ts b/extensions/markdown/src/previewContentProvider.ts index 7e98548f212..caacead613e 100644 --- a/extensions/markdown/src/previewContentProvider.ts +++ b/extensions/markdown/src/previewContentProvider.ts @@ -39,7 +39,7 @@ export function getMarkdownUri(uri: vscode.Uri) { return uri.with({ scheme: 'markdown', - path: uri.fsPath + '.rendered', + path: uri.path + '.rendered', query: uri.toString() }); } @@ -73,6 +73,7 @@ class MarkdownPreviewConfig { this.scrollPreviewWithEditorSelection = !!markdownConfig.get('preview.scrollPreviewWithEditorSelection', true); this.scrollEditorWithPreview = !!markdownConfig.get('preview.scrollEditorWithPreview', true); this.doubleClickToSwitchToEditor = !!markdownConfig.get('preview.doubleClickToSwitchToEditor', true); + this.markEditorSelection = !!markdownConfig.get('preview.markEditorSelection', true); this.fontFamily = markdownConfig.get('preview.fontFamily', undefined); this.fontSize = +markdownConfig.get('preview.fontSize', NaN); @@ -165,7 +166,7 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv private computeCustomStyleSheetIncludes(uri: vscode.Uri): string { if (this.config.styles && Array.isArray(this.config.styles)) { return this.config.styles.map((style) => { - return ``; + return ``; }).join('\n'); } return ''; @@ -195,22 +196,22 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv private getScripts(nonce: string): string { const scripts = [this.getMediaPath('main.js')].concat(this.extraScripts.map(resource => resource.toString())); return scripts - .map(source => ``) + .map(source => ``) .join('\n'); } public provideTextDocumentContent(uri: vscode.Uri): Thenable { const sourceUri = vscode.Uri.parse(uri.query); + let initialLine: number | undefined = undefined; + const editor = vscode.window.activeTextEditor; + if (editor && editor.document.uri.fsPath === sourceUri.fsPath) { + initialLine = editor.selection.active.line; + } + return vscode.workspace.openTextDocument(sourceUri).then(document => { this.config = MarkdownPreviewConfig.getCurrentConfig(); - let initialLine = 0; - const editor = vscode.window.activeTextEditor; - if (editor && editor.document.uri.fsPath === sourceUri.fsPath) { - initialLine = editor.selection.active.line; - } - const initialData = { previewUri: uri.toString(), source: sourceUri.toString(), @@ -237,6 +238,7 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv ${csp} + ${this.getStyles(uri, nonce)} diff --git a/extensions/markdown/src/tableOfContentsProvider.ts b/extensions/markdown/src/tableOfContentsProvider.ts index 7a08e6b4348..983b9113ffa 100644 --- a/extensions/markdown/src/tableOfContentsProvider.ts +++ b/extensions/markdown/src/tableOfContentsProvider.ts @@ -66,7 +66,7 @@ export class TableOfContentsProvider { } private static getHeaderText(header: string): string { - return header.replace(/^\s*(#)+\s*(.*?)\s*\1*$/, '$2').trim(); + return header.replace(/^\s*(#+)\s*(.*?)\s*\1*$/, (_, level, word) => `${level} ${word.trim()}`); } public static slugify(header: string): string { diff --git a/extensions/markdown/syntaxes/gulpfile.js b/extensions/markdown/syntaxes/gulpfile.js index f57cb80fb9d..a01ff06499c 100644 --- a/extensions/markdown/syntaxes/gulpfile.js +++ b/extensions/markdown/syntaxes/gulpfile.js @@ -34,7 +34,7 @@ const languages = [ { name: 'groovy', identifiers: ['groovy', 'gvy'], source: 'source.groovy' }, { name: 'jade', identifiers: ['jade'], source: 'text.jade' }, - { name: 'js', identifiers: ['js', 'jsx', 'javascript'], source: 'source.js' }, + { name: 'js', identifiers: ['js', 'jsx', 'javascript', 'es6', 'mjs'], source: 'source.js' }, { name: 'js_regexp', identifiers: ['regexp'], source: 'source.js.regexp' }, { name: 'json', identifiers: ['json', 'sublime-settings', 'sublime-menu', 'sublime-keymap', 'sublime-mousemap', 'sublime-theme', 'sublime-build', 'sublime-project', 'sublime-completions'], source: 'source.json' }, { name: 'less', identifiers: ['less'], source: 'source.css.less' }, diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index df4657d2014..38d1292f7e4 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -1965,7 +1965,7 @@ fenced_code_block_js begin - (^|\G)(\s*)([`~]{3,})\s*((js|jsx|javascript)(\s+[^`~]*)?$) + (^|\G)(\s*)([`~]{3,})\s*((js|jsx|javascript|es6|mjs)(\s+[^`~]*)?$) name markup.fenced_code.block.markdown end diff --git a/extensions/markdown/tsconfig.json b/extensions/markdown/tsconfig.json index e877d8142f0..ec272338af5 100644 --- a/extensions/markdown/tsconfig.json +++ b/extensions/markdown/tsconfig.json @@ -14,7 +14,7 @@ "noUnusedLocals": true, "noUnusedParameters": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/merge-conflict/package.json b/extensions/merge-conflict/package.json new file mode 100644 index 00000000000..1d099d83c23 --- /dev/null +++ b/extensions/merge-conflict/package.json @@ -0,0 +1,127 @@ +{ + "name": "merge-conflict", + "publisher": "vscode", + "displayName": "merge-conflict", + "description": "Merge Conflict", + "version": "0.7.0", + "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", + "engines": { + "vscode": "^1.5.0" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "*" + ], + "main": "./out/extension", + "scripts": { + "compile": "gulp compile-extension:merge-conflict", + "watch": "gulp watch-extension:merge-conflict" + }, + "contributes": { + "commands": [ + { + "category": "%command.category%", + "title": "%command.accept.all-incoming%", + "command": "merge-conflict.accept.all-incoming" + }, + { + "category": "%command.category%", + "title": "%command.accept.all-both%", + "command": "merge-conflict.accept.all-both" + }, + { + "category": "%command.category%", + "title": "%command.accept.current%", + "command": "merge-conflict.accept.current" + }, + { + "category": "%command.category%", + "title": "%command.accept.incoming%", + "command": "merge-conflict.accept.incoming" + }, + { + "category": "%command.category%", + "title": "Accept selection", + "command": "merge-conflict.accept.selection" + }, + { + "category": "%command.category%", + "title": "%command.accept.both%", + "command": "merge-conflict.accept.both" + }, + { + "category": "%command.category%", + "title": "%command.next%", + "command": "merge-conflict.next" + }, + { + "category": "%command.category%", + "title": "%command.previous%", + "command": "merge-conflict.previous" + }, + { + "category": "%command.category%", + "title": "%command.compare%", + "command": "merge-conflict.compare" + } + ], + "keybindings": [ + { + "command": "merge-conflict.next", + "when": "editorTextFocus", + "key": "alt+m down" + }, + { + "command": "merge-conflict.previous", + "when": "editorTextFocus", + "key": "alt+m up" + }, + { + "command": "merge-conflict.accept.selection", + "when": "editorTextFocus", + "key": "alt+m enter" + }, + { + "command": "merge-conflict.accept.current", + "when": "editorTextFocus", + "key": "alt+m 1" + }, + { + "command": "merge-conflict.accept.incoming", + "when": "editorTextFocus", + "key": "alt+m 2" + }, + { + "command": "merge-conflict.accept.both", + "when": "editorTextFocus", + "key": "alt+m 3" + } + ], + "configuration": { + "title": "%config.title%", + "properties": { + "merge-conflict.codeLens.enabled": { + "type": "boolean", + "description": "%config.codeLensEnabled%", + "default": true + }, + "merge-conflict.decorators.enabled": { + "type": "boolean", + "description": "%config.decoratorsEnabled%", + "default": true + } + } + } + }, + "dependencies": { + "vscode-extension-telemetry": "^0.0.7", + "vscode-nls": "^2.0.2" + }, + "devDependencies": { + "@types/mocha": "^2.2.41", + "@types/node": "^7.0.4", + "mocha": "^3.2.0" + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/package.nls.json b/extensions/merge-conflict/package.nls.json new file mode 100644 index 00000000000..d991f872b44 --- /dev/null +++ b/extensions/merge-conflict/package.nls.json @@ -0,0 +1,15 @@ +{ + "command.category": "Merge Conflict", + "command.accept.all-incoming": "Accept all incoming", + "command.accept.all-both": "Accept all both", + "command.accept.current": "Accept current", + "command.accept.incoming": "Accept incoming", + "command.accept.selection": "Accept selection", + "command.accept.both": "Accept Both", + "command.next": "Next conflict", + "command.previous": "Previous conflict", + "command.compare": "Compare current conflict", + "config.title": "Merge Conflict", + "config.codeLensEnabled": "Enable/disable merge conflict block CodeLens within editor", + "config.decoratorsEnabled": "Enable/disable merge conflict decorators within editor" +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/codelensProvider.ts b/extensions/merge-conflict/src/codelensProvider.ts new file mode 100644 index 00000000000..72135945054 --- /dev/null +++ b/extensions/merge-conflict/src/codelensProvider.ts @@ -0,0 +1,102 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import * as interfaces from './interfaces'; +import { loadMessageBundle } from 'vscode-nls'; +const localize = loadMessageBundle(); + +export default class MergeConflictCodeLensProvider implements vscode.CodeLensProvider, vscode.Disposable { + private codeLensRegistrationHandle: vscode.Disposable | null; + private config: interfaces.IExtensionConfiguration; + private tracker: interfaces.IDocumentMergeConflictTracker; + + constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { + this.tracker = trackerService.createTracker('codelens'); + } + + begin(config: interfaces.IExtensionConfiguration) { + this.config = config; + + if (this.config.enableCodeLens) { + this.registerCodeLensProvider(); + } + } + + configurationUpdated(updatedConfig: interfaces.IExtensionConfiguration) { + + if (updatedConfig.enableCodeLens === false && this.codeLensRegistrationHandle) { + this.codeLensRegistrationHandle.dispose(); + this.codeLensRegistrationHandle = null; + } + else if (updatedConfig.enableCodeLens === true && !this.codeLensRegistrationHandle) { + this.registerCodeLensProvider(); + } + + this.config = updatedConfig; + } + + + dispose() { + if (this.codeLensRegistrationHandle) { + this.codeLensRegistrationHandle.dispose(); + this.codeLensRegistrationHandle = null; + } + } + + async provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): Promise { + + if (!this.config || !this.config.enableCodeLens) { + return null; + } + + let conflicts = await this.tracker.getConflicts(document); + + if (!conflicts || conflicts.length === 0) { + return null; + } + + let items: vscode.CodeLens[] = []; + + conflicts.forEach(conflict => { + let acceptCurrentCommand: vscode.Command = { + command: 'merge-conflict.accept.current', + title: localize('acceptCurrentChange', 'Accept current change'), + arguments: ['known-conflict', conflict] + }; + + let acceptIncomingCommand: vscode.Command = { + command: 'merge-conflict.accept.incoming', + title: localize('acceptIncomingChange', 'Accept incoming change'), + arguments: ['known-conflict', conflict] + }; + + let acceptBothCommand: vscode.Command = { + command: 'merge-conflict.accept.both', + title: localize('acceptBothChanges', 'Accept both changes'), + arguments: ['known-conflict', conflict] + }; + + let diffCommand: vscode.Command = { + command: 'merge-conflict.compare', + title: localize('compareChanges', 'Compare changes'), + arguments: [conflict] + }; + + items.push( + new vscode.CodeLens(conflict.range, acceptCurrentCommand), + new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 1 })), acceptIncomingCommand), + new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 2 })), acceptBothCommand), + new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 3 })), diffCommand) + ); + }); + + return items; + } + + private registerCodeLensProvider() { + this.codeLensRegistrationHandle = vscode.languages.registerCodeLensProvider({ pattern: '**/*' }, this); + } +} diff --git a/extensions/merge-conflict/src/commandHandler.ts b/extensions/merge-conflict/src/commandHandler.ts new file mode 100644 index 00000000000..41982c06307 --- /dev/null +++ b/extensions/merge-conflict/src/commandHandler.ts @@ -0,0 +1,271 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import * as interfaces from './interfaces'; +import ContentProvider from './contentProvider'; +import * as path from 'path'; +import { loadMessageBundle } from 'vscode-nls'; +const localize = loadMessageBundle(); + +interface IDocumentMergeConflictNavigationResults { + canNavigate: boolean; + conflict?: interfaces.IDocumentMergeConflict; +} + +enum NavigationDirection { + Forwards, + Backwards +} + +export default class CommandHandler implements vscode.Disposable { + + private disposables: vscode.Disposable[] = []; + private tracker: interfaces.IDocumentMergeConflictTracker; + + constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { + this.tracker = trackerService.createTracker('commands'); + } + + begin() { + this.disposables.push( + vscode.commands.registerTextEditorCommand('merge-conflict.accept.current', this.acceptCurrent, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.incoming', this.acceptIncoming, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.selection', this.acceptSelection, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.both', this.acceptBoth, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-current', this.acceptAllCurrent, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-incoming', this.acceptAllIncoming, this), + vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-both', this.acceptAllBoth, this), + vscode.commands.registerTextEditorCommand('merge-conflict.next', this.navigateNext, this), + vscode.commands.registerTextEditorCommand('merge-conflict.previous', this.navigatePrevious, this), + vscode.commands.registerTextEditorCommand('merge-conflict.compare', this.compare, this) + ); + } + + acceptCurrent(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.accept(interfaces.CommitType.Current, editor, ...args); + } + + acceptIncoming(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.accept(interfaces.CommitType.Incoming, editor, ...args); + } + + acceptBoth(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.accept(interfaces.CommitType.Both, editor, ...args); + } + + acceptAllCurrent(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.acceptAll(interfaces.CommitType.Current, editor); + } + + acceptAllIncoming(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.acceptAll(interfaces.CommitType.Incoming, editor); + } + + acceptAllBoth(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.acceptAll(interfaces.CommitType.Both, editor); + } + + async compare(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, conflict: interfaces.IDocumentMergeConflict | null, ...args) { + const fileName = path.basename(editor.document.uri.fsPath); + + // No conflict, command executed from command palette + if (!conflict) { + conflict = await this.findConflictContainingSelection(editor); + + // Still failed to find conflict, warn the user and exit + if (!conflict) { + vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict')); + return; + } + } + + let range = conflict.current.content; + const leftUri = editor.document.uri.with({ + scheme: ContentProvider.scheme, + query: JSON.stringify(range) + }); + + range = conflict.incoming.content; + const rightUri = leftUri.with({ query: JSON.stringify(range) }); + + const title = localize('compareChangesTitle', '{0}: Current changes ⟷ Incoming changes', fileName); + vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title); + } + + navigateNext(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.navigate(editor, NavigationDirection.Forwards); + } + + navigatePrevious(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + return this.navigate(editor, NavigationDirection.Backwards); + } + + async acceptSelection(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + let conflict = await this.findConflictContainingSelection(editor); + + if (!conflict) { + vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict')); + return; + } + + let typeToAccept: interfaces.CommitType; + + // Figure out if the cursor is in current or incoming, we do this by seeing if + // the active position is before or after the range of the splitter. We can + // use this trick as the previous check in findConflictByActiveSelection will + // ensure it's within the conflict range, so we don't falsely identify "current" + // or "incoming" if outside of a conflict range. + if (editor.selection.active.isBefore(conflict.splitter.start)) { + typeToAccept = interfaces.CommitType.Current; + } + else if (editor.selection.active.isAfter(conflict.splitter.end)) { + typeToAccept = interfaces.CommitType.Incoming; + } + else { + vscode.window.showWarningMessage(localize('cursorOnSplitterRange', 'Editor cursor is within the merge conflict splitter, please move it to either the "current" or "incoming" block')); + return; + } + + this.tracker.forget(editor.document); + conflict.commitEdit(typeToAccept, editor); + } + + dispose() { + this.disposables.forEach(disposable => disposable.dispose()); + this.disposables = []; + } + + private async navigate(editor: vscode.TextEditor, direction: NavigationDirection): Promise { + let navigationResult = await this.findConflictForNavigation(editor, direction); + + if (!navigationResult) { + vscode.window.showWarningMessage(localize('noConflicts', 'No merge conflicts found in this file')); + return; + } + else if (!navigationResult.canNavigate) { + vscode.window.showWarningMessage(localize('noOtherConflictsInThisFile', 'No other merge conflicts within this file')); + return; + } + else if (!navigationResult.conflict) { + // TODO: Show error message? + return; + } + + // Move the selection to the first line of the conflict + editor.selection = new vscode.Selection(navigationResult.conflict.range.start, navigationResult.conflict.range.start); + editor.revealRange(navigationResult.conflict.range, vscode.TextEditorRevealType.Default); + } + + private async accept(type: interfaces.CommitType, editor: vscode.TextEditor, ...args): Promise { + + let conflict: interfaces.IDocumentMergeConflict | null; + + // If launched with known context, take the conflict from that + if (args[0] === 'known-conflict') { + conflict = args[1]; + } + else { + // Attempt to find a conflict that matches the current curosr position + conflict = await this.findConflictContainingSelection(editor); + } + + if (!conflict) { + vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict')); + return; + } + + // Tracker can forget as we know we are going to do an edit + this.tracker.forget(editor.document); + conflict.commitEdit(type, editor); + } + + private async acceptAll(type: interfaces.CommitType, editor: vscode.TextEditor): Promise { + let conflicts = await this.tracker.getConflicts(editor.document); + + if (!conflicts || conflicts.length === 0) { + vscode.window.showWarningMessage(localize('noConflicts', 'No merge conflicts found in this file')); + return; + } + + // For get the current state of the document, as we know we are doing to do a large edit + this.tracker.forget(editor.document); + + // Apply all changes as one edit + await editor.edit((edit) => conflicts.forEach(conflict => { + conflict.applyEdit(type, editor, edit); + })); + } + + private async findConflictContainingSelection(editor: vscode.TextEditor, conflicts?: interfaces.IDocumentMergeConflict[]): Promise { + + if (!conflicts) { + conflicts = await this.tracker.getConflicts(editor.document); + } + + if (!conflicts || conflicts.length === 0) { + return null; + } + + for (let i = 0; i < conflicts.length; i++) { + if (conflicts[i].range.contains(editor.selection.active)) { + return conflicts[i]; + } + } + + return null; + } + + private async findConflictForNavigation(editor: vscode.TextEditor, direction: NavigationDirection, conflicts?: interfaces.IDocumentMergeConflict[]): Promise { + if (!conflicts) { + conflicts = await this.tracker.getConflicts(editor.document); + } + + if (!conflicts || conflicts.length === 0) { + return null; + } + + let selection = editor.selection.active; + if (conflicts.length === 1) { + if (conflicts[0].range.contains(selection)) { + return { + canNavigate: false + }; + } + + return { + canNavigate: true, + conflict: conflicts[0] + }; + } + + let predicate: (conflict) => boolean; + let fallback: () => interfaces.IDocumentMergeConflict; + + if (direction === NavigationDirection.Forwards) { + predicate = (conflict) => selection.isBefore(conflict.range.start); + fallback = () => conflicts![0]; + } else if (direction === NavigationDirection.Backwards) { + predicate = (conflict) => selection.isAfter(conflict.range.start); + fallback = () => conflicts![conflicts!.length - 1]; + } else { + throw new Error(`Unsupported direction ${direction}`); + } + + for (let i = 0; i < conflicts.length; i++) { + if (predicate(conflicts[i]) && !conflicts[i].range.contains(selection)) { + return { + canNavigate: true, + conflict: conflicts[i] + }; + } + } + + // Went all the way to the end, return the head + return { + canNavigate: true, + conflict: fallback() + }; + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/contentProvider.ts b/extensions/merge-conflict/src/contentProvider.ts new file mode 100644 index 00000000000..910a4b6d2d0 --- /dev/null +++ b/extensions/merge-conflict/src/contentProvider.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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 vscode from 'vscode'; +import * as interfaces from './interfaces'; + +export default class MergeConflictContentProvider implements vscode.TextDocumentContentProvider, vscode.Disposable { + + static scheme = 'merge-conflict.conflict-diff'; + + constructor(private context: vscode.ExtensionContext) { + } + + begin(config: interfaces.IExtensionConfiguration) { + this.context.subscriptions.push( + vscode.workspace.registerTextDocumentContentProvider(MergeConflictContentProvider.scheme, this) + ); + } + + dispose() { + } + + async provideTextDocumentContent(uri: vscode.Uri): Promise { + try { + const [start, end] = JSON.parse(uri.query) as { line: number, character: number }[]; + + const document = await vscode.workspace.openTextDocument(uri.with({ scheme: 'file', query: '' })); + const text = document.getText(new vscode.Range(start.line, start.character, end.line, end.character)); + return text; + } + catch (ex) { + await vscode.window.showErrorMessage('Unable to show comparison'); + return null; + } + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/delayer.ts b/extensions/merge-conflict/src/delayer.ts new file mode 100644 index 00000000000..59ec77ed503 --- /dev/null +++ b/extensions/merge-conflict/src/delayer.ts @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +export interface ITask { + (): T; +} + +export class Delayer { + + public defaultDelay: number; + private timeout: any; // Timer + private completionPromise: Promise | null; + private onSuccess: ((value?: T | Thenable | null) => void) | null; + private task: ITask | null; + + constructor(defaultDelay: number) { + this.defaultDelay = defaultDelay; + this.timeout = null; + this.completionPromise = null; + this.onSuccess = null; + this.task = null; + } + + public trigger(task: ITask, delay: number = this.defaultDelay): Promise { + this.task = task; + if (delay >= 0) { + this.cancelTimeout(); + } + + if (!this.completionPromise) { + this.completionPromise = new Promise((resolve) => { + this.onSuccess = resolve; + }).then(() => { + this.completionPromise = null; + this.onSuccess = null; + var result = this.task!(); + this.task = null; + return result; + }); + } + + if (delay >= 0 || this.timeout === null) { + this.timeout = setTimeout(() => { + this.timeout = null; + this.onSuccess!(null); + }, delay >= 0 ? delay : this.defaultDelay); + } + + return this.completionPromise; + } + + public forceDelivery(): Promise | null { + if (!this.completionPromise) { + return null; + } + this.cancelTimeout(); + let result = this.completionPromise; + this.onSuccess!(null); + return result; + } + + public isTriggered(): boolean { + return this.timeout !== null; + } + + public cancel(): void { + this.cancelTimeout(); + this.completionPromise = null; + } + + private cancelTimeout(): void { + if (this.timeout !== null) { + clearTimeout(this.timeout); + this.timeout = null; + } + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/documentMergeConflict.ts b/extensions/merge-conflict/src/documentMergeConflict.ts new file mode 100644 index 00000000000..221ee8f36bc --- /dev/null +++ b/extensions/merge-conflict/src/documentMergeConflict.ts @@ -0,0 +1,76 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as interfaces from './interfaces'; +import * as vscode from 'vscode'; + +export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict { + + public range: vscode.Range; + public current: interfaces.IMergeRegion; + public incoming: interfaces.IMergeRegion; + public splitter: vscode.Range; + + constructor(document: vscode.TextDocument, descriptor: interfaces.IDocumentMergeConflictDescriptor) { + this.range = descriptor.range; + this.current = descriptor.current; + this.incoming = descriptor.incoming; + this.splitter = descriptor.splitter; + } + + public commitEdit(type: interfaces.CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable { + + if (edit) { + + this.applyEdit(type, editor, edit); + return Promise.resolve(true); + }; + + return editor.edit((edit) => this.applyEdit(type, editor, edit)); + } + + public applyEdit(type: interfaces.CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit): void { + + // Each conflict is a set of ranges as follows, note placements or newlines + // which may not in in spans + // [ Conflict Range -- (Entire content below) + // [ Current Header ]\n -- >>>>> Header + // [ Current Content ] -- (content) + // [ Splitter ]\n -- ===== + // [ Incoming Content ] -- (content) + // [ Incoming Header ]\n -- <<<<< Incoming + // ] + if (type === interfaces.CommitType.Current) { + // Replace [ Conflict Range ] with [ Current Content ] + let content = editor.document.getText(this.current.content); + this.replaceRangeWithContent(content, edit); + } + else if (type === interfaces.CommitType.Incoming) { + let content = editor.document.getText(this.incoming.content); + this.replaceRangeWithContent(content, edit); + } + else if (type === interfaces.CommitType.Both) { + // Replace [ Conflict Range ] with [ Current Content ] + \n + [ Incoming Content ] + + const currentContent = editor.document.getText(this.current.content); + const incomingContent = editor.document.getText(this.incoming.content); + + edit.replace(this.range, currentContent.concat(incomingContent)); + } + } + + private replaceRangeWithContent(content: string, edit: vscode.TextEditorEdit) { + if (this.isNewlineOnly(content)) { + edit.replace(this.range, ''); + return; + } + + // Replace [ Conflict Range ] with [ Current Content ] + edit.replace(this.range, content); + } + + private isNewlineOnly(text: string) { + return text === '\n' || text === '\r\n'; + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/documentTracker.ts b/extensions/merge-conflict/src/documentTracker.ts new file mode 100644 index 00000000000..e6b50fec1a8 --- /dev/null +++ b/extensions/merge-conflict/src/documentTracker.ts @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { MergeConflictParser } from './mergeConflictParser'; +import * as interfaces from './interfaces'; +import { Delayer } from './delayer'; + +class ScanTask { + public origins: Set = new Set(); + public delayTask: Delayer; + + constructor(delayTime: number, initialOrigin: string) { + this.origins.add(initialOrigin); + this.delayTask = new Delayer(delayTime); + } + + public addOrigin(name: string): boolean { + if (this.origins.has(name)) { + return false; + } + + return false; + } + + public hasOrigin(name: string): boolean { + return this.origins.has(name); + } +} + +class OriginDocumentMergeConflictTracker implements interfaces.IDocumentMergeConflictTracker { + constructor(private parent: DocumentMergeConflictTracker, private origin: string) { + } + + getConflicts(document: vscode.TextDocument): PromiseLike { + return this.parent.getConflicts(document, this.origin); + } + + isPending(document: vscode.TextDocument): boolean { + return this.parent.isPending(document, this.origin); + } + + forget(document: vscode.TextDocument) { + this.parent.forget(document); + } +} + +export default class DocumentMergeConflictTracker implements vscode.Disposable, interfaces.IDocumentMergeConflictTrackerService { + private cache: Map = new Map(); + private delayExpireTime: number = 250; + + getConflicts(document: vscode.TextDocument, origin: string): PromiseLike { + // Attempt from cache + + let key = this.getCacheKey(document); + + if (!key) { + // Document doesnt have a uri, can't cache it, so return + return Promise.resolve(this.getConflictsOrEmpty(document, [origin])); + } + + let cacheItem = this.cache.get(key); + if (!cacheItem) { + cacheItem = new ScanTask(this.delayExpireTime, origin); + this.cache.set(key, cacheItem); + } + else { + cacheItem.addOrigin(origin); + } + + return cacheItem.delayTask.trigger(() => { + let conflicts = this.getConflictsOrEmpty(document, Array.from(cacheItem!.origins)); + + if (this.cache) { + this.cache.delete(key!); + } + + return conflicts; + }); + } + + isPending(document: vscode.TextDocument, origin: string): boolean { + if (!document) { + return false; + } + + let key = this.getCacheKey(document); + if (!key) { + return false; + } + + var task = this.cache.get(key); + + if (!task) { + return false; + } + + return task.hasOrigin(origin); + } + + createTracker(origin: string): interfaces.IDocumentMergeConflictTracker { + return new OriginDocumentMergeConflictTracker(this, origin); + } + + forget(document: vscode.TextDocument) { + let key = this.getCacheKey(document); + + if (key) { + this.cache.delete(key); + } + } + + dispose() { + this.cache.clear(); + } + + private getConflictsOrEmpty(document: vscode.TextDocument, origins: string[]): interfaces.IDocumentMergeConflict[] { + const containsConflict = MergeConflictParser.containsConflict(document); + + if (!containsConflict) { + return []; + } + + const conflicts = MergeConflictParser.scanDocument(document); + return conflicts; + } + + private getCacheKey(document: vscode.TextDocument): string | null { + if (document.uri && document.uri) { + return document.uri.toString(); + } + + return null; + } +} + diff --git a/extensions/merge-conflict/src/extension.ts b/extensions/merge-conflict/src/extension.ts new file mode 100644 index 00000000000..33c996955db --- /dev/null +++ b/extensions/merge-conflict/src/extension.ts @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import MergeConflictServices from './services'; + +export function activate(context: vscode.ExtensionContext) { + // Register disposables + const services = new MergeConflictServices(context); + services.begin(); + context.subscriptions.push(services); +} + +export function deactivate() { +} + diff --git a/extensions/merge-conflict/src/interfaces.ts b/extensions/merge-conflict/src/interfaces.ts new file mode 100644 index 00000000000..9d411befaba --- /dev/null +++ b/extensions/merge-conflict/src/interfaces.ts @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; + +export interface IMergeRegion { + name: string; + header: vscode.Range; + content: vscode.Range; + decoratorContent: vscode.Range; +} + +export enum CommitType { + Current, + Incoming, + Both +} + +export interface IExtensionConfiguration { + enableCodeLens: boolean; + enableDecorations: boolean; + enableEditorOverview: boolean; +} + +export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor { + commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit); + applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit); +} + +export interface IDocumentMergeConflictDescriptor { + range: vscode.Range; + current: IMergeRegion; + incoming: IMergeRegion; + splitter: vscode.Range; +} + +export interface IDocumentMergeConflictTracker { + getConflicts(document: vscode.TextDocument): PromiseLike; + isPending(document: vscode.TextDocument): boolean; + forget(document: vscode.TextDocument); +} + +export interface IDocumentMergeConflictTrackerService { + createTracker(origin: string): IDocumentMergeConflictTracker; + forget(document: vscode.TextDocument); +} diff --git a/extensions/merge-conflict/src/mergeConflictParser.ts b/extensions/merge-conflict/src/mergeConflictParser.ts new file mode 100644 index 00000000000..fa316a0701c --- /dev/null +++ b/extensions/merge-conflict/src/mergeConflictParser.ts @@ -0,0 +1,141 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import * as interfaces from './interfaces'; +import { DocumentMergeConflict } from './documentMergeConflict'; + +const startHeaderMarker = '<<<<<<< '; +const splitterMarker = '======='; +const endFooterMarker = '>>>>>>> '; + +interface IScanMergedConflict { + startHeader: vscode.TextLine; + splitter?: vscode.TextLine; + endFooter?: vscode.TextLine; +} + +export class MergeConflictParser { + + static scanDocument(document: vscode.TextDocument): interfaces.IDocumentMergeConflict[] { + + // Scan each line in the document, we already know there is atleast a <<<<<<< and + // >>>>>> marker within the document, we need to group these into conflict ranges. + // We initially build a scan match, that references the lines of the header, splitter + // and footer. This is then converted into a full descriptor containing all required + // ranges. + + let currentConflict: IScanMergedConflict | null = null; + const conflictDescriptors: interfaces.IDocumentMergeConflictDescriptor[] = []; + + for (let i = 0; i < document.lineCount; i++) { + const line = document.lineAt(i); + + // Ignore empty lines + if (!line || line.isEmptyOrWhitespace) { + continue; + } + + // Is this a start line? <<<<<<< + if (line.text.startsWith(startHeaderMarker)) { + if (currentConflict !== null) { + // Error, we should not see a startMarker before we've seen an endMarker + currentConflict = null; + + // Give up parsing, anything matched up this to this point will be decorated + // anything after will not + break; + } + + // Create a new conflict starting at this line + currentConflict = { startHeader: line }; + } + // Are we within a conflict block and is this a splitter? ======= + else if (currentConflict && line.text.startsWith(splitterMarker)) { + currentConflict.splitter = line; + } + // Are we withon a conflict block and is this a footer? >>>>>>> + else if (currentConflict && line.text.startsWith(endFooterMarker)) { + currentConflict.endFooter = line; + + // Create a full descriptor from the lines that we matched. This can return + // null if the descriptor could not be completed. + let completeDescriptor = MergeConflictParser.scanItemTolMergeConflictDescriptor(document, currentConflict); + + if (completeDescriptor !== null) { + conflictDescriptors.push(completeDescriptor); + } + + // Reset the current conflict to be empty, so we can match the next + // starting header marker. + currentConflict = null; + } + } + + return conflictDescriptors + .filter(Boolean) + .map(descriptor => new DocumentMergeConflict(document, descriptor)); + } + + private static scanItemTolMergeConflictDescriptor(document: vscode.TextDocument, scanned: IScanMergedConflict): interfaces.IDocumentMergeConflictDescriptor | null { + // Validate we have all the required lines within the scan item. + if (!scanned.startHeader || !scanned.splitter || !scanned.endFooter) { + return null; + } + + // Assume that descriptor.current.header, descriptor.incoming.header and descriptor.spliiter + // have valid ranges, fill in content and total ranges from these parts. + // NOTE: We need to shift the decortator range back one character so the splitter does not end up with + // two decoration colors (current and splitter), if we take the new line from the content into account + // the decorator will wrap to the next line. + return { + current: { + header: scanned.startHeader.range, + decoratorContent: new vscode.Range( + scanned.startHeader.rangeIncludingLineBreak.end, + MergeConflictParser.shiftBackOneCharacter(document, scanned.splitter.range.start)), + // Current content is range between header (shifted for linebreak) and splitter start + content: new vscode.Range( + scanned.startHeader.rangeIncludingLineBreak.end, + scanned.splitter.range.start), + name: scanned.startHeader.text.substring(startHeaderMarker.length) + }, + splitter: scanned.splitter.range, + incoming: { + header: scanned.endFooter.range, + decoratorContent: new vscode.Range( + scanned.splitter.rangeIncludingLineBreak.end, + MergeConflictParser.shiftBackOneCharacter(document, scanned.endFooter.range.start)), + // Incoming content is range between splitter (shifted for linebreak) and footer start + content: new vscode.Range( + scanned.splitter.rangeIncludingLineBreak.end, + scanned.endFooter.range.start), + name: scanned.endFooter.text.substring(endFooterMarker.length) + }, + // Entire range is between current header start and incoming header end (including line break) + range: new vscode.Range(scanned.startHeader.range.start, scanned.endFooter.rangeIncludingLineBreak.end) + }; + } + + static containsConflict(document: vscode.TextDocument): boolean { + if (!document) { + return false; + } + + let text = document.getText(); + return text.includes(startHeaderMarker) && text.includes(endFooterMarker); + } + + private static shiftBackOneCharacter(document: vscode.TextDocument, range: vscode.Position): vscode.Position { + let line = range.line; + let character = range.character - 1; + + if (character < 0) { + line--; + character = document.lineAt(line).range.end.character; + } + + return new vscode.Position(line, character); + } +} diff --git a/extensions/merge-conflict/src/mergeDecorator.ts b/extensions/merge-conflict/src/mergeDecorator.ts new file mode 100644 index 00000000000..be9e733a562 --- /dev/null +++ b/extensions/merge-conflict/src/mergeDecorator.ts @@ -0,0 +1,205 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import * as interfaces from './interfaces'; +import { loadMessageBundle } from 'vscode-nls'; +const localize = loadMessageBundle(); + +export default class MergeDectorator implements vscode.Disposable { + + private decorations: { [key: string]: vscode.TextEditorDecorationType } = {}; + + private decorationUsesWholeLine: boolean = true; // Useful for debugging, set to false to see exact match ranges + + private config: interfaces.IExtensionConfiguration; + private tracker: interfaces.IDocumentMergeConflictTracker; + + constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { + this.tracker = trackerService.createTracker('decorator'); + } + + begin(config: interfaces.IExtensionConfiguration) { + this.config = config; + this.registerDecorationTypes(config); + + // Check if we already have a set of active windows, attempt to track these. + vscode.window.visibleTextEditors.forEach(e => this.applyDecorations(e)); + + vscode.workspace.onDidOpenTextDocument(event => { + this.applyDecorationsFromEvent(event); + }, null, this.context.subscriptions); + + vscode.workspace.onDidChangeTextDocument(event => { + this.applyDecorationsFromEvent(event.document); + }, null, this.context.subscriptions); + + vscode.window.onDidChangeActiveTextEditor((e) => { + // New editor attempt to apply + this.applyDecorations(e); + }, null, this.context.subscriptions); + } + + configurationUpdated(config: interfaces.IExtensionConfiguration) { + this.config = config; + this.registerDecorationTypes(config); + + // Re-apply the decoration + vscode.window.visibleTextEditors.forEach(e => { + this.removeDecorations(e); + this.applyDecorations(e); + }); + } + + private registerDecorationTypes(config: interfaces.IExtensionConfiguration) { + + // Dispose of existing decorations + Object.keys(this.decorations).forEach(k => this.decorations[k].dispose()); + this.decorations = {}; + + // None of our features are enabled + if (!config.enableDecorations || !config.enableEditorOverview) { + return; + } + + // Create decorators + if (config.enableDecorations || config.enableEditorOverview) { + this.decorations['current.content'] = vscode.window.createTextEditorDecorationType( + this.generateBlockRenderOptions('merge.currentContentBackground', 'overviewRuler.currentContentForeground', config) + ); + + this.decorations['incoming.content'] = vscode.window.createTextEditorDecorationType( + this.generateBlockRenderOptions('merge.incomingContentBackground', 'overviewRuler.incomingContentForeground', config) + ); + } + + if (config.enableDecorations) { + this.decorations['current.header'] = vscode.window.createTextEditorDecorationType({ + isWholeLine: this.decorationUsesWholeLine, + backgroundColor: new vscode.ThemeColor('merge.currentHeaderBackground'), + color: new vscode.ThemeColor('editor.foreground'), + after: { + contentText: ' ' + localize('currentChange', '(Current change)'), + color: new vscode.ThemeColor('descriptionForeground') + } + }); + + this.decorations['splitter'] = vscode.window.createTextEditorDecorationType({ + color: new vscode.ThemeColor('editor.foreground'), + isWholeLine: this.decorationUsesWholeLine, + }); + + this.decorations['incoming.header'] = vscode.window.createTextEditorDecorationType({ + backgroundColor: new vscode.ThemeColor('merge.incomingHeaderBackground'), + color: new vscode.ThemeColor('editor.foreground'), + isWholeLine: this.decorationUsesWholeLine, + after: { + contentText: ' ' + localize('incomingChange', '(Incoming change)'), + color: new vscode.ThemeColor('descriptionForeground') + } + }); + } + } + + dispose() { + + // TODO: Replace with Map + Object.keys(this.decorations).forEach(name => { + this.decorations[name].dispose(); + }); + + this.decorations = {}; + } + + private generateBlockRenderOptions(backgroundColor: string, overviewRulerColor: string, config: interfaces.IExtensionConfiguration): vscode.DecorationRenderOptions { + + let renderOptions: vscode.DecorationRenderOptions = {}; + + if (config.enableDecorations) { + renderOptions.backgroundColor = new vscode.ThemeColor(backgroundColor); + renderOptions.isWholeLine = this.decorationUsesWholeLine; + } + + if (config.enableEditorOverview) { + renderOptions.overviewRulerColor = new vscode.ThemeColor(overviewRulerColor); + renderOptions.overviewRulerLane = vscode.OverviewRulerLane.Full; + } + + return renderOptions; + } + + private applyDecorationsFromEvent(eventDocument: vscode.TextDocument) { + for (var i = 0; i < vscode.window.visibleTextEditors.length; i++) { + if (vscode.window.visibleTextEditors[i].document === eventDocument) { + // Attempt to apply + this.applyDecorations(vscode.window.visibleTextEditors[i]); + } + } + } + + private async applyDecorations(editor: vscode.TextEditor) { + if (!editor || !editor.document) { return; } + + if (!this.config || (!this.config.enableDecorations && !this.config.enableEditorOverview)) { + return; + } + + // If we have a pending scan from the same origin, exit early. + if (this.tracker.isPending(editor.document)) { + return; + } + + let conflicts = await this.tracker.getConflicts(editor.document); + + if (conflicts.length === 0) { + this.removeDecorations(editor); + return; + } + + // Store decorations keyed by the type of decoration, set decoration wants a "style" + // to go with it, which will match this key (see constructor); + let matchDecorations: { [key: string]: vscode.DecorationOptions[] } = {}; + + let pushDecoration = (key: string, d: vscode.DecorationOptions) => { + matchDecorations[key] = matchDecorations[key] || []; + matchDecorations[key].push(d); + }; + + conflicts.forEach(conflict => { + // TODO, this could be more effective, just call getMatchPositions once with a map of decoration to position + pushDecoration('current.content', { range: conflict.current.decoratorContent }); + pushDecoration('incoming.content', { range: conflict.incoming.decoratorContent }); + + if (this.config.enableDecorations) { + pushDecoration('current.header', { range: conflict.current.header }); + pushDecoration('splitter', { range: conflict.splitter }); + pushDecoration('incoming.header', { range: conflict.incoming.header }); + } + }); + + // For each match we've generated, apply the generated decoration with the matching decoration type to the + // editor instance. Keys in both matches and decorations should match. + Object.keys(matchDecorations).forEach(decorationKey => { + let decorationType = this.decorations[decorationKey]; + + if (decorationType) { + editor.setDecorations(decorationType, matchDecorations[decorationKey]); + } + }); + } + + private removeDecorations(editor: vscode.TextEditor) { + // Remove all decorations, there might be none + Object.keys(this.decorations).forEach(decorationKey => { + + // Race condition, while editing the settings, it's possible to + // generate regions before the configuration has been refreshed + let decorationType = this.decorations[decorationKey]; + + if (decorationType) { + editor.setDecorations(decorationType, []); + } + }); + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/package.json b/extensions/merge-conflict/src/package.json new file mode 100644 index 00000000000..2f79e20bf7f --- /dev/null +++ b/extensions/merge-conflict/src/package.json @@ -0,0 +1,722 @@ +{ + "name": "git", + "publisher": "vscode", + "displayName": "git", + "description": "Git", + "version": "0.0.1", + "engines": { + "vscode": "^1.5.0" + }, + "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", + "enableProposedApi": true, + "categories": [ + "Other" + ], + "activationEvents": [ + "*" + ], + "main": "./out/main", + "scripts": { + "compile": "gulp compile-extension:git", + "watch": "gulp watch-extension:git" + }, + "contributes": { + "commands": [ + { + "command": "git.clone", + "title": "%command.clone%", + "category": "Git" + }, + { + "command": "git.init", + "title": "%command.init%", + "category": "Git" + }, + { + "command": "git.refresh", + "title": "%command.refresh%", + "category": "Git", + "icon": { + "light": "resources/icons/light/refresh.svg", + "dark": "resources/icons/dark/refresh.svg" + } + }, + { + "command": "git.openChange", + "title": "%command.openChange%", + "category": "Git", + "icon": { + "light": "resources/icons/light/open-change.svg", + "dark": "resources/icons/dark/open-change.svg" + } + }, + { + "command": "git.openFile", + "title": "%command.openFile%", + "category": "Git", + "icon": { + "light": "resources/icons/light/open-file.svg", + "dark": "resources/icons/dark/open-file.svg" + } + }, + { + "command": "git.stage", + "title": "%command.stage%", + "category": "Git", + "icon": { + "light": "resources/icons/light/stage.svg", + "dark": "resources/icons/dark/stage.svg" + } + }, + { + "command": "git.stageAll", + "title": "%command.stageAll%", + "category": "Git", + "icon": { + "light": "resources/icons/light/stage.svg", + "dark": "resources/icons/dark/stage.svg" + } + }, + { + "command": "git.stageSelectedRanges", + "title": "%command.stageSelectedRanges%", + "category": "Git" + }, + { + "command": "git.revertSelectedRanges", + "title": "%command.revertSelectedRanges%", + "category": "Git" + }, + { + "command": "git.unstage", + "title": "%command.unstage%", + "category": "Git", + "icon": { + "light": "resources/icons/light/unstage.svg", + "dark": "resources/icons/dark/unstage.svg" + } + }, + { + "command": "git.unstageAll", + "title": "%command.unstageAll%", + "category": "Git", + "icon": { + "light": "resources/icons/light/unstage.svg", + "dark": "resources/icons/dark/unstage.svg" + } + }, + { + "command": "git.unstageSelectedRanges", + "title": "%command.unstageSelectedRanges%", + "category": "Git" + }, + { + "command": "git.clean", + "title": "%command.clean%", + "category": "Git", + "icon": { + "light": "resources/icons/light/clean.svg", + "dark": "resources/icons/dark/clean.svg" + } + }, + { + "command": "git.cleanAll", + "title": "%command.cleanAll%", + "category": "Git", + "icon": { + "light": "resources/icons/light/clean.svg", + "dark": "resources/icons/dark/clean.svg" + } + }, + { + "command": "git.commit", + "title": "%command.commit%", + "category": "Git", + "icon": { + "light": "resources/icons/light/check.svg", + "dark": "resources/icons/dark/check.svg" + } + }, + { + "command": "git.commitStaged", + "title": "%command.commitStaged%", + "category": "Git" + }, + { + "command": "git.commitStagedSigned", + "title": "%command.commitStagedSigned%", + "category": "Git" + }, + { + "command": "git.commitAll", + "title": "%command.commitAll%", + "category": "Git" + }, + { + "command": "git.commitAllSigned", + "title": "%command.commitAllSigned%", + "category": "Git" + }, + { + "command": "git.undoCommit", + "title": "%command.undoCommit%", + "category": "Git" + }, + { + "command": "git.checkout", + "title": "%command.checkout%", + "category": "Git" + }, + { + "command": "git.branch", + "title": "%command.branch%", + "category": "Git" + }, + { + "command": "git.pull", + "title": "%command.pull%", + "category": "Git" + }, + { + "command": "git.pullRebase", + "title": "%command.pullRebase%", + "category": "Git" + }, + { + "command": "git.push", + "title": "%command.push%", + "category": "Git" + }, + { + "command": "git.pushTo", + "title": "%command.pushTo%", + "category": "Git" + }, + { + "command": "git.sync", + "title": "%command.sync%", + "category": "Git" + }, + { + "command": "git.publish", + "title": "%command.publish%", + "category": "Git" + }, + { + "command": "git.showOutput", + "title": "%command.showOutput%", + "category": "Git" + }, + { + "command": "git.merge.accept.all-current", + "title": "Accept all current", + "category": "Git Merge" + }, + { + "category": "Git Merge", + "title": "Accept all incoming", + "command": "git.merge.accept.all-incoming" + }, + { + "category": "Git Merge", + "title": "Accept all both", + "command": "git.merge.accept.all-both" + }, + { + "category": "Git Merge", + "title": "Accept current", + "command": "git.merge.accept.current" + }, + { + "category": "Git Merge", + "title": "Accept incoming", + "command": "git.merge.accept.incoming" + }, + { + "category": "Git Merge", + "title": "Accept selection", + "command": "git.merge.accept.selection" + }, + { + "category": "Git Merge", + "title": "Accept both", + "command": "git.merge.accept.both" + }, + { + "category": "Git Merge", + "title": "Next conflict", + "command": "git.merge.next" + }, + { + "category": "Git Merge", + "title": "Previous conflict", + "command": "git.merge.previous" + }, + { + "category": "Git Merge", + "title": "Compare current conflict", + "command": "git.merge.compare" + } + ], + "keybindings": [ + { + "command": "git.merge.next", + "when": "editorTextFocus", + "key": "alt+m down" + }, + { + "command": "git.merge.previous", + "when": "editorTextFocus", + "key": "alt+m up" + }, + { + "command": "git.merge.accept.selection", + "when": "editorTextFocus", + "key": "alt+m enter" + }, + { + "command": "git.merge.accept.current", + "when": "editorTextFocus", + "key": "alt+m 1" + }, + { + "command": "git.merge.accept.incoming", + "when": "editorTextFocus", + "key": "alt+m 2" + }, + { + "command": "git.merge.accept.both", + "when": "editorTextFocus", + "key": "alt+m 3" + } + ], + "menus": { + "commandPalette": [ + { + "command": "git.clone", + "when": "config.git.enabled" + }, + { + "command": "git.init", + "when": "config.git.enabled && scmProvider == git && gitState == norepo" + }, + { + "command": "git.refresh", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.openFile", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.openChange", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.stageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.stageSelectedRanges", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.revertSelectedRanges", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.unstage", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.unstageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.unstageSelectedRanges", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.clean", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.cleanAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitStaged", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitStagedSigned", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitAllSigned", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.undoCommit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.checkout", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.branch", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pull", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pullRebase", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.push", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pushTo", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.publish", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.showOutput", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + } + ], + "scm/title": [ + { + "command": "git.init", + "group": "navigation", + "when": "config.git.enabled && scmProvider == git && gitState == norepo" + }, + { + "command": "git.commit", + "group": "navigation", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.refresh", + "group": "navigation", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.sync", + "group": "1_sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pull", + "group": "1_sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pullRebase", + "group": "1_sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.push", + "group": "1_sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.pushTo", + "group": "1_sync", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.publish", + "group": "2_publish", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitStaged", + "group": "3_commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitStagedSigned", + "group": "3_commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitAll", + "group": "3_commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.commitAllSigned", + "group": "3_commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.undoCommit", + "group": "3_commit", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.unstageAll", + "group": "4_stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.cleanAll", + "group": "4_stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + }, + { + "command": "git.showOutput", + "group": "5_output", + "when": "config.git.enabled && scmProvider == git && gitState == idle" + } + ], + "scm/resourceGroup/context": [ + { + "command": "git.stageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", + "group": "1_modification" + }, + { + "command": "git.stageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", + "group": "inline" + }, + { + "command": "git.unstageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "1_modification" + }, + { + "command": "git.unstageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "inline" + }, + { + "command": "git.cleanAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "1_modification" + }, + { + "command": "git.stageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "1_modification" + }, + { + "command": "git.cleanAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "inline" + }, + { + "command": "git.stageAll", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "inline" + } + ], + "scm/resourceState/context": [ + { + "command": "git.stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", + "group": "1_modification" + }, + { + "command": "git.stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", + "group": "inline" + }, + { + "command": "git.openChange", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "navigation" + }, + { + "command": "git.openFile", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "navigation" + }, + { + "command": "git.unstage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "1_modification" + }, + { + "command": "git.unstage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", + "group": "inline" + }, + { + "command": "git.openChange", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "navigation" + }, + { + "command": "git.openFile", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "navigation" + }, + { + "command": "git.stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "1_modification" + }, + { + "command": "git.clean", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "1_modification" + }, + { + "command": "git.clean", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "inline" + }, + { + "command": "git.stage", + "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", + "group": "inline" + } + ], + "editor/title": [ + { + "command": "git.openFile", + "group": "navigation", + "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != extension" + }, + { + "command": "git.openChange", + "group": "navigation", + "when": "config.git.enabled && scmProvider == git && !isInDiffEditor && resourceScheme != extension" + }, + { + "command": "git.stageSelectedRanges", + "group": "2_git@1", + "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + }, + { + "command": "git.unstageSelectedRanges", + "group": "2_git@2", + "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + }, + { + "command": "git.revertSelectedRanges", + "group": "2_git@3", + "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + } + ] + }, + "configuration": { + "title": "Git", + "properties": { + "git.enabled": { + "type": "boolean", + "description": "%config.enabled%", + "default": true + }, + "git.path": { + "type": [ + "string", + "null" + ], + "description": "%config.path%", + "default": null, + "isExecutable": true + }, + "git.autorefresh": { + "type": "boolean", + "description": "%config.autorefresh%", + "default": true + }, + "git.autofetch": { + "type": "boolean", + "description": "%config.autofetch%", + "default": true + }, + "git.confirmSync": { + "type": "boolean", + "description": "%config.confirmSync%", + "default": true + }, + "git.countBadge": { + "type": "string", + "enum": [ + "all", + "tracked", + "off" + ], + "description": "%config.countBadge%", + "default": "all" + }, + "git.checkoutType": { + "type": "string", + "enum": [ + "all", + "local", + "tags", + "remote" + ], + "description": "%config.checkoutType%", + "default": "all" + }, + "git.ignoreLegacyWarning": { + "type": "boolean", + "description": "%config.ignoreLegacyWarning%", + "default": false + }, + "git.ignoreLimitWarning": { + "type": "boolean", + "description": "%config.ignoreLimitWarning%", + "default": false + }, + "git.defaultCloneDirectory": { + "type": "string", + "default": null, + "description": "%config.defaultCloneDirectory%" + }, + "git.enableSmartCommit": { + "type": "boolean", + "description": "%config.enableSmartCommit%", + "default": false + }, + "git.enableEditorMerge": { + "type": "boolean", + "description": "%config.enableEditorMerge%", + "default": true + } + } + } + }, + "dependencies": { + "iconv-lite": "0.4.15", + "vscode-extension-telemetry": "^0.0.7", + "vscode-nls": "^2.0.1" + }, + "devDependencies": { + "@types/mocha": "^2.2.41", + "@types/node": "^7.0.4", + "mocha": "^3.2.0" + } +} \ No newline at end of file diff --git a/extensions/merge-conflict/src/services.ts b/extensions/merge-conflict/src/services.ts new file mode 100644 index 00000000000..320adb3e53e --- /dev/null +++ b/extensions/merge-conflict/src/services.ts @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import DocumentTracker from './documentTracker'; +import CodeLensProvider from './codelensProvider'; +import CommandHandler from './commandHandler'; +import ContentProvider from './contentProvider'; +import Decorator from './mergeDecorator'; +import * as interfaces from './interfaces'; + +const ConfigurationSectionName = 'merge-conflict'; + +export default class ServiceWrapper implements vscode.Disposable { + + private services: vscode.Disposable[] = []; + + constructor(private context: vscode.ExtensionContext) { + } + + begin() { + + let configuration = this.createExtensionConfiguration(); + const documentTracker = new DocumentTracker(); + + this.services.push( + documentTracker, + new CommandHandler(this.context, documentTracker), + new CodeLensProvider(this.context, documentTracker), + new ContentProvider(this.context), + new Decorator(this.context, documentTracker), + ); + + this.services.forEach((service: any) => { + if (service.begin && service.begin instanceof Function) { + service.begin(configuration); + } + }); + + vscode.workspace.onDidChangeConfiguration(() => { + this.services.forEach((service: any) => { + if (service.configurationUpdated && service.configurationUpdated instanceof Function) { + service.configurationUpdated(this.createExtensionConfiguration()); + } + }); + }); + } + + createExtensionConfiguration(): interfaces.IExtensionConfiguration { + const workspaceConfiguration = vscode.workspace.getConfiguration(ConfigurationSectionName); + const codeLensEnabled: boolean = workspaceConfiguration.get('codeLens.enabled', true); + const decoratorsEnabled: boolean = workspaceConfiguration.get('decorators.enabled', true); + + return { + enableCodeLens: codeLensEnabled, + enableDecorations: decoratorsEnabled, + enableEditorOverview: decoratorsEnabled + }; + } + + dispose() { + this.services.forEach(disposable => disposable.dispose()); + this.services = []; + } +} + diff --git a/extensions/merge-conflict/src/typings/refs.d.ts b/extensions/merge-conflict/src/typings/refs.d.ts new file mode 100644 index 00000000000..0188b6f9ffc --- /dev/null +++ b/extensions/merge-conflict/src/typings/refs.d.ts @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/// +/// +/// diff --git a/extensions/merge-conflict/tsconfig.json b/extensions/merge-conflict/tsconfig.json new file mode 100644 index 00000000000..ce3e55fff2d --- /dev/null +++ b/extensions/merge-conflict/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es6", + "lib": [ + "es2016" + ], + "module": "commonjs", + "outDir": "./out", + "strictNullChecks": true, + "experimentalDecorators": true + }, + "include": [ + "src/**/*" + ] +} diff --git a/extensions/npm-shrinkwrap.json b/extensions/npm-shrinkwrap.json index 34796990f9d..42a40f5d35f 100644 --- a/extensions/npm-shrinkwrap.json +++ b/extensions/npm-shrinkwrap.json @@ -3,9 +3,9 @@ "version": "0.0.1", "dependencies": { "typescript": { - "version": "2.3.2", - "from": "typescript@typescript@2.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.2.tgz" + "version": "2.3.3,", + "from": "typescript@typescript@2.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.3.tgz" } } } diff --git a/extensions/npm/.vscode/launch.json b/extensions/npm/.vscode/launch.json new file mode 100644 index 00000000000..da043ff85d9 --- /dev/null +++ b/extensions/npm/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": ["${workspaceRoot}/client/out/**/*.js"], + "preLaunchTask": "npm" + } + ] +} \ No newline at end of file diff --git a/extensions/npm/.vscode/tasks.json b/extensions/npm/.vscode/tasks.json new file mode 100644 index 00000000000..0a411c1c867 --- /dev/null +++ b/extensions/npm/.vscode/tasks.json @@ -0,0 +1,9 @@ +{ + "version": "0.1.0", + "command": "npm", + "isShellCommand": true, + "showOutput": "silent", + "args": ["run", "compile"], + "isBackground": true, + "problemMatcher": "$tsc-watch" +} \ No newline at end of file diff --git a/extensions/npm/package.json b/extensions/npm/package.json new file mode 100644 index 00000000000..9d626265d36 --- /dev/null +++ b/extensions/npm/package.json @@ -0,0 +1,46 @@ +{ + "name": "npm", + "publisher": "vscode", + "description": "Extension to add task support for npm scripts.", + "displayName": "Npm support for VSCode", + "version": "0.0.1", + "enableProposedApi": true, + "engines": { + "vscode": "0.10.x" + }, + "categories": [ + "Other" + ], + "scripts": { + "compile": "gulp compile-extension:npm", + "watch": "gulp watch-extension:npm" + }, + "dependencies": { + "vscode-nls": "^2.0.2" + }, + "devDependencies": { + "@types/node": "^7.0.12" + }, + "main": "./out/main", + "activationEvents": [ + "onCommand:workbench.action.tasks.runTask" + ], + "contributes": { + "configuration": { + "id": "npm", + "type": "object", + "title": "Npm", + "properties": { + "npm.autoDetect": { + "type": "string", + "enum": [ + "off", + "on" + ], + "default": "on", + "description": "%config.npm.autoDetect%" + } + } + } + } +} \ No newline at end of file diff --git a/extensions/npm/package.nls.json b/extensions/npm/package.nls.json new file mode 100644 index 00000000000..bd7c911cda4 --- /dev/null +++ b/extensions/npm/package.nls.json @@ -0,0 +1,3 @@ +{ + "config.npm.autoDetect": "Controls whether auto detection of npm scripts is on or off. Default is on." +} \ No newline at end of file diff --git a/extensions/npm/src/main.ts b/extensions/npm/src/main.ts new file mode 100644 index 00000000000..beeddfa5a86 --- /dev/null +++ b/extensions/npm/src/main.ts @@ -0,0 +1,99 @@ +/*--------------------------------------------------------------------------------------------- + * 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 fs from 'fs'; +import * as vscode from 'vscode'; + +type AutoDetect = 'on' | 'off'; +let taskProvider: vscode.Disposable | undefined; + +export function activate(_context: vscode.ExtensionContext): void { + let workspaceRoot = vscode.workspace.rootPath; + if (!workspaceRoot) { + return; + } + + function onConfigurationChanged() { + let autoDetect = vscode.workspace.getConfiguration('npm').get('autoDetect'); + if (taskProvider && autoDetect === 'off') { + taskProvider.dispose(); + taskProvider = undefined; + } else if (!taskProvider && autoDetect === 'on') { + taskProvider = vscode.workspace.registerTaskProvider({ + provideTasks: () => { + return getNpmScriptsAsTasks(); + } + }); + } + } + vscode.workspace.onDidChangeConfiguration(onConfigurationChanged); + onConfigurationChanged(); +} + +export function deactivate(): void { + if (taskProvider) { + taskProvider.dispose(); + } +} + +async function exists(file: string): Promise { + return new Promise((resolve, _reject) => { + fs.exists(file, (value) => { + resolve(value); + }); + }); +} + +async function readFile(file: string): Promise { + return new Promise((resolve, reject) => { + fs.readFile(file, (err, data) => { + if (err) { + reject(err); + } + resolve(data.toString()); + }); + }); +} + +async function getNpmScriptsAsTasks(): Promise { + let workspaceRoot = vscode.workspace.rootPath; + let emptyTasks: vscode.Task[] = []; + + if (!workspaceRoot) { + return emptyTasks; + } + + let packageJson = path.join(workspaceRoot, 'package.json'); + if (!await exists(packageJson)) { + return emptyTasks; + } + + try { + var contents = await readFile(packageJson); + var json = JSON.parse(contents); + if (!json.scripts) { + return Promise.resolve(emptyTasks); + } + + const result: vscode.Task[] = []; + Object.keys(json.scripts).forEach(each => { + const task = new vscode.ShellTask(`run ${each}`, `npm run ${each}`); + const lowerCaseTaskName = each.toLowerCase(); + if (lowerCaseTaskName === 'build') { + task.group = vscode.TaskGroup.Build; + } else if (lowerCaseTaskName === 'test') { + task.group = vscode.TaskGroup.Test; + } + result.push(task); + }); + // add some 'well known' npm tasks + result.push(new vscode.ShellTask(`install`, `npm install`)); + return Promise.resolve(result); + } catch (e) { + return Promise.resolve(emptyTasks); + } +} \ No newline at end of file diff --git a/extensions/npm/src/typings/refs.d.ts b/extensions/npm/src/typings/refs.d.ts new file mode 100644 index 00000000000..954bab971e3 --- /dev/null +++ b/extensions/npm/src/typings/refs.d.ts @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/// +/// +/// diff --git a/extensions/npm/tsconfig.json b/extensions/npm/tsconfig.json new file mode 100644 index 00000000000..e804fa3acd7 --- /dev/null +++ b/extensions/npm/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es2016" + ], + "outDir": "./out", + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json index 26550c61e1b..2b46507a2fb 100644 --- a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c++.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.objcpp", "fileTypes": [ "mm", diff --git a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json index 2037028b0c3..a07e0ba7f43 100644 --- a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.objc", "fileTypes": [ "m", @@ -993,6 +998,5 @@ } ] } - }, - "version": "https://github.com/atom/language-objective-c/commit/0727e04544f3414c1c339cf15a39a05ea3938cb4" + } } \ No newline at end of file diff --git a/extensions/objective-c/test/colorize-results/test_m.json b/extensions/objective-c/test/colorize-results/test_m.json index 542815fa192..ed1bda084e3 100644 --- a/extensions/objective-c/test/colorize-results/test_m.json +++ b/extensions/objective-c/test/colorize-results/test_m.json @@ -51,7 +51,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -62,7 +62,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -117,7 +117,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -128,7 +128,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -271,7 +271,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -293,7 +293,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -315,7 +315,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -326,7 +326,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -337,7 +337,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -348,7 +348,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -414,7 +414,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -458,7 +458,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -480,7 +480,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -491,7 +491,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -502,7 +502,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -546,7 +546,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -579,7 +579,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -634,7 +634,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -799,7 +799,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -865,7 +865,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -953,7 +953,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -1250,7 +1250,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1316,7 +1316,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1448,7 +1448,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1503,7 +1503,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1602,7 +1602,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1932,7 +1932,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -1954,7 +1954,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "meta.return-type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.return-type: #4EC9B0" } }, { @@ -1976,7 +1976,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1987,7 +1987,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2075,7 +2075,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2097,7 +2097,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2108,7 +2108,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2196,7 +2196,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2383,7 +2383,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "meta.selector: #D7BA7D", "light_vs": "meta.selector: #800000", - "hc_black": "meta.selector: #D7BA7D" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2438,7 +2438,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -2515,7 +2515,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -2658,7 +2658,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2713,7 +2713,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2779,7 +2779,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2823,7 +2823,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/package.json b/extensions/package.json index a25b7298ebf..ea392e28559 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "typescript@2.3.2" + "typescript": "typescript@2.3.3" }, "scripts": { "postinstall": "node ./postinstall" diff --git a/extensions/perl/syntaxes/perl.tmLanguage.json b/extensions/perl/syntaxes/perl.tmLanguage.json index 612c4796cbe..4c4209c317b 100644 --- a/extensions/perl/syntaxes/perl.tmLanguage.json +++ b/extensions/perl/syntaxes/perl.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/perl.tmbundle/blob/master/Syntaxes/Perl.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "comment": "\n\tTODO:\tInclude RegExp syntax\n", "fileTypes": [ "pl", @@ -2541,6 +2546,5 @@ } }, "scopeName": "source.perl", - "uuid": "EDBFE125-6B1C-11D9-9189-000D93589AF6", - "version": "https://github.com/textmate/perl.tmbundle/commit/c0b7a4bd65882380522d82a60b536479a62b07c3" + "uuid": "EDBFE125-6B1C-11D9-9189-000D93589AF6" } \ No newline at end of file diff --git a/extensions/perl/syntaxes/perl6.tmLanguage.json b/extensions/perl/syntaxes/perl6.tmLanguage.json index a3024a11ae7..9ddfdf42509 100644 --- a/extensions/perl/syntaxes/perl6.tmLanguage.json +++ b/extensions/perl/syntaxes/perl6.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/perl.tmbundle/blob/master/Syntaxes/Perl%206.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "p6", "pl6", @@ -314,6 +319,5 @@ } }, "scopeName": "source.perl.6", - "uuid": "E685440C-0E20-4424-9693-864D5240A269", - "version": "https://github.com/textmate/perl.tmbundle/commit/d9841a0878239fa43f88c640f8d458590f97e8f5" + "uuid": "E685440C-0E20-4424-9693-864D5240A269" } \ No newline at end of file diff --git a/extensions/perl/test/colorize-results/test2_pl.json b/extensions/perl/test/colorize-results/test2_pl.json index 550b80232e3..ef4bcabf439 100644 --- a/extensions/perl/test/colorize-results/test2_pl.json +++ b/extensions/perl/test/colorize-results/test2_pl.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -51,7 +51,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -62,7 +62,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -150,7 +150,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -161,7 +161,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -205,7 +205,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -216,7 +216,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -282,7 +282,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -326,7 +326,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -392,7 +392,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -414,7 +414,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -425,7 +425,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -491,7 +491,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -546,7 +546,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -557,7 +557,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -590,7 +590,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -612,7 +612,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -623,7 +623,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -645,7 +645,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -656,7 +656,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -733,7 +733,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -744,7 +744,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -788,7 +788,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -799,7 +799,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -865,7 +865,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -876,7 +876,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -898,7 +898,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -909,7 +909,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -953,7 +953,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -964,7 +964,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1019,7 +1019,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1041,7 +1041,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1063,7 +1063,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1074,7 +1074,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1151,7 +1151,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1206,7 +1206,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1228,7 +1228,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1250,7 +1250,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1261,7 +1261,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1360,7 +1360,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1437,7 +1437,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1448,7 +1448,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1470,7 +1470,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1481,7 +1481,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1525,7 +1525,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1536,7 +1536,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1624,7 +1624,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1635,7 +1635,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1679,7 +1679,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1723,7 +1723,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1800,7 +1800,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1877,7 +1877,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1921,7 +1921,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1943,7 +1943,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1976,7 +1976,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1998,7 +1998,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2020,7 +2020,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2053,7 +2053,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2064,7 +2064,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2086,7 +2086,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2108,7 +2108,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2119,7 +2119,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2185,7 +2185,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2196,7 +2196,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2218,7 +2218,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2240,7 +2240,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2284,7 +2284,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2339,7 +2339,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2350,7 +2350,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2372,7 +2372,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2383,7 +2383,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2405,7 +2405,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2416,7 +2416,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2460,7 +2460,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2471,7 +2471,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2493,7 +2493,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2504,7 +2504,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2603,7 +2603,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2614,7 +2614,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2636,7 +2636,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2647,7 +2647,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2691,7 +2691,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2713,7 +2713,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2735,7 +2735,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2746,7 +2746,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2768,7 +2768,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2779,7 +2779,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2856,7 +2856,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2922,7 +2922,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2933,7 +2933,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2955,7 +2955,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2966,7 +2966,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3010,7 +3010,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3021,7 +3021,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -3054,7 +3054,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3065,7 +3065,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3087,7 +3087,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3098,7 +3098,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3120,7 +3120,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3142,7 +3142,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3153,7 +3153,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3175,7 +3175,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3186,7 +3186,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3263,7 +3263,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3274,7 +3274,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/perl/test/colorize-results/test_pl.json b/extensions/perl/test/colorize-results/test_pl.json index b07bdb97e20..dd6dc702ac1 100644 --- a/extensions/perl/test/colorize-results/test_pl.json +++ b/extensions/perl/test/colorize-results/test_pl.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -51,7 +51,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -62,7 +62,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -172,7 +172,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -183,7 +183,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -205,7 +205,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -216,7 +216,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -249,7 +249,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -315,7 +315,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -348,7 +348,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -546,7 +546,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -568,7 +568,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -579,7 +579,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -634,7 +634,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -744,7 +744,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -755,7 +755,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -832,7 +832,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -865,7 +865,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -876,7 +876,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -898,7 +898,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -909,7 +909,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -931,7 +931,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -942,7 +942,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1129,7 +1129,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1195,7 +1195,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1206,7 +1206,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1228,7 +1228,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1239,7 +1239,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1272,7 +1272,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1294,7 +1294,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1316,7 +1316,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1327,7 +1327,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1371,7 +1371,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1415,7 +1415,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1426,7 +1426,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1503,7 +1503,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1580,7 +1580,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1591,7 +1591,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1624,7 +1624,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1723,7 +1723,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1745,7 +1745,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1756,7 +1756,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1811,7 +1811,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1822,7 +1822,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1844,7 +1844,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1855,7 +1855,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1910,7 +1910,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1987,7 +1987,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2042,7 +2042,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2064,7 +2064,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2086,7 +2086,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2097,7 +2097,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2141,7 +2141,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2152,7 +2152,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2185,7 +2185,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2207,7 +2207,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2218,7 +2218,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2240,7 +2240,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { diff --git a/extensions/php/package.json b/extensions/php/package.json index 7f1aa550478..a72bd56f64d 100644 --- a/extensions/php/package.json +++ b/extensions/php/package.json @@ -27,6 +27,7 @@ "PHP", "php" ], + "firstLine": "^#!/.*\\bphp\\b", "mimetypes": [ "application/x-php" ], @@ -119,4 +120,4 @@ "devDependencies": { "@types/node": "^7.0.4" } -} \ No newline at end of file +} diff --git a/extensions/php/snippets/php.json b/extensions/php/snippets/php.json index 5a3f2c4418c..24a4426a54a 100644 --- a/extensions/php/snippets/php.json +++ b/extensions/php/snippets/php.json @@ -1,63 +1,75 @@ { - "Class Variable": { - "prefix": "doc_v", - "body": [ - "/**", - " * ${1:undocumented class variable}", - " *", - " * @var ${2:string}", - " **/", - "${3:var} $$2;$0" - ], - "description": "Documented Class Variable" - }, - "function __construct": { - "prefix": "con", - "body": [ - "function __construct(${1:$${2:foo} ${3:= ${4:null}}}) {", - "\t${2:$this->$0 = $$0;}", - "}" - ] - }, "class …": { "prefix": "class", "body": [ - "/**", - " * $1", - " */", - "class ${2:ClassName} ${3:extends ${4:AnotherClass}}", + "class ${1:ClassName} ${2:extends ${3:AnotherClass}} ${4:implements ${5:Interface}}", "{", - "\t$5", - "\tfunction ${6:__construct}(${7:argument})", - "\t{", - "\t\t${0:# code...}", - "\t}", + "\t$0", "}", "" ], "description": "Class definition" }, + "PHPDoc class …": { + "prefix": "doc_class", + "body": [ + "/**", + " * ${6:undocumented class}", + " */", + "class ${1:ClassName} ${2:extends ${3:AnotherClass}} ${4:implements ${5:Interface}}", + "{", + "\t$0", + "}", + "" + ], + "description": "Documented Class Declaration" + }, + "function __construct": { + "prefix": "con", + "body": [ + "${1:public} function __construct(${2:${3:Type} $${4:var}${5: = ${6:null}}}) {", + "\t\\$this->${4:var} = $${4:var};$0", + "}" + ] + }, + "PHPDoc property": { + "prefix": "doc_v", + "body": [ + "/** @var ${1:Type} $${2:var} ${3:description} */", + "${4:protected} $${2:var}${5: = ${6:null}};$0" + ], + "description": "Documented Class Variable" + }, "PHPDoc function …": { "prefix": "doc_f", "body": [ "/**", - " * ${6:undocumented function summary}", + " * ${1:undocumented function summary}", " *", - " * ${7:Undocumented function long description}", + " * ${2:Undocumented function long description}", " *", - " * @param ${8:type} ${9:var} ${10:Description}", + "${3: * @param ${4:Type} $${5:var} ${6:Description}}", + "${7: * @return ${8:type}}", + "${9: * @throws ${10:conditon}}", " **/", - "${1:public }function ${2:FunctionName}(${3:$${4:value}${5:=''}})", + "${11:public }function ${12:FunctionName}(${13:${14:${4:Type} }$${5:var}${15: = ${16:null}}})", "{", "\t${0:# code...}", "}" ], "description": "Documented function" }, + "PHPDoc param …": { + "prefix": "param", + "body": [ + "* @param ${1:Type} ${2:var} ${3:Description}$0" + ], + "description": "Paramater documentation" + }, "function …": { "prefix": "fun", "body": [ - "${1:public }function ${2:FunctionName}(${3:$${4:value}${5:=''}})", + "${1:public }function ${2:FunctionName}(${3:${4:${5:Type} }$${6:var}${7: = ${8:null}}})", "{", "\t${0:# code...}", "}" @@ -72,10 +84,7 @@ " */", "trait ${2:TraitName}", "{", - "\tfunction ${3:functionName}(${4:argument})", - "\t{", - "\t\t${5:# code...}", - "\t}", + "\t$0", "}", "" ], @@ -94,9 +103,27 @@ "body": [ "do {", "\t${0:# code...}", - "} while (${1:${2:$a} <= ${3:10}});" + "} while (${1:$${2:a} <= ${3:10}});" ], "description": "Do-While loop" + }, + "while …": { + "prefix": "while", + "body": [ + "while (${1:$${2:a} <= ${3:10}}) {", + "\t${0:# code...}", + "}" + ], + "description": "While-loop" + }, + "if …": { + "prefix": "if", + "body": [ + "if (${1:condition}) {", + "\t${0:# code...}", + "}" + ], + "description": "If block" }, "if … else …": { "prefix": "ifelse", @@ -110,15 +137,6 @@ ], "description": "If Else block" }, - "if …": { - "prefix": "if", - "body": [ - "if (${1:condition}) {", - "\t${0:# code...}", - "}" - ], - "description": "If block" - }, "$… = ( … ) ? … : …": { "prefix": "if?", "body": "$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b} ;", @@ -178,7 +196,7 @@ "switch …": { "prefix": "switch", "body": [ - "switch (${1:variable}) {", + "switch (\\$${1:variable}) {", "\tcase '${2:value}':", "\t\t${3:# code...}", "\t\tbreak;", @@ -193,7 +211,7 @@ "case …": { "prefix": "case", "body": [ - "case '${1:variable}':", + "case '${1:value}':", "\t${0:# code...}", "\tbreak;" ], @@ -201,12 +219,12 @@ }, "$this->…": { "prefix": "this", - "body": "$this->$0", + "body": "\\$this->$0;", "description": "$this->..." }, "echo $this->…": { "prefix": "ethis", - "body": "echo $this->$0", + "body": "echo \\$this->$0;", "description": "Echo this" }, "Throw Exception": { @@ -216,14 +234,5 @@ "$0" ], "description": "Throw exception" - }, - "while …": { - "prefix": "while", - "body": [ - "while (${1:$a <= 10}) {", - "\t${0:# code...}", - "}" - ], - "description": "While-loop" } } \ No newline at end of file diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index 9586638c4d2..b815d80e072 100644 --- a/extensions/php/syntaxes/php.tmLanguage.json +++ b/extensions/php/syntaxes/php.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/php.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "text.html.php", "name": "PHP", "fileTypes": [ @@ -40,14 +45,14 @@ "begin": "<\\?(?i:php|=)?", "beginCaptures": { "0": { - "name": "punctuation.section.embedded.begin.metatag.php" + "name": "punctuation.section.embedded.begin.php" } }, "contentName": "source.php", "end": "(\\?)>", "endCaptures": { "0": { - "name": "punctuation.section.embedded.end.metatag.php" + "name": "punctuation.section.embedded.end.php" }, "1": { "name": "source.php" @@ -66,14 +71,14 @@ "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", "beginCaptures": { "0": { - "name": "punctuation.section.embedded.begin.metatag.php" + "name": "punctuation.section.embedded.begin.php" } }, "contentName": "source.php", "end": "(\\?)>", "endCaptures": { "0": { - "name": "punctuation.section.embedded.end.metatag.php" + "name": "punctuation.section.embedded.end.php" }, "1": { "name": "source.php" @@ -90,13 +95,13 @@ "begin": "<\\?(?i:php|=)?", "beginCaptures": { "0": { - "name": "punctuation.section.embedded.begin.metatag.php" + "name": "punctuation.section.embedded.begin.php" } }, "end": ">", "endCaptures": { "0": { - "name": "punctuation.section.embedded.end.metatag.php" + "name": "punctuation.section.embedded.end.php" } }, "name": "meta.embedded.line.php", @@ -107,7 +112,7 @@ "name": "source.php" }, "2": { - "name": "punctuation.section.embedded.end.metatag.php" + "name": "punctuation.section.embedded.end.php" }, "3": { "name": "source.php" @@ -122,7 +127,7 @@ "end": "(\\?)(?=>)", "endCaptures": { "0": { - "name": "punctuation.section.embedded.end.metatag.php" + "name": "punctuation.section.embedded.end.php" }, "1": { "name": "source.php" @@ -196,14 +201,18 @@ "comments": { "patterns": [ { - "begin": "/\\*\\*(?:#@\\+)?\\s*$", - "captures": { + "begin": "/\\*\\*(?=\\s)", + "beginCaptures": { "0": { "name": "punctuation.definition.comment.php" } }, - "comment": "This now only highlights a docblock if the first line contains only /**\n\t\t\t\t\t\t\t\t- this is to stop highlighting everything as invalid when people do comment banners with /******** ...\n\t\t\t\t\t\t\t\t- Now matches /**#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate", "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, "name": "comment.block.documentation.phpdoc.php", "patterns": [ { @@ -222,7 +231,7 @@ "name": "comment.block.php" }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^\\s+)?(?=//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.php" @@ -243,7 +252,7 @@ ] }, { - "begin": "(^[ \\t]+)?(?=#)", + "begin": "(^\\s+)?(?=#)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.php" @@ -559,15 +568,6 @@ { "begin": "(?=<<<\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)", "end": "(?!\\G)", - "injections": { - "*": { - "patterns": [ - { - "include": "#interpolation" - } - ] - } - }, "name": "string.unquoted.heredoc.php", "patterns": [ { @@ -576,298 +576,650 @@ ] }, { - "begin": "(?=<<<\\s*('?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)", + "begin": "(?=<<<\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'\\s*$)", "end": "(?!\\G)", - "name": "string.unquoted.heredoc.nowdoc.php", + "name": "string.unquoted.nowdoc.php", "patterns": [ { - "include": "#heredoc_interior" + "include": "#nowdoc_interior" } ] } - ], - "repository": { - "heredoc_interior": { + ] + }, + "heredoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*(\"?)(HTML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.html", "patterns": [ { - "begin": "(<<<)\\s*(['\"]?)(HTML)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, + "include": "#interpolation" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(XML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(SQL)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JAVASCRIPT|JS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JSON)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(CSS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(REGEXP?)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.heredoc.php", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ + { + "include": "#interpolation" + }, + { + "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { "1": { - "name": "punctuation.definition.string.php" + "name": "punctuation.definition.arbitrary-repitition.php" }, "3": { - "name": "keyword.operator.heredoc.php" + "name": "punctuation.definition.arbitrary-repitition.php" } }, - "contentName": "text.html", - "end": "^(\\3)\\b", - "endCaptures": { + "match": "(\\{)\\d+(,\\d+)?(\\})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" + "name": "punctuation.definition.character-class.php" } }, - "name": "meta.embedded.html", + "end": "\\]", + "name": "string.regexp.character-class.php", "patterns": [ { - "include": "text.html.basic" + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" } ] }, { - "begin": "(<<<)\\s*(['\"]?)(XML)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "text.xml", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.xml", - "patterns": [ - { - "include": "text.xml" - } - ] + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" }, { - "begin": "(<<<)\\s*(['\"]?)(SQL)(\\2)\\s*$\\n?", + "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" + "name": "punctuation.definition.comment.php" } }, - "contentName": "source.sql", - "end": "^(\\3)\\b", + "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", + "end": "$\\n?", "endCaptures": { "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" + "name": "punctuation.definition.comment.php" } }, - "name": "meta.embedded.sql", - "patterns": [ - { - "include": "source.sql" - } - ] + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" }, - { - "begin": "(<<<)\\s*(['\"]?)(JAVASCRIPT)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.js", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.js", - "patterns": [ - { - "include": "source.js" - } - ] + "3": { + "name": "keyword.operator.heredoc.php" }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^(\\3)\\b", + "endCaptures": { + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ { - "begin": "(<<<)\\s*(['\"]?)(JSON)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.json", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.json", - "patterns": [ - { - "include": "source.json" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(CSS)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.css", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.css", - "patterns": [ - { - "include": "source.css" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(REGEX)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "string.regexp.heredoc.php", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "patterns": [ - { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", - "match": "(\\\\){1,2}[.$^\\[\\]{}]", - "name": "constant.character.escape.regex.php" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repitition.php" - }, - "3": { - "name": "punctuation.definition.arbitrary-repitition.php" - } - }, - "match": "(\\{)\\d+(,\\d+)?(\\})", - "name": "string.regexp.arbitrary-repitition.php" - }, - { - "begin": "\\[(?:\\^?\\])?", - "captures": { - "0": { - "name": "punctuation.definition.character-class.php" - } - }, - "end": "\\]", - "name": "string.regexp.character-class.php", - "patterns": [ - { - "match": "\\\\[\\\\'\\[\\]]", - "name": "constant.character.escape.php" - } - ] - }, - { - "match": "[$^+*]", - "name": "keyword.operator.regexp.php" - }, - { - "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.comment.php" - } - }, - "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", - "end": "$\\n?", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "name": "comment.line.number-sign.php" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "end": "^(\\3)\\b", - "endCaptures": { - "1": { - "name": "keyword.operator.heredoc.php" - } - } + "include": "#interpolation" } ] } - } + ] + }, + "nowdoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*'(HTML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.html", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*'(XML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*'(SQL)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*'(JAVASCRIPT|JS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*'(JSON)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*'(CSS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*'(REGEXP?)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.nowdoc.php", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "patterns": [ + { + "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repitition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repitition.php" + } + }, + "match": "(\\{)\\d+(,\\d+)?(\\})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + }, + { + "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.php" + } + }, + "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", + "end": "$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(<<<)\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^(\\2)\\b", + "endCaptures": { + "1": { + "name": "keyword.operator.nowdoc.php" + } + } + } + ] }, "instantiation": { "begin": "(?i)(new)\\s+", @@ -1304,7 +1656,7 @@ ] }, { - "begin": "(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z0-9_]+)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()", + "begin": "(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()", "beginCaptures": { "1": { "patterns": [ @@ -1724,7 +2076,7 @@ "patterns": [ { "comment": "PHPDocumentor only recognises lines with an asterisk as the first non-whitespaces character", - "match": "^(?!\\s*\\*).*$\\n?", + "match": "^(?!\\s*\\*).*?(?:(?=\\*\\/)|$\\n?)", "name": "invalid.illegal.missing-asterisk.phpdoc.php" }, { @@ -1753,7 +2105,7 @@ "match": "(@xlink)\\s+(.+)\\s*$" }, { - "match": "\\@(a(pi|bstract|uthor)|c(ategory|opyright)|example|global|internal|li(cense|nk)|method|p(roperty(\\-read|\\-write|)|ackage|aram)|return|s(ee|ince|ource|tatic|ubpackage)|t(hrows|odo)|v(ar|ersion)|uses|deprecated|final|ignore)\\b", + "match": "\\@(a(pi|bstract|uthor)|c(ategory|opyright)|example|global|in(herit[Dd]oc|ternal)|li(cense|nk)|method|p(roperty(\\-read|\\-write|)|ackage|aram)|return|s(ee|ince|ource|tatic|ubpackage)|t(hrows|odo)|v(ar|ersion)|uses|deprecated|final|ignore)\\b", "name": "keyword.other.phpdoc.php" }, { @@ -1762,7 +2114,7 @@ "name": "keyword.other.phpdoc.php" } }, - "match": "\\{(@(link)).+?\\}", + "match": "\\{(@(link|inherit[Dd]oc)).+?\\}", "name": "meta.tag.inline.phpdoc.php" } ] @@ -2627,6 +2979,5 @@ } ] } - }, - "version": "https://github.com/atom/language-php/commit/6c48772bfdf5ed057501952f8454900b91ff140a" + } } \ No newline at end of file diff --git a/extensions/php/test/colorize-fixtures/test.php b/extensions/php/test/colorize-fixtures/test.php index 2a641966368..b7d9578dcac 100644 --- a/extensions/php/test/colorize-fixtures/test.php +++ b/extensions/php/test/colorize-fixtures/test.php @@ -40,7 +40,9 @@ print("Uncut Point: $deck[$index] "); $starting_point++; } + + function foo bar(){} ?> - \ No newline at end of file + diff --git a/extensions/php/test/colorize-results/test_php.json b/extensions/php/test/colorize-results/test_php.json index 72e7f6a86a4..8285f8dee9b 100644 --- a/extensions/php/test/colorize-results/test_php.json +++ b/extensions/php/test/colorize-results/test_php.json @@ -221,12 +221,12 @@ }, { "c": "", - "t": "text.html.php meta.embedded.block.php punctuation.section.embedded.end.metatag.php", + "t": "text.html.php meta.embedded.block.php punctuation.section.embedded.end.php", "r": { - "dark_plus": "punctuation.section.embedded.end.metatag.php: #569CD6", - "light_plus": "punctuation.section.embedded.end.metatag.php: #800000", - "dark_vs": "punctuation.section.embedded.end.metatag.php: #569CD6", - "light_vs": "punctuation.section.embedded.end.metatag.php: #800000", + "dark_plus": "punctuation.section.embedded.end.php: #569CD6", + "light_plus": "punctuation.section.embedded.end.php: #800000", + "dark_vs": "punctuation.section.embedded.end.php: #569CD6", + "light_vs": "punctuation.section.embedded.end.php: #800000", "hc_black": "default: #FFFFFF" } }, @@ -3321,4 +3409,4 @@ "hc_black": "punctuation.definition.tag: #808080" } } -] \ No newline at end of file +] diff --git a/extensions/php/tsconfig.json b/extensions/php/tsconfig.json index 90ac01c2d39..a2b5bcdfddf 100644 --- a/extensions/php/tsconfig.json +++ b/extensions/php/tsconfig.json @@ -7,7 +7,7 @@ "module": "commonjs", "outDir": "./out" }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/powershell/test/colorize-results/test_ps1.json b/extensions/powershell/test/colorize-results/test_ps1.json index 794ed90dcf4..bce680fee40 100644 --- a/extensions/powershell/test/colorize-results/test_ps1.json +++ b/extensions/powershell/test/colorize-results/test_ps1.json @@ -40,7 +40,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -73,7 +73,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -117,7 +117,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -216,7 +216,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -260,7 +260,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -315,7 +315,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -458,7 +458,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -491,7 +491,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -623,7 +623,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -667,7 +667,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -766,7 +766,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name: #9CDCFE", "light_vs": "entity.other.attribute-name: #FF0000", - "hc_black": "entity.other.attribute-name: #9CDCFE" + "hc_black": "variable: #9CDCFE" } }, { @@ -821,7 +821,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -865,7 +865,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -920,7 +920,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -986,7 +986,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1041,7 +1041,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1382,7 +1382,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1459,7 +1459,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1514,7 +1514,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1569,7 +1569,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1690,7 +1690,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1745,7 +1745,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1822,7 +1822,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -1833,7 +1833,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1855,7 +1855,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1888,7 +1888,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1954,7 +1954,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2075,7 +2075,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2119,7 +2119,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2174,7 +2174,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2273,7 +2273,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -2284,7 +2284,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2328,7 +2328,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2350,7 +2350,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2405,7 +2405,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/pug/syntaxes/pug.tmLanguage.json b/extensions/pug/syntaxes/pug.tmLanguage.json index 808be9e6db8..8a3d17a81dc 100644 --- a/extensions/pug/syntaxes/pug.tmLanguage.json +++ b/extensions/pug/syntaxes/pug.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/davidrios/jade-tmbundle/blob/master/Syntaxes/Jade.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "jade" ], @@ -981,6 +986,5 @@ } }, "scopeName": "text.jade", - "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b", - "version": "https://github.com/davidrios/jade-tmbundle/commit/f311a516bb29296fcebfdc7da8149b1c79dfb0a1" + "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b" } \ No newline at end of file diff --git a/extensions/pug/test/colorize-results/test_pug.json b/extensions/pug/test/colorize-results/test_pug.json index 69bd4db3a9c..ad73e9dbaf5 100644 --- a/extensions/pug/test/colorize-results/test_pug.json +++ b/extensions/pug/test/colorize-results/test_pug.json @@ -315,7 +315,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -612,7 +612,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -634,7 +634,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -678,7 +678,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -744,7 +744,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -755,7 +755,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -854,7 +854,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -964,7 +964,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.interpolated.jade: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -986,7 +986,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string.interpolated.jade: #0000FF", - "hc_black": "string: #CE9178" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -1602,7 +1602,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1668,7 +1668,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1778,7 +1778,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { diff --git a/extensions/python/syntaxes/MagicPython.tmLanguage.json b/extensions/python/syntaxes/MagicPython.tmLanguage.json index f9d673e6273..29e51b920fa 100644 --- a/extensions/python/syntaxes/MagicPython.tmLanguage.json +++ b/extensions/python/syntaxes/MagicPython.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicPython.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "MagicPython", "scopeName": "source.python", "fileTypes": [ @@ -5230,6 +5235,5 @@ } ] } - }, - "version": "https://github.com/MagicStack/MagicPython/commit/976e59dcb78cb577e79c8f2117216c06718337e0" + } } \ No newline at end of file diff --git a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json index b5795a7b89f..34d1a973578 100644 --- a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json +++ b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicRegExp.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "MagicRegExp", "scopeName": "source.regexp.python", "fileTypes": [ @@ -460,6 +465,5 @@ } ] } - }, - "version": "https://github.com/MagicStack/MagicPython/commit/df5bb18c64252f2e7b1aa87e2ed124666d314f1d" + } } \ No newline at end of file diff --git a/extensions/python/test/colorize-results/test_py.json b/extensions/python/test/colorize-results/test_py.json index 081349fd61b..5d58f2c7297 100644 --- a/extensions/python/test/colorize-results/test_py.json +++ b/extensions/python/test/colorize-results/test_py.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -29,7 +29,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -84,7 +84,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -216,7 +216,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -271,7 +271,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -458,7 +458,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -480,7 +480,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -579,7 +579,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -667,7 +667,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -689,7 +689,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -744,7 +744,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -854,7 +854,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -942,7 +942,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1030,7 +1030,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1173,7 +1173,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1921,7 +1921,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1976,7 +1976,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1998,7 +1998,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2075,7 +2075,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2119,7 +2119,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -2185,7 +2185,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2240,7 +2240,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2284,7 +2284,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2306,7 +2306,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3175,7 +3175,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3197,7 +3197,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3285,7 +3285,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3406,7 +3406,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3747,7 +3747,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3890,7 +3890,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3934,7 +3934,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3956,7 +3956,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3989,7 +3989,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4033,7 +4033,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4077,7 +4077,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4242,7 +4242,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4341,7 +4341,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -4396,7 +4396,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4418,7 +4418,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4451,7 +4451,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4495,7 +4495,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4550,7 +4550,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4649,7 +4649,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4671,7 +4671,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4715,7 +4715,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4759,7 +4759,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4825,7 +4825,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4869,7 +4869,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4968,7 +4968,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5056,7 +5056,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5078,7 +5078,7 @@ "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5496,7 +5496,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5551,7 +5551,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5606,7 +5606,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5705,7 +5705,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -5760,7 +5760,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5782,7 +5782,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5804,7 +5804,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -5837,7 +5837,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -5903,7 +5903,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5925,7 +5925,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5969,7 +5969,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6585,7 +6585,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6618,7 +6618,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6651,7 +6651,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/python/tsconfig.json b/extensions/python/tsconfig.json index 90ac01c2d39..a2b5bcdfddf 100644 --- a/extensions/python/tsconfig.json +++ b/extensions/python/tsconfig.json @@ -7,7 +7,7 @@ "module": "commonjs", "outDir": "./out" }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/r/package.json b/extensions/r/package.json index a41d8ef1488..e1104e23440 100644 --- a/extensions/r/package.json +++ b/extensions/r/package.json @@ -3,6 +3,9 @@ "version": "0.1.0", "publisher": "vscode", "engines": { "vscode": "*" }, + "scripts": { + "update-grammar": "node ../../build/npm/update-grammar.js textmate/r.tmbundle Syntaxes/R.plist ./syntaxes/r.tmLanguage.json" + }, "contributes": { "languages": [{ "id": "r", @@ -13,7 +16,7 @@ "grammars": [{ "language": "r", "scopeName": "source.r", - "path": "./syntaxes/R.plist" + "path": "./syntaxes/r.tmLanguage.json" }] } } diff --git a/extensions/r/syntaxes/R.plist b/extensions/r/syntaxes/R.plist deleted file mode 100644 index 58022aa142d..00000000000 --- a/extensions/r/syntaxes/R.plist +++ /dev/null @@ -1,316 +0,0 @@ - - - - - fileTypes - - R - r - s - S - Rprofile - - keyEquivalent - ^~R - name - R - patterns - - - captures - - 1 - - name - comment.line.pragma.r - - 2 - - name - entity.name.pragma.name.r - - - match - ^(#pragma[ \t]+mark)[ \t](.*) - name - comment.line.pragma-mark.r - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.r - - - end - (?!\G) - patterns - - - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.r - - - end - \n - name - comment.line.number-sign.r - - - - - match - \b(logical|numeric|character|complex|matrix|array|data\.frame|list|factor)(?=\s*\() - name - storage.type.r - - - match - \b(function|if|break|next|repeat|else|for|return|switch|while|in|invisible)\b - name - keyword.control.r - - - match - \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(i|L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b - name - constant.numeric.r - - - match - \b(T|F|TRUE|FALSE|NULL|NA|Inf|NaN)\b - name - constant.language.r - - - match - \b(pi|letters|LETTERS|month\.abb|month\.name)\b - name - support.constant.misc.r - - - match - (\-|\+|\*|\/|%\/%|%%|%\*%|%in%|%o%|%x%|\^) - name - keyword.operator.arithmetic.r - - - match - (=|<-|<<-|->|->>) - name - keyword.operator.assignment.r - - - match - (==|!=|<>|<|>|<=|>=) - name - keyword.operator.comparison.r - - - match - (!|&{1,2}|[|]{1,2}) - name - keyword.operator.logical.r - - - match - (\.\.\.|\$|@|:|\~) - name - keyword.other.r - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.r - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.r - - - name - string.quoted.double.r - patterns - - - match - \\. - name - constant.character.escape.r - - - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.r - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.r - - - name - string.quoted.single.r - patterns - - - match - \\. - name - constant.character.escape.r - - - - - captures - - 1 - - name - entity.name.function.r - - 2 - - name - keyword.operator.assignment.r - - 3 - - name - keyword.control.r - - - match - ([[:alpha:].][[:alnum:]._]*)\s*(<-)\s*(function) - name - meta.function.r - - - captures - - 1 - - name - entity.name.tag.r - - 4 - - name - entity.name.type.r - - - match - (setMethod|setReplaceMethod|setGeneric|setGroupGeneric|setClass)\s*\(\s*([[:alpha:]\d]+\s*=\s*)?("|\x{27})([a-zA-Z._\[\$@][a-zA-Z0-9._\[]*?)\3.* - name - meta.method.declaration.r - - - match - ([[:alpha:].][[:alnum:]._]*)\s*\( - - - captures - - 1 - - name - variable.parameter.r - - 2 - - name - keyword.operator.assignment.r - - - match - ([[:alpha:].][[:alnum:]._]*)\s*(=)(?=[^=]) - - - match - \b([\d_][[:alnum:]._]+)\b - name - invalid.illegal.variable.other.r - - - match - \b([[:alnum:]_]+)(?=::) - name - entity.namespace.r - - - match - \b([[:alnum:]._]+)\b - name - variable.other.r - - - begin - \{ - beginCaptures - - 0 - - name - punctuation.section.block.begin.r - - - end - \} - endCaptures - - 0 - - name - punctuation.section.block.end.r - - - name - meta.block.r - patterns - - - include - source.r - - - - - scopeName - source.r - uuid - B2E6B78D-6E70-11D9-A369-000D93B3A10E - - \ No newline at end of file diff --git a/extensions/r/syntaxes/r.tmLanguage.json b/extensions/r/syntaxes/r.tmLanguage.json new file mode 100644 index 00000000000..025877c7ab4 --- /dev/null +++ b/extensions/r/syntaxes/r.tmLanguage.json @@ -0,0 +1,208 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/r.tmbundle/blob/master/Syntaxes/R.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "fileTypes": [ + "R", + "r", + "s", + "S", + "Rprofile" + ], + "keyEquivalent": "^~R", + "name": "R", + "patterns": [ + { + "captures": { + "1": { + "name": "comment.line.pragma.r" + }, + "2": { + "name": "entity.name.pragma.name.r" + } + }, + "match": "^(#pragma[ \\t]+mark)[ \\t](.*)", + "name": "comment.line.pragma-mark.r" + }, + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.r" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.r" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.r" + } + ] + }, + { + "match": "\\b(logical|numeric|character|complex|matrix|array|data\\.frame|list|factor)(?=\\s*\\()", + "name": "storage.type.r" + }, + { + "match": "\\b(function|if|break|next|repeat|else|for|return|switch|while|in|invisible)\\b", + "name": "keyword.control.r" + }, + { + "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(i|L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b", + "name": "constant.numeric.r" + }, + { + "match": "\\b(T|F|TRUE|FALSE|NULL|NA|Inf|NaN)\\b", + "name": "constant.language.r" + }, + { + "match": "\\b(pi|letters|LETTERS|month\\.abb|month\\.name)\\b", + "name": "support.constant.misc.r" + }, + { + "match": "(\\-|\\+|\\*|\\/|%\\/%|%%|%\\*%|%in%|%o%|%x%|\\^)", + "name": "keyword.operator.arithmetic.r" + }, + { + "match": "(=|<-|<<-|->|->>)", + "name": "keyword.operator.assignment.r" + }, + { + "match": "(==|!=|<>|<|>|<=|>=)", + "name": "keyword.operator.comparison.r" + }, + { + "match": "(!|&{1,2}|[|]{1,2})", + "name": "keyword.operator.logical.r" + }, + { + "match": "(\\.\\.\\.|\\$|@|:|\\~)", + "name": "keyword.other.r" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.double.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.r" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.r" + } + }, + "name": "string.quoted.single.r", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.r" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.function.r" + }, + "2": { + "name": "keyword.operator.assignment.r" + }, + "3": { + "name": "keyword.control.r" + } + }, + "match": "([[:alpha:].][[:alnum:]._]*)\\s*(<-)\\s*(function)", + "name": "meta.function.r" + }, + { + "captures": { + "1": { + "name": "entity.name.tag.r" + }, + "4": { + "name": "entity.name.type.r" + } + }, + "match": "(setMethod|setReplaceMethod|setGeneric|setGroupGeneric|setClass)\\s*\\(\\s*([[:alpha:]\\d]+\\s*=\\s*)?(\"|\\x{27})([a-zA-Z._\\[\\$@][a-zA-Z0-9._\\[]*?)\\3.*", + "name": "meta.method.declaration.r" + }, + { + "match": "([[:alpha:].][[:alnum:]._]*)\\s*\\(" + }, + { + "captures": { + "1": { + "name": "variable.parameter.r" + }, + "2": { + "name": "keyword.operator.assignment.r" + } + }, + "match": "([[:alpha:].][[:alnum:]._]*)\\s*(=)(?=[^=])" + }, + { + "match": "\\b([\\d_][[:alnum:]._]+)\\b", + "name": "invalid.illegal.variable.other.r" + }, + { + "match": "\\b([[:alnum:]_]+)(?=::)", + "name": "entity.namespace.r" + }, + { + "match": "\\b([[:alnum:]._]+)\\b", + "name": "variable.other.r" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.r" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.r" + } + }, + "name": "meta.block.r", + "patterns": [ + { + "include": "source.r" + } + ] + } + ], + "scopeName": "source.r", + "uuid": "B2E6B78D-6E70-11D9-A369-000D93B3A10E" +} \ No newline at end of file diff --git a/extensions/r/test/colorize-results/test_r.json b/extensions/r/test/colorize-results/test_r.json index bcd1217fd33..545fbd4b31f 100644 --- a/extensions/r/test/colorize-results/test_r.json +++ b/extensions/r/test/colorize-results/test_r.json @@ -205,7 +205,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -249,7 +249,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -271,7 +271,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -293,7 +293,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -381,7 +381,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/razor/syntaxes/cshtml.json b/extensions/razor/syntaxes/cshtml.json index 402915e8c9f..180ad0e68dd 100644 --- a/extensions/razor/syntaxes/cshtml.json +++ b/extensions/razor/syntaxes/cshtml.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/demyte/language-cshtml/blob/master/grammars/cshtml.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "ASP.NET Razor", "scopeName": "text.html.cshtml", "fileTypes": [ @@ -148,6 +153,5 @@ "end": "\\*@", "name": "comment.block.cshtml" } - }, - "version": "https://github.com/demyte/language-cshtml/commit/a49735dc7aef56ae772a3bcfd8e42c89895dcff4" + } } \ No newline at end of file diff --git a/extensions/razor/test/colorize-results/test_cshtml.json b/extensions/razor/test/colorize-results/test_cshtml.json index 8c8c54c9830..b87c41d8f04 100644 --- a/extensions/razor/test/colorize-results/test_cshtml.json +++ b/extensions/razor/test/colorize-results/test_cshtml.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -40,7 +40,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -62,7 +62,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -84,7 +84,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -117,7 +117,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -139,7 +139,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -227,7 +227,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -249,7 +249,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -326,7 +326,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -348,7 +348,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -392,7 +392,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -425,7 +425,7 @@ "light_plus": "storage.type.cs: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.cs: #4EC9B0" } }, { @@ -480,7 +480,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -502,7 +502,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -546,7 +546,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -579,7 +579,7 @@ "light_plus": "storage.type.cs: #267F99", "dark_vs": "storage.type: #569CD6", "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" + "hc_black": "storage.type.cs: #4EC9B0" } }, { @@ -667,7 +667,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -711,7 +711,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -799,7 +799,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -887,7 +887,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -909,7 +909,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -931,7 +931,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1041,7 +1041,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1085,7 +1085,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1118,7 +1118,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3164,7 +3164,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3318,7 +3318,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3340,7 +3340,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/ruby/package.json b/extensions/ruby/package.json index 18fe222daaf..0599300ca04 100644 --- a/extensions/ruby/package.json +++ b/extensions/ruby/package.json @@ -9,7 +9,7 @@ "languages": [{ "id": "ruby", "extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru", ".erb" ], - "filenames": [ "rakefile", "gemfile", "guardfile", "podfile" ], + "filenames": [ "rakefile", "gemfile", "guardfile", "podfile", "capfile" ], "aliases": [ "Ruby", "rb" ], "firstLine": "^#!/.*\\bruby\\b", "configuration": "./language-configuration.json" @@ -17,11 +17,12 @@ "grammars": [{ "language": "ruby", "scopeName": "source.ruby", - "path": "./syntaxes/Ruby.plist" + "path": "./syntaxes/ruby.tmLanguage.json" }] }, "scripts": { "compile": "gulp compile-extension:ruby", - "watch": "gulp watch-extension:ruby" + "watch": "gulp watch-extension:ruby", + "update-grammar": "node ../../build/npm/update-grammar.js textmate/ruby.tmbundle Syntaxes/Ruby.plist ./syntaxes/ruby.tmLanguage.json" } } diff --git a/extensions/ruby/syntaxes/Ruby.plist b/extensions/ruby/syntaxes/Ruby.plist deleted file mode 100644 index 04e41fabbf5..00000000000 --- a/extensions/ruby/syntaxes/Ruby.plist +++ /dev/null @@ -1,4092 +0,0 @@ - - - - - comment - - TODO: unresolved issues - - text: - "p <<end - print me! - end" - symptoms: - not recognized as a heredoc - solution: - there is no way to distinguish perfectly between the << operator and the start - of a heredoc. Currently, we require assignment to recognize a heredoc. More - refinement is possible. - • Heredocs with indented terminators (<<-) are always distinguishable, however. - • Nested heredocs are not really supportable at present - - text: - print <<-'THERE' - This is single quoted. - The above used #{Time.now} - THERE - symtoms: - From Programming Ruby p306; should be a non-interpolated heredoc. - - text: - val?(a):p(b) - val?'a':'b' - symptoms: - ':p' is recognized as a symbol.. its 2 things ':' and 'p'. - :'b' has same problem. - solution: - ternary operator rule, precedence stuff, symbol rule. - but also consider 'a.b?(:c)' ?? - - fileTypes - - rb - rbx - rjs - Rakefile - rake - cgi - fcgi - gemspec - irbrc - Capfile - ru - prawn - Cheffile - Gemfile - Guardfile - Hobofile - Vagrantfile - Appraisals - Rantfile - Berksfile - Berksfile.lock - Thorfile - Puppetfile - - firstLineMatch - ^#!/.*\bruby - keyEquivalent - ^~R - name - Ruby - patterns - - - captures - - 1 - - name - keyword.control.class.ruby - - 2 - - name - entity.name.type.class.ruby - - 3 - - name - keyword.operator.other.ruby - - 4 - - name - entity.other.inherited-class.ruby - - 5 - - name - keyword.operator.other.ruby - - 6 - - name - variable.other.object.ruby - - - match - ^\s*(class)\s+(?:([.a-zA-Z0-9_:]+)(?:\s*(<)\s*([.a-zA-Z0-9_:]+))?|(<<)\s*([.a-zA-Z0-9_:]+)) - name - meta.class.ruby - - - captures - - 1 - - name - keyword.control.module.ruby - - 2 - - name - entity.name.type.module.ruby - - 3 - - name - entity.other.inherited-class.module.first.ruby - - 4 - - name - punctuation.separator.inheritance.ruby - - 5 - - name - entity.other.inherited-class.module.second.ruby - - 6 - - name - punctuation.separator.inheritance.ruby - - 7 - - name - entity.other.inherited-class.module.third.ruby - - 8 - - name - punctuation.separator.inheritance.ruby - - - match - ^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*) - name - meta.module.ruby - - - comment - else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want. - match - (?<!\.)\belse(\s)+if\b - name - invalid.deprecated.ruby - - - captures - - 1 - - name - punctuation.definition.constant.ruby - - - comment - symbols as hash key (1.9 syntax) - match - (?>[a-zA-Z_]\w*(?>[?!])?)(:)(?!:) - name - constant.other.symbol.hashkey.ruby - - - captures - - 1 - - name - punctuation.definition.constant.ruby - - - comment - symbols as hash key (1.8 syntax) - match - (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!])?)(?=\s*=>) - name - constant.other.symbol.hashkey.ruby - - - comment - everything being a reserved word, not a value and needing a 'end' is a.. - match - (?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!]) - name - keyword.control.ruby - - - comment - contextual smart pair support for block parameters - match - (?<!\.)\bdo\b\s* - name - keyword.control.start-block.ruby - - - comment - contextual smart pair support - match - (?<=\{)(\s+) - name - meta.syntax.ruby.start-block - - - comment - as above, just doesn't need a 'end' and does a logic operation - match - (?<!\.)\b(and|not|or)\b - name - keyword.operator.logical.ruby - - - comment - just as above but being not a logical operation - match - (?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\? - name - keyword.control.pseudo-method.ruby - - - match - \b(nil|true|false)\b(?![?!]) - name - constant.language.ruby - - - match - \b(__(FILE|LINE)__|self)\b(?![?!]) - name - variable.language.ruby - - - comment - everything being a method but having a special function is a.. - match - \b(initialize|new|loop|include|extend|prepend|fail|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!]) - name - keyword.other.special-method.ruby - - - begin - \b(require|require_relative|gem)\b - captures - - 1 - - name - keyword.other.special-method.ruby - - - end - $|(?=#|\}) - name - meta.require.ruby - patterns - - - include - $self - - - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (@)[a-zA-Z_]\w* - name - variable.other.readwrite.instance.ruby - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (@@)[a-zA-Z_]\w* - name - variable.other.readwrite.class.ruby - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (\$)[a-zA-Z_]\w* - name - variable.other.readwrite.global.ruby - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (\$)(!|@|&|`|'|\+|\d+|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv]) - name - variable.other.readwrite.global.pre-defined.ruby - - - begin - \b(ENV)\[ - beginCaptures - - 1 - - name - variable.other.constant.ruby - - - end - \] - name - meta.environment-variable.ruby - patterns - - - include - $self - - - - - match - \b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[)) - name - support.class.ruby - - - match - \b[A-Z]\w*\b - name - variable.other.constant.ruby - - - begin - (?x) - (?=def\b) # an optimization to help Oniguruma fail fast - (?<=^|\s)(def)\s+ # the def keyword - ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix - (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name - |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method - \s*(\() # the openning parenthesis for arguments - - beginCaptures - - 1 - - name - keyword.control.def.ruby - - 2 - - name - entity.name.function.ruby - - 3 - - name - punctuation.definition.parameters.ruby - - - comment - the method pattern comes from the symbol pattern, see there for a explaination - end - \) - endCaptures - - 0 - - name - punctuation.definition.parameters.ruby - - - name - meta.function.method.with-arguments.ruby - patterns - - - begin - (?=[&*_a-zA-Z]) - end - (?=[,)]) - patterns - - - captures - - 1 - - name - storage.type.variable.ruby - - 2 - - name - variable.parameter.function.ruby - - - match - \G([&*]?)([_a-zA-Z][_a-zA-Z0-9]*) - - - include - $self - - - - - - - begin - (?x) - (?=def\b) # an optimization to help Oniguruma fail fast - (?<=^|\s)(def)\s+ # the def keyword - ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix - (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name - |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method - [ \t] # the space separating the arguments - (?=[ \t]*[^\s#;]) # make sure arguments and not a comment follow - - beginCaptures - - 1 - - name - keyword.control.def.ruby - - 2 - - name - entity.name.function.ruby - - - comment - same as the previous rule, but without parentheses around the arguments - end - $ - name - meta.function.method.with-arguments.ruby - patterns - - - begin - (?![\s,]) - end - (?=,|$) - patterns - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - \G([&*]?)[_a-zA-Z][_a-zA-Z0-9]* - name - variable.parameter.function.ruby - - - include - $self - - - - - - - captures - - 1 - - name - keyword.control.def.ruby - - 3 - - name - entity.name.function.ruby - - - comment - the optional name is just to catch the def also without a method-name - match - (?x) - (?=def\b) # an optimization to help Oniguruma fail fast - (?<=^|\s)(def)\b # the def keyword - ( \s+ # an optional group of whitespace followed by… - ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix - (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name - |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method - - name - meta.function.method.without-arguments.ruby - - - match - \b\d(?>_?\d)*(?=\.\d|[eE])(\.\d(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?r?i?\b - name - constant.numeric.float.ruby - - - match - \b(0[dD]\d|[1-9])(?>_?\d)*r?i?\b - name - constant.numeric.integer.ruby - - - match - \b0[xX]\h(?>_?\h)*r?i?\b - name - constant.numeric.hex.ruby - - - match - \b0[bB][01](?>_?[01])*r?i?\b - name - constant.numeric.binary.ruby - - - match - \b0([oO]?[0-7](?>_?[0-7])*)?r?i?\b - name - constant.numeric.octal.ruby - - - begin - :' - captures - - 0 - - name - punctuation.definition.constant.ruby - - - end - ' - name - constant.other.symbol.single-quoted.ruby - patterns - - - match - \\['\\] - name - constant.character.escape.ruby - - - - - begin - :" - captures - - 0 - - name - punctuation.definition.constant.ruby - - - end - " - name - constant.other.symbol.double-quoted.ruby - patterns - - - include - #interpolated_ruby - - - include - #escaped_char - - - - - comment - Needs higher precidence than regular expressions. - match - (?<!\()/= - name - keyword.operator.assignment.augmented.ruby - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - comment - single quoted string (does not allow interpolation) - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.quoted.single.ruby - patterns - - - match - \\'|\\\\ - name - constant.character.escape.ruby - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - comment - double quoted string (allows for interpolation) - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.quoted.double.ruby - patterns - - - include - #interpolated_ruby - - - include - #escaped_char - - - - - begin - ` - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - comment - execute string (allows for interpolation) - end - ` - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.interpolated.ruby - patterns - - - include - #interpolated_ruby - - - include - #escaped_char - - - - - include - #percent_literals - - - begin - (?x) - (?: - ^ # beginning of line - | (?<= # or look-behind on: - [=>~(?:\[,|&;] - | [\s;]if\s # keywords - | [\s;]elsif\s - | [\s;]while\s - | [\s;]unless\s - | [\s;]when\s - | [\s;]assert_match\s - | [\s;]or\s # boolean opperators - | [\s;]and\s - | [\s;]not\s - | [\s.]index\s # methods - | [\s.]scan\s - | [\s.]sub\s - | [\s.]sub!\s - | [\s.]gsub\s - | [\s.]gsub!\s - | [\s.]match\s - ) - | (?<= # or a look-behind with line anchor: - ^when\s # duplication necessary due to limits of regex - | ^if\s - | ^elsif\s - | ^while\s - | ^unless\s - ) - ) - \s*((/))(?![*+{}?]) - - captures - - 1 - - name - string.regexp.classic.ruby - - 2 - - name - punctuation.definition.string.ruby - - - comment - regular expressions (normal) - we only start a regexp if the character before it (excluding whitespace) - is what we think is before a regexp - - contentName - string.regexp.classic.ruby - end - ((/[eimnosux]*)) - patterns - - - include - #regex_sub - - - - - captures - - 1 - - name - punctuation.definition.constant.ruby - - - comment - symbols - match - (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*) - name - constant.other.symbol.ruby - - - begin - ^=begin - captures - - 0 - - name - punctuation.definition.comment.ruby - - - comment - multiline comments - end - ^=end - name - comment.block.documentation.ruby - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ruby - - - end - (?!\G) - patterns - - - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.ruby - - - end - \n - name - comment.line.number-sign.ruby - - - - - comment - - matches questionmark-letters. - - examples (1st alternation = hex): - ?\x1 ?\x61 - - examples (2nd alternation = octal): - ?\0 ?\07 ?\017 - - examples (3rd alternation = escaped): - ?\n ?\b - - examples (4th alternation = meta-ctrl): - ?\C-a ?\M-a ?\C-\M-\C-\M-a - - examples (4th alternation = normal): - ?a ?A ?0 - ?* ?" ?( - ?. ?# - - - the negative lookbehind prevents against matching - p(42.tainted?) - - match - (?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\]) - name - constant.numeric.ruby - - - begin - ^__END__\n - captures - - 0 - - name - string.unquoted.program-block.ruby - - - comment - __END__ marker - contentName - text.plain - end - (?=not)impossible - patterns - - - begin - (?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b)) - end - (?=not)impossible - name - text.html.embedded.ruby - patterns - - - include - text.html.basic - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)HTML)\b\1)) - comment - Heredoc with embedded html - end - (?!\G) - name - meta.embedded.block.html - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)HTML)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - text.html - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - text.html.basic - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)SQL)\b\1)) - comment - Heredoc with embedded sql - end - (?!\G) - name - meta.embedded.block.sql - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)SQL)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.sql - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.sql - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)CSS)\b\1)) - comment - Heredoc with embedded css - end - (?!\G) - name - meta.embedded.block.css - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)CSS)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.css - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.css - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)CPP)\b\1)) - comment - Heredoc with embedded c++ - end - (?!\G) - name - meta.embedded.block.cpp - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)CPP)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.cpp - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.cpp - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)C)\b\1)) - comment - Heredoc with embedded c - end - (?!\G) - name - meta.embedded.block.c - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)C)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.c - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.c - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1)) - comment - Heredoc with embedded javascript - end - (?!\G) - name - meta.embedded.block.js - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.js - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.js - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)JQUERY)\b\1)) - comment - Heredoc with embedded jQuery javascript - end - (?!\G) - name - meta.embedded.block.js.jquery - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)JQUERY)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.js.jquery - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.js.jquery - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1)) - comment - Heredoc with embedded shell - end - (?!\G) - name - meta.embedded.block.shell - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.shell - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.shell - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)LUA)\b\1)) - comment - Heredoc with embedded lua - end - (?!\G) - name - meta.embedded.block.lua - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)LUA)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.lua - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.lua - - - include - #escaped_char - - - - - - - begin - (?=(?><<[-~]("?)((?:[_\w]+_|)RUBY)\b\1)) - comment - Heredoc with embedded ruby - end - (?!\G) - name - meta.embedded.block.ruby - patterns - - - begin - (?><<[-~]("?)((?:[_\w]+_|)RUBY)\b\1) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - contentName - source.ruby - end - \s*\2$\n? - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - source.ruby - - - include - #escaped_char - - - - - - - begin - (?>\=\s*<<(\w+)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - end - ^\1$ - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - #escaped_char - - - - - begin - (?><<[-~](\w+)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - comment - heredoc with indented terminator - end - \s*\1$ - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.unquoted.heredoc.ruby - patterns - - - include - #heredoc - - - include - #interpolated_ruby - - - include - #escaped_char - - - - - begin - (?<=\{|do|\{\s|do\s)(\|) - captures - - 1 - - name - punctuation.separator.variable.ruby - - - end - (\|) - patterns - - - match - [_a-zA-Z][_a-zA-Z0-9]* - name - variable.other.block.ruby - - - match - , - name - punctuation.separator.variable.ruby - - - - - match - => - name - punctuation.separator.key-value - - - match - <<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|<< - name - keyword.operator.assignment.augmented.ruby - - - match - <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\? - name - keyword.operator.comparison.ruby - - - match - (?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^ - name - keyword.operator.logical.ruby - - - match - (%|&|\*\*|\*|\+|\-|/) - name - keyword.operator.arithmetic.ruby - - - match - = - name - keyword.operator.assignment.ruby - - - match - \||~|>> - name - keyword.operator.other.ruby - - - match - : - name - punctuation.separator.other.ruby - - - match - \; - name - punctuation.separator.statement.ruby - - - match - , - name - punctuation.separator.object.ruby - - - match - \.|:: - name - punctuation.separator.method.ruby - - - match - \{ - name - punctuation.section.scope.begin.ruby - - - match - \} - name - punctuation.section.scope.end.ruby - - - match - \[ - name - punctuation.section.array.begin.ruby - - - match - \] - name - punctuation.section.array.end.ruby - - - match - \(|\) - name - punctuation.section.function.ruby - - - repository - - escaped_char - - match - \\(?:[0-7]{1,3}|x[\da-fA-F]{1,2}|.) - name - constant.character.escape.ruby - - heredoc - - begin - ^<<[-~]?\w+ - end - $ - patterns - - - include - $self - - - - interpolated_ruby - - patterns - - - begin - #\{ - beginCaptures - - 0 - - name - punctuation.section.embedded.begin.ruby - - - contentName - source.ruby - end - (\}) - endCaptures - - 0 - - name - punctuation.section.embedded.end.ruby - - 1 - - name - source.ruby - - - name - meta.embedded.line.ruby - patterns - - - include - #nest_curly_and_self - - - include - $self - - - repository - - nest_curly_and_self - - patterns - - - begin - \{ - captures - - 0 - - name - punctuation.section.scope.ruby - - - end - \} - patterns - - - include - #nest_curly_and_self - - - - - include - $self - - - - - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (#@)[a-zA-Z_]\w* - name - variable.other.readwrite.instance.ruby - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (#@@)[a-zA-Z_]\w* - name - variable.other.readwrite.class.ruby - - - captures - - 1 - - name - punctuation.definition.variable.ruby - - - match - (#\$)[a-zA-Z_]\w* - name - variable.other.readwrite.global.ruby - - - - percent_literals - - patterns - - - begin - %i(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.section.array.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.section.array.end.ruby - - - name - meta.array.symbol.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - include - #symbol - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - include - #symbol - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - include - #symbol - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - include - #symbol - - - - - include - #symbol - - - repository - - angles - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\<|\\> - name - constant.other.symbol.ruby - - - begin - < - captures - - 0 - - name - constant.other.symbol.ruby - - - end - > - patterns - - - include - #angles - - - include - #symbol - - - - - - braces - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\{|\\\} - name - constant.other.symbol.ruby - - - begin - \{ - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \} - patterns - - - include - #braces - - - include - #symbol - - - - - - brackets - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\[|\\\] - name - constant.other.symbol.ruby - - - begin - \[ - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \] - patterns - - - include - #brackets - - - include - #symbol - - - - - - parens - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\(|\\\) - name - constant.other.symbol.ruby - - - begin - \( - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \) - patterns - - - include - #parens - - - include - #symbol - - - - - - symbol - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\\|\\[ ] - name - constant.other.symbol.ruby - - - match - \S\w* - name - constant.other.symbol.ruby - - - - - - - begin - %I(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.section.array.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.section.array.end.ruby - - - name - meta.array.symbol.interpolated.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - include - #symbol - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - include - #symbol - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - include - #symbol - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - include - #symbol - - - - - include - #symbol - - - repository - - angles - - patterns - - - begin - < - captures - - 0 - - name - constant.other.symbol.ruby - - - end - > - patterns - - - include - #angles - - - include - #symbol - - - - - - braces - - patterns - - - begin - \{ - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \} - patterns - - - include - #braces - - - include - #symbol - - - - - - brackets - - patterns - - - begin - \[ - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \] - patterns - - - include - #brackets - - - include - #symbol - - - - - - parens - - patterns - - - begin - \( - captures - - 0 - - name - constant.other.symbol.ruby - - - end - \) - patterns - - - include - #parens - - - include - #symbol - - - - - - symbol - - patterns - - - begin - (?=\\|#\{) - end - (?!\G) - name - constant.other.symbol.ruby - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - - - match - \S\w* - name - constant.other.symbol.ruby - - - - - - - begin - %q(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.quoted.other.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - - - repository - - angles - - patterns - - - match - \\<|\\>|\\\\ - name - constant.character.escape.ruby - - - begin - < - end - > - patterns - - - include - #angles - - - - - - braces - - patterns - - - match - \\\{|\\\}|\\\\ - name - constant.character.escape.ruby - - - begin - \{ - end - \} - patterns - - - include - #braces - - - - - - brackets - - patterns - - - match - \\\[|\\\]|\\\\ - name - constant.character.escape.ruby - - - begin - \[ - end - \] - patterns - - - include - #brackets - - - - - - parens - - patterns - - - match - \\\(|\\\)|\\\\ - name - constant.character.escape.ruby - - - begin - \( - end - \) - patterns - - - include - #parens - - - - - - - - - begin - %Q?(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.quoted.other.interpolated.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - - - include - #escaped_char - - - include - #interpolated_ruby - - - repository - - angles - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - < - end - > - patterns - - - include - #angles - - - - - - braces - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \{ - end - \} - patterns - - - include - #braces - - - - - - brackets - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \[ - end - \] - patterns - - - include - #brackets - - - - - - parens - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \( - end - \) - patterns - - - include - #parens - - - - - - - - - begin - %r(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - end - ([)\]}>]|\1\2)[eimnosux]* - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.regexp.percent.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - - - include - #regex_sub - - - repository - - angles - - patterns - - - include - #regex_sub - - - begin - < - end - > - patterns - - - include - #angles - - - - - - braces - - patterns - - - include - #regex_sub - - - begin - \{ - end - \} - patterns - - - include - #braces - - - - - - brackets - - patterns - - - include - #regex_sub - - - begin - \[ - end - \] - patterns - - - include - #brackets - - - - - - parens - - patterns - - - include - #regex_sub - - - begin - \( - end - \) - patterns - - - include - #parens - - - - - - - - - begin - %s(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.definition.constant.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.definition.constant.end.ruby - - - name - constant.other.symbol.percent.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - - - repository - - angles - - patterns - - - match - \\<|\\>|\\\\ - name - constant.character.escape.ruby - - - begin - < - end - > - patterns - - - include - #angles - - - - - - braces - - patterns - - - match - \\\{|\\\}|\\\\ - name - constant.character.escape.ruby - - - begin - \{ - end - \} - patterns - - - include - #braces - - - - - - brackets - - patterns - - - match - \\\[|\\\]|\\\\ - name - constant.character.escape.ruby - - - begin - \[ - end - \] - patterns - - - include - #brackets - - - - - - parens - - patterns - - - match - \\\(|\\\)|\\\\ - name - constant.character.escape.ruby - - - begin - \( - end - \) - patterns - - - include - #parens - - - - - - - - - begin - %w(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.section.array.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.section.array.end.ruby - - - name - meta.array.string.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - include - #string - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - include - #string - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - include - #string - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - include - #string - - - - - include - #string - - - repository - - angles - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\<|\\> - name - string.other.ruby - - - begin - < - captures - - 0 - - name - string.other.ruby - - - end - > - patterns - - - include - #angles - - - include - #string - - - - - - braces - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\{|\\\} - name - string.other.ruby - - - begin - \{ - captures - - 0 - - name - string.other.ruby - - - end - \} - patterns - - - include - #braces - - - include - #string - - - - - - brackets - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\[|\\\] - name - string.other.ruby - - - begin - \[ - captures - - 0 - - name - string.other.ruby - - - end - \] - patterns - - - include - #brackets - - - include - #string - - - - - - parens - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\(|\\\) - name - string.other.ruby - - - begin - \( - captures - - 0 - - name - string.other.ruby - - - end - \) - patterns - - - include - #parens - - - include - #string - - - - - - string - - patterns - - - captures - - 0 - - name - constant.character.escape.ruby - - - match - \\\\|\\[ ] - name - string.other.ruby - - - match - \S\w* - name - string.other.ruby - - - - - - - begin - %W(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.section.array.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.section.array.end.ruby - - - name - meta.array.string.interpolated.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - include - #string - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - include - #string - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - include - #string - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - include - #string - - - - - include - #string - - - repository - - angles - - patterns - - - begin - < - captures - - 0 - - name - string.other.ruby - - - end - > - patterns - - - include - #angles - - - include - #string - - - - - - braces - - patterns - - - begin - \{ - captures - - 0 - - name - string.other.ruby - - - end - \} - patterns - - - include - #braces - - - include - #string - - - - - - brackets - - patterns - - - begin - \[ - captures - - 0 - - name - string.other.ruby - - - end - \] - patterns - - - include - #brackets - - - include - #string - - - - - - parens - - patterns - - - begin - \( - captures - - 0 - - name - string.other.ruby - - - end - \) - patterns - - - include - #parens - - - include - #string - - - - - - string - - patterns - - - begin - (?=\\|#\{) - end - (?!\G) - name - string.other.ruby - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - - - match - \S\w* - name - string.other.ruby - - - - - - - begin - %x(?:([(\[{<])|([^\w\s]|_)) - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ruby - - - end - [)\]}>]|\1\2 - endCaptures - - 0 - - name - punctuation.definition.string.end.ruby - - - name - string.interpolated.percent.ruby - patterns - - - begin - \G(?<=\()(?!\)) - end - (?=\)) - patterns - - - include - #parens - - - - - begin - \G(?<=\[)(?!\]) - end - (?=\]) - patterns - - - include - #brackets - - - - - begin - \G(?<=\{)(?!\}) - end - (?=\}) - patterns - - - include - #braces - - - - - begin - \G(?<=<)(?!>) - end - (?=>) - patterns - - - include - #angles - - - - - include - #escaped_char - - - include - #interpolated_ruby - - - repository - - angles - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - < - end - > - patterns - - - include - #angles - - - - - - braces - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \{ - end - \} - patterns - - - include - #braces - - - - - - brackets - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \[ - end - \] - patterns - - - include - #brackets - - - - - - parens - - patterns - - - include - #escaped_char - - - include - #interpolated_ruby - - - begin - \( - end - \) - patterns - - - include - #parens - - - - - - - - - - regex_sub - - patterns - - - include - #interpolated_ruby - - - include - #escaped_char - - - captures - - 1 - - name - punctuation.definition.quantifier.begin.ruby - - 3 - - name - punctuation.definition.quantifier.end.ruby - - - match - (\{)\d+(,\d+)?(\}) - name - keyword.operator.quantifier.ruby - - - begin - \[(?:\^?\])? - beginCaptures - - 0 - - name - punctuation.definition.character-class.begin.ruby - - - end - \] - endCaptures - - 0 - - name - punctuation.definition.character-class.end.ruby - - - name - constant.other.character-class.set.ruby - patterns - - - include - #escaped_char - - - - - begin - \(\?# - beginCaptures - - 0 - - name - punctuation.definition.comment.begin.ruby - - - end - \) - endCaptures - - 0 - - name - punctuation.definition.comment.end.ruby - - - name - comment.line.number-sign.ruby - patterns - - - include - #escaped_char - - - - - begin - \( - captures - - 0 - - name - punctuation.definition.group.ruby - - - end - \) - name - meta.group.regexp.ruby - patterns - - - include - #regex_sub - - - - - begin - (?<=^|\s)(#)\s(?=[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$) - beginCaptures - - 1 - - name - punctuation.definition.comment.ruby - - - comment - We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags. - end - $\n? - name - comment.line.number-sign.ruby - - - - - scopeName - source.ruby - uuid - E00B62AC-6B1C-11D9-9B1F-000D93589AF6 - - - diff --git a/extensions/ruby/syntaxes/ruby.tmLanguage.json b/extensions/ruby/syntaxes/ruby.tmLanguage.json new file mode 100644 index 00000000000..a6e0c01b7b9 --- /dev/null +++ b/extensions/ruby/syntaxes/ruby.tmLanguage.json @@ -0,0 +1,2732 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/ruby.tmbundle/blob/master/Syntaxes/Ruby.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "comment": "\n\tTODO: unresolved issues\n\n\ttext:\n\t\"p <[a-zA-Z_]\\w*(?>[?!])?)(:)(?!:)", + "name": "constant.other.symbol.hashkey.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.ruby" + } + }, + "comment": "symbols as hash key (1.8 syntax)", + "match": "(?[a-zA-Z_]\\w*(?>[?!])?)(?=\\s*=>)", + "name": "constant.other.symbol.hashkey.ruby" + }, + { + "comment": "everything being a reserved word, not a value and needing a 'end' is a..", + "match": "(?|_|\\*|\\$|\\?|:|\"|-[0adFiIlpvw])", + "name": "variable.other.readwrite.global.pre-defined.ruby" + }, + { + "begin": "\\b(ENV)\\[", + "beginCaptures": { + "1": { + "name": "variable.other.constant.ruby" + } + }, + "end": "\\]", + "name": "meta.environment-variable.ruby", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))", + "name": "support.class.ruby" + }, + { + "match": "\\b(abort|at_exit|autoload[?]?|binding|callcc|caller|caller_locations|chomp|chop|eval|exec|exit|exit!|fork|format|gets|global_variables|gsub|lambda|load|local_variables|open|p|print|printf|proc|putc|puts|rand|readline|readlines|select|set_trace_func|sleep|spawn|sprintf|srand|sub|syscall|system|test|trace_var|trap|untrace_var|warn)(\\b|(?<=[?!]))(?![?!])", + "name": "support.function.kernel.ruby" + }, + { + "match": "\\b[A-Z]\\w*\\b", + "name": "variable.other.constant.ruby" + }, + { + "begin": "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\s+ # the def keyword\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) # …or an operator method\n\t\t\t \\s*(\\() # the openning parenthesis for arguments\n\t\t\t ", + "beginCaptures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "2": { + "name": "entity.name.function.ruby" + }, + "3": { + "name": "punctuation.definition.parameters.ruby" + } + }, + "comment": "the method pattern comes from the symbol pattern, see there for a explaination", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.ruby" + } + }, + "name": "meta.function.method.with-arguments.ruby", + "patterns": [ + { + "begin": "(?=[&*_a-zA-Z])", + "end": "(?=[,)])", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.variable.ruby" + }, + "2": { + "name": "constant.other.symbol.hashkey.parameter.function.ruby" + }, + "3": { + "name": "punctuation.definition.constant.ruby" + }, + "4": { + "name": "variable.parameter.function.ruby" + } + }, + "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))" + }, + { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.section.function.ruby" + } + }, + "comment": "Prevent end pattern of parent rule from ending prematurely.", + "end": "\\)", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\s+ # the def keyword\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) # …or an operator method\n\t\t\t [ \\t] # the space separating the arguments\n\t\t\t (?=[ \\t]*[^\\s#;]) # make sure arguments and not a comment follow\n\t\t\t ", + "beginCaptures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "2": { + "name": "entity.name.function.ruby" + } + }, + "comment": "same as the previous rule, but without parentheses around the arguments", + "end": "$", + "name": "meta.function.method.with-arguments.ruby", + "patterns": [ + { + "begin": "(?![\\s,])", + "end": "(?=,|$)", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.variable.ruby" + }, + "2": { + "name": "constant.other.symbol.hashkey.parameter.function.ruby" + }, + "3": { + "name": "punctuation.definition.constant.ruby" + }, + "4": { + "name": "variable.parameter.function.ruby" + } + }, + "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))", + "name": "variable.parameter.function.ruby" + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "3": { + "name": "entity.name.function.ruby" + } + }, + "comment": " the optional name is just to catch the def also without a method-name", + "match": "(?x)\n\t\t\t (?=def\\b) # an optimization to help Oniguruma fail fast\n\t\t\t (?<=^|\\s)(def)\\b # the def keyword\n\t\t\t ( \\s+ # an optional group of whitespace followed by…\n\t\t\t ( (?>[a-zA-Z_]\\w*(?>\\.|::))? # a method name prefix\n\t\t\t (?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))? # the method name\n\t\t\t |===?|!=|!~|>[>=]?|<=>|<[<=]?|[%&`/\\|^]|\\*\\*?|=?~|[-+]@?|\\[\\]=?) ) )? # …or an operator method\n\t\t\t ", + "name": "meta.function.method.without-arguments.ruby" + }, + { + "match": "\\b\\d(?>_?\\d)*(?=\\.\\d|[eE])(\\.\\d(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?r?i?\\b", + "name": "constant.numeric.float.ruby" + }, + { + "match": "\\b(0[dD]\\d|[1-9])(?>_?\\d)*r?i?\\b", + "name": "constant.numeric.integer.ruby" + }, + { + "match": "\\b0[xX]\\h(?>_?\\h)*r?i?\\b", + "name": "constant.numeric.hex.ruby" + }, + { + "match": "\\b0[bB][01](?>_?[01])*r?i?\\b", + "name": "constant.numeric.binary.ruby" + }, + { + "match": "\\b0([oO]?[0-7](?>_?[0-7])*)?r?i?\\b", + "name": "constant.numeric.octal.ruby" + }, + { + "begin": ":'", + "captures": { + "0": { + "name": "punctuation.definition.constant.ruby" + } + }, + "end": "'", + "name": "constant.other.symbol.single-quoted.ruby", + "patterns": [ + { + "match": "\\\\['\\\\]", + "name": "constant.character.escape.ruby" + } + ] + }, + { + "begin": ":\"", + "captures": { + "0": { + "name": "punctuation.definition.constant.ruby" + } + }, + "end": "\"", + "name": "constant.other.symbol.double-quoted.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "comment": "Needs higher precidence than regular expressions.", + "match": "(?~(?:\\[,|&;]\n\t\t\t | [\\s;]if\\s\t\t\t# keywords\n\t\t\t | [\\s;]elsif\\s\n\t\t\t | [\\s;]while\\s\n\t\t\t | [\\s;]unless\\s\n\t\t\t | [\\s;]when\\s\n\t\t\t | [\\s;]assert_match\\s\n\t\t\t | [\\s;]or\\s\t\t\t# boolean opperators\n\t\t\t | [\\s;]and\\s\n\t\t\t | [\\s;]not\\s\n\t\t\t | [\\s.]index\\s\t\t\t# methods\n\t\t\t | [\\s.]scan\\s\n\t\t\t | [\\s.]sub\\s\n\t\t\t | [\\s.]sub!\\s\n\t\t\t | [\\s.]gsub\\s\n\t\t\t | [\\s.]gsub!\\s\n\t\t\t | [\\s.]match\\s\n\t\t\t )\n\t\t\t | (?<= # or a look-behind with line anchor:\n\t\t\t ^when\\s # duplication necessary due to limits of regex\n\t\t\t | ^if\\s\n\t\t\t | ^elsif\\s\n\t\t\t | ^while\\s\n\t\t\t | ^unless\\s\n\t\t\t )\n\t\t\t )\n\t\t\t \\s*((/))(?![*+{}?])\n\t\t\t", + "captures": { + "1": { + "name": "string.regexp.classic.ruby" + }, + "2": { + "name": "punctuation.definition.string.ruby" + } + }, + "comment": "regular expressions (normal)\n\t\t\twe only start a regexp if the character before it (excluding whitespace)\n\t\t\tis what we think is before a regexp\n\t\t\t", + "contentName": "string.regexp.classic.ruby", + "end": "((/[eimnosux]*))", + "patterns": [ + { + "include": "#regex_sub" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.ruby" + } + }, + "comment": "symbols", + "match": "(?[a-zA-Z_]\\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?|(@@?|\\$)[a-zA-Z_]\\w*)", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "^=begin", + "captures": { + "0": { + "name": "punctuation.definition.comment.ruby" + } + }, + "comment": "multiline comments", + "end": "^=end", + "name": "comment.block.documentation.ruby" + }, + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ruby" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ruby" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.ruby" + } + ] + }, + { + "comment": "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2nd alternation = octal):\n\t\t\t?\\0 ?\\07 ?\\017\n\n\t\t\texamples (3rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (4th alternation = meta-ctrl):\n\t\t\t?\\C-a ?\\M-a ?\\C-\\M-\\C-\\M-a\n\n\t\t\texamples (4th alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?\" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t", + "match": "(?<<[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1))", + "comment": "Heredoc with embedded html", + "end": "(?!\\G)", + "name": "meta.embedded.block.html", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "text.html", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "text.html.basic" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1))", + "comment": "Heredoc with embedded sql", + "end": "(?!\\G)", + "name": "meta.embedded.block.sql", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.sql", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.sql" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1))", + "comment": "Heredoc with embedded css", + "end": "(?!\\G)", + "name": "meta.embedded.block.css", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.css", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.css" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1))", + "comment": "Heredoc with embedded c++", + "end": "(?!\\G)", + "name": "meta.embedded.block.c++", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.c++", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.c++" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)C)\\b\\1))", + "comment": "Heredoc with embedded c", + "end": "(?!\\G)", + "name": "meta.embedded.block.c", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)C)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.c", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.c" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1))", + "comment": "Heredoc with embedded javascript", + "end": "(?!\\G)", + "name": "meta.embedded.block.js", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.js", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.js" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1))", + "comment": "Heredoc with embedded jQuery javascript", + "end": "(?!\\G)", + "name": "meta.embedded.block.js.jquery", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.js.jquery", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.js.jquery" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1))", + "comment": "Heredoc with embedded shell", + "end": "(?!\\G)", + "name": "meta.embedded.block.shell", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.shell", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.shell" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1))", + "comment": "Heredoc with embedded lua", + "end": "(?!\\G)", + "name": "meta.embedded.block.lua", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.lua", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.lua" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1))", + "comment": "Heredoc with embedded ruby", + "end": "(?!\\G)", + "name": "meta.embedded.block.ruby", + "patterns": [ + { + "begin": "(?><<[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.ruby", + "end": "\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.ruby" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?>=\\s*<<(\\w+))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "^\\1$", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(?><<[-~](\\w+))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "comment": "heredoc with indented terminator", + "end": "\\s*\\1$", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(?<=\\{|do|\\{\\s|do\\s)(\\|)", + "captures": { + "1": { + "name": "punctuation.separator.arguments.ruby" + } + }, + "end": "(?", + "name": "punctuation.separator.key-value" + }, + { + "match": "->", + "name": "support.function.kernel.lambda.ruby" + }, + { + "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<", + "name": "keyword.operator.assignment.augmented.ruby" + }, + { + "match": "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?", + "name": "keyword.operator.comparison.ruby" + }, + { + "match": "(?>", + "name": "keyword.operator.other.ruby" + }, + { + "match": ";", + "name": "punctuation.separator.statement.ruby" + }, + { + "match": ",", + "name": "punctuation.separator.object.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.namespace.ruby" + } + }, + "comment": "Mark as namespace separator if double colons followed by capital letter", + "match": "(::)\\s*(?=[A-Z])" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.method.ruby" + } + }, + "comment": "Mark as method separator if double colons not followed by capital letter", + "match": "(\\.|::)\\s*(?![A-Z])" + }, + { + "comment": "Must come after method and constant separators to prefer double colons", + "match": ":", + "name": "punctuation.separator.other.ruby" + }, + { + "match": "\\{", + "name": "punctuation.section.scope.begin.ruby" + }, + { + "match": "\\}", + "name": "punctuation.section.scope.end.ruby" + }, + { + "match": "\\[", + "name": "punctuation.section.array.begin.ruby" + }, + { + "match": "\\]", + "name": "punctuation.section.array.end.ruby" + }, + { + "match": "\\(|\\)", + "name": "punctuation.section.function.ruby" + } + ], + "repository": { + "escaped_char": { + "match": "\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)", + "name": "constant.character.escape.ruby" + }, + "heredoc": { + "begin": "^<<[-~]?\\w+", + "end": "$", + "patterns": [ + { + "include": "$self" + } + ] + }, + "interpolated_ruby": { + "patterns": [ + { + "begin": "#\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.ruby" + } + }, + "contentName": "source.ruby", + "end": "(\\})", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.ruby" + }, + "1": { + "name": "source.ruby" + } + }, + "name": "meta.embedded.line.ruby", + "patterns": [ + { + "include": "#nest_curly_and_self" + }, + { + "include": "$self" + } + ], + "repository": { + "nest_curly_and_self": { + "patterns": [ + { + "begin": "\\{", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#nest_curly_and_self" + } + ] + }, + { + "include": "$self" + } + ] + } + } + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.instance.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#@@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.class.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#\\$)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.global.ruby" + } + ] + }, + "percent_literals": { + "patterns": [ + { + "begin": "%i(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "meta.array.symbol.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#symbol" + } + ] + }, + { + "include": "#symbol" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\<|\\\\>", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "<", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\{|\\\\\\}", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "\\{", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\[|\\\\\\]", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "\\[", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\(|\\\\\\)", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "\\(", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "symbol": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\\\|\\\\[ ]", + "name": "constant.other.symbol.ruby" + }, + { + "match": "\\S\\w*", + "name": "constant.other.symbol.ruby" + } + ] + } + } + }, + { + "begin": "%I(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "meta.array.symbol.interpolated.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#symbol" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#symbol" + } + ] + }, + { + "include": "#symbol" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "begin": "<", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "begin": "\\{", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "\\[", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "begin": "\\(", + "captures": { + "0": { + "name": "constant.other.symbol.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#symbol" + } + ] + } + ] + }, + "symbol": { + "patterns": [ + { + "begin": "(?=\\\\|#\\{)", + "end": "(?!\\G)", + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + } + ] + }, + { + "match": "\\S\\w*", + "name": "constant.other.symbol.ruby" + } + ] + } + } + }, + { + "begin": "%q(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + } + ] + } + ], + "repository": { + "angles": { + "patterns": [ + { + "match": "\\\\<|\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "<", + "end": ">", + "patterns": [ + { + "include": "#angles" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "match": "\\\\\\{|\\\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#braces" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "match": "\\\\\\[|\\\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "match": "\\\\\\(|\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#parens" + } + ] + } + ] + } + } + }, + { + "begin": "%Q?(?:([(\\[{<])|([^\\w\\s=]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + } + ] + }, + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "<", + "end": ">", + "patterns": [ + { + "include": "#angles" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#braces" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#parens" + } + ] + } + ] + } + } + }, + { + "begin": "%r(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "([)\\]}>]\\2|\\1\\2)[eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.regexp.percent.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + } + ] + }, + { + "include": "#regex_sub" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "include": "#regex_sub" + }, + { + "begin": "<", + "end": ">", + "patterns": [ + { + "include": "#angles" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "include": "#regex_sub" + }, + { + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#braces" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "include": "#regex_sub" + }, + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "include": "#regex_sub" + }, + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#parens" + } + ] + } + ] + } + } + }, + { + "begin": "%s(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.constant.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.definition.constant.end.ruby" + } + }, + "name": "constant.other.symbol.percent.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + } + ] + } + ], + "repository": { + "angles": { + "patterns": [ + { + "match": "\\\\<|\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "<", + "end": ">", + "patterns": [ + { + "include": "#angles" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "match": "\\\\\\{|\\\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#braces" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "match": "\\\\\\[|\\\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "match": "\\\\\\(|\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#parens" + } + ] + } + ] + } + } + }, + { + "begin": "%w(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "meta.array.string.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#string" + } + ] + }, + { + "include": "#string" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\<|\\\\>", + "name": "string.other.ruby" + }, + { + "begin": "<", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#string" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\{|\\\\\\}", + "name": "string.other.ruby" + }, + { + "begin": "\\{", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#string" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\[|\\\\\\]", + "name": "string.other.ruby" + }, + { + "begin": "\\[", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#string" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\(|\\\\\\)", + "name": "string.other.ruby" + }, + { + "begin": "\\(", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#string" + } + ] + } + ] + }, + "string": { + "patterns": [ + { + "captures": { + "0": { + "name": "constant.character.escape.ruby" + } + }, + "match": "\\\\\\\\|\\\\[ ]", + "name": "string.other.ruby" + }, + { + "match": "\\S\\w*", + "name": "string.other.ruby" + } + ] + } + } + }, + { + "begin": "%W(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "meta.array.string.interpolated.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#string" + } + ] + }, + { + "include": "#string" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "begin": "<", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#angles" + }, + { + "include": "#string" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "begin": "\\{", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\}", + "patterns": [ + { + "include": "#braces" + }, + { + "include": "#string" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "\\[", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + }, + { + "include": "#string" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "begin": "\\(", + "captures": { + "0": { + "name": "string.other.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#parens" + }, + { + "include": "#string" + } + ] + } + ] + }, + "string": { + "patterns": [ + { + "begin": "(?=\\\\|#\\{)", + "end": "(?!\\G)", + "name": "string.other.ruby", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + } + ] + }, + { + "match": "\\S\\w*", + "name": "string.other.ruby" + } + ] + } + } + }, + { + "begin": "%x(?:([(\\[{<])|([^\\w\\s]|_))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "[)\\]}>]\\2|\\1\\2", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.interpolated.percent.ruby", + "patterns": [ + { + "begin": "\\G(?<=\\()(?!\\))", + "end": "(?=\\))", + "patterns": [ + { + "include": "#parens" + } + ] + }, + { + "begin": "\\G(?<=\\[)(?!\\])", + "end": "(?=\\])", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\G(?<=\\{)(?!\\})", + "end": "(?=\\})", + "patterns": [ + { + "include": "#braces" + } + ] + }, + { + "begin": "\\G(?<=<)(?!>)", + "end": "(?=>)", + "patterns": [ + { + "include": "#angles" + } + ] + }, + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + } + ], + "repository": { + "angles": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "<", + "end": ">", + "patterns": [ + { + "include": "#angles" + } + ] + } + ] + }, + "braces": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#braces" + } + ] + } + ] + }, + "brackets": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "parens": { + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#interpolated_ruby" + }, + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#parens" + } + ] + } + ] + } + } + } + ] + }, + "regex_sub": { + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.quantifier.begin.ruby" + }, + "3": { + "name": "punctuation.definition.quantifier.end.ruby" + } + }, + "match": "(\\{)\\d+(,\\d+)?(\\})", + "name": "keyword.operator.quantifier.ruby" + }, + { + "begin": "\\[\\^?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.character-class.begin.ruby" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.character-class.end.ruby" + } + }, + "name": "constant.other.character-class.set.ruby", + "patterns": [ + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "\\(\\?#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.ruby" + } + }, + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.definition.group.ruby" + } + }, + "end": "\\)", + "name": "meta.group.regexp.ruby", + "patterns": [ + { + "include": "#regex_sub" + } + ] + }, + { + "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.ruby" + } + }, + "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", + "end": "$\\n?", + "name": "comment.line.number-sign.ruby" + } + ] + } + }, + "scopeName": "source.ruby", + "uuid": "E00B62AC-6B1C-11D9-9B1F-000D93589AF6" +} \ No newline at end of file diff --git a/extensions/ruby/test/colorize-results/test_rb.json b/extensions/ruby/test/colorize-results/test_rb.json index 0a64f6f6aed..4c6e89c33f0 100644 --- a/extensions/ruby/test/colorize-results/test_rb.json +++ b/extensions/ruby/test/colorize-results/test_rb.json @@ -95,7 +95,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -117,7 +117,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -128,7 +128,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -139,7 +139,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -150,7 +150,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -161,7 +161,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -260,7 +260,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -282,7 +282,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -326,7 +326,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -370,12 +370,12 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { "c": "::", - "t": "source.ruby punctuation.separator.other.ruby", + "t": "source.ruby punctuation.separator.namespace.ruby", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -392,12 +392,12 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { "c": "::", - "t": "source.ruby punctuation.separator.other.ruby", + "t": "source.ruby punctuation.separator.namespace.ruby", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -414,12 +414,12 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { "c": "::", - "t": "source.ruby punctuation.separator.other.ruby", + "t": "source.ruby punctuation.separator.namespace.ruby", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -436,7 +436,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -480,7 +480,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -766,7 +766,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -788,7 +788,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -810,7 +810,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -832,7 +832,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -898,7 +898,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -975,7 +975,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1052,7 +1052,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1063,7 +1063,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1195,7 +1195,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1272,7 +1272,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1349,7 +1349,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1426,7 +1426,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1481,12 +1481,12 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { "c": "::", - "t": "source.ruby punctuation.separator.other.ruby", + "t": "source.ruby punctuation.separator.namespace.ruby", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1503,7 +1503,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1536,7 +1536,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1547,7 +1547,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1602,7 +1602,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1613,7 +1613,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -1695,13 +1695,13 @@ }, { "c": "self", - "t": "source.ruby variable.language.ruby", + "t": "source.ruby variable.language.self.ruby", "r": { "dark_plus": "variable.language: #569CD6", "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1745,7 +1745,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1789,7 +1789,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -1827,13 +1827,13 @@ }, { "c": "self", - "t": "source.ruby variable.language.ruby", + "t": "source.ruby variable.language.self.ruby", "r": { "dark_plus": "variable.language: #569CD6", "light_plus": "variable.language: #0000FF", "dark_vs": "variable.language: #569CD6", "light_vs": "variable.language: #0000FF", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1877,7 +1877,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1965,7 +1965,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1976,7 +1976,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2042,7 +2042,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2053,7 +2053,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2119,7 +2119,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2141,7 +2141,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -2273,7 +2273,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -2328,7 +2328,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2416,7 +2416,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2801,7 +2801,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2823,7 +2823,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2834,7 +2834,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } } ] \ No newline at end of file diff --git a/extensions/ruby/tsconfig.json b/extensions/ruby/tsconfig.json index a016490a376..efe5568f2b5 100644 --- a/extensions/ruby/tsconfig.json +++ b/extensions/ruby/tsconfig.json @@ -8,7 +8,7 @@ ], "sourceMap": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/rust/syntaxes/rust.tmLanguage.json b/extensions/rust/syntaxes/rust.tmLanguage.json index 3b952b7f868..31dcab1d887 100644 --- a/extensions/rust/syntaxes/rust.tmLanguage.json +++ b/extensions/rust/syntaxes/rust.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/zargony/atom-language-rust/blob/master/grammars/rust.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "Rust", "scopeName": "source.rust", "fileTypes": [ @@ -158,6 +163,11 @@ "name": "support.type.std.rust", "match": "\\b(ToOwned|ToString)\\b" }, + "type": { + "comment": "A type", + "name": "entity.name.type.rust", + "match": "\\b([A-Za-z][_A-Za-z0-9]*|_[_A-Za-z0-9]+)\\b" + }, "type_params": { "comment": "Type parameters", "name": "meta.type_params.rust", @@ -201,6 +211,61 @@ } }, "patterns": [ + { + "comment": "Implementation", + "begin": "\\b(impl)\\b", + "end": "\\{", + "beginCaptures": { + "1": { + "name": "storage.type.rust" + } + }, + "patterns": [ + { + "include": "#block_comment" + }, + { + "include": "#line_comment" + }, + { + "include": "#sigils" + }, + { + "include": "#mut" + }, + { + "include": "#ref_lifetime" + }, + { + "include": "#core_types" + }, + { + "include": "#core_marker" + }, + { + "include": "#core_traits" + }, + { + "include": "#std_types" + }, + { + "include": "#std_traits" + }, + { + "include": "#type_params" + }, + { + "include": "#where" + }, + { + "name": "storage.type.rust", + "match": "\\bfor\\b" + }, + { + "include": "#type" + } + ] + }, { "include": "#block_doc_comment" }, @@ -403,16 +468,34 @@ }, { "comment": "Function call", - "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(", + "match": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(", "captures": { "1": { "name": "entity.name.function.rust" } } }, + { + "comment": "Function call with type parameters", + "begin": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*(::)(?=\\s*<.*>\\s*\\()", + "end": "\\(", + "captures": { + "1": { + "name": "entity.name.function.rust" + }, + "2": { + "name": "keyword.operator.misc.rust" + } + }, + "patterns": [ + { + "include": "#type_params" + } + ] + }, { "comment": "Function definition", - "begin": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "begin": "\\b(fn)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)", "end": "[\\{;]", "beginCaptures": { "1": { @@ -470,7 +553,7 @@ }, { "comment": "Function arguments", - "match": "fn", + "match": "\bfn\b", "name": "keyword.other.fn.rust" } ] @@ -564,59 +647,6 @@ "include": "#type_params" } ] - }, - { - "comment": "Implementation", - "begin": "\\b(impl)\\b", - "end": "\\{", - "beginCaptures": { - "1": { - "name": "storage.type.rust" - } - }, - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#sigils" - }, - { - "include": "#mut" - }, - { - "include": "#ref_lifetime" - }, - { - "include": "#core_types" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - }, - { - "include": "#where" - }, - { - "name": "storage.type.rust", - "match": "\\bfor\\b" - } - ] } - ], - "version": "https://github.com/zargony/atom-language-rust/commit/5e32388ed873683f3ccdea618c25d1ace8759608" + ] } \ No newline at end of file diff --git a/extensions/rust/test/colorize-results/test-6611_rs.json b/extensions/rust/test/colorize-results/test-6611_rs.json index 5136a3a57d5..6667e4fd311 100644 --- a/extensions/rust/test/colorize-results/test-6611_rs.json +++ b/extensions/rust/test/colorize-results/test-6611_rs.json @@ -11,7 +11,7 @@ } }, { - "c": " Foo", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -21,6 +21,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "Foo", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "", "t": "source.rust meta.type_params.rust", @@ -55,7 +66,7 @@ } }, { - "c": " A: B", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -65,6 +76,39 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "A", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, + { + "c": ": ", + "t": "source.rust", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "B", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "{ }", "t": "source.rust", @@ -88,7 +132,7 @@ } }, { - "c": " Foo", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -98,6 +142,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "Foo", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "", "t": "source.rust meta.type_params.rust", @@ -132,7 +187,7 @@ } }, { - "c": " C", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -142,6 +197,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "C", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": " ", "t": "source.rust", @@ -165,7 +231,7 @@ } }, { - "c": " A: B", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -175,6 +241,39 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "A", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, + { + "c": ": ", + "t": "source.rust", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "B", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "{ }", "t": "source.rust", @@ -198,7 +297,7 @@ } }, { - "c": " Foo", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -208,6 +307,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "Foo", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "", "t": "source.rust meta.type_params.rust", @@ -242,7 +352,7 @@ } }, { - "c": " C", + "c": " ", "t": "source.rust", "r": { "dark_plus": "default: #D4D4D4", @@ -252,6 +362,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "C", + "t": "source.rust entity.name.type.rust", + "r": { + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "entity.name.type: #4EC9B0" + } + }, { "c": "{", "t": "source.rust", @@ -304,7 +425,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -414,7 +535,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -513,7 +634,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -601,7 +722,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { diff --git a/extensions/rust/test/colorize-results/test_rs.json b/extensions/rust/test/colorize-results/test_rs.json index cc273390c62..977fe6bd28c 100644 --- a/extensions/rust/test/colorize-results/test_rs.json +++ b/extensions/rust/test/colorize-results/test_rs.json @@ -73,7 +73,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -106,7 +106,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -161,7 +161,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -304,7 +304,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -348,7 +348,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -436,7 +436,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -469,7 +469,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -524,7 +524,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { diff --git a/extensions/scss/syntaxes/scss.json b/extensions/scss/syntaxes/scss.json index 921c511a494..d60a4be60ed 100644 --- a/extensions/scss/syntaxes/scss.json +++ b/extensions/scss/syntaxes/scss.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-sass/blob/master/grammars/scss.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.css.scss", "name": "SCSS", "fileTypes": [ @@ -65,9 +70,6 @@ } ], "repository": { - "at_rule__": { - "comment": "Note how all @rules are prefixed." - }, "at_rule_charset": { "begin": "\\s*((@)charset\\b)\\s*", "captures": { @@ -78,7 +80,6 @@ "name": "punctuation.definition.keyword.scss" } }, - "comment": "Charset", "end": "\\s*((?=;|$))", "name": "meta.at-rule.charset.scss", "patterns": [ @@ -255,7 +256,6 @@ "name": "entity.name.function.scss" } }, - "comment": "Function with Attributes", "end": "\\s*(?={)", "name": "meta.at-rule.function.scss", "patterns": [ @@ -276,7 +276,6 @@ "name": "entity.name.function.scss" } }, - "comment": "Simple Function", "match": "\\s*((@)function\\b)\\s*", "name": "meta.at-rule.function.scss" } @@ -508,15 +507,68 @@ }, "name": "meta.at-rule.media.scss", "patterns": [ + { + "include": "#comment_block" + }, + { + "include": "#comment_line" + }, { "match": "\\b(only)\\b", "name": "keyword.control.operator" }, { - "include": "#media_features" - }, - { - "include": "#property_values" + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.media-query.begin.bracket.round.scss" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.media-query.end.bracket.round.scss" + } + }, + "name": "meta.property-list.media-query.scss", + "patterns": [ + { + "begin": "(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(])", - "name": "meta.attribute-selector.scss" + } }, "selector_class": { - "begin": "(\\.)(?=[\\w-]|#{)", - "beginCaptures": { + "match": "(?x)\n(\\.) # Valid class-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.class.css", + "captures": { "1": { "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.scss" + } + ] } - }, - "end": "(?![\\w-]|(#{))", - "name": "entity.other.attribute-name.class.css", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - "selector_entities": { - "match": "(?x)\n\\b\n(a|abbr|acronym|address|area|article|aside|audio|\nb|base|bdi|bdo|big|blockquote|body|br|button|\ncanvas|caption|circle|cite|code|col|colgroup|\ndata|datalist|dd|del|details|dfn|dialog|div|dl|dt|\nellipse|em|embed|eventsource|\nfieldset|figure|figcaption|footer|form|frame|frameset|\ng|\n(h[1-6])|head|header|hgroup|hr|html|\ni|iframe|img|image|input|ins|\nkbd|keygen|\nlabel|legend|li|line(?!-)|link|\nmain|map|mark|menu|menuitem|meta|meter|\nnav|noframes|noscript|\nobject(?!-)|ol|optgroup|option|output|\np|param|path|picture|polygon|polyline|pre|progress|\nq|\nrb|rect|rp|rt|rtc|ruby|\ns|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|svg|\ntable(?!-)|tbody|td|template|text(?!-)|textarea|textpath|tfoot|th|thead|time|title|tr|track|tspan|tt|\nu|ul|\nvar|video|\nwbr)\n\\b", - "name": "entity.name.tag.scss" + } }, "selector_custom": { - "match": "\\b([a-zA-Z0-9]+(-[a-zA-Z0-9]+)+)(?=\\.|\\s++[^:]|\\s*[,{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-(child|last-child|of-type|last-of-type)|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\([0-9A-Za-z]*\\))?)", + "match": "\\b([a-zA-Z0-9]+(-[a-zA-Z0-9]+)+)(?=\\.|\\s++[^:]|\\s*[,\\[{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-(child|last-child|of-type|last-of-type)|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\([0-9A-Za-z]*\\))?)", "name": "entity.name.tag.custom.scss" }, "selector_id": { + "match": "(?x)\n(\\#) # Valid id-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.id.css", "captures": { "1": { "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] } - }, - "match": "(#)[a-zA-Z][a-zA-Z0-9_-]*", - "name": "entity.other.attribute-name.id.css" + } }, "selector_placeholder": { + "match": "(?x)\n(%) # Valid placeholder-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.placeholder.css", "captures": { "1": { - "name": "punctuation.definition.entity.scss" + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] } - }, - "match": "(%)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.placeholder.scss" + } }, "parent_selector_suffix": { - "match": "(?<=&)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.parent-selector-suffix.scss" + "match": "(?x)\n(?<=&)\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.parent-selector-suffix.css", + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] + } + } }, "selector_pseudo_class": { "patterns": [ @@ -1494,9 +1520,12 @@ } }, "patterns": [ + { + "include": "#interpolation" + }, { "match": "\\d+", - "name": "constant.numeric.scss" + "name": "constant.numeric.css" }, { "match": "(?<=\\d)n\\b|\\b(n|even|odd)\\b", @@ -1509,32 +1538,14 @@ ] }, { - "match": "(?x)\n(:)\\b\n(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|\nindeterminate|root|first-child|last-child|first-of-type|last-of-type|\nonly-child|only-of-type|empty|not|valid|invalid)\\b", - "captures": { - "0": { - "name": "entity.other.attribute-name.pseudo-class.css" - }, - "1": { - "name": "punctuation.definition.entity.css" - } - } + "include": "source.css#pseudo-classes" } ] }, - "selector_pseudo_element": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(:+)((-(moz|webkit|ms)-)?(after|before|first-letter|first-line|selection))\\b", - "name": "entity.other.attribute-name.pseudo-element.css" - }, "selectors": { - "comment": "Stuff for Selectors.", "patterns": [ { - "include": "#selector_entities" + "include": "source.css#tag-names" }, { "include": "#selector_custom" @@ -1555,7 +1566,7 @@ "include": "#tag_parent_reference" }, { - "include": "#selector_pseudo_element" + "include": "source.css#pseudo-elements" }, { "include": "#selector_attribute" @@ -1668,6 +1679,5 @@ "match": "(\\$|\\-\\-)[A-Za-z0-9_-]+\\b", "name": "variable.scss" } - }, - "version": "https://github.com/atom/language-sass/commit/63b3aa0ed8f25b80a109c110bdfbd9950bd0df27" + } } \ No newline at end of file diff --git a/extensions/scss/test/colorize-results/test-cssvariables_scss.json b/extensions/scss/test/colorize-results/test-cssvariables_scss.json index 686e91d75e4..e51a05d345f 100644 --- a/extensions/scss/test/colorize-results/test-cssvariables_scss.json +++ b/extensions/scss/test/colorize-results/test-cssvariables_scss.json @@ -89,7 +89,7 @@ }, { "c": "6", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -100,7 +100,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -166,7 +166,7 @@ }, { "c": "(", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss punctuation.definition.begin.bracket.round.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -177,7 +177,7 @@ }, { "c": "4", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -227,7 +227,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -264,8 +264,19 @@ } }, { - "c": ");", - "t": "source.css.scss meta.property-list.scss", + "c": ")", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss punctuation.definition.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ";", + "t": "source.css.scss meta.property-list.scss punctuation.terminator.rule.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -287,13 +298,13 @@ }, { "c": "body", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -331,7 +342,7 @@ }, { "c": "padding-left", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -370,7 +381,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -386,7 +397,7 @@ }, { "c": "4", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -436,7 +447,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -485,7 +496,7 @@ }, { "c": "5", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -496,7 +507,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", diff --git a/extensions/scss/test/colorize-results/test_scss.json b/extensions/scss/test/colorize-results/test_scss.json index 3310661788d..ffcdbc7f034 100644 --- a/extensions/scss/test/colorize-results/test_scss.json +++ b/extensions/scss/test/colorize-results/test_scss.json @@ -95,7 +95,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -106,7 +106,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -254,7 +254,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -287,7 +287,7 @@ }, { "c": "97", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -298,7 +298,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -331,13 +331,13 @@ }, { "c": "p", - "t": "source.css.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -353,13 +353,13 @@ }, { "c": "div", - "t": "source.css.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -397,7 +397,7 @@ }, { "c": "font-size", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -430,7 +430,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -441,7 +441,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -474,13 +474,13 @@ }, { "c": "a", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -518,7 +518,7 @@ }, { "c": "font-weight", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -551,13 +551,13 @@ }, { "c": "bold", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -628,13 +628,13 @@ }, { "c": "pre", - "t": "source.css.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -672,7 +672,7 @@ }, { "c": "font-size", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -705,7 +705,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -716,7 +716,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -859,7 +859,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -892,13 +892,13 @@ }, { "c": "black", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -925,13 +925,13 @@ }, { "c": "a", - "t": "source.css.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -969,7 +969,7 @@ }, { "c": "font-weight", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -1002,13 +1002,13 @@ }, { "c": "bold", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -1101,7 +1101,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -1134,13 +1134,13 @@ }, { "c": "red", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -1299,13 +1299,13 @@ }, { "c": "font", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -1332,7 +1332,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1343,7 +1343,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1365,7 +1365,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1376,7 +1376,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1409,7 +1409,7 @@ }, { "c": "family", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -1453,7 +1453,7 @@ }, { "c": "size", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -1486,7 +1486,7 @@ }, { "c": "30", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1497,7 +1497,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1530,7 +1530,7 @@ }, { "c": "weight", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -1563,13 +1563,13 @@ }, { "c": "bold", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -1662,13 +1662,13 @@ }, { "c": "tr", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -1728,13 +1728,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -1805,13 +1805,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -1849,7 +1849,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1904,13 +1904,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -1937,7 +1937,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1948,7 +1948,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -2014,13 +2014,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -2113,13 +2113,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -2157,7 +2157,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2212,13 +2212,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -2278,7 +2278,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2465,13 +2465,13 @@ }, { "c": "body", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -2509,7 +2509,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -2542,13 +2542,13 @@ }, { "c": "black", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -2652,13 +2652,13 @@ }, { "c": "a", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -2696,7 +2696,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -2729,13 +2729,13 @@ }, { "c": "green", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -2839,7 +2839,7 @@ }, { "c": "5", - "t": "source.css.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2850,7 +2850,7 @@ }, { "c": "em", - "t": "source.css.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -3059,7 +3059,7 @@ }, { "c": "6", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3070,7 +3070,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -3103,7 +3103,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -3202,7 +3202,7 @@ }, { "c": "12", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3213,7 +3213,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -3279,7 +3279,7 @@ }, { "c": "30", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3290,7 +3290,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -3323,13 +3323,13 @@ }, { "c": "font", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -3362,7 +3362,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3384,7 +3384,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3406,7 +3406,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3428,7 +3428,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3532,13 +3532,13 @@ }, { "c": "border", - "t": "source.css.scss meta.set.variable.scss support.type.property-name.scss", + "t": "source.css.scss meta.set.variable.scss support.constant.property-value.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "support.constant.property-value: #CE9178", + "light_plus": "support.constant.property-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "support.constant.property-value: #0451A5", + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -3554,13 +3554,13 @@ }, { "c": "p", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -3582,7 +3582,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -3604,7 +3604,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -3648,7 +3648,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3670,11 +3670,11 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { - "c": "-", + "c": "-color", "t": "source.css.scss meta.property-list.scss meta.property-name.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -3684,17 +3684,6 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", - "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" - } - }, { "c": ":", "t": "source.css.scss meta.property-list.scss punctuation.separator.key-value.scss", @@ -3719,13 +3708,13 @@ }, { "c": "blue", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -3857,7 +3846,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -3873,7 +3862,7 @@ }, { "c": "100", - "t": "source.css.scss meta.set.variable.scss constant.numeric.color.rgb-value.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3906,7 +3895,7 @@ }, { "c": "100", - "t": "source.css.scss meta.set.variable.scss constant.numeric.color.rgb-value.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3939,7 +3928,7 @@ }, { "c": "225", - "t": "source.css.scss meta.set.variable.scss constant.numeric.color.rgb-value.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -3972,7 +3961,7 @@ }, { "c": "0.25", - "t": "source.css.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4060,13 +4049,13 @@ }, { "c": "p", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -4104,7 +4093,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -4137,7 +4126,7 @@ }, { "c": "(", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss punctuation.definition.begin.bracket.round.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -4148,7 +4137,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4159,7 +4148,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -4203,7 +4192,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4214,7 +4203,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -4224,8 +4213,19 @@ } }, { - "c": ") ", - "t": "source.css.scss meta.property-list.scss", + "c": ")", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss punctuation.definition.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -4236,18 +4236,40 @@ }, { "c": "*", - "t": "source.css.scss meta.property-list.scss entity.name.tag.wildcard.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.operator.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", - "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", - "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { - "c": " 3;", - "t": "source.css.scss meta.property-list.scss", + "c": " ", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "3", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #09885A", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #09885A", + "hc_black": "constant.numeric: #B5CEA8" + } + }, + { + "c": ";", + "t": "source.css.scss meta.property-list.scss punctuation.terminator.rule.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -4269,7 +4291,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -4302,24 +4324,24 @@ }, { "c": "#", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "010203", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -4357,24 +4379,24 @@ }, { "c": "#", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "040506", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -4401,7 +4423,7 @@ }, { "c": "font-family", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -4522,7 +4544,7 @@ }, { "c": "margin", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -4555,7 +4577,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4566,7 +4588,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -4610,7 +4632,7 @@ }, { "c": "4", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4621,7 +4643,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -4643,13 +4665,13 @@ }, { "c": "auto", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -4676,13 +4698,13 @@ }, { "c": "content", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -4737,12 +4759,12 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { "c": "5", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4759,7 +4781,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -4781,12 +4803,12 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { "c": "10", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4803,7 +4825,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -4852,7 +4874,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -4891,7 +4913,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4907,7 +4929,7 @@ }, { "c": "0", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4940,7 +4962,7 @@ }, { "c": "100", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4951,7 +4973,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -4984,7 +5006,7 @@ }, { "c": "50", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -4995,7 +5017,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -5039,7 +5061,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -5078,7 +5100,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -5111,7 +5133,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5127,7 +5149,7 @@ }, { "c": "0", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5177,7 +5199,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5193,7 +5215,7 @@ }, { "c": "100", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5204,7 +5226,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -5254,7 +5276,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5270,7 +5292,7 @@ }, { "c": "50", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5281,7 +5303,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -5391,7 +5413,7 @@ }, { "c": "40", - "t": "source.css.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5402,7 +5424,7 @@ }, { "c": "px", - "t": "source.css.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -5457,7 +5479,7 @@ }, { "c": "10", - "t": "source.css.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5468,7 +5490,7 @@ }, { "c": "px", - "t": "source.css.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -5496,7 +5518,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5507,7 +5529,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5529,7 +5551,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -5606,7 +5628,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5617,7 +5639,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5709,7 +5731,7 @@ } }, { - "c": " (", + "c": " ", "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -5719,6 +5741,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss punctuation.definition.begin.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "$n", "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss variable.scss", @@ -5765,7 +5798,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -5775,7 +5808,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss punctuation.definition.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -5897,7 +5941,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -5936,7 +5980,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -5952,7 +5996,7 @@ }, { "c": "5", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -6046,7 +6090,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6057,7 +6101,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6156,7 +6200,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -6233,7 +6277,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6244,7 +6288,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6310,7 +6354,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -6354,7 +6398,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -6376,7 +6420,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -6475,7 +6519,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6486,7 +6530,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6645,7 +6689,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -6678,7 +6722,7 @@ }, { "c": "300", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -6689,7 +6733,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -6728,7 +6772,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6739,7 +6783,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6761,7 +6805,7 @@ "light_plus": "support.constant.media: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.media: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.media: #CE9178" } }, { @@ -6787,7 +6831,7 @@ } }, { - "c": " (", + "c": " ", "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -6797,9 +6841,20 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss punctuation.definition.media-query.begin.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "orientation", - "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss support.type.property-name.media.css", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss meta.property-name.media-query.scss support.type.property-name.media.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -6809,8 +6864,19 @@ } }, { - "c": ": ", - "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss", + "c": ":", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss punctuation.separator.key-value.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -6821,17 +6887,28 @@ }, { "c": "landscape", - "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss meta.property-value.media-query.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", + "hc_black": "support.constant.property-value: #CE9178" + } + }, + { + "c": ")", + "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss meta.property-list.media-query.scss punctuation.definition.media-query.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } }, { - "c": ") ", + "c": " ", "t": "source.css.scss meta.property-list.scss meta.at-rule.media.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -6865,7 +6942,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -6898,7 +6975,7 @@ }, { "c": "500", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -6909,7 +6986,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -7052,7 +7129,7 @@ }, { "c": "border", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7085,7 +7162,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -7096,7 +7173,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -7118,24 +7195,24 @@ }, { "c": "#", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "f00", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -7162,7 +7239,7 @@ }, { "c": "background-color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7195,24 +7272,24 @@ }, { "c": "#", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "fdd", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -7300,7 +7377,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7311,11 +7388,11 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { - "c": " ", + "c": " .error", "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -7325,28 +7402,6 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": ".", - "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css punctuation.definition.entity.css", - "r": { - "dark_plus": "entity.other.attribute-name.class.css: #D7BA7D", - "light_plus": "entity.other.attribute-name.class.css: #800000", - "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", - "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" - } - }, - { - "c": "error", - "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css", - "r": { - "dark_plus": "entity.other.attribute-name.class.css: #D7BA7D", - "light_plus": "entity.other.attribute-name.class.css: #800000", - "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", - "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" - } - }, { "c": ";", "t": "source.css.scss meta.property-list.scss", @@ -7371,7 +7426,7 @@ }, { "c": "border-width", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7404,7 +7459,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -7415,7 +7470,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -7469,7 +7524,7 @@ } }, { - "c": " ", + "c": " a", "t": "source.css.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -7479,20 +7534,9 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": "a", - "t": "source.css.scss entity.name.tag.scss", - "r": { - "dark_plus": "entity.name.tag: #569CD6", - "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", - "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" - } - }, { "c": "%", - "t": "source.css.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss", + "t": "source.css.scss entity.other.attribute-name.placeholder.css punctuation.definition.entity.css", "r": { "dark_plus": "entity.other.attribute-name: #9CDCFE", "light_plus": "entity.other.attribute-name: #FF0000", @@ -7503,7 +7547,7 @@ }, { "c": "extreme", - "t": "source.css.scss entity.other.attribute-name.placeholder.scss", + "t": "source.css.scss entity.other.attribute-name.placeholder.css", "r": { "dark_plus": "entity.other.attribute-name: #9CDCFE", "light_plus": "entity.other.attribute-name: #FF0000", @@ -7547,7 +7591,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7580,13 +7624,13 @@ }, { "c": "blue", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -7613,7 +7657,7 @@ }, { "c": "font-weight", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7646,13 +7690,13 @@ }, { "c": "bold", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -7679,7 +7723,7 @@ }, { "c": "font-size", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -7712,7 +7756,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -7723,7 +7767,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -7817,7 +7861,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7828,7 +7872,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7844,7 +7888,7 @@ }, { "c": "%", - "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.placeholder.css punctuation.definition.entity.css", "r": { "dark_plus": "entity.other.attribute-name: #9CDCFE", "light_plus": "entity.other.attribute-name: #FF0000", @@ -7855,7 +7899,7 @@ }, { "c": "extreme", - "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.placeholder.css", "r": { "dark_plus": "entity.other.attribute-name: #9CDCFE", "light_plus": "entity.other.attribute-name: #FF0000", @@ -7949,7 +7993,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7960,7 +8004,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7993,7 +8037,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8004,7 +8048,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8026,7 +8070,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -8125,7 +8169,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8136,7 +8180,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8158,7 +8202,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -8235,7 +8279,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8246,7 +8290,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8290,7 +8334,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -8312,7 +8356,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -8394,7 +8438,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -8405,7 +8449,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -8510,7 +8554,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8521,7 +8565,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8543,7 +8587,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -8620,7 +8664,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8631,7 +8675,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8675,7 +8719,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -8697,7 +8741,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -8779,7 +8823,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -8790,7 +8834,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -8889,7 +8933,7 @@ }, { "c": "position", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -8922,13 +8966,13 @@ }, { "c": "relative", - "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -8955,7 +8999,7 @@ }, { "c": "left", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -9021,7 +9065,7 @@ }, { "c": "top", - "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -9153,13 +9197,13 @@ }, { "c": "p", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -9203,7 +9247,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9214,7 +9258,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9230,7 +9274,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9274,7 +9318,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9318,7 +9362,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9362,7 +9406,7 @@ }, { "c": "border", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -9395,7 +9439,7 @@ }, { "c": "1", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9406,7 +9450,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -9428,13 +9472,13 @@ }, { "c": "solid", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -9489,7 +9533,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9500,7 +9544,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9516,7 +9560,7 @@ }, { "c": "5", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9560,7 +9604,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9604,7 +9648,7 @@ }, { "c": "border", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -9637,7 +9681,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9648,7 +9692,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -9670,13 +9714,13 @@ }, { "c": "dotted", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -9731,7 +9775,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9742,33 +9786,11 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { - "c": " ", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "null", - "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss support.constant.property-value.scss", - "r": { - "dark_plus": "support.constant.property-value: #CE9178", - "light_plus": "support.constant.property-value: #0451A5", - "dark_vs": "default: #D4D4D4", - "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": " ", + "c": " null ", "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -9802,7 +9824,7 @@ }, { "c": "border", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -9835,7 +9857,7 @@ }, { "c": "3", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -9846,7 +9868,7 @@ }, { "c": "px", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -9868,13 +9890,13 @@ }, { "c": "double", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -10000,13 +10022,13 @@ }, { "c": "p", - "t": "source.css.scss entity.name.tag.scss", + "t": "source.css.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -10050,7 +10072,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10061,7 +10083,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10143,7 +10165,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -10176,13 +10198,13 @@ }, { "c": "blue", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -10237,7 +10259,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10248,7 +10270,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10275,7 +10297,7 @@ }, { "c": "color", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -10308,13 +10330,13 @@ }, { "c": "black", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -10402,7 +10424,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10413,7 +10435,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10457,7 +10479,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10473,7 +10495,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.for.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -10501,7 +10523,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10517,7 +10539,7 @@ }, { "c": "3", - "t": "source.css.scss meta.at-rule.for.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -10589,7 +10611,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -10611,7 +10633,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -10649,7 +10671,7 @@ }, { "c": "width", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -10682,7 +10704,7 @@ }, { "c": "2", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -10693,7 +10715,7 @@ }, { "c": "em", - "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -10831,7 +10853,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10842,7 +10864,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10886,7 +10908,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -10963,7 +10985,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -10985,7 +11007,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -11034,7 +11056,7 @@ }, { "c": "background-image", - "t": "source.css.scss meta.at-rule.each.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -11073,7 +11095,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -11117,7 +11139,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -11139,7 +11161,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -11276,7 +11298,7 @@ }, { "c": "6", - "t": "source.css.scss meta.at-rule.each.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -11304,7 +11326,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11315,7 +11337,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11375,7 +11397,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -11447,7 +11469,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -11469,7 +11491,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -11507,7 +11529,7 @@ }, { "c": "width", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -11540,7 +11562,7 @@ }, { "c": "2", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -11551,7 +11573,7 @@ }, { "c": "em", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -11727,7 +11749,7 @@ }, { "c": "2", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -11799,7 +11821,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11810,7 +11832,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11832,7 +11854,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -11942,7 +11964,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11953,7 +11975,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -11997,7 +12019,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12013,7 +12035,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.for.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -12041,7 +12063,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12107,7 +12129,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12118,11 +12140,11 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { - "c": " (", + "c": " ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12132,6 +12154,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss punctuation.definition.begin.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "unit", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss support.function.misc.scss", @@ -12140,7 +12173,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -12177,29 +12210,7 @@ } }, { - "c": " ", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "==", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss keyword.operator.comparison.scss", - "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" - } - }, - { - "c": " ", + "c": " == ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12243,7 +12254,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss punctuation.definition.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12265,7 +12287,7 @@ } }, { - "c": " (", + "c": " ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12275,6 +12297,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss punctuation.definition.begin.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "$i", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss variable.scss", @@ -12287,7 +12320,7 @@ } }, { - "c": " ", + "c": " == ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12298,19 +12331,8 @@ } }, { - "c": "==", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss keyword.operator.comparison.scss", - "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" - } - }, - { - "c": " (", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", + "c": "(", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss punctuation.definition.begin.bracket.round.scss", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -12365,7 +12387,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -12375,7 +12397,18 @@ } }, { - "c": ")) ", + "c": "))", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss punctuation.definition.end.bracket.round.scss", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -12442,7 +12475,7 @@ }, { "c": "100", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -12453,7 +12486,7 @@ }, { "c": "%", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -12492,7 +12525,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12503,7 +12536,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12624,7 +12657,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12635,7 +12668,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12723,7 +12756,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12734,7 +12767,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -12756,7 +12789,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -12794,13 +12827,13 @@ }, { "c": "font", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -12838,7 +12871,7 @@ }, { "c": "family", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -12871,13 +12904,13 @@ }, { "c": "Arial", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.font-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.font-name.css", "r": { "dark_plus": "support.constant.font-name: #CE9178", "light_plus": "support.constant.font-name: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.font-name: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.font-name: #CE9178" } }, { @@ -12904,7 +12937,7 @@ }, { "c": "size", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -12937,7 +12970,7 @@ }, { "c": "20", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -12948,7 +12981,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -12981,7 +13014,7 @@ }, { "c": "weight", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13014,13 +13047,13 @@ }, { "c": "bold", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -13069,7 +13102,7 @@ }, { "c": "color", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13102,24 +13135,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "ff0000", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -13207,7 +13240,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13218,7 +13251,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13240,7 +13273,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -13267,7 +13300,7 @@ }, { "c": "padding", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13300,7 +13333,7 @@ }, { "c": "4", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -13311,7 +13344,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -13383,7 +13416,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13394,7 +13427,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13416,7 +13449,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -13487,7 +13520,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -13498,7 +13531,7 @@ }, { "c": "in", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss constant.numeric.css keyword.other.unit.in.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -13553,7 +13586,7 @@ }, { "c": "border", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13597,7 +13630,7 @@ }, { "c": "color", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13663,7 +13696,7 @@ }, { "c": "width", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -13729,13 +13762,13 @@ }, { "c": "style", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -13762,13 +13795,13 @@ }, { "c": "dashed", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -13817,13 +13850,13 @@ }, { "c": "p", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -13867,7 +13900,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13878,7 +13911,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -13900,7 +13933,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -13916,13 +13949,13 @@ }, { "c": "blue", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -13999,7 +14032,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14010,7 +14043,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14032,7 +14065,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -14114,13 +14147,13 @@ }, { "c": "-moz-box-shadow", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.vendored.property-name.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "support.type.vendored.property-name: #9CDCFE", + "light_plus": "support.type.vendored.property-name: #FF0000", + "dark_vs": "support.type.vendored.property-name: #9CDCFE", + "light_vs": "support.type.vendored.property-name: #FF0000", + "hc_black": "support.type.vendored.property-name: #D4D4D4" } }, { @@ -14180,13 +14213,13 @@ }, { "c": "-webkit-box-shadow", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.vendored.property-name.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "support.type.vendored.property-name: #9CDCFE", + "light_plus": "support.type.vendored.property-name: #FF0000", + "dark_vs": "support.type.vendored.property-name: #9CDCFE", + "light_vs": "support.type.vendored.property-name: #FF0000", + "hc_black": "support.type.vendored.property-name: #D4D4D4" } }, { @@ -14246,7 +14279,7 @@ }, { "c": "box-shadow", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -14373,7 +14406,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14384,7 +14417,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14406,7 +14439,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -14422,7 +14455,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14433,7 +14466,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14455,7 +14488,7 @@ }, { "c": "4", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14466,7 +14499,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14488,7 +14521,7 @@ }, { "c": "5", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14499,7 +14532,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14521,24 +14554,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "666", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -14554,7 +14587,7 @@ }, { "c": "2", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14565,7 +14598,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14587,7 +14620,7 @@ }, { "c": "6", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14598,7 +14631,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14620,7 +14653,7 @@ }, { "c": "10", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -14631,7 +14664,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -14653,24 +14686,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "999", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -14747,7 +14780,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14758,7 +14791,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -14780,7 +14813,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -14895,7 +14928,7 @@ }, { "c": "color", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -14961,7 +14994,7 @@ }, { "c": "background-color", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -15027,7 +15060,7 @@ }, { "c": "border-color", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -15115,24 +15148,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "ff0000", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -15148,24 +15181,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "00ff00", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -15181,24 +15214,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "0000ff", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -15275,7 +15308,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15286,7 +15319,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15308,7 +15341,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -15418,7 +15451,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15429,7 +15462,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15451,7 +15484,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -15511,13 +15544,13 @@ }, { "c": "html", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -15561,7 +15594,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15616,7 +15649,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15627,7 +15660,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15649,7 +15682,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -15742,7 +15775,7 @@ }, { "c": "background-image", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -15781,7 +15814,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -15814,7 +15847,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -15880,7 +15913,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15891,7 +15924,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15957,7 +15990,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15968,7 +16001,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -15990,7 +16023,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -16105,13 +16138,13 @@ }, { "c": "=", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.attribute-selector.scss punctuation.separator.operator.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.attribute-selector.scss keyword.operator.scss", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { @@ -16127,13 +16160,13 @@ }, { "c": "external", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.attribute-selector.scss string.quoted.double.attribute-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.attribute-selector.scss", "r": { - "dark_plus": "string: #CE9178", - "light_plus": "string: #A31515", - "dark_vs": "string: #CE9178", - "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -16215,13 +16248,13 @@ }, { "c": "content", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -16342,7 +16375,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -16353,7 +16386,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -16375,7 +16408,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -16413,7 +16446,7 @@ }, { "c": "margin-left", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -16446,7 +16479,7 @@ }, { "c": "4", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -16457,7 +16490,7 @@ }, { "c": "cm", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.cm.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -16490,7 +16523,7 @@ }, { "c": "margin-right", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -16523,7 +16556,7 @@ }, { "c": "3", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -16534,7 +16567,7 @@ }, { "c": "cm", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.cm.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -16600,13 +16633,13 @@ }, { "c": "tr", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -16666,13 +16699,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -16765,7 +16798,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -16776,7 +16809,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -16820,13 +16853,13 @@ }, { "c": "white", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -16864,13 +16897,13 @@ }, { "c": "default", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.property-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.property-value.css", "r": { "dark_plus": "support.constant.property-value: #CE9178", "light_plus": "support.constant.property-value: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.property-value: #CE9178" } }, { @@ -16963,13 +16996,13 @@ }, { "c": "black", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.color.w3c-standard-color-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.constant.color.w3c-standard-color-name.css", "r": { "dark_plus": "support.constant.color: #CE9178", "light_plus": "support.constant.color: #0451A5", "dark_vs": "default: #D4D4D4", "light_vs": "support.constant.color: #0451A5", - "hc_black": "support.constant.color: #B5CEA8" + "hc_black": "support.constant.color: #CE9178" } }, { @@ -17029,7 +17062,7 @@ }, { "c": "margin-top", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -17051,7 +17084,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.set.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -17073,7 +17106,7 @@ }, { "c": "margin-bottom", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -17095,24 +17128,24 @@ }, { "c": "#", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss punctuation.definition.constant.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css punctuation.definition.constant.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { "c": "123", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.color.hex-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.other.color.rgb-value.hex.css", "r": { - "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", - "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", - "hc_black": "constant.numeric: #B5CEA8" + "dark_plus": "constant.other.color.rgb-value: #CE9178", + "light_plus": "constant.other.color.rgb-value: #0451A5", + "dark_vs": "default: #D4D4D4", + "light_vs": "constant.other.color.rgb-value: #0451A5", + "hc_black": "constant.other.color.rgb-value: #CE9178" } }, { @@ -17128,7 +17161,7 @@ }, { "c": "margin-top", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -17156,7 +17189,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -17172,7 +17205,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -17244,7 +17277,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17255,7 +17288,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17277,7 +17310,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -17314,7 +17347,7 @@ } }, { - "c": " ", + "c": " false", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.mixin.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -17324,17 +17357,6 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": "false", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.mixin.scss support.constant.property-value.scss", - "r": { - "dark_plus": "support.constant.property-value: #CE9178", - "light_plus": "support.constant.property-value: #0451A5", - "dark_vs": "default: #D4D4D4", - "light_vs": "support.constant.property-value: #0451A5", - "hc_black": "default: #FFFFFF" - } - }, { "c": ")", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.mixin.scss punctuation.definition.parameters.end.bracket.round.scss", @@ -17387,7 +17409,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17398,11 +17420,11 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { - "c": " ", + "c": " .", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -17412,31 +17434,20 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": ".", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css punctuation.definition.entity.css", - "r": { - "dark_plus": "entity.other.attribute-name.class.css: #D7BA7D", - "light_plus": "entity.other.attribute-name.class.css: #800000", - "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", - "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" - } - }, { "c": "#{", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css variable.interpolation.scss punctuation.definition.interpolation.begin.bracket.curly.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss variable.interpolation.scss punctuation.definition.interpolation.begin.bracket.curly.scss", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", - "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" } }, { "c": "$a", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css variable.interpolation.scss variable.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss variable.interpolation.scss variable.scss", "r": { "dark_plus": "variable.scss: #9CDCFE", "light_plus": "variable.scss: #FF0000", @@ -17447,13 +17458,13 @@ }, { "c": "}", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss entity.other.attribute-name.class.css variable.interpolation.scss punctuation.definition.interpolation.end.bracket.curly.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.import.scss variable.interpolation.scss punctuation.definition.interpolation.end.bracket.curly.scss", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", - "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" } }, { @@ -17486,7 +17497,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17497,7 +17508,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17519,7 +17530,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -17541,7 +17552,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -17612,13 +17623,13 @@ }, { "c": "a", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -17645,7 +17656,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -17656,7 +17667,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -17733,13 +17744,13 @@ }, { "c": "b", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "entity.name.tag: #569CD6", + "dark_plus": "entity.name.tag.css: #D7BA7D", "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", + "dark_vs": "entity.name.tag.css: #D7BA7D", "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6" + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { @@ -17766,7 +17777,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -17777,7 +17788,7 @@ }, { "c": "px", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss keyword.other.unit.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -17810,13 +17821,13 @@ }, { "c": "foo", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -17860,7 +17871,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17871,7 +17882,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -17893,7 +17904,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -18014,7 +18025,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -18025,7 +18036,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -18063,7 +18074,7 @@ }, { "c": "font-family", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -18129,7 +18140,7 @@ }, { "c": "src", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -18168,7 +18179,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -18322,7 +18333,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -18344,7 +18355,7 @@ "light_plus": "variable: #001080", "dark_vs": "entity.other.attribute-name.class.css: #D7BA7D", "light_vs": "entity.other.attribute-name.class.css: #800000", - "hc_black": "entity.other.attribute-name.class.css: #D7BA7D" + "hc_black": "variable: #9CDCFE" } }, { @@ -18399,7 +18410,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18421,11 +18432,11 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { - "c": "-", + "c": "-style", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { "dark_plus": "default: #D4D4D4", @@ -18435,17 +18446,6 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": "style", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", - "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" - } - }, { "c": ":", "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss punctuation.separator.key-value.scss", @@ -18470,7 +18470,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -18503,13 +18503,13 @@ }, { "c": "foo-", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -18520,7 +18520,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18542,7 +18542,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18569,7 +18569,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -18608,7 +18608,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18630,18 +18630,18 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { "c": "-bar-", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -18652,7 +18652,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18674,7 +18674,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18701,7 +18701,7 @@ }, { "c": "2", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -18734,13 +18734,13 @@ }, { "c": "foo-", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -18751,7 +18751,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -18773,18 +18773,18 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { "c": "-bar", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { @@ -18811,7 +18811,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -18883,7 +18883,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -18894,7 +18894,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -18976,7 +18976,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19009,7 +19009,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19108,7 +19108,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19141,7 +19141,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19202,7 +19202,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -19213,7 +19213,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -19295,7 +19295,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19328,7 +19328,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19427,7 +19427,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19460,7 +19460,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19526,13 +19526,13 @@ }, { "c": "-o-keyframes", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss invalid.illegal.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-name.scss support.type.vendored.property-name.css", "r": { - "dark_plus": "invalid: #F44747", - "light_plus": "invalid: #CD3131", - "dark_vs": "invalid: #F44747", - "light_vs": "invalid: #CD3131", - "hc_black": "invalid: #F44747" + "dark_plus": "support.type.vendored.property-name: #9CDCFE", + "light_plus": "support.type.vendored.property-name: #FF0000", + "dark_vs": "support.type.vendored.property-name: #9CDCFE", + "light_vs": "support.type.vendored.property-name: #FF0000", + "hc_black": "support.type.vendored.property-name: #D4D4D4" } }, { @@ -19614,7 +19614,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19647,7 +19647,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19724,7 +19724,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19757,7 +19757,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -19818,7 +19818,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -19829,7 +19829,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -19851,7 +19851,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -19933,7 +19933,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -19966,7 +19966,7 @@ }, { "c": "0", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -20065,7 +20065,7 @@ }, { "c": "opacity", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-name.scss support.type.property-name.css", "r": { "dark_plus": "support.type.property-name: #9CDCFE", "light_plus": "support.type.property-name: #FF0000", @@ -20098,7 +20098,7 @@ }, { "c": "1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -20208,18 +20208,18 @@ }, { "c": "=", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss punctuation.separator.operator.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss keyword.operator.scss", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { "c": "'", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss string.quoted.double.attribute-value.scss punctuation.definition.string.begin.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss string.quoted.single.attribute-value.scss punctuation.definition.string.begin.scss", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -20230,18 +20230,18 @@ }, { "c": "test-1", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss string.quoted.double.attribute-value.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss", "r": { - "dark_plus": "string: #CE9178", - "light_plus": "string: #A31515", - "dark_vs": "string: #CE9178", - "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "'", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss string.quoted.double.attribute-value.scss punctuation.definition.string.end.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.attribute-selector.scss string.quoted.single.attribute-value.scss punctuation.definition.string.end.scss", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -20318,13 +20318,13 @@ }, { "c": "content", - "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-name.scss support.type.property-name.scss", + "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss entity.name.tag.css", "r": { - "dark_plus": "support.type.property-name: #9CDCFE", - "light_plus": "support.type.property-name: #FF0000", - "dark_vs": "support.type.property-name: #9CDCFE", - "light_vs": "support.type.property-name: #FF0000", - "hc_black": "support.type.property-name: #D4D4D4" + "dark_plus": "entity.name.tag.css: #D7BA7D", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag.css: #D7BA7D", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag.css: #D7BA7D" } }, { diff --git a/extensions/shaderlab/syntaxes/shaderlab.json b/extensions/shaderlab/syntaxes/shaderlab.json index aad10f3b35a..8a293ee3347 100644 --- a/extensions/shaderlab/syntaxes/shaderlab.json +++ b/extensions/shaderlab/syntaxes/shaderlab.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/tgjones/shaders-tmLanguage/blob/master/grammars/shaderlab.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.shaderlab", "name": "ShaderLab", "fileTypes": [ @@ -93,6 +98,48 @@ "name": "keyword.other" } }, + "patterns": [ + { + "include": "#hlsl-embedded" + } + ] + }, + { + "name": "meta.hlslblock", + "begin": "\\b(HLSLPROGRAM|HLSLINCLUDE)\\b", + "beginCaptures": { + "1": { + "name": "keyword.other" + } + }, + "end": "\\b(ENDHLSL)\\b", + "endCaptures": { + "1": { + "name": "keyword.other" + } + }, + "patterns": [ + { + "include": "#hlsl-embedded" + } + ] + }, + { + "name": "string.quoted.double.shaderlab", + "begin": "\"", + "end": "\"" + } + ], + "repository": { + "numbers": { + "patterns": [ + { + "name": "constant.numeric.shaderlab", + "match": "\\b([0-9]+\\.?[0-9]*)\\b" + } + ] + }, + "hlsl-embedded": { "patterns": [ { "include": "source.hlsl" @@ -154,22 +201,6 @@ "match": "\\b(SurfaceOutputStandardSpecular|SurfaceOutputStandard|SurfaceOutput|Input)\\b" } ] - }, - { - "name": "string.quoted.double.shaderlab", - "begin": "\"", - "end": "\"" } - ], - "repository": { - "numbers": { - "patterns": [ - { - "name": "constant.numeric.shaderlab", - "match": "\\b([0-9]+\\.?[0-9]*)\\b" - } - ] - } - }, - "version": "https://github.com/tgjones/shaders-tmLanguage/commit/cd1ef40f549f9ce2b9e6b73498688de114a85382" + } } \ No newline at end of file diff --git a/extensions/shaderlab/test/colorize-results/test_shader.json b/extensions/shaderlab/test/colorize-results/test_shader.json index 2769b1e9713..7f731af089f 100644 --- a/extensions/shaderlab/test/colorize-results/test_shader.json +++ b/extensions/shaderlab/test/colorize-results/test_shader.json @@ -95,7 +95,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -238,7 +238,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -293,7 +293,7 @@ "light_plus": "support.variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.variable: #9CDCFE" } }, { @@ -359,7 +359,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -381,7 +381,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -425,7 +425,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -535,7 +535,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { diff --git a/extensions/shellscript/syntaxes/Shell-Unix-Bash.tmLanguage.json b/extensions/shellscript/syntaxes/Shell-Unix-Bash.tmLanguage.json index 21055f9d66b..1ac065388d8 100644 --- a/extensions/shellscript/syntaxes/Shell-Unix-Bash.tmLanguage.json +++ b/extensions/shellscript/syntaxes/Shell-Unix-Bash.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/shellscript.tmbundle/blob/master/Syntaxes/Shell-Unix-Bash.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "sh", "bash", @@ -1237,6 +1242,5 @@ } }, "scopeName": "source.shell", - "uuid": "DDEEA3ED-6B1C-11D9-8B10-000D93589AF6", - "version": "https://github.com/textmate/shellscript.tmbundle/commit/ba95d7b742caef130911d878f42f66bdd80181e4" + "uuid": "DDEEA3ED-6B1C-11D9-8B10-000D93589AF6" } \ No newline at end of file diff --git a/extensions/shellscript/test/colorize-results/test_sh.json b/extensions/shellscript/test/colorize-results/test_sh.json index 93acd4ac00c..3bb5e394f1e 100644 --- a/extensions/shellscript/test/colorize-results/test_sh.json +++ b/extensions/shellscript/test/colorize-results/test_sh.json @@ -29,7 +29,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -84,7 +84,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -95,7 +95,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -238,7 +238,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -260,7 +260,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -348,7 +348,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -458,7 +458,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -491,7 +491,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -502,7 +502,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -557,7 +557,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -590,7 +590,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -601,7 +601,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -623,7 +623,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -634,7 +634,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -656,7 +656,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -678,7 +678,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -821,7 +821,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -832,7 +832,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -887,7 +887,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -975,7 +975,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -986,7 +986,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1030,7 +1030,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1151,7 +1151,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1206,7 +1206,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1228,7 +1228,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1239,7 +1239,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1294,7 +1294,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1448,7 +1448,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1503,7 +1503,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1514,7 +1514,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1657,7 +1657,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1679,7 +1679,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1745,7 +1745,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1778,7 +1778,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1800,7 +1800,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1822,7 +1822,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1855,7 +1855,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1899,7 +1899,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1943,7 +1943,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -1954,7 +1954,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/sql/test/colorize-results/test_sql.json b/extensions/sql/test/colorize-results/test_sql.json index a17bd7e32f7..7b133d4de64 100644 --- a/extensions/sql/test/colorize-results/test_sql.json +++ b/extensions/sql/test/colorize-results/test_sql.json @@ -51,7 +51,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { diff --git a/extensions/swift/package.json b/extensions/swift/package.json index b8f262b4cff..a9139a22a6d 100644 --- a/extensions/swift/package.json +++ b/extensions/swift/package.json @@ -3,6 +3,9 @@ "version": "0.1.0", "publisher": "vscode", "engines": { "vscode": "*" }, + "scripts": { + "update-grammar": "node ../../build/npm/update-grammar.js freebroccolo/atom-language-swift grammars/swift.cson ./syntaxes/swift.tmLanguage.json" + }, "contributes": { "languages": [{ "id": "swift", @@ -13,7 +16,7 @@ "grammars": [{ "language": "swift", "scopeName": "source.swift", - "path": "./syntaxes/swift.json" + "path": "./syntaxes/swift.tmLanguage.json" }], "snippets": [{ "language": "swift", diff --git a/extensions/swift/syntaxes/swift.json b/extensions/swift/syntaxes/swift.json deleted file mode 100644 index ffd875717c6..00000000000 --- a/extensions/swift/syntaxes/swift.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "scopeName": "source.swift", - "fileTypes": [ - "swift" - ], - "name": "Swift", - "firstLineMatch": "^#!\\s*/.*\\bswift", - "patterns": [ - { - "name": "keyword.declaration.swift", - "match": "\\b(class|deinit|enum|extension|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b" - }, - { - "name": "keyword.statement.swift", - "match": "\\b(break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while)\\b" - }, - { - "name": "keyword.expressions-and-types.swift", - "match": "\\b(as|catch|dynamicType|false|is|nil|rethrows|super|self|Self|throw|throws|true|try|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\\b" - }, - { - "name": "keyword.patterns.swift", - "match": "\\b(_)\\b" - }, - { - "name": "keyword.primitive-datatypes.swift", - "match": "\\b(Int|UInt|String|Bool|Character|Optional|Float|Double)\\b" - }, - { - "name": "keyword.reserved.swift", - "match": "\\b(associativity|convenience|dynamic|didSet|final|get|infix|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet)\\b" - }, - { - "include": "#comment" - }, - { - "include": "#literal" - }, - { - "include": "#function" - }, - { - "include": "#operator" - }, - { - "include": "#attribute" - } - ], - "repository": { - "comment": { - "patterns": [ - { - "name": "comment.block.swift", - "begin": "/\\*", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.begin.swift" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.end.swift" - } - }, - "patterns": [ - { - "include": "#comment" - } - ] - }, - { - "begin": "(^[ \\t]+)?(?=//)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.swift" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "name": "comment.line.double-slash.swift", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.swift" - } - }, - "end": "\\n", - "patterns": [ - { - "name": "punctuation.separator.continuation.swift", - "match": "(?>\\\\\\s*\\n)" - } - ] - } - ] - } - ] - }, - "escaped-char": { - "patterns": [ - { - "name": "constant.character.escape.swift", - "match": "\\\\[0\\\\tnr\"']" - }, - { - "name": "constant.character.escape.swift", - "match": "\\\\(x\\h{2}|u\\h{4}|U\\h{8})" - }, - { - "name": "invalid.illegal.constant.character.escape.swift", - "match": "\\\\[^uxU]" - } - ] - }, - "identifier": { - "match": "(?x) (? \\g \\g? | ` \\g \\g? ` ){0} (? [ a-z A-Z ] | [ \\u00A8 \\u00AA \\u00AD \\u00AF \\u00B2-\\u00B5 \\u00B7-\\u00BA ] | [ \\u00BC-\\u00BE \\u00C0-\\u00D6 \\u00D8-\\u00F6 \\u00F8-\\u00FF ] | [ \\u0100-\\u02FF \\u0370-\\u167F \\u1681-\\u180D \\u180F-\\u1DBF ] | [ \\u1E00-\\u1FFF ] | [ \\u200B-\\u200D \\u202A-\\u202E \\u203F-\\u2040 \\u2054 \\u2060-\\u206F ] | [ \\u2070-\\u20CF \\u2100-\\u218F \\u2460-\\u24FF \\u2776-\\u2793 ] | [ \\u2C00-\\u2DFF \\u2E80-\\u2FFF ] | [ \\u3004-\\u3007 \\u3021-\\u302F \\u3031-\\u303F \\u3040-\\uD7FF ] | [ \\uF900-\\uFD3D \\uFD40-\\uFDCF \\uFDF0-\\uFE1F \\uFE30-\\uFE44 ] | [ \\uFE47-\\uFFFD ] | [ \\u10000-\\u1FFFD \\u20000-\\u2FFFD \\u30000-\\u3FFFD \\u40000-\\u4FFFD ] | [ \\u50000-\\u5FFFD \\u60000-\\u6FFFD \\u70000-\\u7FFFD \\u80000-\\u8FFFD ] | [ \\u90000-\\u9FFFD \\uA0000-\\uAFFFD \\uB0000-\\uBFFFD \\uC0000-\\uCFFFD ] | [ \\uD0000-\\uDFFFD \\uE0000-\\uEFFFD ] ){0} (? \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g ){0} (? \\g \\g? ){0} (? (?) \\$ \\d+ (?!\\g) (?# FIXME) ){0} \\g | \\g", - "captures": { - "5": { - "name": "variable.other.positional.swift" - } - } - }, - "literal": { - "patterns": [ - { - "include": "#literal-number" - }, - { - "include": "#literal-string" - }, - { - "include": "#literal-boolean" - } - ] - }, - "literal-number": { - "name": "constant.numeric.swift", - "match": "(?x) (?### INTEGER ###) (? \\g | \\g | \\g | \\g ){0} (?### BINARY ###) (? 0b \\g \\g? ){0} (? [0-1] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### OCTAL ###) (? 0o \\g \\g? ){0} (? [0-7] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### DECIMAL ###) (? \\g \\g? ){0} (? \\d ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### HEXADECIMAL ###) (? 0x \\g \\g? ){0} (? \\h ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### FLOATING POINT ###) (? \\g \\g? \\g? | \\g \\g? \\g ){0} (? \\. \\g ){0} (? \\g \\g? \\g ){0} (? \\. \\g? ){0} (? \\g \\g? \\g ){0} (? [eE] ){0} (? [pP] ){0} (? [+-] ){0} (?!0[box]) \\g | \\g" - }, - "literal-string": { - "name": "string.quoted.double.swift", - "begin": "\"", - "end": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.swift" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.swift" - } - }, - "patterns": [ - { - "include": "#quoted-text" - } - ] - }, - "literal-boolean": { - "match": "\\b(true|false)\\b(?![?!])", - "name": "constant.language.boolean.swift" - }, - "operator": { - "patterns": [ - { - "include": "#operator-character" - } - ] - }, - "operator-character": { - "name": "keyword.operator.swift", - "match": "[\\/=\\-+!*%<>&|^~.]" - }, - "quoted-text": { - "patterns": [ - { - "name": "meta.embedded.line.swift", - "contentName": "source.swift", - "begin": "\\\\\\(", - "end": "\\)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.swift" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.swift" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "include": "#escaped-char" - } - ] - }, - "function": { - "name": "meta.function.swift", - "begin": "(func) \\s*", - "end": "(?=\\{|#)|;|$", - "beginCaptures": { - "1": { - "name": "storage.type.function.swift" - } - }, - "comment": "match regular function like: func myFunc(...)", - "patterns": [ - { - "begin": "([a-zA-Z_0-9]+)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.swift" - }, - "2": { - "name": "punctuation.definition.parameters.begin.swift" - } - }, - "comment": "match regular function like: func myFunc(...)", - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.swift" - } - } - }, - { - "name": "meta.return-type.swift", - "match": "((->)\\s*([^\\{]+))", - "captures": { - "2": { - "name": "punctuation.function.swift" - }, - "3": { - "name": "entity.name.type.class.swift" - } - } - } - ] - }, - "whitespace": { - "match": "(?x) [ \\u0020 (?# space) \\u000A (?# line-feed) \\u000D (?# carriage-return) \\u0009 (?# horizontal-tab) \\u000B (?# vertical-tab) \\u000C (?# form-feed) \\u0000 (?# null) ]" - }, - "attribute": { - "name": "storage.type.attribute.swift", - "begin": "@", - "end": " " - } - } -} \ No newline at end of file diff --git a/extensions/swift/syntaxes/swift.tmLanguage.json b/extensions/swift/syntaxes/swift.tmLanguage.json new file mode 100644 index 00000000000..ea83040609c --- /dev/null +++ b/extensions/swift/syntaxes/swift.tmLanguage.json @@ -0,0 +1,221 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/freebroccolo/atom-language-swift/blob/master/grammars/swift.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "scopeName": "source.swift", + "fileTypes": [ + "swift" + ], + "name": "Swift", + "firstLineMatch": "^#!\\s*/.*\\bswift", + "patterns": [ + { + "name": "keyword.others.swift", + "match": "^\\s*(#if|#else|#endif|#elseif|@warn_unused_result|@discardableResult|@IBAction|@IBOutlet|@IBDesignable|@IBInspectable)\\b" + }, + { + "name": "keyword.declaration.swift", + "match": "\\b(deinit|import|init|subscript)\\b" + }, + { + "name": "storage.type.swift", + "match": "\\b(precedencegroup|class|struct|enum|extension|protocol|let|var|typealias)\\b" + }, + { + "name": "storage.modifier.swift", + "match": "\\b(final|internal|private|fileprivate|public|open|static|required|convenience)\\b" + }, + { + "name": "keyword.statement.swift", + "match": "\\b(try|catch|repeat|break|case|continue|default|do|else|fallthrough|if|in|for|return|switch|where|while|guard|defer)\\b" + }, + { + "name": "support.type.swift", + "match": "(?x) \\b(Character|U?Int|U?Int(8|16|32|64) |Float|Double|Float(32|64)|Bool|String|Date|Data|URL |(double|float)[234]|(double|float)[234]x[234] |Any |AnyObject |Error |Equatable |Hashable |Comparable |CustomDebugStringConvertible |CustomStringConvertible |OptionSet |ManagedBuffer |ManagedBufferPointer |BitwiseOperations |CountedSet |Counter |Directions |ExpressibleByArrayLiteral |ExpressibleByBooleanLiteral |ExpressibleByDictionaryLiteral |ExpressibleByExtendedGraphemeClusterLiteral |ExpressibleByFloatLitera |ExpressibleByIntegerLiteral |ExpressibleByNilLiteral |ExpressibleByStringInterpolation |ExpressibleByStringLiteral |ExpressibleByUnicodeScalarLiteral |OrderedSet |PaperSize |RawRepresentable |(UI|NS|CF|CG)[A-Z][a-zA-Z0-9]+ |Stream |(In|Out)putStream |FileManager |Array |Unsafe[a-zA-Z]*Pointer |Bundle |Jex)\\b" + }, + { + "name": "support.function.swift", + "match": "\\b(assert|assertionFailure|print)\\b" + }, + { + "name": "keyword.expressions-and-types.swift", + "match": "\\b(as|dynamicType|is|new|super|self|Self|Type|#column|#file|#function|#line)\\b" + }, + { + "name": "keyword.reserved.swift", + "match": "\\b(associativity|didSet|get|infix|inout|left|mutating|nonmutating|operator|override|postfix|precedence|prefix|right|set|unowned|unowned(safe)|unowned(unsafe)|weak|willSet)\\b" + }, + { + "name": "constant.language.swift", + "match": "\\b(true|false|nil|none)\\b" + }, + { + "name": "entity.name.function.swift", + "match": "\\bfunc\\s+([^\\t\\n\\x20\\x28]+)" + }, + { + "include": "#comment" + }, + { + "include": "#literal" + }, + { + "include": "#operator" + } + ], + "repository": { + "comment": { + "patterns": [ + { + "name": "comment.block.swift", + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.swift" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.swift" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.swift" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "name": "comment.line.double-slash.swift", + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.swift" + } + }, + "end": "\\n", + "patterns": [ + { + "name": "punctuation.separator.continuation.swift", + "match": "(?>\\\\\\s*\\n)" + } + ] + } + ] + } + ] + }, + "escaped-char": { + "patterns": [ + { + "name": "constant.character.escape.swift", + "match": "\\\\[0\\\\tnr\"']" + }, + { + "name": "constant.character.escape.swift", + "match": "\\\\(x\\h{2}|u\\h{4}|U\\h{8})" + }, + { + "name": "invalid.illegal.constant.character.escape.swift", + "match": "\\\\[^uxU]" + } + ] + }, + "identifier": { + "match": "(?x) (? \\g \\g? | ` \\g \\g? ` ){0} (? [ a-z A-Z ] | [ \\u00A8 \\u00AA \\u00AD \\u00AF \\u00B2-\\u00B5 \\u00B7-\\u00BA ] | [ \\u00BC-\\u00BE \\u00C0-\\u00D6 \\u00D8-\\u00F6 \\u00F8-\\u00FF ] | [ \\u0100-\\u02FF \\u0370-\\u167F \\u1681-\\u180D \\u180F-\\u1DBF ] | [ \\u1E00-\\u1FFF ] | [ \\u200B-\\u200D \\u202A-\\u202E \\u203F-\\u2040 \\u2054 \\u2060-\\u206F ] | [ \\u2070-\\u20CF \\u2100-\\u218F \\u2460-\\u24FF \\u2776-\\u2793 ] | [ \\u2C00-\\u2DFF \\u2E80-\\u2FFF ] | [ \\u3004-\\u3007 \\u3021-\\u302F \\u3031-\\u303F \\u3040-\\uD7FF ] | [ \\uF900-\\uFD3D \\uFD40-\\uFDCF \\uFDF0-\\uFE1F \\uFE30-\\uFE44 ] | [ \\uFE47-\\uFFFD ] | [ \\u10000-\\u1FFFD \\u20000-\\u2FFFD \\u30000-\\u3FFFD \\u40000-\\u4FFFD ] | [ \\u50000-\\u5FFFD \\u60000-\\u6FFFD \\u70000-\\u7FFFD \\u80000-\\u8FFFD ] | [ \\u90000-\\u9FFFD \\uA0000-\\uAFFFD \\uB0000-\\uBFFFD \\uC0000-\\uCFFFD ] | [ \\uD0000-\\uDFFFD \\uE0000-\\uEFFFD ] ){0} (? \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g ){0} (? \\g \\g? ){0} (? (?) \\$ \\d+ (?!\\g) (?# FIXME) ){0} \\g | \\g", + "captures": { + "5": { + "name": "variable.other.positional.swift" + } + } + }, + "literal": { + "patterns": [ + { + "include": "#literal-number" + }, + { + "include": "#literal-string" + } + ] + }, + "literal-number": { + "name": "constant.numeric.swift", + "match": "(?x) (?### INTEGER ###) (? \\g | \\g | \\g | \\g ){0} (?### BINARY ###) (? \\b 0b \\g \\g? \\b ){0} (? [0-1] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### OCTAL ###) (? \\b 0o \\g \\g? \\b ){0} (? [0-7] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### DECIMAL ###) (? \\b \\g \\g? \\b ){0} (? \\d ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### HEXADECIMAL ###) (? \\b 0x \\g \\g? \\b ){0} (? \\h ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### FLOATING POINT ###) (? \\b \\g \\g? \\g? \\b | \\b \\g \\g? \\g \\b ){0} (? \\. \\g ){0} (? \\g \\g? \\g ){0} (? \\. \\g? ){0} (? \\g \\g? \\g ){0} (? [eE] ){0} (? [pP] ){0} (? [+-] ){0} (?!0[box]) \\g | \\g" + }, + "literal-string": { + "name": "string.quoted.double.swift", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.swift" + } + }, + "patterns": [ + { + "include": "#quoted-text" + } + ] + }, + "operator": { + "patterns": [ + { + "include": "#operator-character" + } + ] + }, + "operator-character": { + "name": "keyword.operator.swift", + "match": "[\\/=\\-+!*%<>&|^~,\\?:\\[\\]]" + }, + "quoted-text": { + "patterns": [ + { + "name": "meta.embedded.line.swift", + "contentName": "source.swift", + "begin": "\\\\\\(", + "end": "\\)", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.swift" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.swift" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "#escaped-char" + } + ] + }, + "whitespace": { + "match": "(?x) [ \\u0020 (?# space) \\u000A (?# line-feed) \\u000D (?# carriage-return) \\u0009 (?# horizontal-tab) \\u000B (?# vertical-tab) \\u000C (?# form-feed) \\u0000 (?# null) ]" + } + } +} \ No newline at end of file diff --git a/extensions/swift/test/colorize-results/test_swift.json b/extensions/swift/test/colorize-results/test_swift.json index 2da06bcd479..cf3e2493522 100644 --- a/extensions/swift/test/colorize-results/test_swift.json +++ b/extensions/swift/test/colorize-results/test_swift.json @@ -1,13 +1,13 @@ [ { "c": "var", - "t": "source.swift keyword.declaration.swift", + "t": "source.swift storage.type.swift", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" } }, { @@ -56,13 +56,13 @@ }, { "c": "var", - "t": "source.swift keyword.declaration.swift", + "t": "source.swift storage.type.swift", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" } }, { @@ -132,41 +132,19 @@ } }, { - "c": "func", - "t": "source.swift meta.function.swift storage.type.function.swift", - "r": { - "dark_plus": "storage.type: #569CD6", - "light_plus": "storage.type: #0000FF", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" - } - }, - { - "c": " ", - "t": "source.swift meta.function.swift", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "hasAnyMatches", - "t": "source.swift meta.function.swift entity.name.function.swift", + "c": "func hasAnyMatches", + "t": "source.swift entity.name.function.swift", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { - "c": "(", - "t": "source.swift meta.function.swift punctuation.definition.parameters.begin.swift", + "c": "(list", + "t": "source.swift", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -176,30 +154,107 @@ } }, { - "c": "list: [Int], condition: (Int", - "t": "source.swift meta.function.swift", + "c": ":", + "t": "source.swift keyword.operator.swift", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": ")", - "t": "source.swift meta.function.swift punctuation.definition.parameters.end.swift", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { "c": " ", - "t": "source.swift meta.function.swift", + "t": "source.swift", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "[", + "t": "source.swift keyword.operator.swift", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": "Int", + "t": "source.swift support.type.swift", + "r": { + "dark_plus": "support.type: #4EC9B0", + "light_plus": "support.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.type: #4EC9B0" + } + }, + { + "c": "],", + "t": "source.swift keyword.operator.swift", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " condition", + "t": "source.swift", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ":", + "t": "source.swift keyword.operator.swift", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " (", + "t": "source.swift", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "Int", + "t": "source.swift support.type.swift", + "r": { + "dark_plus": "support.type: #4EC9B0", + "light_plus": "support.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.type: #4EC9B0" + } + }, + { + "c": ") ", + "t": "source.swift", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -210,39 +265,83 @@ }, { "c": "->", - "t": "source.swift meta.function.swift meta.return-type.swift punctuation.function.swift", + "t": "source.swift keyword.operator.swift", "r": { - "dark_plus": "meta.return-type: #4EC9B0", - "light_plus": "meta.return-type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { "c": " ", - "t": "source.swift meta.function.swift meta.return-type.swift", + "t": "source.swift", "r": { - "dark_plus": "meta.return-type: #4EC9B0", - "light_plus": "meta.return-type: #267F99", + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } }, { - "c": "Bool) -> Bool ", - "t": "source.swift meta.function.swift meta.return-type.swift entity.name.type.class.swift", + "c": "Bool", + "t": "source.swift support.type.swift", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", + "dark_plus": "support.type: #4EC9B0", + "light_plus": "support.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.type: #4EC9B0" + } + }, + { + "c": ") ", + "t": "source.swift", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } }, { - "c": "{", + "c": "->", + "t": "source.swift keyword.operator.swift", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " ", + "t": "source.swift", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "Bool", + "t": "source.swift support.type.swift", + "r": { + "dark_plus": "support.type: #4EC9B0", + "light_plus": "support.type: #267F99", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "support.type: #4EC9B0" + } + }, + { + "c": " {", "t": "source.swift", "r": { "dark_plus": "default: #D4D4D4", @@ -375,13 +474,13 @@ }, { "c": "true", - "t": "source.swift keyword.expressions-and-types.swift", + "t": "source.swift constant.language.swift", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" + "dark_plus": "constant.language: #569CD6", + "light_plus": "constant.language: #0000FF", + "dark_vs": "constant.language: #569CD6", + "light_vs": "constant.language: #0000FF", + "hc_black": "constant.language: #569CD6" } }, { @@ -441,13 +540,13 @@ }, { "c": "false", - "t": "source.swift keyword.expressions-and-types.swift", + "t": "source.swift constant.language.swift", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" + "dark_plus": "constant.language: #569CD6", + "light_plus": "constant.language: #0000FF", + "dark_vs": "constant.language: #569CD6", + "light_vs": "constant.language: #0000FF", + "hc_black": "constant.language: #569CD6" } }, { diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index aec2495fd14..a67dd83b89d 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -270,6 +270,9 @@ "inputValidation.errorBackground": "#A22D44", "inputValidation.errorBorder": "#AB395B", + "badge.background": "#0063a5", + "progressBar.background": "#0063a5", + "dropdown.background": "#181f2f", // "dropdown.foreground": "", // "dropdown.border": "", @@ -367,12 +370,11 @@ // Workbench: Activity Bar "activityBar.background": "#051336", // "activityBar.foreground": "", - "activityBarBadge.background": "#0063a5", + // "activityBarBadge.background": "", // "activityBarBadge.foreground": "", // "activityBar.dropBackground": "", // Workbench: Panel - // "panel.background": "", "panel.border": "#2b2b4a", // "panelTitle.activeBorder": "", // "panelTitle.activeForeground": "", diff --git a/extensions/theme-defaults/themes/dark_defaults.json b/extensions/theme-defaults/themes/dark_defaults.json index 690098711f9..e15677c62c8 100644 --- a/extensions/theme-defaults/themes/dark_defaults.json +++ b/extensions/theme-defaults/themes/dark_defaults.json @@ -2,11 +2,13 @@ "$schema": "vscode://schemas/color-theme", "name": "Dark Default Colors", "colors": { - "editor.background": "#1e1e1e", + "editor.background": "#1E1E1E", "editor.foreground": "#D4D4D4", "editor.inactiveSelectionBackground": "#3A3D41", "editorIndentGuide.background": "#404040", - "editor.selectionHighlightBackground": "#add6ff26", - "list.dropBackground": "#383B3D" + "editor.selectionHighlightBackground": "#ADD6FF26", + "list.dropBackground": "#383B3D", + "activityBarBadge.background": "#007ACC", + "sideBarTitle.foreground": "#BBBBBB" } } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/dark_vs.json b/extensions/theme-defaults/themes/dark_vs.json index 08b4ecfee9b..827f59892d8 100644 --- a/extensions/theme-defaults/themes/dark_vs.json +++ b/extensions/theme-defaults/themes/dark_vs.json @@ -302,8 +302,8 @@ }, { "scope": [ - "punctuation.section.embedded.begin.metatag.php", - "punctuation.section.embedded.end.metatag.php" + "punctuation.section.embedded.begin.php", + "punctuation.section.embedded.end.php" ], "settings": { "foreground": "#569cd6" @@ -325,6 +325,7 @@ "name": "coloring of the Java import and package identifiers", "scope": [ "storage.modifier.import.java", + "variable.language.wildcard.java", "storage.modifier.package.java" ], "settings": { diff --git a/extensions/theme-defaults/themes/hc_black.json b/extensions/theme-defaults/themes/hc_black.json index 4fb65f26e8b..5cadf6c65cf 100644 --- a/extensions/theme-defaults/themes/hc_black.json +++ b/extensions/theme-defaults/themes/hc_black.json @@ -2,310 +2,108 @@ "$schema": "vscode://schemas/color-theme", "name": "Dark High Contrast", "include": "./hc_black_defaults.json", - "settings": [ - { - "settings": { - "foreground": "#FFFFFF", - "background": "#000000" - } - }, - { - "scope": "emphasis", - "settings": { - "fontStyle": "italic" - } - }, - { - "scope": "strong", - "settings": { - "fontStyle": "bold" - } - }, - { - "scope": "meta.diff.header", - "settings": { - "foreground": "#000080" - } - }, - - { - "scope": "comment", - "settings": { - "foreground": "#7ca668" - } - }, - { - "scope": "constant.language", - "settings": { - "foreground": "#569cd6" - } - }, + "colors": { + "selection.background": "#008000", + "editor.selectionBackground": "#FFFFFF" + }, + "tokenColors": [ { + "name": "Function declarations", "scope": [ - "constant.numeric", + "entity.name.function", + "support.function", + "support.constant.handlebars" + ], + "settings": { + "foreground": "#DCDCAA" + } + }, + { + "name": "Types declaration and references", + "scope": [ + "meta.return-type", + "support.class", + "support.type", + "entity.name.type", + "entity.name.class", + "storage.type.cs", + "storage.type.generic.cs", + "storage.type.modifier.cs", + "storage.type.variable.cs", + "storage.type.annotation.java", + "storage.type.generic.java", + "storage.type.java", + "storage.type.object.array.java", + "storage.type.primitive.array.java", + "storage.type.primitive.java", + "storage.type.token.java", + "storage.type.groovy", + "storage.type.annotation.groovy", + "storage.type.parameters.groovy", + "storage.type.generic.groovy", + "storage.type.object.array.groovy", + "storage.type.primitive.array.groovy", + "storage.type.primitive.groovy" + ], + "settings": { + "foreground": "#4EC9B0" + } + }, + { + "name": "Types declaration and references, TS grammar specific", + "scope": [ + "meta.type.cast.expr", + "meta.type.new.expr", + "support.constant.math", + "support.constant.dom", + "support.constant.json", + "entity.other.inherited-class" + ], + "settings": { + "foreground": "#4EC9B0" + } + }, + { + "name": "Control flow keywords", + "scope": "keyword.control", + "settings": { + "foreground": "#C586C0" + } + }, + { + "name": "Variable and parameter name", + "scope": [ + "variable", + "meta.definition.variable.name", + "support.variable" + ], + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "name": "Object keys, TS grammar specific", + "scope": [ + "meta.object-literal.key", + "meta.object-literal.key entity.name.function" + ], + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "name": "CSS property value", + "scope": [ + "support.constant.property-value", + "support.constant.font-name", + "support.constant.media-type", + "support.constant.media", "constant.other.color.rgb-value", "constant.other.rgb-value", "support.constant.color" ], "settings": { - "foreground": "#b5cea8" - } - }, - { - "scope": "constant.regexp", - "settings": { - "foreground": "#b46695" - } - }, - { - "scope": "entity.name.tag", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "entity.name.tag.css", - "settings": { - "foreground": "#d7ba7d" - } - }, - { - "scope": "entity.other.attribute-name", - "settings": { - "foreground": "#9cdcfe" - } - }, - { - "scope": [ - "entity.other.attribute-name.class.css", - "entity.other.attribute-name.class.mixin.css", - "entity.other.attribute-name.id.css", - "entity.other.attribute-name.parent-selector.css", - "entity.other.attribute-name.pseudo-class.css", - "entity.other.attribute-name.pseudo-element.css", - - "source.css.less entity.other.attribute-name.id", - - "entity.other.attribute-name.attribute.scss", - "entity.other.attribute-name.scss" - ], - "settings": { - "foreground": "#d7ba7d" - } - }, - { - "scope": "invalid", - "settings": { - "foreground": "#f44747" - } - }, - { - "scope": "markup.underline", - "settings": { - "fontStyle": "underline" - } - }, - { - "scope": "markup.bold", - "settings": { - "fontStyle": "bold" - } - }, - { - "scope": "markup.heading", - "settings": { - "foreground": "#6796e6" - } - }, - { - "scope": "markup.italic", - "settings": { - "fontStyle": "italic" - } - }, - { - "scope": "markup.inserted", - "settings": { - "foreground": "#b5cea8" - } - }, - { - "scope": "markup.deleted", - "settings": { - "foreground": "#ce9178" - } - }, - { - "scope": "markup.changed", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "meta.selector", - "settings": { - "foreground": "#d7ba7d" - } - }, - { - "name": "brackets of XML/HTML tags", - "scope": [ - "punctuation.definition.tag" - ], - "settings": { - "foreground": "#808080" - } - }, - { - "scope": "meta.preprocessor", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "meta.preprocessor.string", - "settings": { - "foreground": "#ce9178" - } - }, - { - "scope": "meta.preprocessor.numeric", - "settings": { - "foreground": "#b5cea8" - } - }, - { - "scope": "meta.structure.dictionary.key.python", - "settings": { - "foreground": "#9cdcfe" - } - }, - { - "scope": "storage", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "storage.type", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "storage.modifier", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "string", - "settings": { - "foreground": "#ce9178" - } - }, - { - "scope": "string.tag", - "settings": { - "foreground": "#ce9178" - } - }, - { - "scope": "string.value", - "settings": { - "foreground": "#ce9178" - } - }, - { - "scope": "string.regexp", - "settings": { - "foreground": "#d16969" - } - }, - { - "name": "JavaScript string interpolation ${}", - "scope": [ - "punctuation.definition.template-expression.begin.js", - "punctuation.definition.template-expression.begin.ts", - "punctuation.definition.template-expression.end.ts", - "punctuation.definition.template-expression.end.js" - ], - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": [ - "support.type.vendored.property-name", - "support.type.property-name", - "variable.css", - "variable.scss", - "variable.other.less" - ], - "settings": { - "foreground": "#d4d4d4" - } - }, - { - "scope": "keyword", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "keyword.control", - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "keyword.operator", - "settings": { - "foreground": "#d4d4d4" - } - }, - { - "scope": [ - "keyword.operator.new", - "keyword.operator.expression", - "keyword.operator.cast", - "keyword.operator.sizeof", - "keyword.operator.logical.python" - ], - "settings": { - "foreground": "#569cd6" - } - }, - { - "scope": "keyword.other.unit", - "settings": { - "foreground": "#b5cea8" - } - }, - { - "scope": "support.function.git-rebase", - "settings": { - "foreground": "#d4d4d4" - } - }, - { - "scope": "constant.sha.git-rebase", - "settings": { - "foreground": "#b5cea8" - } - }, - { - "name": "coloring of the Java import and package identifiers", - "scope": ["storage.modifier.import.java", "storage.modifier.package.java"], - "settings": { - "foreground": "#d4d4d4" - } - }, - { - "name": "coloring of the TS this", - "scope": "variable.language.this", - "settings": { - "foreground": "#569cd6" + "foreground": "#CE9178" } } ] diff --git a/extensions/theme-defaults/themes/hc_black_defaults.json b/extensions/theme-defaults/themes/hc_black_defaults.json index ceda83b4465..e1326f20ea2 100644 --- a/extensions/theme-defaults/themes/hc_black_defaults.json +++ b/extensions/theme-defaults/themes/hc_black_defaults.json @@ -4,6 +4,318 @@ "colors": { "editor.background": "#000000", "editor.foreground": "#FFFFFF", - "editorIndentGuide.background": "#FFFFFF" - } + "editorIndentGuide.background": "#FFFFFF", + "sideBarTitle.foreground": "#FFFFFF" + }, + "settings": [ + { + "settings": { + "foreground": "#FFFFFF", + "background": "#000000" + } + }, + { + "scope": "emphasis", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "strong", + "settings": { + "fontStyle": "bold" + } + }, + { + "scope": "meta.diff.header", + "settings": { + "foreground": "#000080" + } + }, + + { + "scope": "comment", + "settings": { + "foreground": "#7ca668" + } + }, + { + "scope": "constant.language", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": [ + "constant.numeric", + "constant.other.color.rgb-value", + "constant.other.rgb-value", + "support.constant.color" + ], + "settings": { + "foreground": "#b5cea8" + } + }, + { + "scope": "constant.regexp", + "settings": { + "foreground": "#b46695" + } + }, + { + "scope": "entity.name.tag", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "entity.name.tag.css", + "settings": { + "foreground": "#d7ba7d" + } + }, + { + "scope": "entity.other.attribute-name", + "settings": { + "foreground": "#9cdcfe" + } + }, + { + "scope": [ + "entity.other.attribute-name.class.css", + "entity.other.attribute-name.class.mixin.css", + "entity.other.attribute-name.id.css", + "entity.other.attribute-name.parent-selector.css", + "entity.other.attribute-name.pseudo-class.css", + "entity.other.attribute-name.pseudo-element.css", + + "source.css.less entity.other.attribute-name.id", + + "entity.other.attribute-name.attribute.scss", + "entity.other.attribute-name.scss" + ], + "settings": { + "foreground": "#d7ba7d" + } + }, + { + "scope": "invalid", + "settings": { + "foreground": "#f44747" + } + }, + { + "scope": "markup.underline", + "settings": { + "fontStyle": "underline" + } + }, + { + "scope": "markup.bold", + "settings": { + "fontStyle": "bold" + } + }, + { + "scope": "markup.heading", + "settings": { + "foreground": "#6796e6" + } + }, + { + "scope": "markup.italic", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "markup.inserted", + "settings": { + "foreground": "#b5cea8" + } + }, + { + "scope": "markup.deleted", + "settings": { + "foreground": "#ce9178" + } + }, + { + "scope": "markup.changed", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "meta.selector", + "settings": { + "foreground": "#d7ba7d" + } + }, + { + "name": "brackets of XML/HTML tags", + "scope": [ + "punctuation.definition.tag" + ], + "settings": { + "foreground": "#808080" + } + }, + { + "scope": "meta.preprocessor", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "meta.preprocessor.string", + "settings": { + "foreground": "#ce9178" + } + }, + { + "scope": "meta.preprocessor.numeric", + "settings": { + "foreground": "#b5cea8" + } + }, + { + "scope": "meta.structure.dictionary.key.python", + "settings": { + "foreground": "#9cdcfe" + } + }, + { + "scope": "storage", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "storage.type", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "storage.modifier", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "string", + "settings": { + "foreground": "#ce9178" + } + }, + { + "scope": "string.tag", + "settings": { + "foreground": "#ce9178" + } + }, + { + "scope": "string.value", + "settings": { + "foreground": "#ce9178" + } + }, + { + "scope": "string.regexp", + "settings": { + "foreground": "#d16969" + } + }, + { + "name": "JavaScript string interpolation ${}", + "scope": [ + "punctuation.definition.template-expression.begin.js", + "punctuation.definition.template-expression.begin.ts", + "punctuation.definition.template-expression.end.ts", + "punctuation.definition.template-expression.end.js" + ], + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": [ + "support.type.vendored.property-name", + "support.type.property-name", + "variable.css", + "variable.scss", + "variable.other.less" + ], + "settings": { + "foreground": "#d4d4d4" + } + }, + { + "scope": "keyword", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "keyword.control", + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "keyword.operator", + "settings": { + "foreground": "#d4d4d4" + } + }, + { + "scope": [ + "keyword.operator.new", + "keyword.operator.expression", + "keyword.operator.cast", + "keyword.operator.sizeof", + "keyword.operator.logical.python" + ], + "settings": { + "foreground": "#569cd6" + } + }, + { + "scope": "keyword.other.unit", + "settings": { + "foreground": "#b5cea8" + } + }, + { + "scope": "support.function.git-rebase", + "settings": { + "foreground": "#d4d4d4" + } + }, + { + "scope": "constant.sha.git-rebase", + "settings": { + "foreground": "#b5cea8" + } + }, + { + "name": "coloring of the Java import and package identifiers", + "scope": [ + "storage.modifier.import.java", + "variable.language.wildcard.java", + "storage.modifier.package.java" + ], + "settings": { + "foreground": "#d4d4d4" + } + }, + { + "name": "coloring of the TS this", + "scope": "variable.language.this", + "settings": { + "foreground": "#569cd6" + } + } + ] } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/light_defaults.json b/extensions/theme-defaults/themes/light_defaults.json index 091fb560b5e..ad85f382140 100644 --- a/extensions/theme-defaults/themes/light_defaults.json +++ b/extensions/theme-defaults/themes/light_defaults.json @@ -2,11 +2,13 @@ "$schema": "vscode://schemas/color-theme", "name": "Light Default Colors", "colors": { - "editor.background": "#ffffff", + "editor.background": "#FFFFFF", "editor.foreground": "#000000", "editor.inactiveSelectionBackground": "#E5EBF1", - "editorIndentGuide.background": "#d3d3d3", - "editor.selectionHighlightBackground": "#add6ff4d", - "editorSuggestWidget.background": "#F3F3F3" + "editorIndentGuide.background": "#D3D3D3", + "editor.selectionHighlightBackground": "#ADD6FF4D", + "editorSuggestWidget.background": "#F3F3F3", + "activityBarBadge.background": "#007ACC", + "sideBarTitle.foreground": "#6F6F6F" } } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/light_vs.json b/extensions/theme-defaults/themes/light_vs.json index b97b25eecd8..1c294607f60 100644 --- a/extensions/theme-defaults/themes/light_vs.json +++ b/extensions/theme-defaults/themes/light_vs.json @@ -318,8 +318,8 @@ }, { "scope": [ - "punctuation.section.embedded.begin.metatag.php", - "punctuation.section.embedded.end.metatag.php" + "punctuation.section.embedded.begin.php", + "punctuation.section.embedded.end.php" ], "settings": { "foreground": "#800000" @@ -341,6 +341,7 @@ "name": "coloring of the Java import and package identifiers", "scope": [ "storage.modifier.import.java", + "variable.language.wildcard.java", "storage.modifier.package.java" ], "settings": { diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index f98364ce67d..7de6b3fd42e 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -26,7 +26,6 @@ "statusBar.noFolderBackground": "#423523", "activityBar.background": "#221a0f", "activityBar.foreground": "#d3af86", - "activityBarBadge.background": "#7f5d38", "sideBar.background": "#362712", "editor.lineHighlightBackground": "#5e452b", "editorCursor.foreground": "#d3af86", @@ -43,7 +42,9 @@ "inputValidation.warningBackground": "#51412c", // "inputValidation.warningBorder": "#5B7E7A", "inputValidation.errorBackground": "#5f0d0d", - "inputValidation.errorBorder": "#9d2f23" + "inputValidation.errorBorder": "#9d2f23", + "badge.background": "#7f5d38", + "progressBar.background": "#7f5d38" }, "tokenColors": [ { @@ -368,7 +369,7 @@ "variable.interpolation" ], "settings": { - "foreground": "#18401e" + "foreground": "#088649" } }, { diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json index 4b598c44ec0..68aeef661f0 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json @@ -1,38 +1,41 @@ { "type": "dark", "colors": { - "dropdown.background": "#383852", - "list.activeSelectionBackground": "#303070", - "list.focusBackground": "#425370", - "list.inactiveSelectionBackground": "#23324e", - "list.hoverBackground": "#005070", + "dropdown.background": "#525252", + "list.activeSelectionBackground": "#707070", + "list.focusBackground": "#707070", + "list.inactiveSelectionBackground": "#4e4e4e", + "list.hoverBackground": "#707070", "list.highlightForeground": "#e58520", - "button.background": "#1e4456", - "editor.background": "#202025", + "button.background": "#565656", + "editor.background": "#1e1e1e", "editor.foreground": "#c5c8c6", "editor.selectionBackground": "#373b41", "editor.lineHighlightBackground": "#303030", "editorCursor.foreground": "#c07020", - "editorWhitespace.foreground": "#383880", + "editorWhitespace.foreground": "#505037", "editorIndentGuide.background": "#505037", - "editorGroupHeader.tabsBackground": "#222228", - "editorGroup.background": "#1a1a1e", - "tab.inactiveBackground": "#333340", - "tab.border": "#000030", + "editorGroupHeader.tabsBackground": "#282828", + "editorGroup.background": "#1e1e1e", + "tab.inactiveBackground": "#404040", + "tab.border": "#303030", + "tab.inactiveForeground": "#d8d8d8", "peekView.border": "#3655b5", - "panelTitle.activeForeground": "#ddffff", - "statusBar.background": "#354550", - "statusBar.debuggingBackground": "#354550", - "statusBar.noFolderBackground": "#354550", - "titleBar.activeBackground": "#354550", - "activityBar.background": "#292935", + "panelTitle.activeForeground": "#ffffff", + "statusBar.background": "#505050", + "statusBar.debuggingBackground": "#505050", + "statusBar.noFolderBackground": "#505050", + "titleBar.activeBackground": "#505050", + "activityBar.background": "#353535", "activityBar.foreground": "#ffffff", "activityBarBadge.background": "#3655b5", - "sideBar.background": "#232327", - "sideBarSectionHeader.background": "#424250", - "notification.background": "#292935", - "pickerGroup.foreground": "#77a5b0", - "terminal.ansiWhite": "#ddffff" + "sideBar.background": "#272727", + "sideBarSectionHeader.background": "#505050", + "notification.background": "#353535", + "pickerGroup.foreground": "#b0b0b0", + "terminal.ansiWhite": "#ffffff", + "inputOption.activeBorder": "#3655b5", + "focusBorder": "#3655b5" }, "tokenColors": [ { diff --git a/extensions/theme-monokai/themes/monokai-color-theme.json b/extensions/theme-monokai/themes/monokai-color-theme.json index 3f9ea01f819..439bf32d607 100644 --- a/extensions/theme-monokai/themes/monokai-color-theme.json +++ b/extensions/theme-monokai/themes/monokai-color-theme.json @@ -1,14 +1,20 @@ +// This theme's colors are based on the original Monokai: +// #1e1f1c (tab well, borders) +// #272822 (editor background) +// #414339 (selection) +// #75715e (focus) +// #f8f8f2 (editor foreground) { "type": "dark", "colors": { "dropdown.background": "#414339", - "list.activeSelectionBackground": "#f92672", + "list.activeSelectionBackground": "#75715E", "list.focusBackground": "#414339", "list.inactiveSelectionBackground": "#414339", "list.hoverBackground": "#272822", "list.dropBackground": "#414339", - "list.highlightForeground": "#f92672", - "button.background": "#f92672", + "list.highlightForeground": "#f8f8f2", + "button.background": "#75715E", "editor.background": "#272822", "editor.foreground": "#f8f8f2", "editor.selectionBackground": "#49483e", @@ -22,35 +28,43 @@ "tab.border": "#1e1f1c", "tab.inactiveForeground": "#ccccc7", // needs to be bright so it's readable when another editor group is focused "widget.shadow": "#1e1f1c", + "progressBar.background": "#75715E", + "badge.background": "#75715E", + "badge.foreground": "#f8f8f2", "editorLineNumber.foreground": "#90908a", "panelTitle.activeForeground": "#f8f8f2", - "panelTitle.activeBorder": "#f92672", - "panelTitle.inactiveForeground": "#75715E", // comment color + "panelTitle.activeBorder": "#75715E", + "panelTitle.inactiveForeground": "#75715E", "panel.border": "#414339", + "titleBar.activeBackground": "#414339", "statusBar.background": "#414339", "statusBar.noFolderBackground": "#414339", - "statusBar.debuggingBackground": "#f92672", + "statusBar.debuggingBackground": "#75715E", "activityBar.background": "#272822", - "activityBarBadge.foreground": "#f8f8f2", - "activityBarBadge.background": "#f92672", "activityBar.foreground": "#f8f8f2", "activityBar.dropBackground": "#414339", "sideBar.background": "#1e1f1c", "sideBarSectionHeader.background": "#272822", - "notification.foreground": "#1e1f1c", - "pickerGroup.foreground": "#f92672", + "pickerGroup.foreground": "#75715E", "input.background": "#414339", - "focusBorder": "#f92672", + "inputOption.activeBorder": "#75715E", + "focusBorder": "#75715E", "editorWidget.background": "#1e1f1c", "debugToolBar.background": "#1e1f1c", "diffEditor.insertedTextBackground": "#66852880", // middle of #272822 and #a6e22e - "diffEditor.removedTextBackground": "#90274A80", // middle of f92672 and #a6e22e + "diffEditor.removedTextBackground": "#90274A80", // middle of #272822 and #f92672 + "inputValidation.errorBackground": "#90274A", // middle of #272822 and #f92672 + "inputValidation.errorBorder": "#f92672", + "inputValidation.warningBackground": "#848528", // middle of #272822 and #e2e22e + "inputValidation.warningBorder": "#e2e22e", + "inputValidation.infoBackground": "#546190", // middle of #272822 and #819aff + "inputValidation.infoBorder": "#819aff", "editorHoverWidget.background": "#414339", - "editorHoverWidget.border": "#75715E", // comment color + "editorHoverWidget.border": "#75715E", "editorSuggestWidget.background": "#272822", - "editorSuggestWidget.border": "#75715E", // comment color - "editorGroup.border": "#414339", // comment color - "peekView.border": "#f92672", + "editorSuggestWidget.border": "#75715E", + "editorGroup.border": "#414339", + "peekView.border": "#75715E", "peekViewEditor.background": "#272822", "peekViewResult.background": "#1e1f1c", "peekViewTitle.background": "#1e1f1c", @@ -58,12 +72,12 @@ "peekViewResult.matchHighlightBackground": "#75715E", "peekViewEditor.matchHighlightBackground": "#75715E", "terminal.ansiBlack": "#333333", - "terminal.ansiRed": "#f92672BF", - "terminal.ansiGreen": "#A6E22EBF", - "terminal.ansiYellow": "#e2e22eBF", - "terminal.ansiBlue": "#819affBF", - "terminal.ansiMagenta": "#AE81FFBF", - "terminal.ansiCyan": "#66D9EFBF", + "terminal.ansiRed": "#C4265E", // the bright color with ~75% transparent on the background + "terminal.ansiGreen": "#86B42B", + "terminal.ansiYellow": "#B3B42B", + "terminal.ansiBlue": "#6A7EC8", + "terminal.ansiMagenta": "#8C6BC8", + "terminal.ansiCyan": "#56ADBC", "terminal.ansiWhite": "#e3e3dd", "terminal.ansiBrightBlack": "#666666", "terminal.ansiBrightRed": "#f92672", diff --git a/extensions/theme-quietlight/themes/quietlight-color-theme.json b/extensions/theme-quietlight/themes/quietlight-color-theme.json index 9e065fef1d6..3086021874b 100644 --- a/extensions/theme-quietlight/themes/quietlight-color-theme.json +++ b/extensions/theme-quietlight/themes/quietlight-color-theme.json @@ -465,7 +465,6 @@ "editorWhitespace.foreground": "#AAAAAA", "editor.lineHighlightBackground": "#E4F6D4", "editor.selectionBackground": "#C9D0D9", - "panel.background": "#F5F5F5", "sideBar.background": "#F2F2F2", "sideBarSectionHeader.background": "#ede8ef", "editorLineNumber.foreground": "#9DA39A", @@ -495,6 +494,8 @@ "inputValidation.warningBackground": "#fffee2", "inputValidation.warningBorder": "#ffe055", "inputValidation.errorBackground": "#ffeaea", - "inputValidation.errorBorder": "#f1897f" + "inputValidation.errorBorder": "#f1897f", + "badge.background": "#705697AA", + "progressBar.background": "#705697" } } \ No newline at end of file diff --git a/extensions/theme-red/themes/Red-color-theme.json b/extensions/theme-red/themes/Red-color-theme.json index 9db55816d80..a35bfe0938b 100644 --- a/extensions/theme-red/themes/Red-color-theme.json +++ b/extensions/theme-red/themes/Red-color-theme.json @@ -2,7 +2,6 @@ "tokenColors": "./red.tmTheme", "colors": { // window - "activityBarBadge.background": "#cc3333", "activityBar.background": "#580000", "tab.inactiveBackground": "#300a0a", "tab.activeBackground": "#490000", @@ -46,12 +45,13 @@ "list.activeSelectionBackground": "#880000", "list.inactiveSelectionBackground": "#770000", "list.dropBackground": "#662222", - "list.focusAndSelectionBackground": "#882222", "list.focusBackground": "#660000", "list.highlightForeground": "#ff4444", "notification.background": "#662222", "pickerGroup.foreground": "#cc9999", - "pickerGroup.border": "#ff000033" + "pickerGroup.border": "#ff000033", + "badge.background": "#cc3333", + "progressBar.background": "#cc3333" }, "name": "Red" } \ No newline at end of file diff --git a/extensions/theme-seti/build/update-icon-theme.js b/extensions/theme-seti/build/update-icon-theme.js index 7f44c3ac245..a2a2bbd840c 100644 --- a/extensions/theme-seti/build/update-icon-theme.js +++ b/extensions/theme-seti/build/update-icon-theme.js @@ -212,6 +212,14 @@ exports.update = function () { } var res = { + information_for_contributors: [ + 'This file has been generated from data in https://github.com/jesseweed/seti-ui:', + '- icon definitions: styles/_fonts/seti.less', + '- icon colors: styles/ui-variables.less', + '- file associations: styles/icons/mapping.less', + 'If you want to provide a fix or improvement, please create a pull request against the jesseweed/seti-ui repository.', + 'Once accepted there, we are happy to receive an update request.', + ], fonts: [{ id: "seti", src: [{ "path": "./seti.woff", "format": "woff" }], diff --git a/extensions/theme-seti/icons/seti.woff b/extensions/theme-seti/icons/seti.woff index d1411ae5221..5dd4c46c58c 100644 Binary files a/extensions/theme-seti/icons/seti.woff and b/extensions/theme-seti/icons/seti.woff differ diff --git a/extensions/theme-seti/icons/vs-seti-icon-theme.json b/extensions/theme-seti/icons/vs-seti-icon-theme.json index 27c00bcc1cd..46e757af3f6 100644 --- a/extensions/theme-seti/icons/vs-seti-icon-theme.json +++ b/extensions/theme-seti/icons/vs-seti-icon-theme.json @@ -1,4 +1,12 @@ { + "information_for_contributors": [ + "This file has been generated from data in https://github.com/jesseweed/seti-ui:", + "- icon definitions: styles/_fonts/seti.less", + "- icon colors: styles/ui-variables.less", + "- file associations: styles/icons/mapping.less", + "If you want to provide a fix or improvement, please create a pull request against the jesseweed/seti-ui repository.", + "Once accepted there, we are happy to receive an update request." + ], "fonts": [ { "id": "seti", @@ -106,775 +114,807 @@ "fontCharacter": "\\E00E", "fontColor": "#6d8086" }, - "_coffee_light": { + "_code-climate_light": { "fontCharacter": "\\E00F", + "fontColor": "#723eb6" + }, + "_code-climate": { + "fontCharacter": "\\E00F", + "fontColor": "#8dc149" + }, + "_coffee_light": { + "fontCharacter": "\\E010", "fontColor": "#3434be" }, "_coffee": { - "fontCharacter": "\\E00F", + "fontCharacter": "\\E010", "fontColor": "#cbcb41" }, "_coffee_erb": { - "fontCharacter": "\\E010" + "fontCharacter": "\\E011" }, "_coldfusion_light": { - "fontCharacter": "\\E011", + "fontCharacter": "\\E012", "fontColor": "#ae6545" }, "_coldfusion": { - "fontCharacter": "\\E011", + "fontCharacter": "\\E012", "fontColor": "#519aba" }, "_config_light": { - "fontCharacter": "\\E012", + "fontCharacter": "\\E013", "fontColor": "#927f79" }, "_config": { - "fontCharacter": "\\E012", + "fontCharacter": "\\E013", "fontColor": "#6d8086" }, "_cpp_light": { - "fontCharacter": "\\E013", + "fontCharacter": "\\E014", "fontColor": "#5f8b3b" }, "_cpp": { - "fontCharacter": "\\E013", + "fontCharacter": "\\E014", "fontColor": "#a074c4" }, "_css_light": { - "fontCharacter": "\\E014", + "fontCharacter": "\\E015", "fontColor": "#ae6545" }, "_css": { - "fontCharacter": "\\E014", + "fontCharacter": "\\E015", "fontColor": "#519aba" }, "_csv_light": { - "fontCharacter": "\\E015", + "fontCharacter": "\\E016", "fontColor": "#723eb6" }, "_csv": { - "fontCharacter": "\\E015", + "fontCharacter": "\\E016", "fontColor": "#8dc149" }, "_d_light": { - "fontCharacter": "\\E016", + "fontCharacter": "\\E017", "fontColor": "#33c1bb" }, "_d": { - "fontCharacter": "\\E016", + "fontCharacter": "\\E017", "fontColor": "#cc3e44" }, "_db_light": { - "fontCharacter": "\\E017", + "fontCharacter": "\\E018", "fontColor": "#aac7a" }, "_db": { - "fontCharacter": "\\E017", + "fontCharacter": "\\E018", "fontColor": "#f55385" }, "_default_light": { - "fontCharacter": "\\E018", + "fontCharacter": "\\E019", "fontColor": "#2b2829" }, "_default": { - "fontCharacter": "\\E018", + "fontCharacter": "\\E019", "fontColor": "#d4d7d6" }, "_deprecation-cop": { - "fontCharacter": "\\E019" + "fontCharacter": "\\E01A" }, "_docker_light": { - "fontCharacter": "\\E01A", - "fontColor": "#ae6545" + "fontCharacter": "\\E01B", + "fontColor": "#aac7a" }, "_docker": { - "fontCharacter": "\\E01A", - "fontColor": "#519aba" - }, - "_editorconfig_light": { "fontCharacter": "\\E01B", - "fontColor": "#ae6545" + "fontColor": "#f55385" }, "_editorconfig": { - "fontCharacter": "\\E01B", - "fontColor": "#519aba" + "fontCharacter": "\\E01C" }, "_ejs_light": { - "fontCharacter": "\\E01C", + "fontCharacter": "\\E01D", "fontColor": "#3434be" }, "_ejs": { - "fontCharacter": "\\E01C", + "fontCharacter": "\\E01D", "fontColor": "#cbcb41" }, "_elixir_light": { - "fontCharacter": "\\E01D", + "fontCharacter": "\\E01E", "fontColor": "#5f8b3b" }, "_elixir": { - "fontCharacter": "\\E01D", + "fontCharacter": "\\E01E", "fontColor": "#a074c4" }, "_elixir_script_light": { - "fontCharacter": "\\E01E", + "fontCharacter": "\\E01F", "fontColor": "#5f8b3b" }, "_elixir_script": { - "fontCharacter": "\\E01E", + "fontCharacter": "\\E01F", "fontColor": "#a074c4" }, "_elm_light": { - "fontCharacter": "\\E01F", + "fontCharacter": "\\E020", "fontColor": "#ae6545" }, "_elm": { - "fontCharacter": "\\E01F", + "fontCharacter": "\\E020", "fontColor": "#519aba" }, "_error": { - "fontCharacter": "\\E020" + "fontCharacter": "\\E021" }, "_eslint_light": { - "fontCharacter": "\\E021", - "fontColor": "#5f8b3b" + "fontCharacter": "\\E022", + "fontColor": "#b2a5a1" }, "_eslint": { - "fontCharacter": "\\E021", - "fontColor": "#a074c4" + "fontCharacter": "\\E022", + "fontColor": "#4d5a5e" + }, + "_f-sharp_light": { + "fontCharacter": "\\E023", + "fontColor": "#ae6545" + }, + "_f-sharp": { + "fontCharacter": "\\E023", + "fontColor": "#519aba" }, "_favicon_light": { - "fontCharacter": "\\E022", + "fontCharacter": "\\E024", "fontColor": "#3434be" }, "_favicon": { - "fontCharacter": "\\E022", + "fontCharacter": "\\E024", "fontColor": "#cbcb41" }, "_folder": { - "fontCharacter": "\\E023" + "fontCharacter": "\\E025" }, "_font_light": { - "fontCharacter": "\\E024", + "fontCharacter": "\\E026", "fontColor": "#33c1bb" }, "_font": { - "fontCharacter": "\\E024", + "fontCharacter": "\\E026", "fontColor": "#cc3e44" }, "_git_folder": { - "fontCharacter": "\\E025" + "fontCharacter": "\\E027" }, "_git_ignore": { - "fontCharacter": "\\E026" + "fontCharacter": "\\E028" }, "_github_light": { - "fontCharacter": "\\E027", + "fontCharacter": "\\E029", "fontColor": "#2b2829" }, "_github": { - "fontCharacter": "\\E027", + "fontCharacter": "\\E029", "fontColor": "#d4d7d6" }, "_go_light": { - "fontCharacter": "\\E028", + "fontCharacter": "\\E02A", "fontColor": "#ae6545" }, "_go": { - "fontCharacter": "\\E028", + "fontCharacter": "\\E02A", "fontColor": "#519aba" }, "_go2_light": { - "fontCharacter": "\\E029", + "fontCharacter": "\\E02B", "fontColor": "#ae6545" }, "_go2": { - "fontCharacter": "\\E029", + "fontCharacter": "\\E02B", "fontColor": "#519aba" }, "_gradle_light": { - "fontCharacter": "\\E02A", + "fontCharacter": "\\E02C", "fontColor": "#723eb6" }, "_gradle": { - "fontCharacter": "\\E02A", + "fontCharacter": "\\E02C", "fontColor": "#8dc149" }, "_grails_light": { - "fontCharacter": "\\E02B", + "fontCharacter": "\\E02D", "fontColor": "#723eb6" }, "_grails": { - "fontCharacter": "\\E02B", + "fontCharacter": "\\E02D", "fontColor": "#8dc149" }, "_grunt_light": { - "fontCharacter": "\\E02C", + "fontCharacter": "\\E02E", "fontColor": "#1c86cc" }, "_grunt": { - "fontCharacter": "\\E02C", + "fontCharacter": "\\E02E", "fontColor": "#e37933" }, "_gulp_light": { - "fontCharacter": "\\E02D", + "fontCharacter": "\\E02F", "fontColor": "#33c1bb" }, "_gulp": { - "fontCharacter": "\\E02D", + "fontCharacter": "\\E02F", "fontColor": "#cc3e44" }, "_hacklang": { - "fontCharacter": "\\E02E" + "fontCharacter": "\\E030" }, "_haml_light": { - "fontCharacter": "\\E02F", + "fontCharacter": "\\E031", "fontColor": "#33c1bb" }, "_haml": { - "fontCharacter": "\\E02F", + "fontCharacter": "\\E031", "fontColor": "#cc3e44" }, "_haskell_light": { - "fontCharacter": "\\E030", + "fontCharacter": "\\E032", "fontColor": "#5f8b3b" }, "_haskell": { - "fontCharacter": "\\E030", + "fontCharacter": "\\E032", "fontColor": "#a074c4" }, "_heroku_light": { - "fontCharacter": "\\E031", + "fontCharacter": "\\E033", "fontColor": "#5f8b3b" }, "_heroku": { - "fontCharacter": "\\E031", + "fontCharacter": "\\E033", "fontColor": "#a074c4" }, "_hex_light": { - "fontCharacter": "\\E032", + "fontCharacter": "\\E034", "fontColor": "#33c1bb" }, "_hex": { - "fontCharacter": "\\E032", + "fontCharacter": "\\E034", "fontColor": "#cc3e44" }, "_html_light": { - "fontCharacter": "\\E033", + "fontCharacter": "\\E035", "fontColor": "#1c86cc" }, "_html": { - "fontCharacter": "\\E033", + "fontCharacter": "\\E035", "fontColor": "#e37933" }, "_html_erb": { - "fontCharacter": "\\E034" + "fontCharacter": "\\E036" }, "_ignored_light": { - "fontCharacter": "\\E035", + "fontCharacter": "\\E037", "fontColor": "#beaca4" }, "_ignored": { - "fontCharacter": "\\E035", + "fontCharacter": "\\E037", "fontColor": "#41535b" }, "_illustrator_light": { - "fontCharacter": "\\E036", + "fontCharacter": "\\E038", "fontColor": "#3434be" }, "_illustrator": { - "fontCharacter": "\\E036", + "fontCharacter": "\\E038", "fontColor": "#cbcb41" }, "_image_light": { - "fontCharacter": "\\E037", + "fontCharacter": "\\E039", "fontColor": "#5f8b3b" }, "_image": { - "fontCharacter": "\\E037", + "fontCharacter": "\\E039", "fontColor": "#a074c4" }, + "_info_light": { + "fontCharacter": "\\E03A", + "fontColor": "#ae6545" + }, "_info": { - "fontCharacter": "\\E038" + "fontCharacter": "\\E03A", + "fontColor": "#519aba" }, "_ionic_light": { - "fontCharacter": "\\E039", + "fontCharacter": "\\E03B", "fontColor": "#ae6545" }, "_ionic": { - "fontCharacter": "\\E039", + "fontCharacter": "\\E03B", "fontColor": "#519aba" }, "_jade_light": { - "fontCharacter": "\\E03A", + "fontCharacter": "\\E03C", "fontColor": "#33c1bb" }, "_jade": { - "fontCharacter": "\\E03A", + "fontCharacter": "\\E03C", "fontColor": "#cc3e44" }, "_java_light": { - "fontCharacter": "\\E03B", + "fontCharacter": "\\E03D", "fontColor": "#33c1bb" }, "_java": { - "fontCharacter": "\\E03B", + "fontCharacter": "\\E03D", "fontColor": "#cc3e44" }, "_javascript_light": { - "fontCharacter": "\\E03C", + "fontCharacter": "\\E03E", "fontColor": "#ae6545" }, "_javascript": { - "fontCharacter": "\\E03C", + "fontCharacter": "\\E03E", "fontColor": "#519aba" }, + "_jenkins_light": { + "fontCharacter": "\\E03F", + "fontColor": "#33c1bb" + }, + "_jenkins": { + "fontCharacter": "\\E03F", + "fontColor": "#cc3e44" + }, "_js_erb": { - "fontCharacter": "\\E03D" + "fontCharacter": "\\E040" }, "_json_light": { - "fontCharacter": "\\E03E", + "fontCharacter": "\\E041", "fontColor": "#3434be" }, "_json": { - "fontCharacter": "\\E03E", + "fontCharacter": "\\E041", "fontColor": "#cbcb41" }, "_julia_light": { - "fontCharacter": "\\E03F", + "fontCharacter": "\\E042", "fontColor": "#5f8b3b" }, "_julia": { - "fontCharacter": "\\E03F", + "fontCharacter": "\\E042", "fontColor": "#a074c4" }, "_karma_light": { - "fontCharacter": "\\E040", + "fontCharacter": "\\E043", "fontColor": "#723eb6" }, "_karma": { - "fontCharacter": "\\E040", + "fontCharacter": "\\E043", "fontColor": "#8dc149" }, "_less_light": { - "fontCharacter": "\\E041", + "fontCharacter": "\\E044", "fontColor": "#ae6545" }, "_less": { - "fontCharacter": "\\E041", + "fontCharacter": "\\E044", "fontColor": "#519aba" }, "_license_light": { - "fontCharacter": "\\E042", + "fontCharacter": "\\E045", "fontColor": "#33c1bb" }, "_license": { - "fontCharacter": "\\E042", + "fontCharacter": "\\E045", "fontColor": "#cc3e44" }, "_liquid_light": { - "fontCharacter": "\\E043", + "fontCharacter": "\\E046", "fontColor": "#723eb6" }, "_liquid": { - "fontCharacter": "\\E043", + "fontCharacter": "\\E046", "fontColor": "#8dc149" }, "_livescript_light": { - "fontCharacter": "\\E044", + "fontCharacter": "\\E047", "fontColor": "#ae6545" }, "_livescript": { - "fontCharacter": "\\E044", + "fontCharacter": "\\E047", "fontColor": "#519aba" }, "_lua_light": { - "fontCharacter": "\\E045", + "fontCharacter": "\\E048", "fontColor": "#ae6545" }, "_lua": { - "fontCharacter": "\\E045", + "fontCharacter": "\\E048", "fontColor": "#519aba" }, "_makefile_light": { - "fontCharacter": "\\E046", + "fontCharacter": "\\E049", "fontColor": "#ae6545" }, "_makefile": { - "fontCharacter": "\\E046", + "fontCharacter": "\\E049", "fontColor": "#519aba" }, "_markdown_light": { - "fontCharacter": "\\E047", - "fontColor": "#aac7a" + "fontCharacter": "\\E04A", + "fontColor": "#ae6545" }, "_markdown": { - "fontCharacter": "\\E047", - "fontColor": "#f55385" + "fontCharacter": "\\E04A", + "fontColor": "#519aba" }, "_maven_light": { - "fontCharacter": "\\E048", + "fontCharacter": "\\E04B", "fontColor": "#33c1bb" }, "_maven": { - "fontCharacter": "\\E048", + "fontCharacter": "\\E04B", "fontColor": "#cc3e44" }, "_mdo_light": { - "fontCharacter": "\\E049", + "fontCharacter": "\\E04C", "fontColor": "#33c1bb" }, "_mdo": { - "fontCharacter": "\\E049", + "fontCharacter": "\\E04C", "fontColor": "#cc3e44" }, "_mustache_light": { - "fontCharacter": "\\E04A", + "fontCharacter": "\\E04D", "fontColor": "#1c86cc" }, "_mustache": { - "fontCharacter": "\\E04A", + "fontCharacter": "\\E04D", "fontColor": "#e37933" }, "_new-file": { - "fontCharacter": "\\E04B" + "fontCharacter": "\\E04E" }, "_npm_light": { - "fontCharacter": "\\E04C", + "fontCharacter": "\\E04F", "fontColor": "#33c1bb" }, "_npm": { - "fontCharacter": "\\E04C", + "fontCharacter": "\\E04F", "fontColor": "#cc3e44" }, "_npm_ignored_light": { - "fontCharacter": "\\E04D", + "fontCharacter": "\\E050", "fontColor": "#beaca4" }, "_npm_ignored": { - "fontCharacter": "\\E04D", + "fontCharacter": "\\E050", "fontColor": "#41535b" }, "_nunjucks_light": { - "fontCharacter": "\\E04E", + "fontCharacter": "\\E051", "fontColor": "#723eb6" }, "_nunjucks": { - "fontCharacter": "\\E04E", + "fontCharacter": "\\E051", "fontColor": "#8dc149" }, "_ocaml_light": { - "fontCharacter": "\\E04F", + "fontCharacter": "\\E052", "fontColor": "#1c86cc" }, "_ocaml": { - "fontCharacter": "\\E04F", + "fontCharacter": "\\E052", "fontColor": "#e37933" }, "_pdf_light": { - "fontCharacter": "\\E050", + "fontCharacter": "\\E053", "fontColor": "#33c1bb" }, "_pdf": { - "fontCharacter": "\\E050", + "fontCharacter": "\\E053", "fontColor": "#cc3e44" }, "_perl_light": { - "fontCharacter": "\\E051", + "fontCharacter": "\\E054", "fontColor": "#ae6545" }, "_perl": { - "fontCharacter": "\\E051", + "fontCharacter": "\\E054", "fontColor": "#519aba" }, "_photoshop_light": { - "fontCharacter": "\\E052", + "fontCharacter": "\\E055", "fontColor": "#ae6545" }, "_photoshop": { - "fontCharacter": "\\E052", + "fontCharacter": "\\E055", "fontColor": "#519aba" }, "_php_light": { - "fontCharacter": "\\E053", + "fontCharacter": "\\E056", "fontColor": "#5f8b3b" }, "_php": { - "fontCharacter": "\\E053", + "fontCharacter": "\\E056", "fontColor": "#a074c4" }, - "_project": { - "fontCharacter": "\\E054" - }, - "_pug_light": { - "fontCharacter": "\\E055", + "_powershell_light": { + "fontCharacter": "\\E057", "fontColor": "#ae6545" }, - "_pug": { - "fontCharacter": "\\E055", + "_powershell": { + "fontCharacter": "\\E057", "fontColor": "#519aba" }, + "_project": { + "fontCharacter": "\\E058" + }, + "_pug_light": { + "fontCharacter": "\\E059", + "fontColor": "#33c1bb" + }, + "_pug": { + "fontCharacter": "\\E059", + "fontColor": "#cc3e44" + }, "_puppet_light": { - "fontCharacter": "\\E056", + "fontCharacter": "\\E05A", "fontColor": "#3434be" }, "_puppet": { - "fontCharacter": "\\E056", + "fontCharacter": "\\E05A", "fontColor": "#cbcb41" }, "_python_light": { - "fontCharacter": "\\E057", + "fontCharacter": "\\E05B", "fontColor": "#ae6545" }, "_python": { - "fontCharacter": "\\E057", + "fontCharacter": "\\E05B", "fontColor": "#519aba" }, "_rails": { - "fontCharacter": "\\E058" + "fontCharacter": "\\E05C" }, "_react_light": { - "fontCharacter": "\\E059", + "fontCharacter": "\\E05D", "fontColor": "#ae6545" }, "_react": { - "fontCharacter": "\\E059", + "fontCharacter": "\\E05D", "fontColor": "#519aba" }, "_rollup_light": { - "fontCharacter": "\\E05A", + "fontCharacter": "\\E05E", "fontColor": "#33c1bb" }, "_rollup": { - "fontCharacter": "\\E05A", + "fontCharacter": "\\E05E", "fontColor": "#cc3e44" }, "_ruby_light": { - "fontCharacter": "\\E05B", + "fontCharacter": "\\E05F", "fontColor": "#33c1bb" }, "_ruby": { - "fontCharacter": "\\E05B", + "fontCharacter": "\\E05F", "fontColor": "#cc3e44" }, "_rust_light": { - "fontCharacter": "\\E05C", + "fontCharacter": "\\E060", "fontColor": "#927f79" }, "_rust": { - "fontCharacter": "\\E05C", + "fontCharacter": "\\E060", "fontColor": "#6d8086" }, "_salesforce_light": { - "fontCharacter": "\\E05D", + "fontCharacter": "\\E061", "fontColor": "#ae6545" }, "_salesforce": { - "fontCharacter": "\\E05D", + "fontCharacter": "\\E061", "fontColor": "#519aba" }, "_sass_light": { - "fontCharacter": "\\E05E", + "fontCharacter": "\\E062", "fontColor": "#aac7a" }, "_sass": { - "fontCharacter": "\\E05E", + "fontCharacter": "\\E062", "fontColor": "#f55385" }, "_sbt_light": { - "fontCharacter": "\\E05F", + "fontCharacter": "\\E063", "fontColor": "#ae6545" }, "_sbt": { - "fontCharacter": "\\E05F", + "fontCharacter": "\\E063", "fontColor": "#519aba" }, "_scala_light": { - "fontCharacter": "\\E060", + "fontCharacter": "\\E064", "fontColor": "#33c1bb" }, "_scala": { - "fontCharacter": "\\E060", + "fontCharacter": "\\E064", "fontColor": "#cc3e44" }, "_search": { - "fontCharacter": "\\E061" + "fontCharacter": "\\E065" }, "_settings": { - "fontCharacter": "\\E062" + "fontCharacter": "\\E066" }, "_shell_light": { - "fontCharacter": "\\E063", + "fontCharacter": "\\E067", "fontColor": "#b2a5a1" }, "_shell": { - "fontCharacter": "\\E063", + "fontCharacter": "\\E067", "fontColor": "#4d5a5e" }, "_slim_light": { - "fontCharacter": "\\E064", + "fontCharacter": "\\E068", "fontColor": "#1c86cc" }, "_slim": { - "fontCharacter": "\\E064", + "fontCharacter": "\\E068", "fontColor": "#e37933" }, "_smarty_light": { - "fontCharacter": "\\E065", + "fontCharacter": "\\E069", "fontColor": "#3434be" }, "_smarty": { - "fontCharacter": "\\E065", + "fontCharacter": "\\E069", "fontColor": "#cbcb41" }, "_spring_light": { - "fontCharacter": "\\E066", + "fontCharacter": "\\E06A", "fontColor": "#723eb6" }, "_spring": { - "fontCharacter": "\\E066", + "fontCharacter": "\\E06A", "fontColor": "#8dc149" }, "_stylus_light": { - "fontCharacter": "\\E067", + "fontCharacter": "\\E06B", "fontColor": "#723eb6" }, "_stylus": { - "fontCharacter": "\\E067", + "fontCharacter": "\\E06B", "fontColor": "#8dc149" }, "_sublime_light": { - "fontCharacter": "\\E068", + "fontCharacter": "\\E06C", "fontColor": "#1c86cc" }, "_sublime": { - "fontCharacter": "\\E068", + "fontCharacter": "\\E06C", "fontColor": "#e37933" }, "_svg_light": { - "fontCharacter": "\\E069", + "fontCharacter": "\\E06D", "fontColor": "#5f8b3b" }, "_svg": { - "fontCharacter": "\\E069", + "fontCharacter": "\\E06D", "fontColor": "#a074c4" }, "_swift_light": { - "fontCharacter": "\\E06A", + "fontCharacter": "\\E06E", "fontColor": "#1c86cc" }, "_swift": { - "fontCharacter": "\\E06A", + "fontCharacter": "\\E06E", "fontColor": "#e37933" }, "_terraform_light": { - "fontCharacter": "\\E06B", + "fontCharacter": "\\E06F", "fontColor": "#5f8b3b" }, "_terraform": { - "fontCharacter": "\\E06B", + "fontCharacter": "\\E06F", "fontColor": "#a074c4" }, "_tex_light": { - "fontCharacter": "\\E06C", + "fontCharacter": "\\E070", "fontColor": "#2b2829" }, "_tex": { - "fontCharacter": "\\E06C", + "fontCharacter": "\\E070", "fontColor": "#d4d7d6" }, "_time-cop": { - "fontCharacter": "\\E06D" + "fontCharacter": "\\E071" }, "_todo": { - "fontCharacter": "\\E06E" + "fontCharacter": "\\E072" }, "_twig_light": { - "fontCharacter": "\\E06F", + "fontCharacter": "\\E073", "fontColor": "#723eb6" }, "_twig": { - "fontCharacter": "\\E06F", + "fontCharacter": "\\E073", "fontColor": "#8dc149" }, "_typescript_light": { - "fontCharacter": "\\E070", + "fontCharacter": "\\E074", "fontColor": "#ae6545" }, "_typescript": { - "fontCharacter": "\\E070", + "fontCharacter": "\\E074", "fontColor": "#519aba" }, "_vala_light": { - "fontCharacter": "\\E071", + "fontCharacter": "\\E075", "fontColor": "#927f79" }, "_vala": { - "fontCharacter": "\\E071", + "fontCharacter": "\\E075", "fontColor": "#6d8086" }, "_video_light": { - "fontCharacter": "\\E072", + "fontCharacter": "\\E076", "fontColor": "#aac7a" }, "_video": { - "fontCharacter": "\\E072", + "fontCharacter": "\\E076", "fontColor": "#f55385" }, "_vue_light": { - "fontCharacter": "\\E073", - "fontColor": "#bc94db" + "fontCharacter": "\\E077", + "fontColor": "#723eb6" }, "_vue": { - "fontCharacter": "\\E073", - "fontColor": "#436b24" + "fontCharacter": "\\E077", + "fontColor": "#8dc149" }, "_windows_light": { - "fontCharacter": "\\E074", + "fontCharacter": "\\E078", "fontColor": "#ae6545" }, "_windows": { - "fontCharacter": "\\E074", + "fontCharacter": "\\E078", "fontColor": "#519aba" }, "_word_light": { - "fontCharacter": "\\E075", + "fontCharacter": "\\E079", "fontColor": "#ae6545" }, "_word": { - "fontCharacter": "\\E075", + "fontCharacter": "\\E079", "fontColor": "#519aba" }, "_xls_light": { - "fontCharacter": "\\E076", + "fontCharacter": "\\E07A", "fontColor": "#723eb6" }, "_xls": { - "fontCharacter": "\\E076", + "fontCharacter": "\\E07A", "fontColor": "#8dc149" }, "_xml_light": { - "fontCharacter": "\\E077", + "fontCharacter": "\\E07B", "fontColor": "#1c86cc" }, "_xml": { - "fontCharacter": "\\E077", + "fontCharacter": "\\E07B", "fontColor": "#e37933" }, "_yarn_light": { - "fontCharacter": "\\E078", + "fontCharacter": "\\E07C", "fontColor": "#ae6545" }, "_yarn": { - "fontCharacter": "\\E078", + "fontCharacter": "\\E07C", "fontColor": "#519aba" }, "_yml_light": { - "fontCharacter": "\\E079", + "fontCharacter": "\\E07D", "fontColor": "#5f8b3b" }, "_yml": { - "fontCharacter": "\\E079", + "fontCharacter": "\\E07D", "fontColor": "#a074c4" } }, @@ -922,6 +962,7 @@ "class": "_java", "classpath": "_java", "js.map": "_javascript", + "spec.js": "_javascript", "es": "_javascript", "es5": "_javascript", "es7": "_javascript", @@ -997,24 +1038,39 @@ "wav": "_audio", "babelrc": "_babel", "bowerrc": "_bower", + "dockerignore": "_docker", + "codeclimate.yml": "_code-climate", "eslintrc": "_eslint", + "eslintrc.js": "_eslint", + "eslintrc.yaml": "_eslint", + "eslintrc.yml": "_eslint", + "eslintrc.json": "_eslint", "eslintignore": "_eslint", "jshintrc": "_javascript", "jscsrc": "_javascript", "direnv": "_config", "env": "_config", "static": "_config", - "editorconfig": "_editorconfig", + "editorconfig": "_config", "slugignore": "_config", "tmp": "_clock", + "htaccess": "_config", "ds_store": "_ignored" }, "fileNames": { "mix": "_hex", + "jenkinsfile": "_jenkins", "karma.conf.js": "_karma", "karma.conf.coffee": "_karma", + "readme.md": "_info", + "changelog.md": "_clock", + "changelog": "_clock", + "version.md": "_clock", + "version": "_clock", "mvnw": "_maven", "bower.json": "_bower", + "docker-healthcheck": "_docker", + "docker-compose.yml": "_docker", "gruntfile.js": "_grunt", "gruntfile.babel.js": "_grunt", "gruntfile.coffee": "_grunt", @@ -1030,7 +1086,6 @@ "copying": "_license", "compiling": "_license", "contributing": "_license", - "readme": "_markdown", "qmakefile": "_makefile", "omakefile": "_makefile", "cmakelists.txt": "_makefile", @@ -1046,6 +1101,7 @@ "csharp": "_c-sharp", "css": "_css", "dockerfile": "_docker", + "fsharp": "_f-sharp", "go": "_go2", "groovy": "_grails", "handlebars": "_mustache", @@ -1062,6 +1118,7 @@ "objective-c": "_c", "perl": "_perl", "php": "_php", + "powershell": "_powershell", "jade": "_jade", "python": "_python", "ruby": "_ruby", @@ -1120,6 +1177,7 @@ "class": "_java_light", "classpath": "_java_light", "js.map": "_javascript_light", + "spec.js": "_javascript_light", "es": "_javascript_light", "es5": "_javascript_light", "es7": "_javascript_light", @@ -1195,16 +1253,23 @@ "wav": "_audio_light", "babelrc": "_babel_light", "bowerrc": "_bower_light", + "dockerignore": "_docker_light", + "codeclimate.yml": "_code-climate_light", "eslintrc": "_eslint_light", + "eslintrc.js": "_eslint_light", + "eslintrc.yaml": "_eslint_light", + "eslintrc.yml": "_eslint_light", + "eslintrc.json": "_eslint_light", "eslintignore": "_eslint_light", "jshintrc": "_javascript_light", "jscsrc": "_javascript_light", "direnv": "_config_light", "env": "_config_light", "static": "_config_light", - "editorconfig": "_editorconfig_light", + "editorconfig": "_config_light", "slugignore": "_config_light", "tmp": "_clock_light", + "htaccess": "_config_light", "ds_store": "_ignored_light" }, "languageIds": { @@ -1215,6 +1280,7 @@ "csharp": "_c-sharp_light", "css": "_css_light", "dockerfile": "_docker_light", + "fsharp": "_f-sharp_light", "go": "_go2_light", "groovy": "_grails_light", "handlebars": "_mustache_light", @@ -1231,6 +1297,7 @@ "objective-c": "_c_light", "perl": "_perl_light", "php": "_php_light", + "powershell": "_powershell_light", "jade": "_jade_light", "python": "_python_light", "ruby": "_ruby_light", @@ -1246,10 +1313,18 @@ }, "fileNames": { "mix": "_hex_light", + "jenkinsfile": "_jenkins_light", "karma.conf.js": "_karma_light", "karma.conf.coffee": "_karma_light", + "readme.md": "_info_light", + "changelog.md": "_clock_light", + "changelog": "_clock_light", + "version.md": "_clock_light", + "version": "_clock_light", "mvnw": "_maven_light", "bower.json": "_bower_light", + "docker-healthcheck": "_docker_light", + "docker-compose.yml": "_docker_light", "gruntfile.js": "_grunt_light", "gruntfile.babel.js": "_grunt_light", "gruntfile.coffee": "_grunt_light", @@ -1265,7 +1340,6 @@ "copying": "_license_light", "compiling": "_license_light", "contributing": "_license_light", - "readme": "_markdown_light", "qmakefile": "_makefile_light", "omakefile": "_makefile_light", "cmakelists.txt": "_makefile_light", @@ -1273,5 +1347,5 @@ "npm-debug.log": "_npm_ignored_light" } }, - "version": "https://github.com/jesseweed/seti-ui/commit/f7e582faec0961ddf783ad4dffed41e0f2da5413" + "version": "https://github.com/jesseweed/seti-ui/commit/f78d62397f6f779ad43b0b5dce2cbfd68e21bf34" } \ No newline at end of file diff --git a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json index 75862dc7088..10b058c4911 100644 --- a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json +++ b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json @@ -303,6 +303,7 @@ "input.background": "#003847", "input.foreground": "#93A1A1", + "input.placeholderForeground": "#93A1A1AA", // "input.border": "", "inputOption.activeBorder": "#2AA19899", @@ -313,6 +314,9 @@ "inputValidation.errorBackground": "#571b26", "inputValidation.errorBorder": "#a92049", + "badge.background": "#047aa6", + "progressBar.background": "#047aa6", + "dropdown.background": "#00212B", "dropdown.border": "#2AA19899", // "dropdown.foreground": "", @@ -409,13 +413,12 @@ // Workbench: Activity Bar "activityBar.background": "#003847", - "activityBarBadge.background": "#047aa6", + // "activityBarBadge.background": "", // "activityBar.dropBackground": "", // "activityBar.foreground": "", // "activityBarBadge.foreground": "", // Workbench: Panel - // "panel.background": "", "panel.border": "#2b2b4a", // "panelTitle.activeBorder": "", // "panelTitle.activeForeground": "", @@ -447,24 +450,25 @@ // Workbench: Quick Open "pickerGroup.foreground": "#2AA19899", - "pickerGroup.border": "#2AA19899" + "pickerGroup.border": "#2AA19899", // Workbench: Terminal - // "terminal.ansiBlack": "", - // "terminal.ansiBlue": "", - // "terminal.ansiBrightBlack": "", - // "terminal.ansiBrightBlue": "", - // "terminal.ansiBrightCyan": "", - // "terminal.ansiBrightGreen": "", - // "terminal.ansiBrightMagenta": "", - // "terminal.ansiBrightRed": "", - // "terminal.ansiBrightWhite": "", - // "terminal.ansiBrightYellow": "", - // "terminal.ansiCyan": "", - // "terminal.ansiGreen": "", - // "terminal.ansiMagenta": "", - // "terminal.ansiRed": "", - // "terminal.ansiWhite": "", - // "terminal.ansiYellow": "" + // Colors sourced from the official palette http://ethanschoonover.com/solarized + "terminal.ansiBlack": "#262626", + "terminal.ansiBlue": "#0087ff", + "terminal.ansiBrightBlack": "#1c1c1c", + "terminal.ansiBrightBlue": "#808080", + "terminal.ansiBrightCyan": "#808080", + "terminal.ansiBrightGreen": "#585858", + "terminal.ansiBrightMagenta": "#5f5faf", + "terminal.ansiBrightRed": "#d75f00", + "terminal.ansiBrightWhite": "#808080", + "terminal.ansiBrightYellow": "#626262", + "terminal.ansiCyan": "#00afaf", + "terminal.ansiGreen": "#5f8700", + "terminal.ansiMagenta": "#af005f", + "terminal.ansiRed": "#d70000", + "terminal.ansiWhite": "#808080", + "terminal.ansiYellow": "#af8700" } } \ No newline at end of file diff --git a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json index de82f120283..cebad7db3b2 100644 --- a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json +++ b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json @@ -304,6 +304,7 @@ "input.background": "#DDD6C1", // "input.border": "", "input.foreground": "#586E75", + "input.placeholderForeground": "#586E75AA", "inputOption.activeBorder": "#D3AF86", // "inputValidation.infoBorder": "", // "inputValidation.infoBackground": "", @@ -312,6 +313,9 @@ // "inputValidation.errorBackground": "", // "inputValidation.errorBorder": "", + "badge.background": "#B58900AA", + "progressBar.background": "#B58900", + "dropdown.background": "#EEE8D5", // "dropdown.foreground": "", "dropdown.border": "#D3AF86", @@ -415,7 +419,6 @@ // "activityBarBadge.foreground": "", // Workbench: Panel - // "panel.background": "", "panel.border": "#DDD6C1", // "panelTitle.activeBorder": "", // "panelTitle.activeForeground": "", @@ -448,24 +451,25 @@ // Workbench: Quick Open "pickerGroup.border": "#2AA19899", - "pickerGroup.foreground": "#2AA19899" + "pickerGroup.foreground": "#2AA19899", // Workbench: Terminal - // "terminal.ansiBlack": "#111111", - // "terminal.ansiRed": "#ff9da4", - // "terminal.ansiGreen": "#d1f1a9", - // "terminal.ansiYellow": "#ffeead", - // "terminal.ansiBlue": "#bbdaff", - // "terminal.ansiMagenta": "#ebbbff", - // "terminal.ansiCyan": "#99ffff", - // "terminal.ansiWhite": "#cccccc", - // "terminal.ansiBrightBlack": "#333333", - // "terminal.ansiBrightRed": "#ff7882", - // "terminal.ansiBrightGreen": "#b8f171", - // "terminal.ansiBrightYellow": "#ffe580", - // "terminal.ansiBrightBlue": "#80baff", - // "terminal.ansiBrightMagenta": "#d778ff", - // "terminal.ansiBrightCyan": "#78ffff", - // "terminal.ansiBrightWhite": "#ffffff" + // Colors sourced from the official palette http://ethanschoonover.com/solarized + "terminal.ansiBlack": "#262626", + "terminal.ansiBlue": "#0087ff", + "terminal.ansiBrightBlack": "#1c1c1c", + "terminal.ansiBrightBlue": "#808080", + "terminal.ansiBrightCyan": "#808080", + "terminal.ansiBrightGreen": "#585858", + "terminal.ansiBrightMagenta": "#5f5faf", + "terminal.ansiBrightRed": "#d75f00", + "terminal.ansiBrightWhite": "#808080", + "terminal.ansiBrightYellow": "#626262", + "terminal.ansiCyan": "#00afaf", + "terminal.ansiGreen": "#5f8700", + "terminal.ansiMagenta": "#af005f", + "terminal.ansiRed": "#d70000", + "terminal.ansiWhite": "#808080", + "terminal.ansiYellow": "#af8700" } } \ No newline at end of file diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json index 1e1ba355fb2..319f8be0a61 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json @@ -31,8 +31,9 @@ "statusBar.noFolderBackground": "#001126", "statusBar.debuggingBackground": "#001126", "activityBar.background": "#001733", - "activityBarBadge.background": "#bbdaff", - "activityBarBadge.foreground": "#001733", + "progressBar.background": "#bbdaffcc", + "badge.background": "#bbdaffcc", + "badge.foreground": "#001733", "sideBar.background": "#001c40", "terminal.ansiBlack": "#111111", "terminal.ansiRed": "#ff9da4", diff --git a/extensions/typescript/build/update-grammars.js b/extensions/typescript/build/update-grammars.js index 2ce6ee9d828..c38d6f10510 100644 --- a/extensions/typescript/build/update-grammars.js +++ b/extensions/typescript/build/update-grammars.js @@ -8,7 +8,7 @@ var updateGrammar = require('../../../build/npm/update-grammar'); function adaptToJavaScript(grammar) { grammar.name = 'JavaScript (with React support)'; - grammar.fileTypes = ['.js', '.jsx' ]; + grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs' ]; grammar.scopeName = 'source.js'; var fixScopeNames = function(rule) { diff --git a/extensions/typescript/package.json b/extensions/typescript/package.json index 1d239313b43..11b75cfc26b 100644 --- a/extensions/typescript/package.json +++ b/extensions/typescript/package.json @@ -21,7 +21,7 @@ }, "scripts": { "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript ./tsconfig.json", - "update-grammars": "node ./build/update-grammars.js" + "update-grammar": "node ./build/update-grammars.js" }, "activationEvents": [ "onLanguage:javascript", @@ -34,7 +34,8 @@ "onCommand:typescript.selectTypeScriptVersion", "onCommand:javascript.goToProjectConfig", "onCommand:typescript.goToProjectConfig", - "onCommand:typescript.openTsServerLog" + "onCommand:typescript.openTsServerLog", + "onCommand:workbench.action.tasks.runTask" ], "main": "./out/typescriptMain", "contributes": { @@ -107,9 +108,14 @@ "default": true, "description": "%typescript.check.npmIsInstalled%" }, - "typescript.referencesCodeLens.enabled": { + "javascript.referencesCodeLens.enabled": { "type": "boolean", "default": false, + "description": "%javascript.referencesCodeLens.enabled%" + }, + "typescript.referencesCodeLens.enabled": { + "type": "boolean", + "default": true, "description": "%typescript.referencesCodeLens.enabled%" }, "typescript.implementationsCodeLens.enabled": { @@ -302,6 +308,20 @@ "type": "boolean", "default": false, "description": "%javascript.implicitProjectConfig.checkJs%" + }, + "javascript.nameSuggestions": { + "type": "boolean", + "default": true, + "description": "%javascript.nameSuggestions%" + }, + "typescript.tsc.autoDetect": { + "type": "string", + "default": "on", + "enum": [ + "on", + "off" + ], + "description": "%typescript.tsc.autoDetect%" } } }, @@ -335,6 +355,11 @@ "command": "typescript.openTsServerLog", "title": "%typescript.openTsServerLog.title%", "category": "TypeScript" + }, + { + "command": "typescript.restartTsServer", + "title": "%typescript.restartTsServer%", + "category": "TypeScript" } ], "menus": { @@ -456,4 +481,4 @@ } ] } -} +} \ No newline at end of file diff --git a/extensions/typescript/package.nls.json b/extensions/typescript/package.nls.json index 78103b90939..0679841532d 100644 --- a/extensions/typescript/package.nls.json +++ b/extensions/typescript/package.nls.json @@ -28,11 +28,15 @@ "javascript.validate.enable": "Enable/disable JavaScript validation.", "typescript.goToProjectConfig.title": "Go to Project Configuration", "javascript.goToProjectConfig.title": "Go to Project Configuration", - "typescript.referencesCodeLens.enabled": "Enable/disable references CodeLens. Requires TypeScript >= 2.0.6.", + "javascript.referencesCodeLens.enabled": "Enable/disable references CodeLens in JavaScript files.", + "typescript.referencesCodeLens.enabled": "Enable/disable references CodeLens in TypeScript files. Requires TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Enable/disable implementations CodeLens. Requires TypeScript >= 2.2.0.", - "typescript.openTsServerLog.title": "Open TS Server log file", + "typescript.openTsServerLog.title": "Open TS Server log", + "typescript.restartTsServer": "Restart TS server", "typescript.selectTypeScriptVersion.title": "Select TypeScript Version", "jsDocCompletion.enabled": "Enable/disable auto JSDoc comments", "javascript.implicitProjectConfig.checkJs": "Enable/disable semantic checking of JavaScript files. Existing jsconfig.json or tsconfig.json files override this setting. Requires TypeScript >=2.3.1.", - "typescript.check.npmIsInstalled": "Check if NPM is installed for automatic typings acquisition" + "typescript.check.npmIsInstalled": "Check if NPM is installed for automatic typings acquisition", + "javascript.nameSuggestions": "Enable/disable including unique names from the file in JavaScript suggestion lists.", + "typescript.tsc.autoDetect": "Controls whether auto detection of tsc tasks is on or off." } diff --git a/extensions/typescript/src/features/baseCodeLensProvider.ts b/extensions/typescript/src/features/baseCodeLensProvider.ts index 986cb09b8d0..20952150c4b 100644 --- a/extensions/typescript/src/features/baseCodeLensProvider.ts +++ b/extensions/typescript/src/features/baseCodeLensProvider.ts @@ -3,9 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import { CodeLensProvider, CodeLens, CancellationToken, TextDocument, Range, Uri, Position, Event, EventEmitter, workspace, } from 'vscode'; +import { CodeLensProvider, CodeLens, CancellationToken, TextDocument, Range, Uri, Position, Event, EventEmitter, ProviderResult, } from 'vscode'; import * as Proto from '../protocol'; import { ITypescriptServiceClient } from '../typescriptService'; @@ -21,35 +19,32 @@ export class ReferencesCodeLens extends CodeLens { } export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider { - private enabled: boolean = false; + private enabled: boolean = true; private onDidChangeCodeLensesEmitter = new EventEmitter(); public constructor( - protected client: ITypescriptServiceClient, - private toggleSettingName: string + protected client: ITypescriptServiceClient ) { } public get onDidChangeCodeLenses(): Event { return this.onDidChangeCodeLensesEmitter.event; } - public updateConfiguration(): void { - const typeScriptConfig = workspace.getConfiguration('typescript'); - const wasEnabled = this.enabled; - this.enabled = typeScriptConfig.get(this.toggleSettingName, false); - if (wasEnabled !== this.enabled) { + protected setEnabled(enabled: false): void { + if (this.enabled !== enabled) { + this.enabled = enabled; this.onDidChangeCodeLensesEmitter.fire(); } } - provideCodeLenses(document: TextDocument, token: CancellationToken): Promise { + provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult { if (!this.enabled) { - return Promise.resolve([]); + return []; } const filepath = this.client.normalizePath(document.uri); if (!filepath) { - return Promise.resolve([]); + return []; } return this.client.execute('navtree', { file: filepath }, token).then(response => { if (!response) { @@ -61,6 +56,9 @@ export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider tree.childItems.forEach(item => this.walkNavTree(document, item, null, referenceableSpans)); } return referenceableSpans.map(span => new ReferencesCodeLens(document.uri, filepath, span)); + }, (err: any) => { + this.client.error(`'navtree' request failed with error.`, err); + return []; }); } @@ -108,7 +106,7 @@ export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider const text = document.getText(range); - const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${(item.text || '').replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}\\b`, 'gm'); + const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${(item.text || '').replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}(\\b|\\W)`, 'gm'); const match = identifierMatch.exec(text); const prefixLength = match ? match.index + match[1].length : 0; const startOffset = document.offsetAt(new Position(range.start.line, range.start.character)) + prefixLength; diff --git a/extensions/typescript/src/features/bufferSyncSupport.ts b/extensions/typescript/src/features/bufferSyncSupport.ts index 9e9858902e4..f2b11faebef 100644 --- a/extensions/typescript/src/features/bufferSyncSupport.ts +++ b/extensions/typescript/src/features/bufferSyncSupport.ts @@ -2,16 +2,14 @@ * 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 cp from 'child_process'; import * as fs from 'fs'; -import { workspace, window, TextDocument, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Disposable, MessageItem } from 'vscode'; +import { workspace, window, TextDocument, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Disposable, MessageItem, Uri, commands } from 'vscode'; import * as Proto from '../protocol'; import { ITypescriptServiceClient } from '../typescriptService'; import { Delayer } from '../utils/async'; -import LinkedMap from './linkedMap'; import * as nls from 'vscode-nls'; let localize = nls.loadMessageBundle(); @@ -20,26 +18,24 @@ interface IDiagnosticRequestor { requestDiagnostic(filepath: string): void; } -const Mode2ScriptKind: ObjectMap<'TS' | 'JS' | 'TSX' | 'JSX'> = { - 'typescript': 'TS', - 'typescriptreact': 'TSX', - 'javascript': 'JS', - 'javascriptreact': 'JSX' -}; +function mode2ScriptKind(mode: string): 'TS' | 'TSX' | 'JS' | 'JSX' | undefined { + switch (mode) { + case 'typescript': return 'TS'; + case 'typescriptreact': return 'TSX'; + case 'javascript': return 'JS'; + case 'javascriptreact': return 'JSX'; + } + return undefined; +} class SyncedBuffer { - private document: TextDocument; - private filepath: string; - private diagnosticRequestor: IDiagnosticRequestor; - private client: ITypescriptServiceClient; - - constructor(document: TextDocument, filepath: string, diagnosticRequestor: IDiagnosticRequestor, client: ITypescriptServiceClient) { - this.document = document; - this.filepath = filepath; - this.diagnosticRequestor = diagnosticRequestor; - this.client = client; - } + constructor( + private readonly document: TextDocument, + private readonly filepath: string, + private readonly diagnosticRequestor: IDiagnosticRequestor, + private readonly client: ITypescriptServiceClient + ) { } public open(): void { const args: Proto.OpenRequestArgs = { @@ -48,7 +44,7 @@ class SyncedBuffer { }; if (this.client.apiVersion.has203Features()) { - const scriptKind = Mode2ScriptKind[this.document.languageId]; + const scriptKind = mode2ScriptKind(this.document.languageId); if (scriptKind) { args.scriptKindName = scriptKind; } @@ -66,23 +62,22 @@ class SyncedBuffer { } public close(): void { - let args: Proto.FileRequestArgs = { + const args: Proto.FileRequestArgs = { file: this.filepath }; this.client.execute('close', args, false); } - onContentChanged(events: TextDocumentContentChangeEvent[]): void { - let filePath = this.client.normalizePath(this.document.uri); + public onContentChanged(events: TextDocumentContentChangeEvent[]): void { + const filePath = this.client.normalizePath(this.document.uri); if (!filePath) { return; } - for (let i = 0; i < events.length; i++) { - let event = events[i]; - let range = event.range; - let text = event.text; - let args: Proto.ChangeRequestArgs = { + for (const event of events) { + const range = event.range; + const text = event.text; + const args: Proto.ChangeRequestArgs = { file: filePath, line: range.start.line + 1, offset: range.start.character + 1, @@ -103,40 +98,31 @@ export interface Diagnostics { const checkTscVersionSettingKey = 'check.tscVersion'; export default class BufferSyncSupport { - private client: ITypescriptServiceClient; + private readonly client: ITypescriptServiceClient; private _validate: boolean; - private modeIds: ObjectMap; - private extensions: ObjectMap; - private diagnostics: Diagnostics; - private disposables: Disposable[] = []; - private syncedBuffers: ObjectMap; - - private projectValidationRequested: boolean; + private readonly modeIds: Set; + private readonly diagnostics: Diagnostics; + private readonly disposables: Disposable[] = []; + private readonly syncedBuffers: ObjectMap; private pendingDiagnostics: { [key: string]: number; }; - private diagnosticDelayer: Delayer; - private emitQueue: LinkedMap; + private readonly diagnosticDelayer: Delayer; private checkGlobalTSCVersion: boolean; - constructor(client: ITypescriptServiceClient, modeIds: string[], diagnostics: Diagnostics, extensions: ObjectMap, validate: boolean = true) { + constructor(client: ITypescriptServiceClient, modeIds: string[], diagnostics: Diagnostics, validate: boolean = true) { this.client = client; - this.modeIds = Object.create(null); - modeIds.forEach(modeId => this.modeIds[modeId] = true); + this.modeIds = new Set(modeIds); this.diagnostics = diagnostics; - this.extensions = extensions; this._validate = validate; - this.projectValidationRequested = false; - this.pendingDiagnostics = Object.create(null); this.diagnosticDelayer = new Delayer(300); this.syncedBuffers = Object.create(null); - this.emitQueue = new LinkedMap(); const tsConfig = workspace.getConfiguration('typescript'); - this.checkGlobalTSCVersion = client.checkGlobalTSCVersion && this.modeIds['typescript'] === true && tsConfig.get(checkTscVersionSettingKey, true); + this.checkGlobalTSCVersion = client.checkGlobalTSCVersion && this.modeIds.has('typescript') && tsConfig.get(checkTscVersionSettingKey, true); } public listen(): void { @@ -175,7 +161,7 @@ export default class BufferSyncSupport { } private onDidOpenTextDocument(document: TextDocument): void { - if (!this.modeIds[document.languageId]) { + if (!this.modeIds.has(document.languageId)) { return; } let resource = document.uri; @@ -299,21 +285,6 @@ export default class BufferSyncSupport { id: number; } - function openUrl(url: string) { - let cmd: string; - switch (process.platform) { - case 'darwin': - cmd = 'open'; - break; - case 'win32': - cmd = 'start'; - break; - default: - cmd = 'xdg-open'; - } - return cp.exec(cmd + ' ' + url); - } - let tscVersion: string | undefined = undefined; try { let out = cp.execSync('tsc --version', { encoding: 'utf8' }); @@ -347,7 +318,7 @@ export default class BufferSyncSupport { } switch (selected.id) { case 1: - openUrl('http://go.microsoft.com/fwlink/?LinkId=826239'); + commands.executeCommand('vscode.open', Uri.parse('http://go.microsoft.com/fwlink/?LinkId=826239')); break; case 2: const tsConfig = workspace.getConfiguration('typescript'); diff --git a/extensions/typescript/src/features/codeActionProvider.ts b/extensions/typescript/src/features/codeActionProvider.ts index aea55cef7ed..8f0dd56f01d 100644 --- a/extensions/typescript/src/features/codeActionProvider.ts +++ b/extensions/typescript/src/features/codeActionProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { CodeActionProvider, TextDocument, Range, CancellationToken, CodeActionContext, Command, commands, Uri, workspace, WorkspaceEdit, TextEdit, FormattingOptions, window, ProviderResult } from 'vscode'; import * as Proto from '../protocol'; @@ -58,7 +56,7 @@ export default class TypeScriptCodeActionProvider implements CodeActionProvider }; return this.getSupportedActionsForContext(context) .then(supportedActions => { - if (!supportedActions.length) { + if (!supportedActions.size) { return []; } return this.client.execute('getCodeFixes', { @@ -67,8 +65,8 @@ export default class TypeScriptCodeActionProvider implements CodeActionProvider endLine: range.end.line + 1, startOffset: range.start.character + 1, endOffset: range.end.character + 1, - errorCodes: supportedActions - }, token).then(response => response.body || []); + errorCodes: Array.from(supportedActions) + } as Proto.CodeFixRequestArgs, token).then(response => response.body || []); }) .then(codeActions => codeActions.map(action => this.actionToEdit(source, action))); } @@ -87,11 +85,11 @@ export default class TypeScriptCodeActionProvider implements CodeActionProvider return this._supportedCodeActions; } - private getSupportedActionsForContext(context: CodeActionContext) { + private getSupportedActionsForContext(context: CodeActionContext): Thenable> { return this.supportedCodeActions.then(supportedActions => - context.diagnostics + new Set(context.diagnostics .map(diagnostic => +diagnostic.code) - .filter(code => supportedActions[code])); + .filter(code => supportedActions[code]))); } private actionToEdit(source: Source, action: Proto.CodeAction): Command { diff --git a/extensions/typescript/src/features/completionItemProvider.ts b/extensions/typescript/src/features/completionItemProvider.ts index 9a4ad7c1f7d..5f0740be10c 100644 --- a/extensions/typescript/src/features/completionItemProvider.ts +++ b/extensions/typescript/src/features/completionItemProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { CompletionItem, TextDocument, Position, CompletionItemKind, CompletionItemProvider, CancellationToken, TextEdit, Range, SnippetString, workspace, ProviderResult } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; @@ -128,11 +126,13 @@ class MyCompletionItem extends CompletionItem { } interface Configuration { - useCodeSnippetsOnMethodSuggest?: boolean; + useCodeSnippetsOnMethodSuggest: boolean; + nameSuggestions: boolean; } namespace Configuration { export const useCodeSnippetsOnMethodSuggest = 'useCodeSnippetsOnMethodSuggest'; + export const nameSuggestions = 'nameSuggestions'; } export default class TypeScriptCompletionItemProvider implements CompletionItemProvider { @@ -143,13 +143,19 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP private client: ITypescriptServiceClient, private typingsStatus: TypingsStatus ) { - this.config = { useCodeSnippetsOnMethodSuggest: false }; + this.config = { + useCodeSnippetsOnMethodSuggest: false, + nameSuggestions: true + }; } public updateConfiguration(): void { // Use shared setting for js and ts const typeScriptConfig = workspace.getConfiguration('typescript'); this.config.useCodeSnippetsOnMethodSuggest = typeScriptConfig.get(Configuration.useCodeSnippetsOnMethodSuggest, false); + + const jsConfig = workspace.getConfiguration('javascript'); + this.config.nameSuggestions = jsConfig.get(Configuration.nameSuggestions, true); } public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise { @@ -202,13 +208,15 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP // Prevents incorrectly completing while typing spread operators. if (position.character > 0) { const preText = document.getText(new Range( - new Position(position.line, 0), - new Position(position.line, position.character - 1))); + position.line, 0, + position.line, position.character - 1)); enableDotCompletions = preText.match(/[a-z_$\)\]\}]\s*$/ig) !== null; } - for (let i = 0; i < body.length; i++) { - const element = body[i]; + for (const element of body) { + if (element.kind === PConst.Kind.warning && !this.config.nameSuggestions) { + continue; + } const item = new MyCompletionItem(position, document, element, enableDotCompletions, !this.config.useCodeSnippetsOnMethodSuggest); completionItems.push(item); } @@ -242,9 +250,10 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP return item; } const detail = details[0]; - item.documentation = Previewer.plain(detail.documentation); item.detail = Previewer.plain(detail.displayParts); + item.documentation = Previewer.plainDocumentation(detail.documentation, detail.tags); + if (detail && this.config.useCodeSnippetsOnMethodSuggest && (item.kind === CompletionItemKind.Function || item.kind === CompletionItemKind.Method)) { return this.isValidFunctionCompletionContext(filepath, item.position).then(shouldCompleteFunction => { if (shouldCompleteFunction) { diff --git a/extensions/typescript/src/features/definitionProvider.ts b/extensions/typescript/src/features/definitionProvider.ts index ee364a63614..2713fc603db 100644 --- a/extensions/typescript/src/features/definitionProvider.ts +++ b/extensions/typescript/src/features/definitionProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { DefinitionProvider, TextDocument, Position, CancellationToken, Definition } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; diff --git a/extensions/typescript/src/features/definitionProviderBase.ts b/extensions/typescript/src/features/definitionProviderBase.ts index 3cf66901015..b405d28fbaf 100644 --- a/extensions/typescript/src/features/definitionProviderBase.ts +++ b/extensions/typescript/src/features/definitionProviderBase.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { TextDocument, Position, Range, CancellationToken, Location } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/directiveCommentCompletionProvider.ts b/extensions/typescript/src/features/directiveCommentCompletionProvider.ts new file mode 100644 index 00000000000..6dd8aa8418d --- /dev/null +++ b/extensions/typescript/src/features/directiveCommentCompletionProvider.ts @@ -0,0 +1,69 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Position, CompletionItemProvider, CompletionItemKind, TextDocument, CancellationToken, CompletionItem, ProviderResult, Range } from 'vscode'; + +import { ITypescriptServiceClient } from '../typescriptService'; + +import * as nls from 'vscode-nls'; +const localize = nls.loadMessageBundle(); + +interface Directive { + value: string; + description: string; +} + +const directives: Directive[] = [ + { + value: '@ts-check', + description: localize( + 'ts-check', + 'Enables semantic checking in a JavaScript file. Must be at the top of a file.') + }, { + value: '@ts-nocheck', + description: localize( + 'ts-nocheck', + 'Disables semantic checking in a JavaScript file. Must be at the top of a file.') + }, { + value: '@ts-ignore', + description: localize( + 'ts-ignore', + 'Suppresses @ts-check errors on the next line of a file.') + } +]; + +export class DirectiveCommentCompletionProvider implements CompletionItemProvider { + constructor( + private client: ITypescriptServiceClient, + ) { } + + public provideCompletionItems(document: TextDocument, position: Position, _token: CancellationToken): ProviderResult { + if (!this.client.apiVersion.has230Features()) { + return []; + } + + const file = this.client.normalizePath(document.uri); + if (!file) { + return []; + } + + const line = document.lineAt(position.line).text; + const prefix = line.slice(0, position.character); + const match = prefix.match(/^\s*\/\/+\s?(@[a-zA-Z\-]*)?$/); + if (match) { + return directives.map(directive => { + const item = new CompletionItem(directive.value, CompletionItemKind.Snippet); + item.detail = directive.description; + item.range = new Range(position.line, Math.max(0, position.character - match[1].length), position.line, position.character); + return item; + }); + } + return []; + } + + public resolveCompletionItem(item: CompletionItem, _token: CancellationToken) { + return item; + } +} \ No newline at end of file diff --git a/extensions/typescript/src/features/documentHighlightProvider.ts b/extensions/typescript/src/features/documentHighlightProvider.ts index afffc9fa60c..f0140953d92 100644 --- a/extensions/typescript/src/features/documentHighlightProvider.ts +++ b/extensions/typescript/src/features/documentHighlightProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { DocumentHighlightProvider, DocumentHighlight, DocumentHighlightKind, TextDocument, Position, Range, CancellationToken } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/documentSymbolProvider.ts b/extensions/typescript/src/features/documentSymbolProvider.ts index 5d4a8595a37..aa6a4e5ab7f 100644 --- a/extensions/typescript/src/features/documentSymbolProvider.ts +++ b/extensions/typescript/src/features/documentSymbolProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { DocumentSymbolProvider, SymbolInformation, SymbolKind, TextDocument, Range, Location, CancellationToken, Uri } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/formattingProvider.ts b/extensions/typescript/src/features/formattingProvider.ts index 77f6971201e..40b5522d0fa 100644 --- a/extensions/typescript/src/features/formattingProvider.ts +++ b/extensions/typescript/src/features/formattingProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { workspace as Workspace, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, FormattingOptions, TextDocument, Position, Range, CancellationToken, TextEdit, WorkspaceConfiguration } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/hoverProvider.ts b/extensions/typescript/src/features/hoverProvider.ts index 960d4964c42..e726ff1dc34 100644 --- a/extensions/typescript/src/features/hoverProvider.ts +++ b/extensions/typescript/src/features/hoverProvider.ts @@ -3,12 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { HoverProvider, Hover, TextDocument, Position, Range, CancellationToken } from 'vscode'; import * as Proto from '../protocol'; import { ITypescriptServiceClient } from '../typescriptService'; +import { tagsMarkdownPreview } from "./previewer"; export default class TypeScriptHoverProvider implements HoverProvider { @@ -29,7 +28,7 @@ export default class TypeScriptHoverProvider implements HoverProvider { if (response && response.body) { const data = response.body; return new Hover( - [{ language: 'typescript', value: data.displayString }, data.documentation], + TypeScriptHoverProvider.getContents(data), new Range(data.start.line - 1, data.start.offset - 1, data.end.line - 1, data.end.offset - 1)); } return undefined; @@ -38,4 +37,12 @@ export default class TypeScriptHoverProvider implements HoverProvider { return null; }); } + + private static getContents(data: Proto.QuickInfoResponseBody) { + const tags = tagsMarkdownPreview(data.tags); + return [ + { language: 'typescript', value: data.displayString }, + data.documentation + (tags ? '\n\n' + tags : '') + ]; + } } \ No newline at end of file diff --git a/extensions/typescript/src/features/implementationProvider.ts b/extensions/typescript/src/features/implementationProvider.ts index 452afad1033..ab4d5b8c45b 100644 --- a/extensions/typescript/src/features/implementationProvider.ts +++ b/extensions/typescript/src/features/implementationProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { ImplementationProvider, TextDocument, Position, CancellationToken, Definition } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; diff --git a/extensions/typescript/src/features/implementationsCodeLensProvider.ts b/extensions/typescript/src/features/implementationsCodeLensProvider.ts index ad083c2cbe4..30daa644a4e 100644 --- a/extensions/typescript/src/features/implementationsCodeLensProvider.ts +++ b/extensions/typescript/src/features/implementationsCodeLensProvider.ts @@ -3,9 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import { CodeLens, CancellationToken, TextDocument, Range, Location } from 'vscode'; +import { CodeLens, CancellationToken, TextDocument, Range, Location, ProviderResult, workspace } from 'vscode'; import * as Proto from '../protocol'; import * as PConst from '../protocol.const'; @@ -17,14 +15,20 @@ const localize = nls.loadMessageBundle(); export default class TypeScriptImplementationsCodeLensProvider extends TypeScriptBaseCodeLensProvider { public constructor( - client: ITypescriptServiceClient + client: ITypescriptServiceClient, + private readonly language: string ) { - super(client, 'implementationsCodeLens.enabled'); + super(client); } - provideCodeLenses(document: TextDocument, token: CancellationToken): Promise { + public updateConfiguration(): void { + const config = workspace.getConfiguration(this.language); + this.setEnabled(config.get('implementationsCodeLens.enabled', false)); + } + + provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult { if (!this.client.apiVersion.has220Features()) { - return Promise.resolve([]); + return []; } return super.provideCodeLenses(document, token); } diff --git a/extensions/typescript/src/features/jsDocCompletionProvider.ts b/extensions/typescript/src/features/jsDocCompletionProvider.ts index 7f9aaf8c029..502cf89c42c 100644 --- a/extensions/typescript/src/features/jsDocCompletionProvider.ts +++ b/extensions/typescript/src/features/jsDocCompletionProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { Position, Range, CompletionItemProvider, CompletionItemKind, TextDocument, CancellationToken, CompletionItem, window, Uri, ProviderResult, TextEditor, SnippetString, workspace } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; @@ -26,7 +24,7 @@ namespace Configuration { class JsDocCompletionItem extends CompletionItem { constructor( - file: Uri, + document: TextDocument, position: Position, shouldGetJSDocFromTSServer: boolean, ) { @@ -34,10 +32,19 @@ class JsDocCompletionItem extends CompletionItem { this.detail = localize('typescript.jsDocCompletionItem.documentation', 'JSDoc comment'); this.insertText = ''; this.sortText = '\0'; + + const line = document.lineAt(position.line).text; + const prefix = line.slice(0, position.character).match(/\/\**\s*$/); + const suffix = line.slice(position.character).match(/^\s*\**\//); + const start = position.translate(0, prefix ? -prefix[0].length : 0); + this.range = new Range( + start, + position.translate(0, suffix ? suffix[0].length : 0)); + this.command = { title: 'Try Complete JSDoc', command: TryCompleteJsDocCommand.COMMAND_NAME, - arguments: [file, position, shouldGetJSDocFromTSServer] + arguments: [document.uri, start, shouldGetJSDocFromTSServer] }; } } @@ -67,7 +74,7 @@ export class JsDocCompletionProvider implements CompletionItemProvider { const line = document.lineAt(position.line).text; const prefix = line.slice(0, position.character); if (prefix.match(/^\s*$|\/\*\*\s*$|^\s*\/\*\*+\s*$/)) { - return [new JsDocCompletionItem(document.uri, position, this.config.enabled)]; + return [new JsDocCompletionItem(document, position, this.config.enabled)]; } return []; } @@ -80,16 +87,16 @@ export class JsDocCompletionProvider implements CompletionItemProvider { export class TryCompleteJsDocCommand { static COMMAND_NAME = '_typeScript.tryCompleteJsDoc'; - constructor(private client: ITypescriptServiceClient) { - - } + constructor( + private lazyClient: () => ITypescriptServiceClient + ) { } /** * Try to insert a jsdoc comment, using a template provide by typescript * if possible, otherwise falling back to a default comment format. */ - public tryCompleteJsDoc(resource: Uri, position: Position, shouldGetJSDocFromTSServer: boolean): Thenable { - const file = this.client.normalizePath(resource); + public tryCompleteJsDoc(resource: Uri, start: Position, shouldGetJSDocFromTSServer: boolean): Thenable { + const file = this.lazyClient().normalizePath(resource); if (!file) { return Promise.resolve(false); } @@ -99,44 +106,17 @@ export class TryCompleteJsDocCommand { return Promise.resolve(false); } - return this.prepForDocCompletion(editor, position) - .then((start: Position) => { - if (!shouldGetJSDocFromTSServer) { - return this.tryInsertDefaultDoc(editor, start); - } - - return this.tryInsertJsDocFromTemplate(editor, file, start) - .then((didInsertFromTemplate: boolean) => { - if (didInsertFromTemplate) { - return true; - } - return this.tryInsertDefaultDoc(editor, start); - }); - }); - } - - /** - * Prepare the area around the position for insertion of the jsdoc. - * - * Removes any the prefix and suffix of a possible jsdoc - */ - private prepForDocCompletion(editor: TextEditor, position: Position): Thenable { - const line = editor.document.lineAt(position.line).text; - const prefix = line.slice(0, position.character).match(/\/\**\s*$/); - const suffix = line.slice(position.character).match(/^\s*\**\//); - if (!prefix && !suffix) { - // Nothing to remove - return Promise.resolve(position); + if (!shouldGetJSDocFromTSServer) { + return this.tryInsertDefaultDoc(editor, start); } - const start = position.translate(0, prefix ? -prefix[0].length : 0); - return editor.edit( - edits => { - edits.delete(new Range(start, position.translate(0, suffix ? suffix[0].length : 0))); - }, { - undoStopBefore: true, - undoStopAfter: false - }).then(() => start); + return this.tryInsertJsDocFromTemplate(editor, file, start) + .then((didInsertFromTemplate: boolean) => { + if (didInsertFromTemplate) { + return true; + } + return this.tryInsertDefaultDoc(editor, start); + }); } private tryInsertJsDocFromTemplate(editor: TextEditor, file: string, position: Position): Promise { @@ -146,7 +126,7 @@ export class TryCompleteJsDocCommand { offset: position.character + 1 }; return Promise.race([ - this.client.execute('docCommentTemplate', args), + this.lazyClient().execute('docCommentTemplate', args), new Promise((_, reject) => setTimeout(reject, 250)) ]).then((res: DocCommandTemplateResponse) => { if (!res || !res.body) { diff --git a/extensions/typescript/src/features/linkedMap.ts b/extensions/typescript/src/features/linkedMap.ts deleted file mode 100644 index 9f0a41a02bb..00000000000 --- a/extensions/typescript/src/features/linkedMap.ts +++ /dev/null @@ -1,168 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -interface Item { - previous: Item | undefined; - next: Item | undefined; - key: string; - value: T; -} - -export default class LinkedMap { - - private map: ObjectMap>; - private head: Item | undefined; - private tail: Item | undefined; - private _length: number; - - constructor() { - this.map = Object.create(null); - this.head = undefined; - this.tail = undefined; - this._length = 0; - } - - public isEmpty(): boolean { - return !this.head && !this.tail; - } - - public length(): number { - return this._length; - } - - public get(key: string): T | undefined { - const item = this.map[key]; - if (!item) { - return undefined; - } - return item.value; - } - - public add(key: string, value: T, touch = false): void { - let item = this.map[key]; - if (item) { - item.value = value; - if (touch) { - this.touch(item); - } - } - else { - item = { key, value, next: undefined, previous: undefined }; - if (touch) { - this.addItemFirst(item); - } - else { - this.addItemLast(item); - } - this.map[key] = item; - this._length++; - } - } - - public remove(key: string): T | undefined { - const item = this.map[key]; - if (!item) { - return undefined; - } - delete this.map[key]; - this.removeItem(item); - this._length--; - return item.value; - } - - public shift(): T | undefined { - if (!this.head && !this.tail) { - return undefined; - } - if (!this.head || !this.tail) { - throw new Error('Invalid list'); - } - const item = this.head; - delete this.map[item.key]; - this.removeItem(item); - this._length--; - return item.value; - } - - private addItemFirst(item: Item): void { - // First time Insert - if (!this.head && !this.tail) { - this.tail = item; - } else if (!this.head) { - throw new Error('Invalid list'); - } else { - item.next = this.head; - this.head.previous = item; - } - this.head = item; - } - - private addItemLast(item: Item): void { - // First time Insert - if (!this.head && !this.tail) { - this.head = item; - } else if (!this.tail) { - throw new Error('Invalid list'); - } else { - item.previous = this.tail; - this.tail.next = item; - } - this.tail = item; - } - - private removeItem(item: Item): void { - if (item === this.head && item === this.tail) { - this.head = undefined; - this.tail = undefined; - } - else if (item === this.head) { - this.head = item.next; - } - else if (item === this.tail) { - this.tail = item.previous; - } - else { - const next = item.next; - const previous = item.previous; - if (!next || !previous) { - throw new Error('Invalid list'); - } - next.previous = previous; - previous.next = next; - } - } - - private touch(item: Item): void { - if (item === this.head) { - return; - } - - const next = item.next; - const previous = item.previous; - - // Unlink the item - if (item === this.tail) { - this.tail = previous; - } - else { - // Both next and previous are not null since item was neither head nor tail. - if (next) { - next.previous = previous; - } - if (previous) { - previous.next = next; - } - } - - // Insert the node at head - item.previous = undefined; - item.next = this.head; - if (!this.head) { - throw new Error('Invalid list'); - } - this.head.previous = item; - this.head = item; - } -} diff --git a/extensions/typescript/src/features/previewer.ts b/extensions/typescript/src/features/previewer.ts index 0f57473fa58..c418e92d59a 100644 --- a/extensions/typescript/src/features/previewer.ts +++ b/extensions/typescript/src/features/previewer.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as Proto from '../protocol'; export function plain(parts: Proto.SymbolDisplayPart[]): string { @@ -12,4 +10,33 @@ export function plain(parts: Proto.SymbolDisplayPart[]): string { return ''; } return parts.map(part => part.text).join(''); +} + +export function tagsMarkdownPreview(tags: Proto.JSDocTagInfo[]): string { + return (tags || []) + .map(tag => { + const label = `*@${tag.name}*`; + if (!tag.text) { + return label; + } + return label + (tag.text.match(/\r\n|\n/g) ? ' \n' + tag.text : ` — ${tag.text}`); + }) + .join(' \n\n'); +} + +function tagsPlainPreview(tags: Proto.JSDocTagInfo[]): string { + return (tags || []) + .map(tag => { + const label = `@${tag.name}`; + if (!tag.text) { + return label; + } + return label + (tag.text.match(/\r\n|\n/g) ? '\n' + tag.text : ` — ${tag.text}`); + }) + .join('\n\ngit'); +} + +export function plainDocumentation(documentation: Proto.SymbolDisplayPart[], tags: Proto.JSDocTagInfo[]): string { + const parts = [plain(documentation), tagsPlainPreview(tags)]; + return parts.filter(x => x).join('\n\n'); } \ No newline at end of file diff --git a/extensions/typescript/src/features/referenceProvider.ts b/extensions/typescript/src/features/referenceProvider.ts index 56aac3a0cd8..47921d128ea 100644 --- a/extensions/typescript/src/features/referenceProvider.ts +++ b/extensions/typescript/src/features/referenceProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { ReferenceProvider, Location, TextDocument, Position, Range, CancellationToken } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/referencesCodeLensProvider.ts b/extensions/typescript/src/features/referencesCodeLensProvider.ts index b5d249d6d45..5576bfc4825 100644 --- a/extensions/typescript/src/features/referencesCodeLensProvider.ts +++ b/extensions/typescript/src/features/referencesCodeLensProvider.ts @@ -3,9 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import { CodeLens, CancellationToken, TextDocument, Range, Location } from 'vscode'; +import { CodeLens, CancellationToken, TextDocument, Range, Location, ProviderResult, workspace } from 'vscode'; import * as Proto from '../protocol'; import * as PConst from '../protocol.const'; @@ -17,14 +15,20 @@ const localize = nls.loadMessageBundle(); export default class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLensProvider { public constructor( - client: ITypescriptServiceClient + client: ITypescriptServiceClient, + private readonly language: string ) { - super(client, 'referencesCodeLens.enabled'); + super(client); } - provideCodeLenses(document: TextDocument, token: CancellationToken): Promise { + public updateConfiguration(): void { + const config = workspace.getConfiguration(this.language); + this.setEnabled(config.get('referencesCodeLens.enabled', false)); + } + + provideCodeLenses(document: TextDocument, token: CancellationToken): ProviderResult { if (!this.client.apiVersion.has206Features()) { - return Promise.resolve([]); + return []; } return super.provideCodeLenses(document, token); } diff --git a/extensions/typescript/src/features/renameProvider.ts b/extensions/typescript/src/features/renameProvider.ts index da279ab5596..39c85f307a7 100644 --- a/extensions/typescript/src/features/renameProvider.ts +++ b/extensions/typescript/src/features/renameProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { RenameProvider, WorkspaceEdit, TextDocument, Position, Range, CancellationToken } from 'vscode'; import * as Proto from '../protocol'; diff --git a/extensions/typescript/src/features/signatureHelpProvider.ts b/extensions/typescript/src/features/signatureHelpProvider.ts index 7d6f8942bfe..0a794878624 100644 --- a/extensions/typescript/src/features/signatureHelpProvider.ts +++ b/extensions/typescript/src/features/signatureHelpProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { SignatureHelpProvider, SignatureHelp, SignatureInformation, ParameterInformation, TextDocument, Position, CancellationToken } from 'vscode'; import * as Previewer from './previewer'; @@ -61,7 +59,7 @@ export default class TypeScriptSignatureHelpProvider implements SignatureHelpPro } }); signature.label += Previewer.plain(item.suffixDisplayParts); - signature.documentation = Previewer.plain(item.documentation); + signature.documentation = Previewer.plainDocumentation(item.documentation, item.tags); result.signatures.push(signature); }); diff --git a/extensions/typescript/src/features/taskProvider.ts b/extensions/typescript/src/features/taskProvider.ts new file mode 100644 index 00000000000..9cb0a3a64a8 --- /dev/null +++ b/extensions/typescript/src/features/taskProvider.ts @@ -0,0 +1,158 @@ +/*--------------------------------------------------------------------------------------------- + * 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 fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; + +import * as Proto from '../protocol'; +import TypeScriptServiceClient from '../typescriptServiceClient'; +import TsConfigProvider from "../utils/tsconfigProvider"; + + +const exists = (file: string): Promise => + new Promise((resolve, _reject) => { + fs.exists(file, (value: boolean) => { + resolve(value); + }); + }); + +/** + * Provides tasks for building `tsconfig.json` files in a project. + */ +class TscTaskProvider implements vscode.TaskProvider { + private readonly tsconfigProvider: TsConfigProvider; + + public constructor( + private readonly lazyClient: () => TypeScriptServiceClient + ) { + this.tsconfigProvider = new TsConfigProvider(); + } + + dispose() { + this.tsconfigProvider.dispose(); + } + + public async provideTasks(token: vscode.CancellationToken): Promise { + const rootPath = vscode.workspace.rootPath; + if (!rootPath) { + return []; + } + + const command = await this.getCommand(); + const projects = await this.getAllTsConfigs(token); + + return projects.map(configFile => { + const configFileName = path.relative(rootPath, configFile); + const buildTask = new vscode.ShellTask(`build ${configFileName}`, `${command} -p "${configFile}"`, '$tsc'); + buildTask.source = 'tsc'; + buildTask.group = vscode.TaskGroup.Build; + return buildTask; + }); + } + + private async getAllTsConfigs(token: vscode.CancellationToken): Promise { + const out = new Set(); + const configs = (await this.getTsConfigForActiveFile(token)).concat(await this.getTsConfigsInWorkspace()); + for (const config of configs) { + if (await exists(config)) { + out.add(config); + } + } + return Array.from(out); + } + + private async getTsConfigForActiveFile(token: vscode.CancellationToken): Promise { + const editor = vscode.window.activeTextEditor; + if (editor) { + if (path.basename(editor.document.fileName).match(/^tsconfig\.(.\.)?json$/)) { + return [editor.document.fileName]; + } + } + + const file = this.getActiveTypeScriptFile(); + if (!file) { + return []; + } + + const res: Proto.ProjectInfoResponse = await this.lazyClient().execute( + 'projectInfo', + { file, needFileNameList: false } as protocol.ProjectInfoRequestArgs, + token); + + if (!res || !res.body) { + return []; + } + + const { configFileName } = res.body; + if (configFileName && configFileName.indexOf('/dev/null/') !== 0) { + return [configFileName]; + } + return []; + } + + private async getTsConfigsInWorkspace(): Promise { + return Array.from(await this.tsconfigProvider.getConfigsForWorkspace()); + } + + private async getCommand(): Promise { + const platform = process.platform; + if (platform === 'win32' && await exists(path.join(vscode.workspace.rootPath!, 'node_modules', '.bin', 'tsc.cmd'))) { + return path.join('.', 'node_modules', '.bin', 'tsc.cmd'); + } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(vscode.workspace.rootPath!, 'node_modules', '.bin', 'tsc'))) { + return path.join('.', 'node_modules', '.bin', 'tsc'); + } else { + return 'tsc'; + } + } + + private getActiveTypeScriptFile(): string | null { + const editor = vscode.window.activeTextEditor; + if (editor) { + const document = editor.document; + if (document && (document.languageId === 'typescript' || document.languageId === 'typescriptreact')) { + return this.lazyClient().normalizePath(document.uri); + } + } + return null; + } +} + +type AutoDetect = 'on' | 'off'; + +/** + * Manages registrations of TypeScript task provides with VScode. + */ +export default class TypeScriptTaskProviderManager { + private taskProviderSub: vscode.Disposable | undefined = undefined; + private readonly disposables: vscode.Disposable[] = []; + + constructor( + private readonly lazyClient: () => TypeScriptServiceClient + ) { + vscode.workspace.onDidChangeConfiguration(this.onConfigurationChanged, this, this.disposables); + this.onConfigurationChanged(); + } + + dispose() { + if (this.taskProviderSub) { + this.taskProviderSub.dispose(); + this.taskProviderSub = undefined; + } + this.disposables.forEach(x => x.dispose()); + } + + private onConfigurationChanged() { + let autoDetect = vscode.workspace.getConfiguration('typescript.tsc').get('autoDetect'); + if (this.taskProviderSub && autoDetect === 'off') { + this.taskProviderSub.dispose(); + this.taskProviderSub = undefined; + } else if (!this.taskProviderSub && autoDetect === 'on') { + this.taskProviderSub = vscode.workspace.registerTaskProvider(new TscTaskProvider(this.lazyClient)); + } + } +} \ No newline at end of file diff --git a/extensions/typescript/src/features/typeDefinitionProvider.ts b/extensions/typescript/src/features/typeDefinitionProvider.ts index edaccf0bf33..d107f67580a 100644 --- a/extensions/typescript/src/features/typeDefinitionProvider.ts +++ b/extensions/typescript/src/features/typeDefinitionProvider.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { TypeDefinitionProvider, TextDocument, Position, CancellationToken, Definition } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; diff --git a/extensions/typescript/src/features/workspaceSymbolProvider.ts b/extensions/typescript/src/features/workspaceSymbolProvider.ts index 625c2d1c4ba..016ac8726b3 100644 --- a/extensions/typescript/src/features/workspaceSymbolProvider.ts +++ b/extensions/typescript/src/features/workspaceSymbolProvider.ts @@ -3,20 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { workspace, window, Uri, WorkspaceSymbolProvider, SymbolInformation, SymbolKind, Range, Location, CancellationToken } from 'vscode'; import * as Proto from '../protocol'; import { ITypescriptServiceClient } from '../typescriptService'; -const _kindMapping: { [kind: string]: SymbolKind } = Object.create(null); -_kindMapping['method'] = SymbolKind.Method; -_kindMapping['enum'] = SymbolKind.Enum; -_kindMapping['function'] = SymbolKind.Function; -_kindMapping['class'] = SymbolKind.Class; -_kindMapping['interface'] = SymbolKind.Interface; -_kindMapping['var'] = SymbolKind.Variable; +function getSymbolKind(item: Proto.NavtoItem): SymbolKind { + switch (item.kind) { + case 'method': return SymbolKind.Method; + case 'enum': return SymbolKind.Enum; + case 'function': return SymbolKind.Function; + case 'class': return SymbolKind.Class; + case 'interface': return SymbolKind.Interface; + case 'var': return SymbolKind.Variable; + default: return SymbolKind.Variable; + } +} export default class TypeScriptWorkspaceSymbolProvider implements WorkspaceSymbolProvider { public constructor( @@ -28,16 +30,16 @@ export default class TypeScriptWorkspaceSymbolProvider implements WorkspaceSymbo // general questions so we check the active editor. If this // doesn't match we take the first TS document. let uri: Uri | undefined = undefined; - let editor = window.activeTextEditor; + const editor = window.activeTextEditor; if (editor) { - let document = editor.document; + const document = editor.document; if (document && document.languageId === this.modeId) { uri = document.uri; } } if (!uri) { - let documents = workspace.textDocuments; - for (let document of documents) { + const documents = workspace.textDocuments; + for (const document of documents) { if (document.languageId === this.modeId) { uri = document.uri; break; @@ -53,34 +55,28 @@ export default class TypeScriptWorkspaceSymbolProvider implements WorkspaceSymbo if (!filepath) { return Promise.resolve([]); } - let args: Proto.NavtoRequestArgs = { + const args: Proto.NavtoRequestArgs = { file: filepath, searchValue: search }; - if (!args.file) { - return Promise.resolve([]); - } return this.client.execute('navto', args, token).then((response): SymbolInformation[] => { + const result: SymbolInformation[] = []; let data = response.body; if (data) { - let result: SymbolInformation[] = []; for (let item of data) { if (!item.containerName && item.kind === 'alias') { continue; } - let range = new Range(item.start.line - 1, item.start.offset - 1, item.end.line - 1, item.end.offset - 1); + const range = new Range(item.start.line - 1, item.start.offset - 1, item.end.line - 1, item.end.offset - 1); let label = item.name; if (item.kind === 'method' || item.kind === 'function') { label += '()'; } - result.push(new SymbolInformation(label, _kindMapping[item.kind], item.containerName ? item.containerName : '', + result.push(new SymbolInformation(label, getSymbolKind(item), item.containerName || '', new Location(this.client.asUrl(item.file), range))); } - return result; - } else { - return []; } - + return result; }, (err) => { this.client.error(`'navto' request failed with error.`, err); return []; diff --git a/extensions/typescript/src/protocol.const.ts b/extensions/typescript/src/protocol.const.ts index 6990868683d..822e05d2b21 100644 --- a/extensions/typescript/src/protocol.const.ts +++ b/extensions/typescript/src/protocol.const.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - export class Kind { public static readonly alias = 'alias'; public static readonly callSignature = 'call'; diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index cc01c02942b..9c207250932 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -7,9 +7,8 @@ * Includes code from typescript-sublime-plugin project, obtained from * https://github.com/Microsoft/TypeScript-Sublime-Plugin/blob/master/TypeScript%20Indent.tmPreferences * ------------------------------------------------------------------------------------------ */ -'use strict'; -import { env, languages, commands, workspace, window, ExtensionContext, Memento, IndentAction, Diagnostic, DiagnosticCollection, Range, Disposable, Uri, MessageItem, TextEditor, FileSystemWatcher, DiagnosticSeverity } from 'vscode'; +import { env, languages, commands, workspace, window, ExtensionContext, Memento, IndentAction, Diagnostic, DiagnosticCollection, Range, Disposable, Uri, MessageItem, TextEditor, DiagnosticSeverity, TextDocument, SnippetString } from 'vscode'; // This must be the first statement otherwise modules might got loaded with // the wrong locale. @@ -41,19 +40,22 @@ import WorkspaceSymbolProvider from './features/workspaceSymbolProvider'; import CodeActionProvider from './features/codeActionProvider'; import ReferenceCodeLensProvider from './features/referencesCodeLensProvider'; import { JsDocCompletionProvider, TryCompleteJsDocCommand } from './features/jsDocCompletionProvider'; +import { DirectiveCommentCompletionProvider } from './features/directiveCommentCompletionProvider'; +import TypeScriptTaskProviderManager from './features/taskProvider'; + import ImplementationCodeLensProvider from './features/implementationsCodeLensProvider'; import * as BuildStatus from './utils/buildStatus'; import * as ProjectStatus from './utils/projectStatus'; import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus'; -import * as VersionStatus from './utils/versionStatus'; +import VersionStatus from './utils/versionStatus'; +import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin } from "./utils/plugins"; interface LanguageDescription { id: string; diagnosticSource: string; modeIds: string[]; - extensions: string[]; - configFile: string; + configFile?: string; } enum ProjectConfigAction { @@ -66,87 +68,115 @@ interface ProjectConfigMessageItem extends MessageItem { id: ProjectConfigAction; } +const MODE_ID_TS = 'typescript'; +const MODE_ID_TSX = 'typescriptreact'; +const MODE_ID_JS = 'javascript'; +const MODE_ID_JSX = 'javascriptreact'; + +const standardLanguageDescriptions: LanguageDescription[] = [ + { + id: 'typescript', + diagnosticSource: 'ts', + modeIds: [MODE_ID_TS, MODE_ID_TSX], + configFile: 'tsconfig.json' + }, { + id: 'javascript', + diagnosticSource: 'js', + modeIds: [MODE_ID_JS, MODE_ID_JSX], + configFile: 'jsconfig.json' + } +]; + export function activate(context: ExtensionContext): void { - const MODE_ID_TS = 'typescript'; - const MODE_ID_TSX = 'typescriptreact'; - const MODE_ID_JS = 'javascript'; - const MODE_ID_JSX = 'javascriptreact'; + const plugins = getContributedTypeScriptServerPlugins(); - const clientHost = new TypeScriptServiceClientHost([ - { - id: 'typescript', - diagnosticSource: 'ts', - modeIds: [MODE_ID_TS, MODE_ID_TSX], - extensions: ['.ts', '.tsx'], - configFile: 'tsconfig.json' - }, - { - id: 'javascript', - diagnosticSource: 'js', - modeIds: [MODE_ID_JS, MODE_ID_JSX], - extensions: ['.js', '.jsx'], - configFile: 'jsconfig.json' - } - ], context.storagePath, context.globalState, context.workspaceState); - context.subscriptions.push(clientHost); + const lazyClientHost = (() => { + let clientHost: TypeScriptServiceClientHost | undefined; + return () => { + if (!clientHost) { + clientHost = new TypeScriptServiceClientHost(standardLanguageDescriptions, context.storagePath, context.globalState, context.workspaceState, plugins); + context.subscriptions.push(clientHost); + + const host = clientHost; + clientHost.serviceClient.onReady().then(() => { + context.subscriptions.push(ProjectStatus.create(host.serviceClient, + path => new Promise(resolve => setTimeout(() => resolve(host.handles(path)), 750)), + context.workspaceState)); + }, () => { + // Nothing to do here. The client did show a message; + }); + } + return clientHost; + }; + })(); - const client = clientHost.serviceClient; context.subscriptions.push(commands.registerCommand('typescript.reloadProjects', () => { - clientHost.reloadProjects(); + lazyClientHost().reloadProjects(); })); context.subscriptions.push(commands.registerCommand('javascript.reloadProjects', () => { - clientHost.reloadProjects(); + lazyClientHost().reloadProjects(); })); context.subscriptions.push(commands.registerCommand('typescript.selectTypeScriptVersion', () => { - client.onVersionStatusClicked(); + lazyClientHost().serviceClient.onVersionStatusClicked(); })); context.subscriptions.push(commands.registerCommand('typescript.openTsServerLog', () => { - client.openTsServerLogFile(); + lazyClientHost().serviceClient.openTsServerLogFile(); })); + context.subscriptions.push(commands.registerCommand('typescript.restartTsServer', () => { + lazyClientHost().serviceClient.restartTsServer(); + })); + + context.subscriptions.push(new TypeScriptTaskProviderManager(() => lazyClientHost().serviceClient)); + const goToProjectConfig = (isTypeScript: boolean) => { const editor = window.activeTextEditor; if (editor) { - clientHost.goToProjectConfig(isTypeScript, editor.document.uri); + lazyClientHost().goToProjectConfig(isTypeScript, editor.document.uri); } }; context.subscriptions.push(commands.registerCommand('typescript.goToProjectConfig', goToProjectConfig.bind(null, true))); context.subscriptions.push(commands.registerCommand('javascript.goToProjectConfig', goToProjectConfig.bind(null, false))); - const jsDocCompletionCommand = new TryCompleteJsDocCommand(client); + const jsDocCompletionCommand = new TryCompleteJsDocCommand(() => lazyClientHost().serviceClient); context.subscriptions.push(commands.registerCommand(TryCompleteJsDocCommand.COMMAND_NAME, jsDocCompletionCommand.tryCompleteJsDoc, jsDocCompletionCommand)); - window.onDidChangeActiveTextEditor(VersionStatus.showHideStatus, null, context.subscriptions); - client.onReady().then(() => { - context.subscriptions.push(ProjectStatus.create(client, - path => new Promise(resolve => setTimeout(() => resolve(clientHost.handles(path)), 750)), - context.workspaceState)); - }, () => { - // Nothing to do here. The client did show a message; - }); + const supportedLanguage = [].concat.apply([], standardLanguageDescriptions.map(x => x.modeIds).concat(plugins.map(x => x.languages))); + function didOpenTextDocument(textDocument: TextDocument): boolean { + if (supportedLanguage.indexOf(textDocument.languageId) >= 0) { + openListener.dispose(); + // Force activation + void lazyClientHost(); + return true; + } + return false; + }; + const openListener = workspace.onDidOpenTextDocument(didOpenTextDocument); + for (let textDocument of workspace.textDocuments) { + if (didOpenTextDocument(textDocument)) { + break; + } + } + BuildStatus.update({ queueLength: 0 }); } + const validateSetting = 'validate.enable'; class LanguageProvider { - - private readonly extensions: ObjectMap; private syntaxDiagnostics: ObjectMap; private readonly currentDiagnostics: DiagnosticCollection; private readonly bufferSyncSupport: BufferSyncSupport; - private completionItemProvider: CompletionItemProvider; private formattingProvider: FormattingProvider; private formattingProviderRegistration: Disposable | null; private typingsStatus: TypingsStatus; - private referenceCodeLensProvider: ReferenceCodeLensProvider; - private implementationCodeLensProvider: ImplementationCodeLensProvider; - private JsDocCompletionProvider: JsDocCompletionProvider; + private toUpdateOnConfigurationChanged: ({ updateConfiguration: () => void })[] = []; private _validate: boolean = true; @@ -158,14 +188,11 @@ class LanguageProvider { private readonly client: TypeScriptServiceClient, private readonly description: LanguageDescription ) { - this.extensions = Object.create(null); - description.extensions.forEach(extension => this.extensions[extension] = true); - this.bufferSyncSupport = new BufferSyncSupport(client, description.modeIds, { delete: (file: string) => { this.currentDiagnostics.delete(client.asUrl(file)); } - }, this.extensions); + }); this.syntaxDiagnostics = Object.create(null); this.currentDiagnostics = languages.createDiagnosticCollection(description.id); @@ -211,9 +238,12 @@ class LanguageProvider { const selector = this.description.modeIds; const config = workspace.getConfiguration(this.id); - this.completionItemProvider = new CompletionItemProvider(client, this.typingsStatus); - this.completionItemProvider.updateConfiguration(); - this.disposables.push(languages.registerCompletionItemProvider(selector, this.completionItemProvider, '.')); + const completionItemProvider = new CompletionItemProvider(client, this.typingsStatus); + completionItemProvider.updateConfiguration(); + this.toUpdateOnConfigurationChanged.push(completionItemProvider); + this.disposables.push(languages.registerCompletionItemProvider(selector, completionItemProvider, '.')); + + this.disposables.push(languages.registerCompletionItemProvider(selector, new DirectiveCommentCompletionProvider(client), '@')); this.formattingProvider = new FormattingProvider(client); this.formattingProvider.updateConfiguration(config); @@ -222,9 +252,9 @@ class LanguageProvider { this.formattingProviderRegistration = languages.registerDocumentRangeFormattingEditProvider(selector, this.formattingProvider); } - this.JsDocCompletionProvider = new JsDocCompletionProvider(client); - this.JsDocCompletionProvider.updateConfiguration(); - this.disposables.push(languages.registerCompletionItemProvider(selector, this.JsDocCompletionProvider, '*')); + const jsDocCompletionProvider = new JsDocCompletionProvider(client); + jsDocCompletionProvider.updateConfiguration(); + this.disposables.push(languages.registerCompletionItemProvider(selector, jsDocCompletionProvider, '*')); this.disposables.push(languages.registerHoverProvider(selector, new HoverProvider(client))); this.disposables.push(languages.registerDefinitionProvider(selector, new DefinitionProvider(client))); @@ -234,14 +264,6 @@ class LanguageProvider { this.disposables.push(languages.registerSignatureHelpProvider(selector, new SignatureHelpProvider(client), '(', ',')); this.disposables.push(languages.registerRenameProvider(selector, new RenameProvider(client))); - this.referenceCodeLensProvider = new ReferenceCodeLensProvider(client); - this.referenceCodeLensProvider.updateConfiguration(); - this.disposables.push(languages.registerCodeLensProvider(selector, this.referenceCodeLensProvider)); - - this.implementationCodeLensProvider = new ImplementationCodeLensProvider(client); - this.implementationCodeLensProvider.updateConfiguration(); - this.disposables.push(languages.registerCodeLensProvider(selector, this.implementationCodeLensProvider)); - this.disposables.push(languages.registerCodeActionsProvider(selector, new CodeActionProvider(client, this.description.id))); this.registerVersionDependentProviders(); @@ -249,6 +271,17 @@ class LanguageProvider { this.description.modeIds.forEach(modeId => { this.disposables.push(languages.registerWorkspaceSymbolProvider(new WorkspaceSymbolProvider(client, modeId))); + const referenceCodeLensProvider = new ReferenceCodeLensProvider(client, modeId); + referenceCodeLensProvider.updateConfiguration(); + this.toUpdateOnConfigurationChanged.push(referenceCodeLensProvider); + this.disposables.push(languages.registerCodeLensProvider(selector, referenceCodeLensProvider)); + + const implementationCodeLensProvider = new ImplementationCodeLensProvider(client, modeId); + implementationCodeLensProvider.updateConfiguration(); + this.toUpdateOnConfigurationChanged.push(implementationCodeLensProvider); + this.disposables.push(languages.registerCodeLensProvider(selector, implementationCodeLensProvider)); + + this.disposables.push(languages.setLanguageConfiguration(modeId, { indentationRules: { // ^(.*\*/)?\s*\}.*$ @@ -306,15 +339,7 @@ class LanguageProvider { private configurationChanged(): void { const config = workspace.getConfiguration(this.id); this.updateValidate(config.get(validateSetting, true)); - if (this.completionItemProvider) { - this.completionItemProvider.updateConfiguration(); - } - if (this.referenceCodeLensProvider) { - this.referenceCodeLensProvider.updateConfiguration(); - } - if (this.implementationCodeLensProvider) { - this.implementationCodeLensProvider.updateConfiguration(); - } + if (this.formattingProvider) { this.formattingProvider.updateConfiguration(config); if (!this.formattingProvider.isEnabled() && this.formattingProviderRegistration) { @@ -325,18 +350,26 @@ class LanguageProvider { this.formattingProviderRegistration = languages.registerDocumentRangeFormattingEditProvider(this.description.modeIds, this.formattingProvider); } } - if (this.JsDocCompletionProvider) { - this.JsDocCompletionProvider.updateConfiguration(); + + for (const toUpdate of this.toUpdateOnConfigurationChanged) { + toUpdate.updateConfiguration(); } } - public handles(file: string): boolean { - const extension = path.extname(file); - if ((extension && this.extensions[extension]) || this.bufferSyncSupport.handles(file)) { + public handles(file: string, doc: TextDocument): boolean { + if (doc && this.description.modeIds.indexOf(doc.languageId) >= 0) { return true; } + + if (this.bufferSyncSupport.handles(file)) { + return true; + } + const basename = path.basename(file); - return !!basename && basename === this.description.configFile; + if (!!basename && basename === this.description.configFile) { + return true; + } + return false; } public get id(): string { @@ -416,16 +449,17 @@ class LanguageProvider { class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { private client: TypeScriptServiceClient; - private languages: LanguageProvider[]; + private languages: LanguageProvider[] = []; private languagePerId: ObjectMap; - private configFileWatcher: FileSystemWatcher; private readonly disposables: Disposable[] = []; + private readonly versionStatus: VersionStatus; constructor( descriptions: LanguageDescription[], storagePath: string | undefined, globalState: Memento, - workspaceState: Memento + workspaceState: Memento, + plugins: TypeScriptServerPlugin[] ) { const handleProjectCreateOrDelete = () => { this.client.execute('reloadProjects', null, false); @@ -442,8 +476,10 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { configFileWatcher.onDidDelete(handleProjectCreateOrDelete, this, this.disposables); configFileWatcher.onDidChange(handleProjectChange, this, this.disposables); - this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState, this.disposables); - this.languages = []; + this.versionStatus = new VersionStatus(); + this.disposables.push(this.versionStatus); + + this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState, this.versionStatus, plugins, this.disposables); this.languagePerId = Object.create(null); for (const description of descriptions) { const manager = new LanguageProvider(this.client, description); @@ -451,6 +487,30 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { this.disposables.push(manager); this.languagePerId[description.id] = manager; } + + this.client.onReady().then(() => { + if (!this.client.apiVersion.has230Features()) { + return; + } + + const langauges = new Set(); + for (const plugin of plugins) { + for (const language of plugin.languages) { + langauges.add(language); + } + } + if (langauges.size) { + const description: LanguageDescription = { + id: 'typescript-plugins', + modeIds: Array.from(langauges.values()), + diagnosticSource: 'ts-plugins' + }; + const manager = new LanguageProvider(this.client, description); + this.languages.push(manager); + this.disposables.push(manager); + this.languagePerId[description.id] = manager; + } + }); } public dispose(): void { @@ -460,22 +520,12 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { obj.dispose(); } } - this.configFileWatcher.dispose(); } public get serviceClient(): TypeScriptServiceClient { return this.client; } - public restartTsServer(): void { - this.client.restartTsServer(); - if (this.languages) { - for (const provider of this.languages) { - provider.reInitialize(); - } - } - } - public reloadProjects(): void { this.client.execute('reloadProjects', null, false); this.triggerAllDiagnostics(); @@ -537,10 +587,15 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { switch (selected && selected.id) { case ProjectConfigAction.CreateConfig: const configFile = Uri.file(path.join(rootPath, isTypeScriptProject ? 'tsconfig.json' : 'jsconfig.json')); + const col = window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined; return workspace.openTextDocument(configFile) - .then(undefined, _ => workspace.openTextDocument(configFile.with({ scheme: 'untitled' }))) - .then(doc => - window.showTextDocument(doc, window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined)); + .then(doc => { + return window.showTextDocument(doc, col); + }, _ => { + return workspace.openTextDocument(configFile.with({ scheme: 'untitled' })) + .then(doc => window.showTextDocument(doc, col)) + .then(editor => editor.insertSnippet(new SnippetString('{\n\t$0\n}'))); + }); case ProjectConfigAction.LearnMore: if (isTypeScriptProject) { @@ -557,14 +612,15 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { }); } - private findLanguage(file: string): LanguageProvider | null { - for (let i = 0; i < this.languages.length; i++) { - let language = this.languages[i]; - if (language.handles(file)) { - return language; + private findLanguage(file: string): Thenable { + return workspace.openTextDocument(file).then((doc: TextDocument) => { + for (const language of this.languages) { + if (language.handles(file, doc)) { + return language; + } } - } - return null; + return null; + }, () => null); } private triggerAllDiagnostics() { @@ -579,22 +635,24 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { } /* internal */ syntaxDiagnosticsReceived(event: Proto.DiagnosticEvent): void { - let body = event.body; + const body = event.body; if (body && body.diagnostics) { - let language = this.findLanguage(body.file); - if (language) { - language.syntaxDiagnosticsReceived(body.file, this.createMarkerDatas(body.diagnostics, language.diagnosticSource)); - } + this.findLanguage(body.file).then(language => { + if (language) { + language.syntaxDiagnosticsReceived(body.file, this.createMarkerDatas(body.diagnostics, language.diagnosticSource)); + } + }); } } /* internal */ semanticDiagnosticsReceived(event: Proto.DiagnosticEvent): void { - let body = event.body; + const body = event.body; if (body && body.diagnostics) { - let language = this.findLanguage(body.file); - if (language) { - language.semanticDiagnosticsReceived(body.file, this.createMarkerDatas(body.diagnostics, language.diagnosticSource)); - } + this.findLanguage(body.file).then(language => { + if (language) { + language.semanticDiagnosticsReceived(body.file, this.createMarkerDatas(body.diagnostics, language.diagnosticSource)); + } + }); } /* if (Is.defined(body.queueLength)) { @@ -610,47 +668,48 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { return; } - const language = body.triggerFile ? this.findLanguage(body.triggerFile) : this.findLanguage(body.configFile); - if (!language) { - return; - } - if (body.diagnostics.length === 0) { - language.configFileDiagnosticsReceived(body.configFile, []); - } else if (body.diagnostics.length >= 1) { - workspace.openTextDocument(Uri.file(body.configFile)).then((document) => { - let curly: [number, number, number] | undefined = undefined; - let nonCurly: [number, number, number] | undefined = undefined; - let diagnostic: Diagnostic; - for (let index = 0; index < document.lineCount; index++) { - const line = document.lineAt(index); - const text = line.text; - const firstNonWhitespaceCharacterIndex = line.firstNonWhitespaceCharacterIndex; - if (firstNonWhitespaceCharacterIndex < text.length) { - if (text.charAt(firstNonWhitespaceCharacterIndex) === '{') { - curly = [index, firstNonWhitespaceCharacterIndex, firstNonWhitespaceCharacterIndex + 1]; - break; - } else { - const matches = /\s*([^\s]*)(?:\s*|$)/.exec(text.substr(firstNonWhitespaceCharacterIndex)); - if (matches && matches.length >= 1) { - nonCurly = [index, firstNonWhitespaceCharacterIndex, firstNonWhitespaceCharacterIndex + matches[1].length]; + (body.triggerFile ? this.findLanguage(body.triggerFile) : this.findLanguage(body.configFile)).then(language => { + if (!language) { + return; + } + if (body.diagnostics.length === 0) { + language.configFileDiagnosticsReceived(body.configFile, []); + } else if (body.diagnostics.length >= 1) { + workspace.openTextDocument(Uri.file(body.configFile)).then((document) => { + let curly: [number, number, number] | undefined = undefined; + let nonCurly: [number, number, number] | undefined = undefined; + let diagnostic: Diagnostic; + for (let index = 0; index < document.lineCount; index++) { + const line = document.lineAt(index); + const text = line.text; + const firstNonWhitespaceCharacterIndex = line.firstNonWhitespaceCharacterIndex; + if (firstNonWhitespaceCharacterIndex < text.length) { + if (text.charAt(firstNonWhitespaceCharacterIndex) === '{') { + curly = [index, firstNonWhitespaceCharacterIndex, firstNonWhitespaceCharacterIndex + 1]; + break; + } else { + const matches = /\s*([^\s]*)(?:\s*|$)/.exec(text.substr(firstNonWhitespaceCharacterIndex)); + if (matches && matches.length >= 1) { + nonCurly = [index, firstNonWhitespaceCharacterIndex, firstNonWhitespaceCharacterIndex + matches[1].length]; + } } } } - } - const match = curly || nonCurly; - if (match) { - diagnostic = new Diagnostic(new Range(match[0], match[1], match[0], match[2]), body.diagnostics[0].text); - } else { - diagnostic = new Diagnostic(new Range(0, 0, 0, 0), body.diagnostics[0].text); - } - if (diagnostic) { - diagnostic.source = language.diagnosticSource; - language.configFileDiagnosticsReceived(body.configFile, [diagnostic]); - } - }, _error => { - language.configFileDiagnosticsReceived(body.configFile, [new Diagnostic(new Range(0, 0, 0, 0), body.diagnostics[0].text)]); - }); - } + const match = curly || nonCurly; + if (match) { + diagnostic = new Diagnostic(new Range(match[0], match[1], match[0], match[2]), body.diagnostics[0].text); + } else { + diagnostic = new Diagnostic(new Range(0, 0, 0, 0), body.diagnostics[0].text); + } + if (diagnostic) { + diagnostic.source = language.diagnosticSource; + language.configFileDiagnosticsReceived(body.configFile, [diagnostic]); + } + }, _error => { + language.configFileDiagnosticsReceived(body.configFile, [new Diagnostic(new Range(0, 0, 0, 0), body.diagnostics[0].text)]); + }); + } + }); } private createMarkerDatas(diagnostics: Proto.Diagnostic[], source: string): Diagnostic[] { diff --git a/extensions/typescript/src/typescriptService.ts b/extensions/typescript/src/typescriptService.ts index bfc410c6cba..8b15cc79f7b 100644 --- a/extensions/typescript/src/typescriptService.ts +++ b/extensions/typescript/src/typescriptService.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { CancellationToken, Uri, Event } from 'vscode'; import * as Proto from './protocol'; diff --git a/extensions/typescript/src/typescriptServiceClient.ts b/extensions/typescript/src/typescriptServiceClient.ts index 66e83da0185..5e22350feb0 100644 --- a/extensions/typescript/src/typescriptServiceClient.ts +++ b/extensions/typescript/src/typescriptServiceClient.ts @@ -3,26 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as cp from 'child_process'; import * as path from 'path'; import * as fs from 'fs'; import * as os from 'os'; +import * as net from 'net'; import * as electron from './utils/electron'; import { Reader } from './utils/wireProtocol'; -import { workspace, window, extensions, Uri, CancellationToken, Disposable, OutputChannel, Memento, MessageItem, QuickPickItem, EventEmitter, Event, commands, WorkspaceConfiguration } from 'vscode'; +import { workspace, window, Uri, CancellationToken, Disposable, Memento, MessageItem, QuickPickItem, EventEmitter, Event, commands, WorkspaceConfiguration } from 'vscode'; import * as Proto from './protocol'; import { ITypescriptServiceClient, ITypescriptServiceClientHost, API } from './typescriptService'; +import { TypeScriptServerPlugin } from './utils/plugins'; +import Logger from './utils/logger'; -import * as VersionStatus from './utils/versionStatus'; +import VersionStatus from './utils/versionStatus'; import * as is from './utils/is'; -import TelemetryReporter from 'vscode-extension-telemetry'; - import * as nls from 'vscode-nls'; +import TelemetryReporter from "./utils/telemetry"; +import Tracer from "./utils/tracer"; const localize = nls.loadMessageBundle(); interface CallbackItem { @@ -41,34 +42,6 @@ interface RequestItem { callbacks: CallbackItem | null; } -interface IPackageInfo { - name: string; - version: string; - aiKey: string; -} - -enum Trace { - Off, - Messages, - Verbose -} - -namespace Trace { - export function fromString(value: string): Trace { - value = value.toLowerCase(); - switch (value) { - case 'off': - return Trace.Off; - case 'messages': - return Trace.Messages; - case 'verbose': - return Trace.Verbose; - default: - return Trace.Off; - } - } -} - enum TsServerLogLevel { Off, Normal, @@ -121,12 +94,6 @@ interface MyMessageItem extends MessageItem { id: MessageAction; } -interface TypeScriptServerPlugin { - path: string; - name: string; -} - - export default class TypeScriptServiceClient implements ITypescriptServiceClient { private static useWorkspaceTsdkStorageKey = 'typescript.useWorkspaceTsdk'; private static tsdkMigratedStorageKey = 'typescript.tsdkMigrated'; @@ -145,15 +112,14 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private localTsdk: string | null; private _checkGlobalTSCVersion: boolean; private _experimentalAutoBuild: boolean; - private trace: Trace; - private _output: OutputChannel; + private tracer: Tracer; + private readonly logger: Logger = new Logger(); private tsServerLogFile: string | null = null; private tsServerLogLevel: TsServerLogLevel = TsServerLogLevel.Off; private servicePromise: Thenable | null; private lastError: Error | null; private reader: Reader; private sequenceNumber: number; - private exitRequested: boolean; private firstStart: number; private lastStart: number; private numberRestarts: number; @@ -167,12 +133,20 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private _onDidEndInstallTypings = new EventEmitter(); private _onTypesInstallerInitializationFailed = new EventEmitter(); - private _packageInfo: IPackageInfo | null; private _apiVersion: API; private telemetryReporter: TelemetryReporter; private checkJs: boolean; - constructor(host: ITypescriptServiceClientHost, storagePath: string | undefined, globalState: Memento, private workspaceState: Memento, disposables: Disposable[]) { + constructor( + host: ITypescriptServiceClientHost, + storagePath: string | undefined, + globalState: Memento, + private readonly workspaceState: Memento, + private readonly versionStatus: VersionStatus, + + private plugins: TypeScriptServerPlugin[], + disposables: Disposable[] + ) { this.host = host; this.storagePath = storagePath; this.globalState = globalState; @@ -187,7 +161,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.servicePromise = null; this.lastError = null; this.sequenceNumber = 0; - this.exitRequested = false; this.firstStart = Date.now(); this.numberRestarts = 0; @@ -201,7 +174,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this._experimentalAutoBuild = false; // configuration.get('typescript.tsserver.experimentalAutoBuild', false); this._apiVersion = new API('1.0.0'); this._checkGlobalTSCVersion = true; - this.trace = this.readTrace(); + this.tracer = new Tracer(this.logger); this.tsServerLogLevel = this.readTsServerLogLevel(); this.checkJs = this.readCheckJs(); @@ -211,7 +184,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient let oldLocalTsdk = this.localTsdk; let oldCheckJs = this.checkJs; - this.trace = this.readTrace(); + this.tracer.updateConfiguration(); this.tsServerLogLevel = this.readTsServerLogLevel(); const configuration = workspace.getConfiguration(); @@ -229,16 +202,13 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.restartTsServer(); } })); - if (this.packageInfo && this.packageInfo.aiKey) { - this.telemetryReporter = new TelemetryReporter(this.packageInfo.name, this.packageInfo.version, this.packageInfo.aiKey); - disposables.push(this.telemetryReporter); - } + this.telemetryReporter = new TelemetryReporter(); + disposables.push(this.telemetryReporter); this.startService(); } public restartTsServer(): void { const start = () => { - this.trace = this.readTrace(); this.tsServerLogLevel = this.readTsServerLogLevel(); this.servicePromise = this.startService(); return this.servicePromise; @@ -291,21 +261,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this._onTypesInstallerInitializationFailed.event; } - private get output(): OutputChannel { - if (!this._output) { - this._output = window.createOutputChannel(localize('channelName', 'TypeScript')); - } - return this._output; - } - - private readTrace(): Trace { - let result: Trace = Trace.fromString(workspace.getConfiguration().get('typescript.tsserver.trace', 'off')); - if (result === Trace.Off && !!process.env.TSS_TRACE) { - result = Trace.Messages; - } - return result; - } - private readTsServerLogLevel(): TsServerLogLevel { const setting = workspace.getConfiguration().get('typescript.tsserver.log', 'off'); return TsServerLogLevel.fromString(setting); @@ -331,80 +286,20 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this._onReady.promise; } - private data2String(data: any): string { - if (data instanceof Error) { - if (is.string(data.stack)) { - return data.stack; - } - return (data as Error).message; - } - if (is.boolean(data.success) && !data.success && is.string(data.message)) { - return data.message; - } - if (is.string(data)) { - return data; - } - return data.toString(); - } - public info(message: string, data?: any): void { - this.output.appendLine(`[Info - ${(new Date().toLocaleTimeString())}] ${message}`); - if (data) { - this.output.appendLine(this.data2String(data)); - } + this.logger.info(message, data); } public warn(message: string, data?: any): void { - this.output.appendLine(`[Warn - ${(new Date().toLocaleTimeString())}] ${message}`); - if (data) { - this.output.appendLine(this.data2String(data)); - } + this.logger.warn(message, data); } public error(message: string, data?: any): void { - // See https://github.com/Microsoft/TypeScript/issues/10496 - if (data && data.message === 'No content available.') { - return; - } - this.output.appendLine(`[Error - ${(new Date().toLocaleTimeString())}] ${message}`); - if (data) { - this.output.appendLine(this.data2String(data)); - } - // this.output.show(true); - } - - private logTrace(message: string, data?: any): void { - this.output.appendLine(`[Trace - ${(new Date().toLocaleTimeString())}] ${message}`); - if (data) { - this.output.appendLine(this.data2String(data)); - } - // this.output.show(true); - } - - private get packageInfo(): IPackageInfo | null { - - if (this._packageInfo !== undefined) { - return this._packageInfo; - } - let packagePath = path.join(__dirname, './../package.json'); - let extensionPackage = require(packagePath); - if (extensionPackage) { - this._packageInfo = { - name: extensionPackage.name, - version: extensionPackage.version, - aiKey: extensionPackage.aiKey - }; - } else { - this._packageInfo = null; - } - - return this._packageInfo; + this.logger.error(message, data); } public logTelemetry(eventName: string, properties?: { [prop: string]: string }) { - if (this.telemetryReporter) { - this.telemetryReporter.sendTelemetryEvent(eventName, properties); - } + this.telemetryReporter.logTelemetry(eventName, properties); } private service(): Thenable { @@ -485,6 +380,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } return modulePath; }).then(modulePath => { + return this.getDebugPort().then(debugPort => ({ modulePath, debugPort })); + }).then(({ modulePath, debugPort }) => { return this.servicePromise = new Promise((resolve, reject) => { const tsConfig = workspace.getConfiguration('typescript'); @@ -509,8 +406,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient const label = version || localize('versionNumber.custom', 'custom'); const tooltip = modulePath; this.modulePath = modulePath; - VersionStatus.showHideStatus(); - VersionStatus.setInfo(label, tooltip); + this.versionStatus.showHideStatus(); + this.versionStatus.setInfo(label, tooltip); // This is backwards compatibility code to move the setting from the local // store into the workspace setting file. @@ -522,22 +419,25 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.globalState.update(doGlobalVersionCheckKey, true); } + this.sequenceNumber = 0; + this.requestQueue = []; + this.pendingResponses = 0; + this.lastError = null; + try { - let options: electron.IForkOptions = { + const options: electron.IForkOptions = { execArgv: [] // [`--debug-brk=5859`] }; if (workspace.rootPath) { options.cwd = workspace.rootPath; } - let value = process.env.TSS_DEBUG; - if (value) { - let port = parseInt(value); - if (!isNaN(port)) { - this.info(`TSServer started in debug mode using port ${port}`); - options.execArgv = [`--debug=${port}`]; - } + + if (debugPort && !isNaN(debugPort)) { + this.info(`TSServer started in debug mode using port ${debugPort}`); + options.execArgv = [`--debug=${debugPort}`]; } - let args: string[] = []; + + const args: string[] = []; if (this.apiVersion.has206Features()) { args.push('--useSingleInferredProject'); if (workspace.getConfiguration().get('typescript.disableAutomaticTypeAcquisition', false)) { @@ -570,16 +470,15 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } if (this.apiVersion.has230Features()) { - const plugins = this.getContributedTypeScriptServerPlugins(); - if (plugins.length) { - args.push('--globalPlugins', plugins.map(x => x.name).join(',')); + if (this.plugins.length) { + args.push('--globalPlugins', this.plugins.map(x => x.name).join(',')); if (modulePath === this.globalTypescriptPath) { - args.push('--pluginProbeLocations', plugins.map(x => x.path).join(',')); + args.push('--pluginProbeLocations', this.plugins.map(x => x.path).join(',')); } } } - electron.fork(modulePath, args, options, (err: any, childProcess: cp.ChildProcess) => { + electron.fork(modulePath, args, options, this.logger, (err: any, childProcess: cp.ChildProcess) => { if (err) { this.lastError = err; this.error('Starting TSServer failed with error.', err); @@ -594,6 +493,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient if (this.tsServerLogFile) { this.error(`TSServer log file: ${this.tsServerLogFile}`); } + this.logTelemetry('tsserver.error'); this.serviceExited(false); }); childProcess.on('exit', (code: any) => { @@ -601,6 +501,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.info(`TSServer exited`); } else { this.error(`TSServer exited with code: ${code}`); + this.logTelemetry('tsserver.exitWithCode', { code: code }); } if (this.tsServerLogFile) { @@ -608,9 +509,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } this.serviceExited(true); }); - this.reader = new Reader(childProcess.stdout, (msg) => { - this.dispatchMessage(msg); - }); + + this.reader = new Reader( + childProcess.stdout, + (msg) => { this.dispatchMessage(msg); }, + error => { this.error('ReaderError', error); }); + this._onReady.resolve(); resolve(childProcess); this.serviceStarted(resendModels); @@ -622,6 +526,30 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient }); } + private getDebugPort(): Promise { + const value = process.env.TSS_DEBUG; + if (value) { + const port = parseInt(value); + if (!isNaN(port)) { + return Promise.resolve(port); + } + } + + if (workspace.getConfiguration('typescript').get('tsserver.debug', false)) { + return Promise.race([ + new Promise((resolve) => setTimeout(() => resolve(undefined), 1000)), + new Promise((resolve) => { + const server = net.createServer(sock => sock.end()); + server.listen(0, function () { + resolve(server.address().port); + }); + }) + ]); + } + + return Promise.resolve(undefined); + } + public onVersionStatusClicked(): Thenable { return this.showVersionPicker(false); } @@ -738,21 +666,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient 'TS Server has not started logging.')).then(() => false); } - return workspace.openTextDocument(this.tsServerLogFile) - .then(doc => { - if (!doc) { - return false; - } - return window.showTextDocument(doc, window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined) - .then(editor => !!editor); - }, () => false) - .then(didOpen => { - if (!didOpen) { - window.showWarningMessage(localize( - 'openTsServerLog.openFileFailedFailed', - 'Could not open TS Server log file')); - } - return didOpen; + return commands.executeCommand('_workbench.action.files.revealInOS', Uri.parse(this.tsServerLogFile)) + .then(() => true, () => { + window.showWarningMessage(localize( + 'openTsServerLog.openFileFailedFailed', + 'Could not open TS Server log file')); + return false; }); } @@ -828,22 +747,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return desc.version; } - private getContributedTypeScriptServerPlugins(): TypeScriptServerPlugin[] { - const plugins: TypeScriptServerPlugin[] = []; - for (const extension of extensions.all) { - const pack = extension.packageJSON; - if (pack.contributes && pack.contributes.typescriptServerPlugins && Array.isArray(pack.contributes.typescriptServerPlugins)) { - for (const plugin of pack.contributes.typescriptServerPlugins) { - plugins.push({ - name: plugin.name, - path: extension.extensionPath - }); - } - } - } - return plugins; - } - private serviceExited(restart: boolean): void { this.servicePromise = null; this.tsServerLogFile = null; @@ -851,8 +754,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.callbacks[parseInt(key)].e(new Error('Service died.')); }); this.callbacks = Object.create(null); - if (!this.exitRequested && restart) { - let diff = Date.now() - this.lastStart; + if (restart) { + const diff = Date.now() - this.lastStart; this.numberRestarts++; let startService = true; if (this.numberRestarts > 5) { @@ -923,7 +826,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return Uri.file(filepath); } - public execute(command: string, args: any, expectsResultOrToken?: boolean | CancellationToken, token?: CancellationToken): Promise { + public execute(command: string, args: any, expectsResultOrToken?: boolean | CancellationToken): Promise { + let token: CancellationToken | undefined = undefined; let expectsResult = true; if (typeof expectsResultOrToken === 'boolean') { expectsResult = expectsResultOrToken; @@ -931,13 +835,13 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient token = expectsResultOrToken; } - let request: Proto.Request = { + const request: Proto.Request = { seq: this.sequenceNumber++, type: 'request', command: command, arguments: args }; - let requestInfo: RequestItem = { + const requestInfo: RequestItem = { request: request, promise: null, callbacks: null @@ -972,7 +876,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private sendRequest(requestItem: RequestItem): void { let serverRequest = requestItem.request; - this.traceRequest(serverRequest, !!requestItem.callbacks); + this.tracer.traceRequest(serverRequest, !!requestItem.callbacks, this.requestQueue.length); if (requestItem.callbacks) { this.callbacks[serverRequest.seq] = requestItem.callbacks; this.pendingResponses++; @@ -994,38 +898,39 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient for (let i = 0; i < this.requestQueue.length; i++) { if (this.requestQueue[i].request.seq === seq) { this.requestQueue.splice(i, 1); - if (this.trace !== Trace.Off) { - this.logTrace(`TypeScript Service: canceled request with sequence number ${seq}`); - } + this.tracer.logTrace(`TypeScript Service: canceled request with sequence number ${seq}`); return true; } } if (this.apiVersion.has222Features() && this.cancellationPipeName) { - if (this.trace !== Trace.Off) { - this.logTrace(`TypeScript Service: trying to cancel ongoing request with sequence number ${seq}`); - } + this.tracer.logTrace(`TypeScript Service: trying to cancel ongoing request with sequence number ${seq}`); try { fs.writeFileSync(this.cancellationPipeName + seq, ''); return true; } catch (e) { // noop + } finally { + const p = this.callbacks[seq]; + if (p) { + delete this.callbacks[seq]; + this.pendingResponses--; + p.e(new Error(`Cancelled Request ${seq}`)); + } } } - if (this.trace !== Trace.Off) { - this.logTrace(`TypeScript Service: tried to cancel request with sequence number ${seq}. But request got already delivered.`); - } + this.tracer.logTrace(`TypeScript Service: tried to cancel request with sequence number ${seq}. But request got already delivered.`); return false; } private dispatchMessage(message: Proto.Message): void { try { if (message.type === 'response') { - let response: Proto.Response = message; - let p = this.callbacks[response.request_seq]; + const response: Proto.Response = message as Proto.Response; + const p = this.callbacks[response.request_seq]; if (p) { - this.traceResponse(response, p.start); + this.tracer.traceResponse(response, p.start); delete this.callbacks[response.request_seq]; this.pendingResponses--; if (response.success) { @@ -1035,8 +940,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } } } else if (message.type === 'event') { - let event: Proto.Event = message; - this.traceEvent(event); + const event: Proto.Event = message; + this.tracer.traceEvent(event); if (event.event === 'syntaxDiag') { this.host.syntaxDiagnosticsReceived(event as Proto.DiagnosticEvent); } else if (event.event === 'semanticDiag') { @@ -1098,37 +1003,4 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.sendNextRequests(); } } - - private traceRequest(request: Proto.Request, responseExpected: boolean): void { - if (this.trace === Trace.Off) { - return; - } - let data: string | undefined = undefined; - if (this.trace === Trace.Verbose && request.arguments) { - data = `Arguments: ${JSON.stringify(request.arguments, null, 4)}`; - } - this.logTrace(`Sending request: ${request.command} (${request.seq}). Response expected: ${responseExpected ? 'yes' : 'no'}. Current queue length: ${this.requestQueue.length}`, data); - } - - private traceResponse(response: Proto.Response, startTime: number): void { - if (this.trace === Trace.Off) { - return; - } - let data: string | undefined = undefined; - if (this.trace === Trace.Verbose && response.body) { - data = `Result: ${JSON.stringify(response.body, null, 4)}`; - } - this.logTrace(`Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - startTime} ms. Success: ${response.success} ${!response.success ? '. Message: ' + response.message : ''}`, data); - } - - private traceEvent(event: Proto.Event): void { - if (this.trace === Trace.Off) { - return; - } - let data: string | undefined = undefined; - if (this.trace === Trace.Verbose && event.body) { - data = `Data: ${JSON.stringify(event.body, null, 4)}`; - } - this.logTrace(`Event received: ${event.event} (${event.seq}).`, data); - } } \ No newline at end of file diff --git a/extensions/typescript/src/utils/async.ts b/extensions/typescript/src/utils/async.ts index fb260bde50b..f87754e69e8 100644 --- a/extensions/typescript/src/utils/async.ts +++ b/extensions/typescript/src/utils/async.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - export interface ITask { (): T; } diff --git a/extensions/typescript/src/utils/buildStatus.ts b/extensions/typescript/src/utils/buildStatus.ts index cf640508af3..ced56fd43b9 100644 --- a/extensions/typescript/src/utils/buildStatus.ts +++ b/extensions/typescript/src/utils/buildStatus.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import vscode = require('vscode'); const statusItem: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE); diff --git a/extensions/typescript/src/utils/electron.ts b/extensions/typescript/src/utils/electron.ts index 799628d2801..4418ca51dbd 100644 --- a/extensions/typescript/src/utils/electron.ts +++ b/extensions/typescript/src/utils/electron.ts @@ -3,17 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import path = require('path'); import os = require('os'); import net = require('net'); import cp = require('child_process'); +import Logger from './logger'; export interface IForkOptions { cwd?: string; - env?: any; - encoding?: string; execArgv?: string[]; } @@ -58,17 +55,23 @@ function generatePatchedEnv(env: any, stdInPipeName: string, stdOutPipeName: str return newEnv; } -export function fork(modulePath: string, args: string[], options: IForkOptions, callback: (error: any, cp: cp.ChildProcess | null) => void): void { +export function fork( + modulePath: string, + args: string[], + options: IForkOptions, + logger: Logger, + callback: (error: any, cp: cp.ChildProcess | null) => void, +): void { var callbackCalled = false; - var resolve = (result: cp.ChildProcess) => { + const resolve = (result: cp.ChildProcess) => { if (callbackCalled) { return; } callbackCalled = true; callback(null, result); }; - var reject = (err: any) => { + const reject = (err: any) => { if (callbackCalled) { return; } @@ -77,13 +80,12 @@ export function fork(modulePath: string, args: string[], options: IForkOptions, }; // Generate three unique pipe names - var stdInPipeName = generatePipeName(); - var stdOutPipeName = generatePipeName(); - let stdErrPipeName = generatePipeName(); + const stdInPipeName = generatePipeName(); + const stdOutPipeName = generatePipeName(); + const stdErrPipeName = generatePipeName(); - var newEnv = generatePatchedEnv(options.env || process.env, stdInPipeName, stdOutPipeName, stdErrPipeName); - + const newEnv = generatePatchedEnv(process.env, stdInPipeName, stdOutPipeName, stdErrPipeName); var childProcess: cp.ChildProcess; // Begin listening to stderr pipe @@ -110,7 +112,7 @@ export function fork(modulePath: string, args: string[], options: IForkOptions, stdOutServer.listen(stdOutPipeName); var serverClosed = false; - var closeServer = () => { + const closeServer = () => { if (serverClosed) { return; } @@ -120,7 +122,9 @@ export function fork(modulePath: string, args: string[], options: IForkOptions, }; // Create the process - let bootstrapperPath = path.join(__dirname, 'electronForkStart'); + logger.info('Forking TSServer', `PATH: ${newEnv['PATH']}`); + + const bootstrapperPath = path.join(__dirname, 'electronForkStart'); childProcess = cp.fork(bootstrapperPath, [modulePath].concat(args), { silent: true, cwd: options.cwd, diff --git a/extensions/typescript/src/utils/is.ts b/extensions/typescript/src/utils/is.ts index 78ef8c734cd..fc6fd6ad286 100644 --- a/extensions/typescript/src/utils/is.ts +++ b/extensions/typescript/src/utils/is.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - const toString = Object.prototype.toString; export function defined(value: any): boolean { diff --git a/extensions/typescript/src/utils/logger.ts b/extensions/typescript/src/utils/logger.ts new file mode 100644 index 00000000000..8e31d66d858 --- /dev/null +++ b/extensions/typescript/src/utils/logger.ts @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { OutputChannel, window } from 'vscode'; +import * as is from './is'; + +import * as nls from 'vscode-nls'; +const localize = nls.loadMessageBundle(); + +export default class Logger { + private _output: OutputChannel; + + private get output(): OutputChannel { + if (!this._output) { + this._output = window.createOutputChannel(localize('channelName', 'TypeScript')); + } + return this._output; + } + + private data2String(data: any): string { + if (data instanceof Error) { + if (is.string(data.stack)) { + return data.stack; + } + return (data as Error).message; + } + if (is.boolean(data.success) && !data.success && is.string(data.message)) { + return data.message; + } + if (is.string(data)) { + return data; + } + return data.toString(); + } + + public info(message: string, data?: any): void { + this.logLevel('Info', message, data); + } + + public warn(message: string, data?: any): void { + this.logLevel('Warn', message, data); + } + + public error(message: string, data?: any): void { + // See https://github.com/Microsoft/TypeScript/issues/10496 + if (data && data.message === 'No content available.') { + return; + } + this.logLevel('Error', message, data); + } + + public logLevel(level: string, message: string, data?: any): void { + this.output.appendLine(`[${level} - ${(new Date().toLocaleTimeString())}] ${message}`); + if (data) { + this.output.appendLine(this.data2String(data)); + } + } +} \ No newline at end of file diff --git a/extensions/typescript/src/utils/plugins.ts b/extensions/typescript/src/utils/plugins.ts new file mode 100644 index 00000000000..23342cc8b31 --- /dev/null +++ b/extensions/typescript/src/utils/plugins.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { extensions } from 'vscode'; + + +export interface TypeScriptServerPlugin { + path: string; + name: string; + languages: string[]; +} + +export function getContributedTypeScriptServerPlugins(): TypeScriptServerPlugin[] { + const plugins: TypeScriptServerPlugin[] = []; + for (const extension of extensions.all) { + const pack = extension.packageJSON; + if (pack.contributes && pack.contributes.typescriptServerPlugins && Array.isArray(pack.contributes.typescriptServerPlugins)) { + for (const plugin of pack.contributes.typescriptServerPlugins) { + plugins.push({ + name: plugin.name, + path: extension.extensionPath, + languages: Array.isArray(plugin.languages) ? plugin.languages : [] + }); + } + } + } + return plugins; +} diff --git a/extensions/typescript/src/utils/projectStatus.ts b/extensions/typescript/src/utils/projectStatus.ts index f6042d29449..8c9911531eb 100644 --- a/extensions/typescript/src/utils/projectStatus.ts +++ b/extensions/typescript/src/utils/projectStatus.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as vscode from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; import { loadMessageBundle } from 'vscode-nls'; diff --git a/extensions/typescript/src/utils/telemetry.ts b/extensions/typescript/src/utils/telemetry.ts new file mode 100644 index 00000000000..b687b11b4ac --- /dev/null +++ b/extensions/typescript/src/utils/telemetry.ts @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as path from 'path'; +import VsCodeTelemetryReporter from 'vscode-extension-telemetry'; +import { Disposable } from 'vscode'; + + +interface IPackageInfo { + name: string; + version: string; + aiKey: string; +} + + +export default class TelemetryReporter extends Disposable { + private _packageInfo: IPackageInfo | null; + + private _reporter: VsCodeTelemetryReporter | null; + + constructor() { + super(() => this.dispose()); + } + + dispose() { + if (this._reporter) { + this._reporter.dispose(); + this._reporter = null; + } + } + + public logTelemetry(eventName: string, properties?: { [prop: string]: string }) { + if (this.reporter) { + this.reporter.sendTelemetryEvent(eventName, properties); + } + } + + private get reporter(): VsCodeTelemetryReporter | null { + if (typeof this._reporter !== 'undefined') { + return this._reporter; + } + + if (this.packageInfo && this.packageInfo.aiKey) { + this._reporter = new VsCodeTelemetryReporter( + this.packageInfo.name, + this.packageInfo.version, + this.packageInfo.aiKey); + } else { + this._reporter = null; + } + return this._reporter; + } + + private get packageInfo(): IPackageInfo | null { + if (this._packageInfo !== undefined) { + return this._packageInfo; + } + let packagePath = path.join(__dirname, '..', '..', 'package.json'); + let extensionPackage = require(packagePath); + if (extensionPackage) { + this._packageInfo = { + name: extensionPackage.name, + version: extensionPackage.version, + aiKey: extensionPackage.aiKey + }; + } else { + this._packageInfo = null; + } + + return this._packageInfo; + } +} \ No newline at end of file diff --git a/extensions/typescript/src/utils/tracer.ts b/extensions/typescript/src/utils/tracer.ts new file mode 100644 index 00000000000..fe16a13d61a --- /dev/null +++ b/extensions/typescript/src/utils/tracer.ts @@ -0,0 +1,93 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { workspace } from 'vscode'; + +import * as Proto from '../protocol'; +import Logger from './logger'; + + +enum Trace { + Off, + Messages, + Verbose +} + +namespace Trace { + export function fromString(value: string): Trace { + value = value.toLowerCase(); + switch (value) { + case 'off': + return Trace.Off; + case 'messages': + return Trace.Messages; + case 'verbose': + return Trace.Verbose; + default: + return Trace.Off; + } + } +} + +export default class Tracer { + private trace: Trace; + + constructor( + private readonly logger: Logger + ) { + this.updateConfiguration(); + } + + public updateConfiguration() { + this.trace = Tracer.readTrace(); + } + + private static readTrace(): Trace { + let result: Trace = Trace.fromString(workspace.getConfiguration().get('typescript.tsserver.trace', 'off')); + if (result === Trace.Off && !!process.env.TSS_TRACE) { + result = Trace.Messages; + } + return result; + } + + public traceRequest(request: Proto.Request, responseExpected: boolean, queueLength: number): void { + if (this.trace === Trace.Off) { + return; + } + let data: string | undefined = undefined; + if (this.trace === Trace.Verbose && request.arguments) { + data = `Arguments: ${JSON.stringify(request.arguments, null, 4)}`; + } + this.logTrace(`Sending request: ${request.command} (${request.seq}). Response expected: ${responseExpected ? 'yes' : 'no'}. Current queue length: ${queueLength}`, data); + } + + public traceResponse(response: Proto.Response, startTime: number): void { + if (this.trace === Trace.Off) { + return; + } + let data: string | undefined = undefined; + if (this.trace === Trace.Verbose && response.body) { + data = `Result: ${JSON.stringify(response.body, null, 4)}`; + } + this.logTrace(`Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - startTime} ms. Success: ${response.success} ${!response.success ? '. Message: ' + response.message : ''}`, data); + } + + public traceEvent(event: Proto.Event): void { + if (this.trace === Trace.Off) { + return; + } + let data: string | undefined = undefined; + if (this.trace === Trace.Verbose && event.body) { + data = `Data: ${JSON.stringify(event.body, null, 4)}`; + } + this.logTrace(`Event received: ${event.event} (${event.seq}).`, data); + } + + public logTrace(message: string, data?: any): void { + if (this.trace !== Trace.Off) { + this.logger.logLevel('Trace', message, data); + } + } +} \ No newline at end of file diff --git a/extensions/typescript/src/utils/tsconfigProvider.ts b/extensions/typescript/src/utils/tsconfigProvider.ts new file mode 100644 index 00000000000..e85ca24bbff --- /dev/null +++ b/extensions/typescript/src/utils/tsconfigProvider.ts @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; + +export default class TsConfigProvider extends vscode.Disposable { + private readonly tsconfigs = new Set(); + + private activated: boolean = false; + private disposables: vscode.Disposable[] = []; + + constructor() { + super(() => this.dispose()); + } + + dispose(): void { + this.disposables.forEach(d => d.dispose()); + } + + public async getConfigsForWorkspace(): Promise> { + if (!vscode.workspace.rootPath) { + return []; + } + await this.ensureActivated(); + return this.tsconfigs; + } + + private async ensureActivated() { + if (this.activated) { + return this; + } + this.activated = true; + + for (const config of await TsConfigProvider.loadWorkspaceTsconfigs()) { + this.tsconfigs.add(config.fsPath); + } + + const configFileWatcher = vscode.workspace.createFileSystemWatcher('**/tsconfig*.json'); + this.disposables.push(configFileWatcher); + configFileWatcher.onDidCreate(this.handleProjectCreate, this, this.disposables); + configFileWatcher.onDidDelete(this.handleProjectDelete, this, this.disposables); + + return this; + } + + private static loadWorkspaceTsconfigs() { + return vscode.workspace.findFiles('**/tsconfig*.json', '**/node_modules/**'); + } + + private handleProjectCreate(e: vscode.Uri) { + this.tsconfigs.add(e.fsPath); + } + + private handleProjectDelete(e: vscode.Uri) { + this.tsconfigs.delete(e.fsPath); + } +} diff --git a/extensions/typescript/src/utils/typingsStatus.ts b/extensions/typescript/src/utils/typingsStatus.ts index 4798046abf6..44f90ec15c1 100644 --- a/extensions/typescript/src/utils/typingsStatus.ts +++ b/extensions/typescript/src/utils/typingsStatus.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { MessageItem, workspace, Disposable, ProgressLocation, window, commands, Uri } from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; import { loadMessageBundle } from 'vscode-nls'; diff --git a/extensions/typescript/src/utils/versionStatus.ts b/extensions/typescript/src/utils/versionStatus.ts index 358d3a9b103..21f3a1c34f1 100644 --- a/extensions/typescript/src/utils/versionStatus.ts +++ b/extensions/typescript/src/utils/versionStatus.ts @@ -3,44 +3,53 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; +import * as vscode from 'vscode'; -import vscode = require('vscode'); -const versionBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE); +export default class VersionStatus extends vscode.Disposable { + onChangeEditorSub: any; + private versionBarEntry: vscode.StatusBarItem; -export function showHideStatus() { - if (!versionBarEntry) { - return; - } - if (!vscode.window.activeTextEditor) { - versionBarEntry.hide(); - return; + constructor() { + super(() => this.dispose()); + + this.versionBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE); + + this.onChangeEditorSub = vscode.window.onDidChangeActiveTextEditor(this.showHideStatus, this); } - let doc = vscode.window.activeTextEditor.document; - if (vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) { - versionBarEntry.show(); - return; + dispose() { + this.versionBarEntry.dispose(); + this.onChangeEditorSub.dispose(); } - if (!vscode.window.activeTextEditor.viewColumn) { - // viewColumn is undefined for the debug/output panel, but we still want - // to show the version info - return; + showHideStatus() { + if (!this.versionBarEntry) { + return; + } + if (!vscode.window.activeTextEditor) { + this.versionBarEntry.hide(); + return; + } + + let doc = vscode.window.activeTextEditor.document; + if (vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) { + this.versionBarEntry.show(); + return; + } + + if (!vscode.window.activeTextEditor.viewColumn) { + // viewColumn is undefined for the debug/output panel, but we still want + // to show the version info + return; + } + + this.versionBarEntry.hide(); } - versionBarEntry.hide(); -} - -export function disposeStatus() { - if (versionBarEntry) { - versionBarEntry.dispose(); + public setInfo(message: string, tooltip: string) { + this.versionBarEntry.text = message; + this.versionBarEntry.tooltip = tooltip; + this.versionBarEntry.command = 'typescript.selectTypeScriptVersion'; } } - -export function setInfo(message: string, tooltip: string) { - versionBarEntry.text = message; - versionBarEntry.tooltip = tooltip; - versionBarEntry.command = 'typescript.selectTypeScriptVersion'; -} diff --git a/extensions/typescript/src/utils/wireProtocol.ts b/extensions/typescript/src/utils/wireProtocol.ts index 0227b3be7e6..ad5d464304d 100644 --- a/extensions/typescript/src/utils/wireProtocol.ts +++ b/extensions/typescript/src/utils/wireProtocol.ts @@ -3,16 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import stream = require('stream'); -let DefaultSize: number = 8192; -let ContentLength: string = 'Content-Length: '; -let ContentLengthSize: number = Buffer.byteLength(ContentLength, 'utf8'); -let Blank: number = new Buffer(' ', 'utf8')[0]; -let BackslashR: number = new Buffer('\r', 'utf8')[0]; -let BackslashN: number = new Buffer('\n', 'utf8')[0]; +const DefaultSize: number = 8192; +const ContentLength: string = 'Content-Length: '; +const ContentLengthSize: number = Buffer.byteLength(ContentLength, 'utf8'); +const Blank: number = new Buffer(' ', 'utf8')[0]; +const BackslashR: number = new Buffer('\r', 'utf8')[0]; +const BackslashN: number = new Buffer('\n', 'utf8')[0]; class ProtocolBuffer { @@ -83,36 +81,6 @@ class ProtocolBuffer { this.index = this.index - sourceStart; return result; } - - public tryReadLine(): string | null { - let end: number = 0; - while (end < this.index && this.buffer[end] !== BackslashR && this.buffer[end] !== BackslashN) { - end++; - } - if (end >= this.index) { - return null; - } - let result = this.buffer.toString('utf8', 0, end); - while (end < this.index && (this.buffer[end] === BackslashR || this.buffer[end] === BackslashN)) { - end++; - } - if (this.index === end) { - this.index = 0; - } else { - this.buffer.copy(this.buffer, 0, end); - this.index = this.index - end; - } - return result; - } - - public get numberOfBytes(): number { - return this.index; - } -} - -export enum ReaderType { - Length = 0, - Line = 1 } export interface ICallback { @@ -121,75 +89,45 @@ export interface ICallback { export class Reader { - private readable: stream.Readable; - private callback: ICallback; - private buffer: ProtocolBuffer; + private readonly readable: stream.Readable; + private readonly callback: ICallback; + private readonly buffer: ProtocolBuffer; private nextMessageLength: number; - public constructor(readable: stream.Readable, callback: ICallback, type: ReaderType = ReaderType.Length) { + public constructor( + readable: stream.Readable, + callback: ICallback, + private readonly onError: (error: any) => void = () => ({}) + ) { this.readable = readable; this.buffer = new ProtocolBuffer(); this.callback = callback; this.nextMessageLength = -1; - if (type === ReaderType.Length) { - this.readable.on('data', (data: Buffer) => { - this.onLengthData(data); - }); - } else if (type === ReaderType.Line) { - this.readable.on('data', (data: Buffer) => { - this.onLineData(data); - }); - } + this.readable.on('data', (data: Buffer) => { + this.onLengthData(data); + }); } private onLengthData(data: Buffer): void { - this.buffer.append(data); - while (true) { - if (this.nextMessageLength === -1) { - this.nextMessageLength = this.buffer.tryReadContentLength(); + try { + this.buffer.append(data); + while (true) { if (this.nextMessageLength === -1) { + this.nextMessageLength = this.buffer.tryReadContentLength(); + if (this.nextMessageLength === -1) { + return; + } + } + const msg = this.buffer.tryReadContent(this.nextMessageLength); + if (msg === null) { return; } + this.nextMessageLength = -1; + const json = JSON.parse(msg); + this.callback(json); } - let msg = this.buffer.tryReadContent(this.nextMessageLength); - if (msg === null) { - return; - } - this.nextMessageLength = -1; - let json = JSON.parse(msg); - this.callback(json); - } - } - - private onLineData(data: Buffer): void { - this.buffer.append(data); - while (true) { - let msg = this.buffer.tryReadLine(); - if (msg === null) { - return; - } - this.callback(JSON.parse(msg)); + } catch (e) { + this.onError(e); } } } - -export class Writer { - - private writable: stream.Writable; - - public constructor(writable: stream.Writable) { - this.writable = writable; - } - - public write(msg: T): void { - let json = JSON.stringify(msg); - let buffer: string[] = [ - ContentLength, - Buffer.byteLength(json, 'utf8').toString(), - '\r\n\r\n', - json, - '\r\n' - ]; - this.writable.write(buffer.join(''), 'utf8'); - } -} \ No newline at end of file diff --git a/extensions/typescript/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript/syntaxes/TypeScript.tmLanguage.json index b80d24f1c23..a4ba918145b 100644 --- a/extensions/typescript/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript/syntaxes/TypeScript.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "TypeScript", "scopeName": "source.ts", "fileTypes": [ @@ -71,7 +76,7 @@ "name": "storage.type.ts" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -100,7 +105,7 @@ "name": "meta.definition.variable.ts entity.name.function.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -115,7 +120,7 @@ "name": "meta.definition.variable.ts variable.other.constant.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -130,7 +135,7 @@ "name": "meta.definition.variable.ts variable.other.readwrite.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -157,7 +162,7 @@ { "name": "meta.object-binding-pattern-variable.ts", "begin": "(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", + "end": "(?=$|^|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { "include": "#comment" @@ -2013,7 +2061,7 @@ "name": "punctuation.definition.typeparameters.begin.ts" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.ts" @@ -2048,7 +2096,7 @@ "name": "keyword.operator.assignment.ts" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2487,7 +2535,7 @@ "patterns": [ { "name": "cast.expr.ts", - "begin": "(?:(?<=return|throw|yield|await|default|[=(,:>*]))\\s*(<)(?!*?]))\\s*(<)(?! is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -3389,25 +3437,17 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.ts" + }, + "2": { + "name": "comment.line.double-slash.ts punctuation.definition.comment.ts" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.ts", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.ts" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.ts" } ] }, @@ -3419,7 +3459,7 @@ "name": "punctuation.definition.comment.ts" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.ts", @@ -3922,6 +3962,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986" + } } \ No newline at end of file diff --git a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json index 3781e7bc5dc..f52b684089e 100644 --- a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "TypeScriptReact", "scopeName": "source.tsx", "fileTypes": [ @@ -71,7 +76,7 @@ "name": "storage.type.tsx" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -100,7 +105,7 @@ "name": "meta.definition.variable.tsx entity.name.function.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -115,7 +120,7 @@ "name": "meta.definition.variable.tsx variable.other.constant.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -130,7 +135,7 @@ "name": "meta.definition.variable.tsx variable.other.readwrite.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -157,7 +162,7 @@ { "name": "meta.object-binding-pattern-variable.tsx", "begin": "(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", + "end": "(?=$|^|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { "include": "#comment" @@ -2016,7 +2064,7 @@ "name": "punctuation.definition.typeparameters.begin.tsx" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.tsx" @@ -2051,7 +2099,7 @@ "name": "keyword.operator.assignment.tsx" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2690,7 +2738,7 @@ "name": "keyword.control.as.tsx" } }, - "end": "(?=$|[;,:})\\]])", + "end": "(?=$|^|[;,:})\\]])", "patterns": [ { "include": "#type" @@ -2775,7 +2823,7 @@ }, { "name": "meta.arrow.tsx", - "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends \n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -3355,25 +3403,17 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.tsx" + }, + "2": { + "name": "comment.line.double-slash.tsx punctuation.definition.comment.tsx" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.tsx", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.tsx" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.tsx" } ] }, @@ -3385,7 +3425,7 @@ "name": "punctuation.definition.comment.tsx" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.tsx", @@ -4005,8 +4045,8 @@ }, "jsx-tag-without-attributes": { "name": "meta.tag.without-attributes.tsx", - "begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?)", - "end": "()", + "begin": "(<)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", + "end": "()", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.tsx" @@ -4015,6 +4055,9 @@ "name": "entity.name.tag.tsx" }, "3": { + "name": "support.class.component.tsx" + }, + "4": { "name": "punctuation.definition.tag.end.tsx" } }, @@ -4026,6 +4069,9 @@ "name": "entity.name.tag.tsx" }, "3": { + "name": "support.class.component.tsx" + }, + "4": { "name": "punctuation.definition.tag.end.tsx" } }, @@ -4038,7 +4084,7 @@ }, "jsx-tag-in-expression": { "begin": "(?x)\n (?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", - "end": "(/>)|(?:())", + "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.tsx" @@ -4053,6 +4099,9 @@ "name": "entity.name.tag.tsx" }, "4": { + "name": "support.class.component.tsx" + }, + "5": { "name": "punctuation.definition.tag.end.tsx" } }, @@ -4064,7 +4113,7 @@ }, "jsx-child-tag": { "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?))", - "end": "(/>)|(?:())", + "end": "(/>)|(?:())", "endCaptures": { "0": { "name": "meta.tag.tsx" @@ -4079,6 +4128,9 @@ "name": "entity.name.tag.tsx" }, "4": { + "name": "support.class.component.tsx" + }, + "5": { "name": "punctuation.definition.tag.end.tsx" } }, @@ -4094,13 +4146,16 @@ "end": "(?=(/>)|(?:()))", "patterns": [ { - "begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?)", + "begin": "(?x)\n (<)\\s*\n ((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.tsx" }, "2": { "name": "entity.name.tag.tsx" + }, + "3": { + "name": "support.class.component.tsx" } }, "end": "(?=[/]?>)", @@ -4169,6 +4224,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986" + } } \ No newline at end of file diff --git a/extensions/typescript/test/colorize-results/test-brackets_tsx.json b/extensions/typescript/test/colorize-results/test-brackets_tsx.json index 26c893e42af..92fe70a1da2 100644 --- a/extensions/typescript/test/colorize-results/test-brackets_tsx.json +++ b/extensions/typescript/test/colorize-results/test-brackets_tsx.json @@ -29,7 +29,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -73,7 +73,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -95,7 +95,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -194,7 +194,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -271,7 +271,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -293,7 +293,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -359,7 +359,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test-function-inv_ts.json b/extensions/typescript/test/colorize-results/test-function-inv_ts.json index 5e3326255f7..c99ec3d0ce2 100644 --- a/extensions/typescript/test/colorize-results/test-function-inv_ts.json +++ b/extensions/typescript/test/colorize-results/test-function-inv_ts.json @@ -7,7 +7,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -29,7 +29,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -51,7 +51,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -95,7 +95,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -117,7 +117,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -150,7 +150,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test-issue11_ts.json b/extensions/typescript/test/colorize-results/test-issue11_ts.json index dec1231bd19..c7ee2e71f21 100644 --- a/extensions/typescript/test/colorize-results/test-issue11_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue11_ts.json @@ -29,7 +29,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -95,7 +95,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -139,7 +139,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -304,7 +304,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -370,7 +370,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -425,7 +425,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -480,7 +480,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -535,7 +535,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -590,7 +590,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -645,7 +645,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -700,7 +700,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -755,7 +755,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -810,7 +810,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -865,7 +865,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -920,7 +920,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -975,7 +975,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1030,7 +1030,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1085,7 +1085,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1162,7 +1162,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1217,7 +1217,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1316,7 +1316,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1426,7 +1426,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1503,7 +1503,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1723,7 +1723,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1745,7 +1745,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1778,7 +1778,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1888,7 +1888,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1954,7 +1954,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2042,7 +2042,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -2152,7 +2152,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2229,7 +2229,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2306,7 +2306,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -2328,7 +2328,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2405,7 +2405,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2482,7 +2482,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2515,7 +2515,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2548,7 +2548,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2592,7 +2592,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -2647,7 +2647,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -2680,7 +2680,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2735,7 +2735,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2768,7 +2768,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2790,7 +2790,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2834,7 +2834,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2867,7 +2867,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2911,7 +2911,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -2966,7 +2966,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3252,7 +3252,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3340,7 +3340,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3362,7 +3362,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { diff --git a/extensions/typescript/test/colorize-results/test-issue5431_ts.json b/extensions/typescript/test/colorize-results/test-issue5431_ts.json index 8f699a350f5..9d1dd3c555b 100644 --- a/extensions/typescript/test/colorize-results/test-issue5431_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue5431_ts.json @@ -29,7 +29,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -51,7 +51,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -84,7 +84,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -117,7 +117,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -194,7 +194,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -238,7 +238,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -414,7 +414,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -469,7 +469,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/typescript/test/colorize-results/test-issue5465_ts.json b/extensions/typescript/test/colorize-results/test-issue5465_ts.json index f43dc3fba29..f4a61d6e1ac 100644 --- a/extensions/typescript/test/colorize-results/test-issue5465_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue5465_ts.json @@ -40,7 +40,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -106,7 +106,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -183,7 +183,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/typescript/test/colorize-results/test-issue5566_ts.json b/extensions/typescript/test/colorize-results/test-issue5566_ts.json index 1d4071b8100..86357c7c0cd 100644 --- a/extensions/typescript/test/colorize-results/test-issue5566_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue5566_ts.json @@ -29,7 +29,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -117,7 +117,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -205,7 +205,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -315,7 +315,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test-keywords_ts.json b/extensions/typescript/test/colorize-results/test-keywords_ts.json index ac1e6e571f7..016639c505d 100644 --- a/extensions/typescript/test/colorize-results/test-keywords_ts.json +++ b/extensions/typescript/test/colorize-results/test-keywords_ts.json @@ -7,7 +7,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -51,7 +51,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -172,7 +172,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { diff --git a/extensions/typescript/test/colorize-results/test-members_ts.json b/extensions/typescript/test/colorize-results/test-members_ts.json index e6937242dc4..05e924b9c13 100644 --- a/extensions/typescript/test/colorize-results/test-members_ts.json +++ b/extensions/typescript/test/colorize-results/test-members_ts.json @@ -29,7 +29,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -73,7 +73,7 @@ "light_plus": "entity.other.inherited-class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.other.inherited-class: #4EC9B0" } }, { @@ -139,7 +139,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -172,7 +172,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -271,7 +271,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -293,7 +293,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -337,7 +337,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { diff --git a/extensions/typescript/test/colorize-results/test-object-literals_ts.json b/extensions/typescript/test/colorize-results/test-object-literals_ts.json index 36b795a88e5..1b5123075e0 100644 --- a/extensions/typescript/test/colorize-results/test-object-literals_ts.json +++ b/extensions/typescript/test/colorize-results/test-object-literals_ts.json @@ -29,7 +29,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -95,7 +95,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -150,7 +150,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -161,7 +161,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -183,7 +183,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -216,7 +216,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { @@ -227,7 +227,7 @@ "light_plus": "meta.object-literal.key: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "meta.object-literal.key: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test-strings_ts.json b/extensions/typescript/test/colorize-results/test-strings_ts.json index c3486c526ff..fd42a3a3930 100644 --- a/extensions/typescript/test/colorize-results/test-strings_ts.json +++ b/extensions/typescript/test/colorize-results/test-strings_ts.json @@ -29,7 +29,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -161,7 +161,7 @@ "light_plus": "support.class: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.class: #4EC9B0" } }, { @@ -183,7 +183,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -271,7 +271,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -315,7 +315,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -414,7 +414,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -480,7 +480,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { @@ -524,7 +524,7 @@ "light_plus": "variable: #001080", "dark_vs": "string: #CE9178", "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test-this_ts.json b/extensions/typescript/test/colorize-results/test-this_ts.json index 0efe6a8d69c..bb626c7e100 100644 --- a/extensions/typescript/test/colorize-results/test-this_ts.json +++ b/extensions/typescript/test/colorize-results/test-this_ts.json @@ -51,7 +51,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/typescript/test/colorize-results/test_ts.json b/extensions/typescript/test/colorize-results/test_ts.json index d407ffa3a5b..72fb99dba53 100644 --- a/extensions/typescript/test/colorize-results/test_ts.json +++ b/extensions/typescript/test/colorize-results/test_ts.json @@ -95,7 +95,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -139,7 +139,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -183,7 +183,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -249,7 +249,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -282,7 +282,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -337,7 +337,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -370,7 +370,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -425,7 +425,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -458,7 +458,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -513,7 +513,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -546,7 +546,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -579,7 +579,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -612,7 +612,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -645,7 +645,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -678,7 +678,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -755,7 +755,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -799,7 +799,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -854,7 +854,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -898,7 +898,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -953,7 +953,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -997,7 +997,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1063,7 +1063,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1107,7 +1107,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -1173,7 +1173,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1206,7 +1206,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1261,7 +1261,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1294,7 +1294,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1349,7 +1349,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1382,7 +1382,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1437,7 +1437,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1470,7 +1470,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1525,7 +1525,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1558,7 +1558,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1613,7 +1613,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1701,7 +1701,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1734,7 +1734,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1789,7 +1789,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1822,7 +1822,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -1877,7 +1877,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1998,7 +1998,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2097,7 +2097,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2196,7 +2196,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2317,7 +2317,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2438,7 +2438,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2559,7 +2559,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2680,7 +2680,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2779,7 +2779,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2878,7 +2878,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2944,7 +2944,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3010,7 +3010,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3098,7 +3098,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3164,7 +3164,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3208,7 +3208,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3252,7 +3252,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3296,7 +3296,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -3373,7 +3373,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3395,7 +3395,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3439,7 +3439,7 @@ "light_plus": "support.constant.math: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.constant.math: #4EC9B0" } }, { @@ -3461,7 +3461,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -3538,7 +3538,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3571,7 +3571,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -3593,7 +3593,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3714,7 +3714,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3780,7 +3780,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -3846,7 +3846,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3912,7 +3912,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -3956,7 +3956,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -3989,7 +3989,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -4066,7 +4066,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4132,7 +4132,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4154,7 +4154,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4176,7 +4176,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4198,7 +4198,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4220,7 +4220,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4286,7 +4286,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -4308,7 +4308,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4352,7 +4352,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -4396,7 +4396,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -4418,7 +4418,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4506,7 +4506,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -4627,7 +4627,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -4704,7 +4704,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4792,7 +4792,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -4814,7 +4814,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -4858,7 +4858,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -4935,7 +4935,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5001,7 +5001,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -5023,7 +5023,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5089,7 +5089,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5155,7 +5155,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -5177,7 +5177,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5199,7 +5199,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5232,7 +5232,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5254,7 +5254,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5287,7 +5287,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5309,7 +5309,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5353,7 +5353,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5375,7 +5375,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5463,7 +5463,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5540,7 +5540,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5562,7 +5562,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5639,7 +5639,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5661,7 +5661,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5683,7 +5683,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5760,7 +5760,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5782,7 +5782,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5859,7 +5859,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -5881,7 +5881,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -5958,7 +5958,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -5980,7 +5980,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6024,7 +6024,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -6101,7 +6101,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6178,7 +6178,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6222,7 +6222,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6310,7 +6310,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6376,7 +6376,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6442,7 +6442,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6486,7 +6486,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6574,7 +6574,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6651,7 +6651,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6717,7 +6717,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6739,7 +6739,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6827,7 +6827,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -6904,7 +6904,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6937,7 +6937,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -6981,7 +6981,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -7003,7 +7003,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7025,7 +7025,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7069,7 +7069,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7102,7 +7102,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7124,7 +7124,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7168,7 +7168,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7223,7 +7223,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7333,7 +7333,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7355,7 +7355,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7432,7 +7432,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -7454,7 +7454,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7498,7 +7498,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -7531,7 +7531,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7575,7 +7575,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -7630,7 +7630,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -7652,7 +7652,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7740,7 +7740,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7828,7 +7828,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7894,7 +7894,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -7938,7 +7938,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8004,7 +8004,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8037,7 +8037,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8092,7 +8092,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8136,7 +8136,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8158,7 +8158,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8180,7 +8180,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8213,7 +8213,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8290,7 +8290,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -8312,7 +8312,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8389,7 +8389,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8466,7 +8466,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8510,7 +8510,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8587,7 +8587,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8653,7 +8653,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8686,7 +8686,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8774,7 +8774,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8851,7 +8851,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -8895,7 +8895,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -8972,7 +8972,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9038,7 +9038,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9071,7 +9071,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9137,7 +9137,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9159,7 +9159,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -9181,7 +9181,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -9225,7 +9225,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -9247,7 +9247,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9280,7 +9280,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9390,7 +9390,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9412,7 +9412,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -9434,7 +9434,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9500,7 +9500,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9522,7 +9522,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9599,7 +9599,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -9621,7 +9621,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9665,7 +9665,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -9720,7 +9720,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -9764,7 +9764,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9863,7 +9863,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9929,7 +9929,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -9973,7 +9973,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10028,7 +10028,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10050,7 +10050,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10116,7 +10116,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10171,7 +10171,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10193,7 +10193,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -10215,7 +10215,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10237,7 +10237,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10303,7 +10303,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10336,7 +10336,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10358,7 +10358,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10402,7 +10402,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10457,7 +10457,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10512,7 +10512,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10578,7 +10578,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10600,7 +10600,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10644,7 +10644,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10666,7 +10666,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10732,7 +10732,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10798,7 +10798,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10853,7 +10853,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10875,7 +10875,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -10897,7 +10897,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10919,7 +10919,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -10985,7 +10985,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11018,7 +11018,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11040,7 +11040,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11084,7 +11084,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11139,7 +11139,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11194,7 +11194,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11304,7 +11304,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -11370,7 +11370,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -11392,7 +11392,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { diff --git a/extensions/typescript/tsconfig.json b/extensions/typescript/tsconfig.json index 2e44abefad4..da4f1bb399b 100644 --- a/extensions/typescript/tsconfig.json +++ b/extensions/typescript/tsconfig.json @@ -11,12 +11,11 @@ "noImplicitAny": true, "noImplicitReturns": true, "noUnusedLocals": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "strict": true, + "alwaysStrict": true }, - "exclude": [ - "node_modules", - "server", - "out", - "test/colorize-fixtures" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json b/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json index f1d697c499a..1df56b22df8 100644 --- a/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json +++ b/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/asp.vb.net.tmbundle/blob/master/Syntaxes/ASP%20VB.net.plist", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", "fileTypes": [ "vb" @@ -233,6 +238,5 @@ } }, "scopeName": "source.asp.vb.net", - "uuid": "7F9C9343-D48E-4E7D-BFE8-F680714DCD3E", - "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69" + "uuid": "7F9C9343-D48E-4E7D-BFE8-F680714DCD3E" } \ No newline at end of file diff --git a/extensions/vb/test/colorize-results/test_vb.json b/extensions/vb/test/colorize-results/test_vb.json index abbc7e6a32f..b4567db9c74 100644 --- a/extensions/vb/test/colorize-results/test_vb.json +++ b/extensions/vb/test/colorize-results/test_vb.json @@ -40,7 +40,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -62,7 +62,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -106,7 +106,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -128,7 +128,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -293,7 +293,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -348,7 +348,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -359,7 +359,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -370,7 +370,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -403,7 +403,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -447,7 +447,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -458,7 +458,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -469,7 +469,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -502,7 +502,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -546,7 +546,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -557,7 +557,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -568,7 +568,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -601,7 +601,7 @@ "light_plus": "support.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.type: #4EC9B0" } }, { @@ -722,7 +722,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -766,7 +766,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -788,7 +788,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -832,7 +832,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -865,7 +865,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -898,7 +898,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -920,7 +920,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -942,7 +942,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -964,7 +964,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1019,7 +1019,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1052,7 +1052,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1250,7 +1250,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1272,7 +1272,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1294,7 +1294,7 @@ "light_plus": "support.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "support.function: #DCDCAA" } }, { @@ -1349,7 +1349,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1382,7 +1382,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1415,7 +1415,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1514,7 +1514,7 @@ "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.function: #DCDCAA" } }, { @@ -1536,7 +1536,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1624,7 +1624,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1646,7 +1646,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1668,7 +1668,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -1866,7 +1866,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1888,7 +1888,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1910,7 +1910,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -1998,7 +1998,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2031,7 +2031,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2064,7 +2064,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -2119,7 +2119,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -2163,7 +2163,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { diff --git a/extensions/vscode-api-tests/src/configuration.test.ts b/extensions/vscode-api-tests/src/configuration.test.ts index 8b063ae4c78..65dc52e4537 100644 --- a/extensions/vscode-api-tests/src/configuration.test.ts +++ b/extensions/vscode-api-tests/src/configuration.test.ts @@ -8,7 +8,7 @@ import * as vscode from 'vscode'; suite('Configuration tests', () => { - test('Default configurations', function () { + test('configurations, language defaults', function () { const defaultLanguageSettings = vscode.workspace.getConfiguration().get('[abcLang]'); assert.deepEqual(defaultLanguageSettings, { @@ -17,4 +17,29 @@ suite('Configuration tests', () => { }); }); -}); \ No newline at end of file + test('configuration, defaults', () => { + const config = vscode.workspace.getConfiguration('farboo'); + + assert.ok(config.has('config0')); + assert.equal(config.get('config0'), true); + assert.equal(config.get('config4'), ''); + assert.equal(config['config0'], true); + assert.equal(config['config4'], ''); + + assert.throws(() => (config)['config4'] = 'valuevalue'); + + assert.ok(config.has('nested.config1')); + assert.equal(config.get('nested.config1'), 42); + assert.ok(config.has('nested.config2')); + assert.equal(config.get('nested.config2'), 'Das Pferd frisst kein Reis.'); + }); + + test('configuration, name vs property', () => { + const config = vscode.workspace.getConfiguration('farboo'); + + assert.ok(config.has('get')); + assert.equal(config.get('get'), 'get-prop'); + assert.deepEqual(config['get'], config.get); + assert.throws(() => config['get'] = 'get-prop'); + }); +}); diff --git a/extensions/vscode-api-tests/src/languages.test.ts b/extensions/vscode-api-tests/src/languages.test.ts index d4a0c80130e..321b1b772f2 100644 --- a/extensions/vscode-api-tests/src/languages.test.ts +++ b/extensions/vscode-api-tests/src/languages.test.ts @@ -14,7 +14,7 @@ import { suite('languages namespace tests', () => { - test('diagnostics & CodeActionProvider', function (done) { + test('diagnostics & CodeActionProvider', function () { class D2 extends Diagnostic { customProp = { complex() { } }; @@ -54,20 +54,15 @@ suite('languages namespace tests', () => { let r4 = languages.createDiagnosticCollection(); r4.set(uri, [diag2]); - workspace.openTextDocument(uri).then(doc => { + return workspace.openTextDocument(uri).then(doc => { return commands.executeCommand('vscode.executeCodeActionProvider', uri, new Range(0, 0, 0, 10)); }).then(commands => { - try { - assert.ok(ran); - Disposable.from(r1, r2, r3, r4).dispose(); - done(); - } catch (e) { - done(e); - } - }, done); + assert.ok(ran); + Disposable.from(r1, r2, r3, r4).dispose(); + }); }); - test('completions with document filters', function (done) { + test('completions with document filters', function () { let ran = false; let uri = Uri.file(join(workspace.rootPath || '', './bower.json')); @@ -82,17 +77,13 @@ suite('languages namespace tests', () => { } }); - workspace.openTextDocument(uri).then(doc => { + return workspace.openTextDocument(uri).then(doc => { return commands.executeCommand('vscode.executeCompletionItemProvider', uri, new Position(1, 0)); }).then((result: CompletionList) => { - try { - assert.equal(result.items[0].label, 'foo'); - assert.ok(ran); - Disposable.from(r1).dispose(); - done(); - } catch (e) { - done(e); - } - }, done); + r1.dispose(); + assert.ok(ran); + console.log(result.items); + assert.equal(result.items[0].label, 'foo'); + }); }); }); diff --git a/extensions/vscode-api-tests/src/window.test.ts b/extensions/vscode-api-tests/src/window.test.ts index 94a11bdff8e..cb14027e666 100644 --- a/extensions/vscode-api-tests/src/window.test.ts +++ b/extensions/vscode-api-tests/src/window.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind } from 'vscode'; import { join } from 'path'; -import { cleanUp, pathEquals } from './utils'; +import { cleanUp, pathEquals, createRandomFile } from './utils'; suite('window namespace tests', () => { @@ -110,6 +110,25 @@ suite('window namespace tests', () => { }); }); + test('issue #25801 - default column when opening a file', async () => { + const [docA, docB, docC] = await Promise.all([ + workspace.openTextDocument(await createRandomFile()), + workspace.openTextDocument(await createRandomFile()), + workspace.openTextDocument(await createRandomFile()) + ]); + + await window.showTextDocument(docA, ViewColumn.One); + await window.showTextDocument(docB, ViewColumn.Two); + + assert.ok(window.activeTextEditor); + assert.ok(window.activeTextEditor!.document === docB); + assert.equal(window.activeTextEditor!.viewColumn, ViewColumn.Two); + + await window.showTextDocument(docC); + assert.ok(window.activeTextEditor!.document === docC); + assert.equal(window.activeTextEditor!.viewColumn, ViewColumn.One); + }); + test('issue #5362 - Incorrect TextEditor passed by onDidChangeTextEditorSelection', (done) => { const file10Path = join(workspace.rootPath || '', './10linefile.ts'); const file30Path = join(workspace.rootPath || '', './30linefile.ts'); diff --git a/extensions/vscode-api-tests/src/workspace.test.ts b/extensions/vscode-api-tests/src/workspace.test.ts index 31303542fad..54aaa0f7962 100644 --- a/extensions/vscode-api-tests/src/workspace.test.ts +++ b/extensions/vscode-api-tests/src/workspace.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { workspace, TextDocument, window, Position, Uri, EventEmitter, WorkspaceEdit, Disposable, EndOfLine } from 'vscode'; +import * as vscode from 'vscode'; import { createRandomFile, deleteFile, cleanUp, pathEquals } from './utils'; import { join, basename } from 'path'; import * as fs from 'fs'; @@ -15,59 +15,29 @@ suite('workspace-namespace', () => { teardown(cleanUp); - test('configuration, defaults', () => { - const config = workspace.getConfiguration('farboo'); - - assert.ok(config.has('config0')); - assert.equal(config.get('config0'), true); - assert.equal(config.get('config4'), ''); - assert.equal(config['config0'], true); - assert.equal(config['config4'], ''); - - assert.throws(() => (config)['config4'] = 'valuevalue'); - - assert.ok(config.has('nested.config1')); - assert.equal(config.get('nested.config1'), 42); - assert.ok(config.has('nested.config2')); - assert.equal(config.get('nested.config2'), 'Das Pferd frisst kein Reis.'); - }); - - test('configuration, name vs property', () => { - const config = workspace.getConfiguration('farboo'); - - assert.ok(config.has('get')); - assert.equal(config.get('get'), 'get-prop'); - assert.deepEqual(config['get'], config.get); - assert.throws(() => config['get'] = 'get-prop'); - }); - - // test('configuration, getConfig/value', () => { - // const value = workspace.getConfiguration('farboo.config0'); - // assert.equal(Object.keys(value).length, 3); - // }); test('textDocuments', () => { - assert.ok(Array.isArray(workspace.textDocuments)); - assert.throws(() => (workspace).textDocuments = null); + assert.ok(Array.isArray(vscode.workspace.textDocuments)); + assert.throws(() => (vscode.workspace).textDocuments = null); }); test('rootPath', () => { - if (workspace.rootPath) { - assert.ok(pathEquals(workspace.rootPath, join(__dirname, '../testWorkspace'))); + if (vscode.workspace.rootPath) { + assert.ok(pathEquals(vscode.workspace.rootPath, join(__dirname, '../testWorkspace'))); } - assert.throws(() => workspace.rootPath = 'farboo'); + assert.throws(() => vscode.workspace.rootPath = 'farboo'); }); test('openTextDocument', () => { - let len = workspace.textDocuments.length; - return workspace.openTextDocument(join(workspace.rootPath || '', './simple.txt')).then(doc => { + let len = vscode.workspace.textDocuments.length; + return vscode.workspace.openTextDocument(join(vscode.workspace.rootPath || '', './simple.txt')).then(doc => { assert.ok(doc); - assert.equal(workspace.textDocuments.length, len + 1); + assert.equal(vscode.workspace.textDocuments.length, len + 1); }); }); test('openTextDocument, illegal path', () => { - return workspace.openTextDocument('funkydonky.txt').then(doc => { + return vscode.workspace.openTextDocument('funkydonky.txt').then(doc => { throw new Error('missing error'); }, err => { // good! @@ -75,28 +45,28 @@ suite('workspace-namespace', () => { }); test('openTextDocument, untitled is dirty', function () { - return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath || '', './newfile.txt'))).then(doc => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + join(vscode.workspace.rootPath || '', './newfile.txt'))).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.ok(doc.isDirty); }); }); test('openTextDocument, untitled with host', function () { - const uri = Uri.parse('untitled://localhost/c%24/Users/jrieken/code/samples/foobar.txt'); - return workspace.openTextDocument(uri).then(doc => { + const uri = vscode.Uri.parse('untitled://localhost/c%24/Users/jrieken/code/samples/foobar.txt'); + return vscode.workspace.openTextDocument(uri).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); }); }); test('openTextDocument, untitled without path', function () { - return workspace.openTextDocument().then(doc => { + return vscode.workspace.openTextDocument().then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.ok(doc.isDirty); }); }); test('openTextDocument, untitled without path but language ID', function () { - return workspace.openTextDocument({ language: 'xml' }).then(doc => { + return vscode.workspace.openTextDocument({ language: 'xml' }).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.equal(doc.languageId, 'xml'); assert.ok(doc.isDirty); @@ -104,7 +74,7 @@ suite('workspace-namespace', () => { }); test('openTextDocument, untitled without path but language ID and content', function () { - return workspace.openTextDocument({ language: 'html', content: '

Hello world!

' }).then(doc => { + return vscode.workspace.openTextDocument({ language: 'html', content: '

Hello world!

' }).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.equal(doc.languageId, 'html'); assert.ok(doc.isDirty); @@ -113,16 +83,16 @@ suite('workspace-namespace', () => { }); test('openTextDocument, untitled closes on save', function (done) { - const path = join(workspace.rootPath || '', './newfile.txt'); + const path = join(vscode.workspace.rootPath || '', './newfile.txt'); - return workspace.openTextDocument(Uri.parse('untitled:' + path)).then(doc => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + path)).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.ok(doc.isDirty); - let closed: TextDocument; - let d0 = workspace.onDidCloseTextDocument(e => closed = e); + let closed: vscode.TextDocument; + let d0 = vscode.workspace.onDidCloseTextDocument(e => closed = e); - return window.showTextDocument(doc).then(() => { + return vscode.window.showTextDocument(doc).then(() => { return doc.save().then(() => { assert.ok(closed === doc); assert.ok(!doc.isDirty); @@ -130,7 +100,7 @@ suite('workspace-namespace', () => { d0.dispose(); - return deleteFile(Uri.file(join(workspace.rootPath || '', './newfile.txt'))).then(() => done(null)); + return deleteFile(vscode.Uri.file(join(vscode.workspace.rootPath || '', './newfile.txt'))).then(() => done(null)); }); }); @@ -139,22 +109,22 @@ suite('workspace-namespace', () => { test('openTextDocument, uri scheme/auth/path', function () { - let registration = workspace.registerTextDocumentContentProvider('sc', { + let registration = vscode.workspace.registerTextDocumentContentProvider('sc', { provideTextDocumentContent() { return 'SC'; } }); return Promise.all([ - workspace.openTextDocument(Uri.parse('sc://auth')).then(doc => { + vscode.workspace.openTextDocument(vscode.Uri.parse('sc://auth')).then(doc => { assert.equal(doc.uri.authority, 'auth'); assert.equal(doc.uri.path, ''); }), - workspace.openTextDocument(Uri.parse('sc:///path')).then(doc => { + vscode.workspace.openTextDocument(vscode.Uri.parse('sc:///path')).then(doc => { assert.equal(doc.uri.authority, ''); assert.equal(doc.uri.path, '/path'); }), - workspace.openTextDocument(Uri.parse('sc://auth/path')).then(doc => { + vscode.workspace.openTextDocument(vscode.Uri.parse('sc://auth/path')).then(doc => { assert.equal(doc.uri.authority, 'auth'); assert.equal(doc.uri.path, '/path'); }) @@ -165,110 +135,110 @@ suite('workspace-namespace', () => { test('eol, read', () => { const a = createRandomFile('foo\nbar\nbar').then(file => { - return workspace.openTextDocument(file).then(doc => { - assert.equal(doc.eol, EndOfLine.LF); + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.LF); }); }); const b = createRandomFile('foo\nbar\nbar\r\nbaz').then(file => { - return workspace.openTextDocument(file).then(doc => { - assert.equal(doc.eol, EndOfLine.LF); + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.LF); }); }); const c = createRandomFile('foo\r\nbar\r\nbar').then(file => { - return workspace.openTextDocument(file).then(doc => { - assert.equal(doc.eol, EndOfLine.CRLF); + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.CRLF); }); }); return Promise.all([a, b, c]); }); - // test('eol, change via editor', () => { - // return createRandomFile('foo\nbar\nbar').then(file => { - // return workspace.openTextDocument(file).then(doc => { - // assert.equal(doc.eol, EndOfLine.LF); - // return window.showTextDocument(doc).then(editor => { - // return editor.edit(builder => builder.setEndOfLine(EndOfLine.CRLF)); + test('eol, change via editor', () => { + return createRandomFile('foo\nbar\nbar').then(file => { + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.LF); + return vscode.window.showTextDocument(doc).then(editor => { + return editor.edit(builder => builder.setEndOfLine(vscode.EndOfLine.CRLF)); - // }).then(value => { - // assert.ok(value); - // assert.ok(doc.isDirty); - // assert.equal(doc.eol, EndOfLine.CRLF); - // }); - // }); - // }); - // }); + }).then(value => { + assert.ok(value); + assert.ok(doc.isDirty); + assert.equal(doc.eol, vscode.EndOfLine.CRLF); + }); + }); + }); + }); - // test('eol, change via applyEdit', () => { - // return createRandomFile('foo\nbar\nbar').then(file => { - // return workspace.openTextDocument(file).then(doc => { - // assert.equal(doc.eol, EndOfLine.LF); + test('eol, change via applyEdit', () => { + return createRandomFile('foo\nbar\nbar').then(file => { + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.LF); - // const edit = new WorkspaceEdit(); - // edit.set(file, [TextEdit.setEndOfLine(EndOfLine.CRLF)]); - // return workspace.applyEdit(edit).then(value => { - // assert.ok(value); - // assert.ok(doc.isDirty); - // assert.equal(doc.eol, EndOfLine.CRLF); - // }); - // }); - // }); - // }); + const edit = new vscode.WorkspaceEdit(); + edit.set(file, [vscode.TextEdit.setEndOfLine(vscode.EndOfLine.CRLF)]); + return vscode.workspace.applyEdit(edit).then(value => { + assert.ok(value); + assert.ok(doc.isDirty); + assert.equal(doc.eol, vscode.EndOfLine.CRLF); + }); + }); + }); + }); - // test('eol, change via onWillSave', () => { + test('eol, change via onWillSave', () => { - // let called = false; - // let sub = workspace.onWillSaveTextDocument(e => { - // called = true; - // e.waitUntil(Promise.resolve([TextEdit.setEndOfLine(EndOfLine.LF)])); - // }); + let called = false; + let sub = vscode.workspace.onWillSaveTextDocument(e => { + called = true; + e.waitUntil(Promise.resolve([vscode.TextEdit.setEndOfLine(vscode.EndOfLine.LF)])); + }); - // return createRandomFile('foo\r\nbar\r\nbar').then(file => { - // return workspace.openTextDocument(file).then(doc => { - // assert.equal(doc.eol, EndOfLine.CRLF); - // const edit = new WorkspaceEdit(); - // edit.set(file, [TextEdit.insert(new Position(0, 0), '-changes-')]); + return createRandomFile('foo\r\nbar\r\nbar').then(file => { + return vscode.workspace.openTextDocument(file).then(doc => { + assert.equal(doc.eol, vscode.EndOfLine.CRLF); + const edit = new vscode.WorkspaceEdit(); + edit.set(file, [vscode.TextEdit.insert(new vscode.Position(0, 0), '-changes-')]); - // return workspace.applyEdit(edit).then(success => { - // assert.ok(success); - // return doc.save(); + return vscode.workspace.applyEdit(edit).then(success => { + assert.ok(success); + return doc.save(); - // }).then(success => { - // assert.ok(success); - // assert.ok(called); - // assert.ok(!doc.isDirty); - // assert.equal(doc.eol, EndOfLine.LF); - // sub.dispose(); - // }); - // }); - // }); - // }); + }).then(success => { + assert.ok(success); + assert.ok(called); + assert.ok(!doc.isDirty); + assert.equal(doc.eol, vscode.EndOfLine.LF); + sub.dispose(); + }); + }); + }); + }); test('events: onDidOpenTextDocument, onDidChangeTextDocument, onDidSaveTextDocument', () => { return createRandomFile().then(file => { - let disposables: Disposable[] = []; + let disposables: vscode.Disposable[] = []; let onDidOpenTextDocument = false; - disposables.push(workspace.onDidOpenTextDocument(e => { + disposables.push(vscode.workspace.onDidOpenTextDocument(e => { assert.ok(pathEquals(e.uri.fsPath, file.fsPath)); onDidOpenTextDocument = true; })); let onDidChangeTextDocument = false; - disposables.push(workspace.onDidChangeTextDocument(e => { + disposables.push(vscode.workspace.onDidChangeTextDocument(e => { assert.ok(pathEquals(e.document.uri.fsPath, file.fsPath)); onDidChangeTextDocument = true; })); let onDidSaveTextDocument = false; - disposables.push(workspace.onDidSaveTextDocument(e => { + disposables.push(vscode.workspace.onDidSaveTextDocument(e => { assert.ok(pathEquals(e.uri.fsPath, file.fsPath)); onDidSaveTextDocument = true; })); - return workspace.openTextDocument(file).then(doc => { - return window.showTextDocument(doc).then((editor) => { + return vscode.workspace.openTextDocument(file).then(doc => { + return vscode.window.showTextDocument(doc).then((editor) => { return editor.edit((builder) => { - builder.insert(new Position(0, 0), 'Hello World'); + builder.insert(new vscode.Position(0, 0), 'Hello World'); }).then(applied => { return doc.save().then(saved => { assert.ok(onDidOpenTextDocument); @@ -292,14 +262,14 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, simple', function () { - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { return uri.toString(); } }); - const uri = Uri.parse('foo://testing/virtual.js'); - return workspace.openTextDocument(uri).then(doc => { + const uri = vscode.Uri.parse('foo://testing/virtual.js'); + return vscode.workspace.openTextDocument(uri).then(doc => { assert.equal(doc.getText(), uri.toString()); assert.equal(doc.isDirty, false); assert.equal(doc.uri.toString(), uri.toString()); @@ -311,15 +281,15 @@ suite('workspace-namespace', () => { // built-in assert.throws(function () { - workspace.registerTextDocumentContentProvider('untitled', { provideTextDocumentContent() { return null; } }); + vscode.workspace.registerTextDocumentContentProvider('untitled', { provideTextDocumentContent() { return null; } }); }); // built-in assert.throws(function () { - workspace.registerTextDocumentContentProvider('file', { provideTextDocumentContent() { return null; } }); + vscode.workspace.registerTextDocumentContentProvider('file', { provideTextDocumentContent() { return null; } }); }); // missing scheme - return workspace.openTextDocument(Uri.parse('notThere://foo/far/boo/bar')).then(() => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('notThere://foo/far/boo/bar')).then(() => { assert.ok(false, 'expected failure'); }, err => { // expected @@ -329,14 +299,14 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, multiple', function () { // duplicate registration - let registration1 = workspace.registerTextDocumentContentProvider('foo', { + let registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { if (uri.authority === 'foo') { return '1'; } } }); - let registration2 = workspace.registerTextDocumentContentProvider('foo', { + let registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { if (uri.authority === 'bar') { return '2'; @@ -345,8 +315,8 @@ suite('workspace-namespace', () => { }); return Promise.all([ - workspace.openTextDocument(Uri.parse('foo://foo/bla')).then(doc => { assert.equal(doc.getText(), '1'); }), - workspace.openTextDocument(Uri.parse('foo://bar/bla')).then(doc => { assert.equal(doc.getText(), '2'); }) + vscode.workspace.openTextDocument(vscode.Uri.parse('foo://foo/bla')).then(doc => { assert.equal(doc.getText(), '1'); }), + vscode.workspace.openTextDocument(vscode.Uri.parse('foo://bar/bla')).then(doc => { assert.equal(doc.getText(), '2'); }) ]).then(() => { registration1.dispose(); registration2.dispose(); @@ -356,18 +326,18 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, evil provider', function () { // duplicate registration - let registration1 = workspace.registerTextDocumentContentProvider('foo', { + let registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { return '1'; } }); - let registration2 = workspace.registerTextDocumentContentProvider('foo', { + let registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri): string { throw new Error('fail'); } }); - return workspace.openTextDocument(Uri.parse('foo://foo/bla')).then(doc => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('foo://foo/bla')).then(doc => { assert.equal(doc.getText(), '1'); registration1.dispose(); registration2.dispose(); @@ -376,12 +346,12 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, invalid text', function () { - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { return 123; } }); - return workspace.openTextDocument(Uri.parse('foo://auth/path')).then(() => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('foo://auth/path')).then(() => { assert.ok(false, 'expected failure'); }, err => { // expected @@ -391,14 +361,14 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, show virtual document', function () { - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { return 'I am virtual'; } }); - return workspace.openTextDocument(Uri.parse('foo://something/path')).then(doc => { - return window.showTextDocument(doc).then(editor => { + return vscode.workspace.openTextDocument(vscode.Uri.parse('foo://something/path')).then(doc => { + return vscode.window.showTextDocument(doc).then(editor => { assert.ok(editor.document === doc); assert.equal(editor.document.getText(), 'I am virtual'); @@ -410,19 +380,19 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, open/open document', function () { let callCount = 0; - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { callCount += 1; return 'I am virtual'; } }); - const uri = Uri.parse('foo://testing/path'); + const uri = vscode.Uri.parse('foo://testing/path'); - return Promise.all([workspace.openTextDocument(uri), workspace.openTextDocument(uri)]).then(docs => { + return Promise.all([vscode.workspace.openTextDocument(uri), vscode.workspace.openTextDocument(uri)]).then(docs => { let [first, second] = docs; assert.ok(first === second); - assert.ok(workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())); + assert.ok(vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())); assert.equal(callCount, 1); registration.dispose(); }); @@ -430,15 +400,15 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, empty doc', function () { - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { provideTextDocumentContent(uri) { return ''; } }); - const uri = Uri.parse('foo:doc/empty'); + const uri = vscode.Uri.parse('foo:doc/empty'); - return workspace.openTextDocument(uri).then(doc => { + return vscode.workspace.openTextDocument(uri).then(doc => { assert.equal(doc.getText(), ''); assert.equal(doc.uri.toString(), uri.toString()); registration.dispose(); @@ -448,25 +418,25 @@ suite('workspace-namespace', () => { test('registerTextDocumentContentProvider, change event', function () { let callCount = 0; - let emitter = new EventEmitter(); + let emitter = new vscode.EventEmitter(); - let registration = workspace.registerTextDocumentContentProvider('foo', { + let registration = vscode.workspace.registerTextDocumentContentProvider('foo', { onDidChange: emitter.event, provideTextDocumentContent(uri) { return 'call' + (callCount++); } }); - const uri = Uri.parse('foo://testing/path3'); + const uri = vscode.Uri.parse('foo://testing/path3'); - return workspace.openTextDocument(uri).then(doc => { + return vscode.workspace.openTextDocument(uri).then(doc => { assert.equal(callCount, 1); assert.equal(doc.getText(), 'call0'); return new Promise((resolve, reject) => { - let subscription = workspace.onDidChangeTextDocument(event => { + let subscription = vscode.workspace.onDidChangeTextDocument(event => { subscription.dispose(); assert.ok(event.document === doc); assert.equal(event.document.getText(), 'call1'); @@ -481,9 +451,9 @@ suite('workspace-namespace', () => { }); test('findFiles', () => { - return workspace.findFiles('*.js').then((res) => { + return vscode.workspace.findFiles('*.js').then((res) => { assert.equal(res.length, 1); - assert.equal(basename(workspace.asRelativePath(res[0])), 'far.js'); + assert.equal(basename(vscode.workspace.asRelativePath(res[0])), 'far.js'); }); }); @@ -494,17 +464,17 @@ suite('workspace-namespace', () => { // const token = source.token; // just to get an instance first // source.cancel(); - // return workspace.findFiles('*.js', null, 100, token).then((res) => { + // return vscode.workspace.findFiles('*.js', null, 100, token).then((res) => { // assert.equal(res, void 0); // }); // }); test('applyEdit', () => { - return workspace.openTextDocument(Uri.parse('untitled:' + join(workspace.rootPath || '', './new2.txt'))).then(doc => { - let edit = new WorkspaceEdit(); - edit.insert(doc.uri, new Position(0, 0), new Array(1000).join('Hello World')); - return workspace.applyEdit(edit); + return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + join(vscode.workspace.rootPath || '', './new2.txt'))).then(doc => { + let edit = new vscode.WorkspaceEdit(); + edit.insert(doc.uri, new vscode.Position(0, 0), new Array(1000).join('Hello World')); + return vscode.workspace.applyEdit(edit); }); }); }); diff --git a/extensions/vscode-api-tests/tsconfig.json b/extensions/vscode-api-tests/tsconfig.json index 620857bb06f..26c357e374b 100644 --- a/extensions/vscode-api-tests/tsconfig.json +++ b/extensions/vscode-api-tests/tsconfig.json @@ -9,7 +9,7 @@ "sourceMap": true, "strictNullChecks": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/vscode-colorize-tests/package.json b/extensions/vscode-colorize-tests/package.json index a91ebb2a4d7..2e886b67189 100644 --- a/extensions/vscode-colorize-tests/package.json +++ b/extensions/vscode-colorize-tests/package.json @@ -8,14 +8,12 @@ "vscode": "*" }, "scripts": { - "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json", "postinstall": "node ./node_modules/vscode/bin/install" }, "devDependencies": { "@types/mocha": "^2.2.38", "@types/node": "^7.0.4", - "typescript": "^1.6.2", "vscode": "1.0.1" } } \ No newline at end of file diff --git a/extensions/vscode-colorize-tests/src/colorizer.test.ts b/extensions/vscode-colorize-tests/src/colorizer.test.ts index d709300a839..3c91e57ef3f 100644 --- a/extensions/vscode-colorize-tests/src/colorizer.test.ts +++ b/extensions/vscode-colorize-tests/src/colorizer.test.ts @@ -38,7 +38,7 @@ function assertUnchangedTokens(testFixurePath: string, done) { }, done); } -suite("colorization", () => { +suite('colorization', () => { let extensionsFolder = normalize(join(__dirname, '../../')); let extensions = fs.readdirSync(extensionsFolder); extensions.forEach(extension => { diff --git a/extensions/vscode-colorize-tests/tsconfig.json b/extensions/vscode-colorize-tests/tsconfig.json index 099a940aa2e..366e25ea09c 100644 --- a/extensions/vscode-colorize-tests/tsconfig.json +++ b/extensions/vscode-colorize-tests/tsconfig.json @@ -8,7 +8,7 @@ ], "sourceMap": true }, - "exclude": [ - "node_modules" + "include": [ + "src/**/*" ] } \ No newline at end of file diff --git a/extensions/xml/syntaxes/xml.json b/extensions/xml/syntaxes/xml.json index 8237ae9f315..a2006a0d265 100644 --- a/extensions/xml/syntaxes/xml.json +++ b/extensions/xml/syntaxes/xml.json @@ -1,7 +1,13 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-xml/blob/master/grammars/xml.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "text.xml", "name": "XML", "fileTypes": [ + "aiml", "atom", "axml", "bpmn", @@ -21,6 +27,7 @@ "fodt", "fsproj", "fxml", + "gir", "glade", "gpx", "graphml", @@ -29,6 +36,7 @@ "isml", "jmx", "jsp", + "kst", "launch", "menu", "mxml", @@ -44,7 +52,10 @@ "rdf", "rng", "rss", + "sdf", "shproj", + "siml", + "sld", "storyboard", "svg", "targets", @@ -57,7 +68,12 @@ "vcproj.filters", "vcxproj", "vcxproj.filters", + "wixmsp", + "wixmst", + "wixobj", + "wixout", "wsdl", + "wxs", "xaml", "xbl", "xib", @@ -69,6 +85,7 @@ "xul", "ui" ], + "firstLineMatch": "(?x)\n# XML declaration\n(?:\n ^ <\\? xml\n\n # VersionInfo\n \\s+ version\n \\s* = \\s*\n (['\"])\n 1 \\. [0-9]+\n \\1\n\n # EncodingDecl\n (?:\n \\s+ encoding\n \\s* = \\s*\n\n # EncName\n (['\"])\n [A-Za-z]\n [-A-Za-z0-9._]*\n \\2\n )?\n\n # SDDecl\n (?:\n \\s+ standalone\n \\s* = \\s*\n (['\"])\n (?:yes|no)\n \\3\n )?\n\n \\s* \\?>\n)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n xml\n (?=[\\s;]|(?]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n xml\n (?=\\s|:|$)\n)", "patterns": [ { "begin": "(<\\?)\\s*([-_a-zA-Z0-9]+)", @@ -421,6 +438,5 @@ "end": "--%?>", "name": "comment.block.xml" } - }, - "version": "https://github.com/atom/language-xml/commit/f461d428fb87040cb8a52d87d0b95151b9d3c0cc" + } } \ No newline at end of file diff --git a/extensions/xml/syntaxes/xsl.json b/extensions/xml/syntaxes/xsl.json index 8b715b599f9..2193c1a9570 100644 --- a/extensions/xml/syntaxes/xsl.json +++ b/extensions/xml/syntaxes/xsl.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-xml/blob/master/grammars/xsl.cson", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "text.xml.xsl", "name": "XSL", "fileTypes": [ @@ -88,6 +93,5 @@ }, "name": "string.quoted.single.xml" } - }, - "version": "https://github.com/atom/language-xml/commit/507de2ee7daca60cf02e9e21fbeb92bbae73e280" + } } \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml.json b/extensions/yaml/syntaxes/yaml.json index 55939b86d8d..82cd7d840db 100644 --- a/extensions/yaml/syntaxes/yaml.json +++ b/extensions/yaml/syntaxes/yaml.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/yaml.tmbundle/blob/master/Syntaxes/YAML.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "fileTypes": [ "yaml", "yml", @@ -624,6 +629,5 @@ } }, "scopeName": "source.yaml", - "uuid": "686AD6AE-33F3-4493-9512-9E9FC1D5417F", - "version": "https://github.com/textmate/yaml.tmbundle/commit/efc96efafe5e48480cf55a2ed124b388cbea4440" + "uuid": "686AD6AE-33F3-4493-9512-9E9FC1D5417F" } \ No newline at end of file diff --git a/extensions/yaml/test/colorize-results/test_yaml.json b/extensions/yaml/test/colorize-results/test_yaml.json index 8bea09ae57d..e4e35ba7eef 100644 --- a/extensions/yaml/test/colorize-results/test_yaml.json +++ b/extensions/yaml/test/colorize-results/test_yaml.json @@ -84,7 +84,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -95,7 +95,7 @@ "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -348,7 +348,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -359,7 +359,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -447,7 +447,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -458,7 +458,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { @@ -579,7 +579,7 @@ "light_plus": "keyword.control: #AF00DB", "dark_vs": "keyword.control: #569CD6", "light_vs": "keyword.control: #0000FF", - "hc_black": "keyword.control: #569CD6" + "hc_black": "keyword.control: #C586C0" } }, { @@ -590,7 +590,7 @@ "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json index 214156f8972..f40aa81fa48 100644 --- a/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json +++ b/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "activeEditorShort": "例如 myFile.txt", - "activeEditorMedium": "e.g. myFolder/myFile.txt", - "activeEditorLong": "e.g. /Users/Development/myProject/myFolder/myFile.txt", + "activeEditorMedium": "例如 myFolder/myFile.txt", + "activeEditorLong": "例如 /Users/Development/myProject/myFolder/myFile.txt", "rootName": "例如 myProject", "rootPath": "例如 /Users/Development/myProject", "appName": "例如 VS Code", diff --git a/i18n/chs/extensions/git/out/commands.i18n.json b/i18n/chs/extensions/git/out/commands.i18n.json index b7d7aed9960..ceede002e08 100644 --- a/i18n/chs/extensions/git/out/commands.i18n.json +++ b/i18n/chs/extensions/git/out/commands.i18n.json @@ -16,11 +16,19 @@ "confirm discard": "ç¡®å®šè¦æ”¾å¼ƒ {0} 中更改å—?", "confirm discard multiple": "是å¦ç¡®å®žè¦æ”¾å¼ƒ {0} 文件中的更改?", "discard": "放弃更改", + "confirm discard all": "ç¡®å®šè¦æ”¾å¼ƒæ‰€æœ‰æ›´æ”¹å—?此æ“作ä¸å¯æ’¤é”€ï¼", + "discardAll": "放弃所有更改", + "no staged changes": "现在没有暂存的更改以供æäº¤\n\n是å¦è¦ç›´æŽ¥è‡ªåŠ¨æš‚å­˜æ‰€æœ‰æ›´æ”¹å¹¶æäº¤ï¼Ÿ", + "yes": "是", + "always": "始终", "no changes": "æ²¡æœ‰è¦æäº¤çš„æ›´æ”¹ã€‚", "commit message": "æäº¤æ¶ˆæ¯", "provide commit message": "请æä¾›æäº¤æ¶ˆæ¯", "branch name": "分支åç§°", "provide branch name": "请æä¾›åˆ†æ”¯åç§°", + "select branch to delete": "选择è¦åˆ é™¤çš„分支", + "confirm force delete branch": "“{0}â€åˆ†æ”¯æœªè¢«å®Œå…¨åˆå¹¶ã€‚是å¦ä»è¦åˆ é™¤ï¼Ÿ", + "delete branch": "删除分支", "no remotes to pull": "存储库未é…置任何从其中进行拉å–的远程存储库。", "no remotes to push": "存储库未é…ç½®ä»»ä½•è¦æŽ¨é€åˆ°çš„远程存储库。", "nobranch": "请签出一个分支以推é€åˆ°è¿œç¨‹ã€‚", @@ -31,6 +39,7 @@ "no remotes to publish": "存储库未é…置任何è¦å‘布到的远程存储库。", "disabled": "此工作区已ç¦ç”¨æˆ–䏿”¯æŒ GIT", "clean repo": "在签出å‰ï¼Œè¯·æ¸…ç†å­˜å‚¨åº“工作树。", + "cant push": "æ— æ³•æŽ¨é€ refs 到远端。请先è¿è¡Œâ€œæ‹‰å–â€åŠŸèƒ½ä»¥æ•´åˆä½ çš„æ›´æ”¹ã€‚", "git error details": "Git:{0}", "git error": "Git 错误", "open git log": "打开 GIT 日志" diff --git a/i18n/chs/extensions/git/out/main.i18n.json b/i18n/chs/extensions/git/out/main.i18n.json index 266c6a1a3e5..7b6c6f37d1f 100644 --- a/i18n/chs/extensions/git/out/main.i18n.json +++ b/i18n/chs/extensions/git/out/main.i18n.json @@ -7,5 +7,5 @@ "using git": "使用 {1} 中的 GIT {0}", "updateGit": "æ›´æ–° GIT", "neverShowAgain": "ä¸å†æ˜¾ç¤º", - "git20": "似乎已安装 GIT {0}。Code éžå¸¸é€‚åˆ GIT >= 2" + "git20": "你似乎已安装 Git {0}。Code å’Œ Git 版本 >=2 一起工作最佳" } \ No newline at end of file diff --git a/i18n/chs/extensions/git/out/scmProvider.i18n.json b/i18n/chs/extensions/git/out/scmProvider.i18n.json index 7fded37328a..c52199b46c1 100644 --- a/i18n/chs/extensions/git/out/scmProvider.i18n.json +++ b/i18n/chs/extensions/git/out/scmProvider.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "commit": "Commit" + "commit": "æäº¤" } \ No newline at end of file diff --git a/i18n/chs/extensions/git/package.i18n.json b/i18n/chs/extensions/git/package.i18n.json index d45df3f45c4..9c65f275fd6 100644 --- a/i18n/chs/extensions/git/package.i18n.json +++ b/i18n/chs/extensions/git/package.i18n.json @@ -20,12 +20,13 @@ "command.cleanAll": "放弃所有更改", "command.commit": "Commit", "command.commitStaged": "æäº¤å·²æš‚存文件", - "command.commitStagedSigned": "æäº¤æš‚存数æ®(已签收)", + "command.commitStagedSigned": "æäº¤å·²æš‚存文件(已签å)", "command.commitAll": "全部æäº¤", - "command.commitAllSigned": "æäº¤æ‰€æœ‰æ•°æ®(已签收)", + "command.commitAllSigned": "全部æäº¤(已签å)", "command.undoCommit": "撤消上次æäº¤", "command.checkout": "签出到...", "command.branch": "创建分支...", + "command.deleteBranch": "删除分支...", "command.pull": "拉å–", "command.pullRebase": "拉å–(å˜åŸº)", "command.push": "推é€", @@ -34,11 +35,15 @@ "command.publish": "å‘布", "command.showOutput": "显示 GIT 输出", "config.enabled": "是å¦å·²å¯ç”¨ GIT", - "config.path": "坿‰§è¡Œ GIT 的路径", + "config.path": "Git 坿‰§è¡Œæ–‡ä»¶è·¯å¾„", "config.autorefresh": "是å¦å·²å¯ç”¨è‡ªåŠ¨åˆ·æ–°", "config.autofetch": "是å¦å¯ç”¨äº†è‡ªåЍæå–", "config.enableLongCommitWarning": "是å¦é’ˆå¯¹é•¿æ®µæäº¤æ¶ˆæ¯è¿›è¡Œè­¦å‘Š", - "config.confirmSync": "åŒæ­¥ GIT 存储库å‰è¯·å…ˆè¿›è¡Œç¡®è®¤", + "config.confirmSync": "åŒæ­¥ Git 存储库å‰è¿›è¡Œç¡®è®¤", + "config.countBadge": "控制 Git 徽章计数器。“allâ€è®¡ç®—所有更改。“trackedâ€åªè®¡ç®—跟踪的更改。“offâ€å…³é—­æ­¤åŠŸèƒ½ã€‚", + "config.checkoutType": "控制è¿è¡Œâ€œç­¾å‡ºåˆ°...â€æ—¶åˆ—出的分支的类型。“allâ€æ˜¾ç¤ºæ‰€æœ‰ refs,“localâ€åªæ˜¾ç¤ºæœ¬åœ°åˆ†æ”¯ï¼Œâ€œtagsâ€åªæ˜¾ç¤ºæ ‡ç­¾ï¼Œâ€œremoteâ€åªæ˜¾ç¤ºè¿œç¨‹åˆ†æ”¯ã€‚", "config.ignoreLegacyWarning": "忽略旧版 Git 警告", - "config.ignoreLimitWarning": "å¿½ç•¥â€œå­˜å‚¨åº“ä¸­å­˜åœ¨å¤§é‡æ›´æ”¹â€çš„警告" + "config.ignoreLimitWarning": "å¿½ç•¥â€œå­˜å‚¨åº“ä¸­å­˜åœ¨å¤§é‡æ›´æ”¹â€çš„警告", + "config.defaultCloneDirectory": "克隆 Git 存储库的默认ä½ç½®", + "config.enableSmartCommit": "在没有暂存的更改时æäº¤æ‰€æœ‰æ›´æ”¹ã€‚" } \ No newline at end of file diff --git a/i18n/chs/extensions/gulp/out/main.i18n.json b/i18n/chs/extensions/gulp/out/main.i18n.json index 500082cf82f..bda8a250c25 100644 --- a/i18n/chs/extensions/gulp/out/main.i18n.json +++ b/i18n/chs/extensions/gulp/out/main.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "execFailed": "自动检测 gulp 失败,错误为: {0}" + "execFailed": "自动检测 gulp 失败,错误:{0}" } \ No newline at end of file diff --git a/i18n/chs/extensions/gulp/package.i18n.json b/i18n/chs/extensions/gulp/package.i18n.json index 8b6ad71cd4e..368a4601441 100644 --- a/i18n/chs/extensions/gulp/package.i18n.json +++ b/i18n/chs/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "控制自动检测 Gulp ä»»åŠ¡æ˜¯å¦æ‰“开。默认开å¯ã€‚" +} \ No newline at end of file diff --git a/i18n/chs/extensions/jake/out/main.i18n.json b/i18n/chs/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..d2f56bdda98 --- /dev/null +++ b/i18n/chs/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "自动检测 Jake 失败,错误:{0}" +} \ No newline at end of file diff --git a/i18n/chs/extensions/jake/package.i18n.json b/i18n/chs/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..46f020cf890 --- /dev/null +++ b/i18n/chs/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.jake.autoDetect": "控制自动检测 Jake ä»»åŠ¡æ˜¯å¦æ‰“开。默认开å¯ã€‚" +} \ No newline at end of file diff --git a/i18n/chs/extensions/json/package.i18n.json b/i18n/chs/extensions/json/package.i18n.json index 6c9d2ad0143..f147c64ed82 100644 --- a/i18n/chs/extensions/json/package.i18n.json +++ b/i18n/chs/extensions/json/package.i18n.json @@ -10,6 +10,6 @@ "json.schemas.fileMatch.item.desc": "å°† JSON 文件解æžåˆ°æž¶æž„时,用于匹é…çš„å¯ä»¥åŒ…å« \"*\" 的文件模å¼ã€‚", "json.schemas.schema.desc": "给定 URL 的架构定义。åªéœ€æä¾›è¯¥æž¶æž„以é¿å…对架构 URL 的访问。", "json.format.enable.desc": "å¯ç”¨/ç¦ç”¨é»˜è®¤ JSON æ ¼å¼åŒ–程åº(需è¦é‡å¯)", - "json.tracing.desc": "跟踪 VS Code å’Œ JSON 语言æœåŠ¡å™¨ä¹‹é—´çš„é€šä¿¡ã€‚", + "json.tracing.desc": "跟踪 VS Code 与 JSON 语言æœåŠ¡å™¨ä¹‹é—´çš„é€šä¿¡ã€‚", "json.colorDecorators.enable.desc": "å¯ç”¨æˆ–ç¦ç”¨é¢œè‰²ä¿®é¥°å™¨" } \ No newline at end of file diff --git a/src/vs/editor/contrib/snippet/browser/snippet.ts b/i18n/chs/extensions/markdown/out/extension.i18n.json similarity index 86% rename from src/vs/editor/contrib/snippet/browser/snippet.ts rename to i18n/chs/extensions/markdown/out/extension.i18n.json index 3d8b6eb3399..8b6ad71cd4e 100644 --- a/src/vs/editor/contrib/snippet/browser/snippet.ts +++ b/i18n/chs/extensions/markdown/out/extension.i18n.json @@ -2,7 +2,5 @@ * 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 'vs/css!./snippet'; \ No newline at end of file +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..3590523ef87 --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "é‡‡ç”¨å½“å‰æ›´æ”¹" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..996cf7276b8 --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +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. +{ + "cursorNotInConflict": "编辑器光标ä¸åœ¨åˆå¹¶å†²çªå†…", + "noConflicts": "没有在此文件中找到åˆå¹¶å†²çª", + "noOtherConflictsInThisFile": "此文件中没有其他åˆå¹¶å†²çªäº†" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..feac7a236d8 --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "(当剿›´æ”¹)" +} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/gitless/gitlessView.css b/i18n/chs/extensions/merge-conflict/package.i18n.json similarity index 60% rename from src/vs/workbench/parts/git/browser/views/gitless/gitlessView.css rename to i18n/chs/extensions/merge-conflict/package.i18n.json index a06817221da..82e4bc58463 100644 --- a/src/vs/workbench/parts/git/browser/views/gitless/gitlessView.css +++ b/i18n/chs/extensions/merge-conflict/package.i18n.json @@ -2,22 +2,11 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -.git-viewlet > .gitless-view { - padding: 0 20px 0 20px; -} - -.git-viewlet > .gitless-view > p { - line-height: 1.5em; -} - -.git-viewlet > .gitless-view .code { - display: inline; -} - -.git-viewlet > .gitless-view a +// Do not edit this file. It is machine generated. { - color: inherit; - font-weight: bold; - text-decoration: underline; -} + "command.category": "åˆå¹¶å†²çª", + "command.next": "下一个冲çª", + "command.previous": "上一个冲çª", + "command.compare": "比较当å‰å†²çª", + "config.title": "åˆå¹¶å†²çª" +} \ No newline at end of file diff --git a/i18n/chs/extensions/npm/package.i18n.json b/i18n/chs/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..6130b12cc05 --- /dev/null +++ b/i18n/chs/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.npm.autoDetect": "控制自动检测 npm è„šæœ¬æ˜¯å¦æ‰“开。默认开å¯ã€‚" +} \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json index c885212097a..9dcaf692d8f 100644 --- a/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -6,7 +6,7 @@ { "versionMismatch": "版本ä¸åŒ¹é…! 全局 tsc ({0}) != VS Code 的语言æœåŠ¡({1})。å¯èƒ½å‡ºçްä¸ä¸€è‡´çš„编译错误", "moreInformation": "详细信æ¯", - "doNotCheckAgain": "ä¸è¦å†æ¬¡æ£€æŸ¥", + "doNotCheckAgain": "ä¸å†æ£€æŸ¥", "close": "关闭", "updateTscCheck": "已将用户设置 \"typescript.check.tscVersion\" 更新为 false" } \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/chs/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..de76bf9b5f5 --- /dev/null +++ b/i18n/chs/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +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. +{ + "ts-check": "在 JavaScript 文件中å¯ç”¨è¯­ä¹‰æ£€æŸ¥ã€‚必须在文件顶部。", + "ts-nocheck": "在 JavaScript 文件中ç¦ç”¨è¯­ä¹‰æ£€æŸ¥ã€‚必须在文件顶部。", + "ts-ignore": "å–æ¶ˆæ–‡ä»¶ä¸‹ä¸€è¡Œçš„ @ts-check 错误æç¤ºã€‚" +} \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/chs/extensions/typescript/out/typescriptServiceClient.i18n.json index 79910794a22..06c4e0ea585 100644 --- a/i18n/chs/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/chs/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "路径 {0} æœªæŒ‡å‘æœ‰æ•ˆçš„ tsserver 安装。请回退到æ†ç»‘çš„ TypeScript 版本。", "noBundledServerFound": "其他应用程åº(例如è¿è¡Œå¼‚常的病毒检测工具)已删除 VSCode çš„ tsserverã€‚è¯·é‡æ–°å®‰è£… VS Code。", "versionNumber.custom": "自定义", diff --git a/i18n/chs/extensions/typescript/out/utils/logger.i18n.json b/i18n/chs/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/chs/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json index f6ee369cc40..01709f2e6d3 100644 --- a/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "æå–æ•°æ®ä»¥å®žçŽ°æ›´å¥½çš„ TypeScript IntelliSense", + "typesInstallerInitializationFailed.title": "无法为 JavaScript 语言功能安装 typings 文件。请确认 NPM å·²ç»å®‰è£…且ä½äºŽ PATH 中", "typesInstallerInitializationFailed.moreInformation": "详细信æ¯", "typesInstallerInitializationFailed.doNotCheckAgain": "ä¸è¦å†æ¬¡æ£€æŸ¥", "typesInstallerInitializationFailed.close": "关闭" diff --git a/i18n/chs/extensions/typescript/package.i18n.json b/i18n/chs/extensions/typescript/package.i18n.json index 1e24a1e8d40..e9bd0e95be0 100644 --- a/i18n/chs/extensions/typescript/package.i18n.json +++ b/i18n/chs/extensions/typescript/package.i18n.json @@ -33,11 +33,14 @@ "javascript.validate.enable": "å¯ç”¨/ç¦ç”¨ JavaScript 验è¯ã€‚", "typescript.goToProjectConfig.title": "转到项目é…ç½®", "javascript.goToProjectConfig.title": "转到项目é…ç½®", - "typescript.referencesCodeLens.enabled": "å¯ç”¨/ç¦ç”¨å¼•用 CodeLensã€‚è¦æ±‚ TypeScript >= 2.0.6。", + "javascript.referencesCodeLens.enabled": "å¯ç”¨/ç¦ç”¨åœ¨ JavaScript 文件中引用 CodeLens。", + "typescript.referencesCodeLens.enabled": "å¯ç”¨/ç¦ç”¨åœ¨ TypeScript 文件中引用 CodeLensã€‚è¦æ±‚ TypeScript >= 2.0.6。", "typescript.implementationsCodeLens.enabled": "å¯ç”¨/ç¦ç”¨å®žçް CodeLensã€‚è¦æ±‚ TypeScript >= 2.2.0。", - "typescript.openTsServerLog.title": "打开 TS æœåŠ¡å™¨æ—¥å¿—æ–‡ä»¶", + "typescript.openTsServerLog.title": "打开 TS æœåŠ¡å™¨æ—¥å¿—", + "typescript.restartTsServer": "é‡å¯ TS æœåС噍", "typescript.selectTypeScriptVersion.title": "选择 TypeScript 版本", "jsDocCompletion.enabled": "å¯ç”¨/ç¦ç”¨è‡ªåЍ JSDoc 注释", "javascript.implicitProjectConfig.checkJs": "å¯ç”¨/ç¦ç”¨ JavaScript 文件的语义检查。现有的 jsconfig.json 或\n tsconfig.json æ–‡ä»¶ä¼šè¦†ç›–æ­¤è®¾ç½®ã€‚è¦æ±‚ TypeScript >=2.3.1。", - "typescript.check.npmIsInstalled": "检查是å¦å®‰è£…了 NPM 以进行自动 typings 获å–" + "typescript.check.npmIsInstalled": "检查是å¦å®‰è£…了 NPM 以进行自动 typings 获å–", + "javascript.nameSuggestions": "å¯ç”¨/ç¦ç”¨åœ¨ JavaScript å»ºè®®åˆ—è¡¨ä¸­åŒ…å«æ–‡ä»¶ä¸­çš„唯一å称。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index 8f887744626..4e5bf82d935 100644 --- a/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "图åƒå¤ªå¤§ï¼Œæ— æ³•在编辑器中显示。 ", - "resourceOpenExternalButton": "打开图åƒ", - "resourceOpenExternalText": " 是å¦ä½¿ç”¨å¤–部程åº?", "nativeBinaryError": "文件将ä¸åœ¨ç¼–辑器中显示,因为它是二进制文件ã€éžå¸¸å¤§æˆ–ä½¿ç”¨ä¸æ”¯æŒçš„æ–‡æœ¬ç¼–ç ã€‚", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/chs/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/chs/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..0400ef47d7c --- /dev/null +++ b/i18n/chs/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "ç¬¦å·æ— æ•ˆ", + "error.invalidNumberFormat": "æ•°å­—æ ¼å¼æ— æ•ˆ", + "error.propertyNameExpected": "需è¦å±žæ€§å", + "error.valueExpected": "需è¦å€¼", + "error.colonExpected": "需è¦å†’å·", + "error.commaExpected": "需è¦é€—å·", + "error.closeBraceExpected": "需è¦å³å¤§æ‹¬å·", + "error.closeBracketExpected": "需è¦å³æ‹¬å·", + "error.endOfFileExpected": "éœ€è¦æ–‡ä»¶ç»“å°¾(EOF)" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/code/electron-main/menus.i18n.json b/i18n/chs/src/vs/code/electron-main/menus.i18n.json index f049e294f3b..4f7e61e056c 100644 --- a/i18n/chs/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/chs/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "帮助(&&H)", "miNewWindow": "新建窗å£(&&W)", "mAbout": "关于 {0}", + "mServices": "æœåŠ¡", "mHide": "éšè— {0}", "mHideOthers": "éšè—å…¶ä»–", "mShowAll": "全部显示", @@ -54,9 +55,9 @@ "miShowEmmetCommands": "Emmet(&&M)...", "miToggleLineComment": "切æ¢è¡Œæ³¨é‡Š(&&T)", "miToggleBlockComment": "切æ¢å—注释(&&B)", - "miInsertCursorAbove": "åœ¨ä¸Šé¢æ·»åŠ æ¸¸æ ‡(&&A)", - "miInsertCursorBelow": "åœ¨ä¸‹é¢æ·»åŠ æ¸¸æ ‡(&&D)", - "miInsertCursorAtEndOfEachLineSelected": "在行尾添加游标(&&U)", + "miInsertCursorAbove": "åœ¨ä¸Šé¢æ·»åŠ å…‰æ ‡(&&A)", + "miInsertCursorBelow": "åœ¨ä¸‹é¢æ·»åŠ å…‰æ ‡(&&D)", + "miInsertCursorAtEndOfEachLineSelected": "在行尾添加光标(&&U)", "miAddSelectionToNextFindMatch": "添加下一个匹é…项(&&N)", "miAddSelectionToPreviousFindMatch": "添加上一个匹é…项(&&R)", "miSelectHighlights": "选择所有匹é…项(&&O)", @@ -69,7 +70,7 @@ "miSmartSelectShrink": "缩å°é€‰å®šèŒƒå›´(&&S)", "miViewExplorer": "资æºç®¡ç†å™¨(&&E)", "miViewSearch": "æœç´¢(&&S)", - "miViewGit": "GIT(&&G)", + "miViewSCM": "SCM(&&C)", "miViewDebug": "调试(&&D)", "miViewExtensions": "扩展(&&X)", "miToggleOutput": "输出(&&O)", @@ -114,9 +115,11 @@ "miGotoSymbolInFile": "转到文件中的符å·(&&S)...", "miGotoSymbolInWorkspace": "转到工作区中的符å·(&&W)...", "miGotoDefinition": "转到定义(&&D)...", + "miGotoTypeDefinition": "转到类型定义(&&T)", + "miGotoImplementation": "转到实现(&&I)", "miGotoLine": "转到行(&&L)...", "miStartDebugging": "å¯åŠ¨è°ƒè¯•(&&S)", - "miStartWithoutDebugging": "在ä¸è°ƒè¯•的情况下å¯åЍ(&&W)", + "miStartWithoutDebugging": "éžè°ƒè¯•å¯åЍ(&&W)", "miStopDebugging": "åœæ­¢è°ƒè¯•(&&S)", "miRestart Debugging": "é‡å¯è°ƒè¯•(&&R)", "miOpenConfigurations": "打开é…ç½®(&&C)", @@ -140,9 +143,10 @@ "miAccessibilityOptions": "辅助功能选项(&&O)", "miReportIssues": "报告问题(&&I)", "miWelcome": "欢迎使用(&&W)", + "miInteractivePlayground": "äº¤äº’å¼æ¼”练场(&&I)", "miDocumentation": "文档(&&D)", "miReleaseNotes": "å‘行说明(&&R)", - "miKeyboardShortcuts": "é”®ç›˜å¿«æ·æ–¹å¼å‚考(&&K)", + "miKeyboardShortcuts": "å¿«æ·é”®å‚考(&&K)", "miIntroductoryVideos": "ä»‹ç»æ€§è§†é¢‘(&&V)", "miTwitter": "在 Twitter 上加入我们(&&J)", "miUserVoice": "æœç´¢åŠŸèƒ½è¯·æ±‚(&&S)", @@ -155,6 +159,6 @@ "miDownloadingUpdate": "正在下载更新...", "miInstallingUpdate": "正在安装更新...", "miCheckForUpdates": "检查更新...", - "aboutDetail": "\n版本 {0}\næäº¤ {1}\n日期 {2}\nShell {3}\n呈现器 {4}\nNode {5}", + "aboutDetail": "\n版本 {0}\næäº¤ {1}\n日期 {2}\nShell {3}\n渲染器 {4}\nNode {5}", "okButton": "确定" } \ No newline at end of file diff --git a/i18n/chs/src/vs/code/electron-main/windows.i18n.json b/i18n/chs/src/vs/code/electron-main/windows.i18n.json index 6982cf6190c..55246096dd2 100644 --- a/i18n/chs/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/chs/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "确定", "pathNotExistTitle": "路径ä¸å­˜åœ¨", "pathNotExistDetail": "ç£ç›˜ä¸Šä¼¼ä¹Žä¸å†å­˜åœ¨è·¯å¾„“{0}â€ã€‚", - "accessibilityOptionsWindowTitle": "辅助功能选项", "reopen": "釿–°æ‰“å¼€", "wait": "ä¿æŒç­‰å¾…", "close": "关闭", diff --git a/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json index 4a8ec7c378a..5c4e0b1ea13 100644 --- a/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,11 +9,12 @@ "fontWeight": "控制字体粗细。", "fontSize": "以åƒç´ ä¸ºå•ä½æŽ§åˆ¶å­—å·ã€‚", "lineHeight": "控制行高。使用 0 通过字å·è®¡ç®—行高。", + "letterSpacing": "以åƒç´ ä¸ºå•ä½æŽ§åˆ¶å­—ç¬¦é—´è·ã€‚", "lineNumbers": "控制行å·çš„æ˜¾ç¤ºã€‚å¯èƒ½çš„值为“开â€ã€â€œå…³â€å’Œâ€œç›¸å¯¹â€ã€‚“相对â€å°†æ˜¾ç¤ºä»Žå½“å‰å…‰æ ‡ä½ç½®å¼€å§‹è®¡æ•°çš„行数。", "rulers": "显示垂直标尺的列", "wordSeparators": "执行文字相关的导航或æ“作时将用作文字分隔符的字符", "tabSize": "一个制表符等于的空格数。该设置在 `editor.detectIndentation` å¯ç”¨æ—¶æ ¹æ®æ–‡ä»¶å†…容进行é‡å†™ã€‚", - "tabSize.errorMessage": "应为 \\\\\"number\\\\\"。注æ„,值\\\\\"auto\\\\\"已由 \\\\\"editor.detectIndentation\\\\\" 设置替æ¢ã€‚", + "tabSize.errorMessage": "应为“numberâ€ã€‚注æ„,值“autoâ€å·²ç”±â€œeditor.detectIndentationâ€è®¾ç½®æ›¿æ¢ã€‚", "insertSpaces": "按 \"Tab\" æ—¶æ’入空格。该设置在 `editor.detectIndentation` å¯ç”¨æ—¶æ ¹æ®æ–‡ä»¶å†…容进行é‡å†™ã€‚", "insertSpaces.errorMessage": "应为 \"boolean\"。注æ„,值 \"auto\" 已由 \"editor.detectIndentation\" 设置替æ¢ã€‚", "detectIndentation": "当打开文件时,将基于文件内容检测 \"editor.tabSize\" å’Œ \"editor.insertSpaces\"。", @@ -26,9 +27,9 @@ "wordWrap.on": "将在视区宽度处æ¢è¡Œã€‚", "wordWrap.wordWrapColumn": "将在 \"editor.wordWrapColumn\" 处æ¢è¡Œã€‚", "wordWrap.bounded": "将在最å°è§†åŒºå’Œ \"editor.wordWrapColumn\" 处æ¢è¡Œã€‚", - "wordWrap": "控制æ¢è¡Œæ–¹å¼ã€‚å¯ä»¥é€‰æ‹©ï¼š\n - “off†(ç¦ç”¨æ¢è¡Œ),\n - “on†(视区æ¢è¡Œ),\n - “wordWrapColumn†(在 \"editor.wordWrapColumn\" 处æ¢è¡Œ`) 或\n - “bounded†(在视区和 \"editor.wordWrapColumn\" 中的最å°å€¼å¤„æ¢è¡Œ)。", + "wordWrap": "控制折行方å¼ã€‚å¯ä»¥é€‰æ‹©ï¼š - “off†(ç¦ç”¨æŠ˜è¡Œï¼‰ï¼Œ - “on†(视区折行), - “wordWrapColumnâ€ï¼ˆåœ¨â€œeditor.wordWrapColumnâ€å¤„折行)或 - “boundedâ€ï¼ˆåœ¨è§†åŒºä¸Žâ€œeditor.wordWrapColumnâ€ä¸¤è€…的较å°è€…处折行)。", "wordWrapColumn": "在 \"editor.wordWrap\" 为 \"wordWrapColumn\" 或 \"bounded\" 时控制编辑器列的æ¢è¡Œã€‚", - "wrappingIndent": "控制æ¢è¡Œçš„行的缩进。å¯ä»¥æ˜¯\\\\\"none\\\\\"〠\\\\\"same\\\\\" 或 \\\\\"indent\\\\\"。", + "wrappingIndent": "控制折行的缩进。å¯ä»¥æ˜¯â€œnoneâ€ã€â€œsameâ€æˆ–“indentâ€ã€‚", "mouseWheelScrollSensitivity": "è¦å¯¹é¼ æ ‡æ»šè½®æ»šåŠ¨äº‹ä»¶çš„ \"deltaX\" å’Œ \"deltaY\" 使用的乘数 ", "quickSuggestions.strings": "在字符串内å¯ç”¨å¿«é€Ÿå»ºè®®ã€‚", "quickSuggestions.comments": "在注释内å¯ç”¨å¿«é€Ÿå»ºè®®ã€‚", @@ -40,7 +41,6 @@ "formatOnType": "控制编辑器是å¦åº”在键入åŽè‡ªåŠ¨è®¾ç½®è¡Œçš„æ ¼å¼", "formatOnPaste": "控制编辑器是å¦åº”自动设置粘贴内容的格å¼ã€‚æ ¼å¼åŒ–程åºå¿…é¡»å¯ç”¨å¹¶ä¸”能设置文档中æŸä¸€èŒƒå›´çš„æ ¼å¼ã€‚", "suggestOnTriggerCharacters": "控制键入触å‘器字符时是å¦åº”自动显示建议", - "acceptSuggestionOnEnter": "控制除了 \"Tab\" 键以外,是å¦è¿˜åº”在é‡åˆ° \"Enter\" 键时接å—建议。帮助é¿å…“æ’å…¥æ–°è¡Œâ€æˆ–“接å—建议â€ä¹‹é—´å‡ºçŽ°æ­§ä¹‰ã€‚", "acceptSuggestionOnCommitCharacter": "控制是å¦åº”在é‡åˆ°æäº¤å­—符时接å—建议。例如,在 JavaScript 中,分å·(\";\")å¯ä»¥ä¸ºæäº¤å­—ç¬¦ï¼Œå¯æŽ¥å—建议并键入该字符。", "snippetSuggestions": "控制是å¦å°†ä»£ç æ®µä¸Žå…¶ä»–建议一起显示以åŠå®ƒä»¬çš„æŽ’åºæ–¹å¼ã€‚", "emptySelectionClipboard": "控制没有选择内容的å¤åˆ¶æ˜¯å¦å¤åˆ¶å½“å‰è¡Œã€‚", @@ -62,6 +62,7 @@ "renderLineHighlight": "控制编辑器应如何呈现当å‰è¡Œçªå‡ºæ˜¾ç¤ºï¼Œå¯èƒ½ä¸ºâ€œæ— â€ã€â€œè£…订线â€ã€â€œçº¿â€å’Œâ€œå…¨éƒ¨â€ã€‚", "codeLens": "æŽ§åˆ¶ç¼–è¾‘å™¨æ˜¯å¦æ˜¾ç¤ºä»£ç æ»¤é•œ", "folding": "控制编辑器是å¦å¯ç”¨ä»£ç æŠ˜å åŠŸèƒ½", + "showFoldingControls": "控制是å¦è‡ªåЍéšè—å¯¼èˆªçº¿ä¸Šçš„æŠ˜å æŽ§ä»¶ã€‚", "matchBrackets": "当选择其中一项时,将çªå‡ºæ˜¾ç¤ºåŒ¹é…的括å·ã€‚", "glyphMargin": "控制编辑器是å¦åº”呈现垂直字形边è·ã€‚å­—å½¢è¾¹è·æœ€å¸¸ç”¨äºŽè°ƒè¯•。", "useTabStops": "在制表ä½åŽæ’入和删除空格", diff --git a/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..9d5691d3e42 --- /dev/null +++ b/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "编辑器内容" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json index d517535edca..dc0edc0650c 100644 --- a/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,11 @@ "caret": "编辑器光标颜色。", "editorWhitespaces": "编辑器中空白字符颜色。", "editorIndentGuides": "编辑器缩进å‚考线颜色。", - "editorLineNumbers": "编辑器行å·é¢œè‰²ã€‚" + "editorLineNumbers": "编辑器行å·é¢œè‰²ã€‚", + "editorRuler": "编辑器标尺的颜色。", + "editorCodeLensForeground": "编辑器 CodeLens çš„å‰æ™¯è‰²", + "editorBracketMatchBackground": "åŒ¹é…æ‹¬å·çš„背景色", + "editorBracketMatchBorder": "åŒ¹é…æ‹¬å·å¤–框颜色", + "editorOverviewRulerBorder": "概览标尺边框的颜色。", + "editorGutter": "编辑器导航线的背景色。导航线包括边缘符å·å’Œè¡Œå·ã€‚" } \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/disabled/disabledView.css b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json similarity index 85% rename from src/vs/workbench/parts/git/browser/views/disabled/disabledView.css rename to i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json index f5e5b1994a5..8b6ad71cd4e 100644 --- a/src/vs/workbench/parts/git/browser/views/disabled/disabledView.css +++ b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -2,7 +2,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -.git-viewlet > .disabled-view { - padding: 0 20px 0 20px; -} +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/chs/src/vs/editor/contrib/hover/browser/hover.i18n.json index 2d214d20aca..65910844481 100644 --- a/i18n/chs/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "显示悬åœ", - "hoverHighlight": "在显示软键盘的字下方çªå‡ºæ˜¾ç¤ºã€‚", - "hoverBackground": "编辑器悬åœçš„背景颜色。", - "hoverBorder": "编辑器软键盘边框颜色。" + "showHover": "显示悬åœ" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json index 76fa4543d53..5bd5906da32 100644 --- a/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -8,7 +8,7 @@ "indentationToTabs": "将缩进转æ¢ä¸ºåˆ¶è¡¨ç¬¦", "configuredTabSize": "å·²é…置制表符大å°", "selectTabWidth": "é€‰æ‹©å½“å‰æ–‡ä»¶çš„制表符大å°", - "indentUsingTabs": "使用 \\\\\"Tab\\\\\" 缩进", + "indentUsingTabs": "使用“Tabâ€ç¼©è¿›", "indentUsingSpaces": "使用空格缩进", "detectIndentation": "检查内容中的缩进", "editor.reindentlines": "釿–°ç¼©è¿›è¡Œ" diff --git a/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index e200e46e376..70e89645ee3 100644 --- a/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,11 +16,12 @@ "peekViewTitleInfoForeground": "速览视图标题信æ¯é¢œè‰²ã€‚", "peekViewBorder": "速览视图边框和箭头颜色。", "peekViewResultsBackground": "速览视图结果列表背景颜色。", - "peekViewResultsMatchForeground": "åœ¨é€Ÿè§ˆè§†å›¾ç»“æžœåˆ—è¡¨ä¸­åŒ¹é…æ¡ç›®å‰æ™¯è‰²ã€‚", - "peekViewResultsFileForeground": "速览视图结果列表中的文件æ¡ç›®å‰æ™¯è‰²ã€‚", + "peekViewResultsMatchForeground": "é€Ÿè§ˆè§†å›¾ç»“æžœåˆ—è¡¨ä¸­è¡ŒèŠ‚ç‚¹çš„å‰æ™¯è‰²ã€‚", + "peekViewResultsFileForeground": "é€Ÿè§ˆè§†å›¾ç»“æžœåˆ—è¡¨ä¸­æ–‡ä»¶èŠ‚ç‚¹çš„å‰æ™¯è‰²ã€‚", "peekViewResultsSelectionBackground": "速览视图结果列表中所选æ¡ç›®çš„背景颜色。", "peekViewResultsSelectionForeground": "速览视图结果列表中所选æ¡ç›®çš„剿™¯è‰²ã€‚", "peekViewEditorBackground": "速览视图编辑器背景颜色。", + "peekViewEditorGutterBackground": "速览视图编辑器中导航线的背景颜色。", "peekViewResultsMatchHighlight": "在速览视图结果列表中匹é…çªå‡ºæ˜¾ç¤ºé¢œè‰²ã€‚", "peekViewEditorMatchHighlight": "在速览视图编辑器中匹é…çªå‡ºæ˜¾ç¤ºé¢œè‰²ã€‚" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 12737ed6d9b..ec34ba659f1 100644 --- a/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -9,10 +9,10 @@ "editorSuggestWidgetForeground": "建议å°ç»„ä»¶çš„å‰æ™¯é¢œè‰²ã€‚", "editorSuggestWidgetSelectedBackground": "建议å°ç»„件中被选择æ¡ç›®çš„背景颜色。", "editorSuggestWidgetHighlightForeground": "建议å°ç»„件中匹é…内容的高亮颜色。", - "readMore": "阅读更多...{0}", + "readMore": "阅读详细信æ¯...{0}", "suggestionWithDetailsAriaLabel": "{0}(建议)具有详细信æ¯", "suggestionAriaLabel": "{0},建议", - "goback": "返回", + "readLess": "阅读简略信æ¯...{0}", "suggestWidget.loading": "正在加载...", "suggestWidget.noSuggestions": "无建议。", "suggestionAriaAccepted": "{0},已接å—", diff --git a/i18n/chs/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/chs/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index f588a8a1586..a4b09b5b447 100644 --- a/i18n/chs/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/chs/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "定义增加和å‡å°‘缩进的括å·ã€‚", "schema.autoClosingPairs": "定义括å·å¯¹ã€‚å½“è¾“å…¥å·¦æ–¹æ‹¬å·æ—¶ï¼Œå°†è‡ªåЍæ’入峿–¹æ‹¬å·ã€‚", "schema.autoClosingPairs.notIn": "定义ç¦ç”¨äº†è‡ªåЍé…对的作用域列表。", - "schema.surroundingPairs": "定义å¯ç”¨äºŽåŒ…围所选字符串的括å·å¯¹ã€‚" + "schema.surroundingPairs": "定义å¯ç”¨äºŽåŒ…围所选字符串的括å·å¯¹ã€‚", + "schema.wordPattern": "此语言的文本定义。", + "schema.wordPattern.pattern": "ç”¨äºŽåŒ¹é…æ–‡æœ¬çš„æ­£åˆ™è¡¨è¾¾å¼æ¨¡å¼ã€‚", + "schema.wordPattern.flags": "ç”¨äºŽåŒ¹é…æ–‡æœ¬çš„æ­£åˆ™è¡¨è¾¾å¼æ ‡å¿—。", + "schema.wordPattern.flags.errorMessage": "å¿…é¡»åŒ¹é…æ¨¡å¼â€œ/^([gimuy]+)$/â€ã€‚" } \ No newline at end of file diff --git a/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 3aee009f0fb..806db0f0748 100644 --- a/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -18,9 +18,9 @@ "menus.explorerContext": "文件资æºç®¡ç†å™¨ä¸Šä¸‹æ–‡èœå•", "menus.editorTabContext": "编辑器选项å¡ä¸Šä¸‹æ–‡èœå•", "menus.debugCallstackContext": "调试调用堆栈上下文èœå•", - "menus.scmTitle": "æºæŽ§ä»¶æ ‡é¢˜èœå•", - "menus.resourceGroupContext": "æºæŽ§ä»¶èµ„æºç»„上下文èœå•", - "menus.resourceStateContext": "æºæŽ§ä»¶èµ„æºçжæ€ä¸Šä¸‹æ–‡èœå•", + "menus.scmTitle": "æºä»£ç ç®¡ç†æ ‡é¢˜èœå•", + "menus.resourceGroupContext": "æºä»£ç ç®¡ç†èµ„æºç»„上下文èœå•", + "menus.resourceStateContext": "æºä»£ç ç®¡ç†èµ„æºçжæ€ä¸Šä¸‹æ–‡èœå•", "nonempty": "应为éžç©ºå€¼ã€‚", "opticon": "å¯ä»¥çœç•¥å±žæ€§â€œå›¾æ ‡â€æˆ–者它必须是一个字符串或类似“{dark, light}â€çš„æ–‡æœ¬", "requireStringOrObject": "属性“{0}â€ä¸ºå¿…éœ€ä¸”å…¶ç±»åž‹å¿…é¡»ä¸ºâ€œå­—ç¬¦ä¸²â€æˆ–“对象â€", diff --git a/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json index ea616506b8e..781727fae4d 100644 --- a/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json +++ b/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -10,7 +10,7 @@ "vscode.extension.contributes.configuration": "用于é…置字符串。", "vscode.extension.contributes.configuration.title": "设置摘è¦ã€‚此标签将在设置文件中用作分隔注释。", "vscode.extension.contributes.configuration.properties": "é…置属性的æè¿°ã€‚", - "config.property.languageDefault": "无法注册“{0}â€ã€‚这符åˆå±žæ€§æ¨¡å¼ \"\\\\[.*\\\\]$\",å¯ç”¨äºŽæè¿°ç‰¹å®šè¯­è¨€ç¼–辑器设置。请使用 \"configurationDefaults\"。", + "config.property.languageDefault": "无法注册“{0}â€ã€‚å…¶ç¬¦åˆæè¿°ç‰¹å®šè¯­è¨€ç¼–è¾‘å™¨è®¾ç½®çš„è¡¨è¾¾å¼ \"\\\\[.*\\\\]$\"。请使用 \"configurationDefaults\"。", "config.property.duplicate": "无法注册“{0}â€ã€‚此属性已注册。", "invalid.properties": "configuration.properties 必须是对象", "invalid.type": "如果进行设置,\"configuration.type\" 必须设置为对象", diff --git a/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json index a28f091a27b..b9fc2ddbbde 100644 --- a/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "错误: 模å¼å±žæ€§ {0} 是无效的模å¼å˜é‡å。", "ProblemMatcherParser.problemPattern.watchingMatcher": "问题匹é…程åºå¿…须定义监视的开始模å¼å’Œç»“æŸæ¨¡å¼ã€‚", "ProblemMatcherParser.invalidRegexp": "错误: 字符串 {0} 䏿˜¯æœ‰æ•ˆçš„æ­£åˆ™è¡¨è¾¾å¼ã€‚\n", - "WatchingPatternSchema.regexp": "用于检测监视任务的开始和结æŸçš„æ­£åˆ™è¡¨è¾¾å¼ã€‚", + "WatchingPatternSchema.regexp": "用于检测åŽå°ä»»åŠ¡å¼€å§‹æˆ–ç»“æŸçš„æ­£åˆ™è¡¨è¾¾å¼ã€‚", "WatchingPatternSchema.file": "文件å的匹é…组索引。å¯ä»¥çœç•¥ã€‚", "PatternTypeSchema.name": "所æä¾›æˆ–预定义模å¼çš„åç§°", "PatternTypeSchema.description": "é—®é¢˜æ¨¡å¼æˆ–者所æä¾›æˆ–预定义问题模å¼çš„å称。如果已指定基准,则å¯ä»¥çœç•¥ã€‚", @@ -43,10 +43,15 @@ "ProblemMatcherSchema.severity": "æ•èŽ·é—®é¢˜çš„é»˜è®¤ä¸¥é‡æ€§ã€‚å¦‚æžœæ¨¡å¼æœªå®šä¹‰ä¸¥é‡æ€§çš„匹é…组,则使用。", "ProblemMatcherSchema.applyTo": "控制文本文档上报告的问题是å¦ä»…应用于打开ã€å…³é—­æˆ–所有文档。", "ProblemMatcherSchema.fileLocation": "定义应如何解释问题模å¼ä¸­æŠ¥å‘Šçš„æ–‡ä»¶å。", + "ProblemMatcherSchema.background": "用于跟踪在åŽå°ä»»åŠ¡ä¸Šæ¿€æ´»çš„åŒ¹é…程åºçš„开始和结æŸçš„æ¨¡å¼ã€‚", + "ProblemMatcherSchema.background.activeOnStart": "如果设置为 true,则会在任务开始时激活åŽå°ç›‘控。这相当于å‘出与 beginPattern 匹é…的行。", + "ProblemMatcherSchema.background.beginsPattern": "如果在输出内匹é…,则会å‘出åŽå°ä»»åŠ¡å¼€å§‹çš„ä¿¡å·ã€‚", + "ProblemMatcherSchema.background.endsPattern": "如果在输出内匹é…,则会å‘出åŽå°ä»»åŠ¡ç»“æŸçš„ä¿¡å·ã€‚", + "ProblemMatcherSchema.watching.deprecated": "“watchingâ€å±žæ€§å·²è¢«å¼ƒç”¨ã€‚请改用“backgroundâ€ã€‚", + "ProblemMatcherSchema.watching": "用于跟踪监视匹é…程åºå¼€å§‹å’Œç»“æŸçš„æ¨¡å¼ã€‚", "ProblemMatcherSchema.watching.activeOnStart": "如果设置为 true,则当任务开始时观察程åºå¤„于活动模å¼ã€‚这相当于å‘出与 beginPattern 匹é…的行。", "ProblemMatcherSchema.watching.beginsPattern": "如果在输出内匹é…,则在监视任务开始时会å‘出信å·ã€‚", "ProblemMatcherSchema.watching.endsPattern": "如果在输出内匹é…ï¼Œåˆ™åœ¨ç›‘è§†ä»»åŠ¡ç»“æŸæ—¶ä¼šå‘出信å·ã€‚", - "ProblemMatcherSchema.watching": "用于跟踪观看模å¼å¼€å§‹å’Œç»“æŸçš„æ¨¡å¼ã€‚", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "此属性已弃用。请改用观看属性。", "LegacyProblemMatcherSchema.watchedBegin": "一个正则表达å¼ï¼Œå‘出å—监视任务开始执行(通过文件监视触å‘)的信å·ã€‚", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "此属性已弃用。请改用观看属性。", diff --git a/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json index 5f7643de9e4..0af4fc2114c 100644 --- a/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -7,14 +7,25 @@ "invalid.color": "é¢œè‰²æ ¼å¼æ— æ•ˆã€‚请使用 #RGBã€#RGBAã€#RRGGBB 或 #RRGGBBAA", "schema.colors": "工作å°ä¸­ä½¿ç”¨çš„颜色。", "foreground": "æ•´ä½“å‰æ™¯è‰²ã€‚此颜色仅在ä¸è¢«ç»„件覆盖时适用。", + "errorForeground": "错误信æ¯çš„æ•´ä½“剿™¯è‰²ã€‚此颜色仅在ä¸è¢«ç»„件覆盖时适用。", + "descriptionForeground": "æä¾›å…¶ä»–ä¿¡æ¯çš„è¯´æ˜Žæ–‡æœ¬çš„å‰æ™¯è‰²ï¼Œä¾‹å¦‚标签文本。", "focusBorder": "焦点元素的整体边框颜色。此颜色仅在ä¸è¢«å…¶ä»–组件覆盖时适用。", "contrastBorder": "在元素周围é¢å¤–çš„ä¸€å±‚è¾¹æ¡†ï¼Œç”¨æ¥æé«˜å¯¹æ¯”åº¦ä»Žè€ŒåŒºåˆ«å…¶ä»–å…ƒç´ ã€‚", "activeContrastBorder": "在活动元素周围é¢å¤–çš„ä¸€å±‚è¾¹æ¡†ï¼Œç”¨æ¥æé«˜å¯¹æ¯”åº¦ä»Žè€ŒåŒºåˆ«å…¶ä»–å…ƒç´ ã€‚", + "selectionBackground": "å·¥ä½œå°æ‰€é€‰æ–‡æœ¬çš„背景颜色(例如输入字段或文本区域)。注æ„,本设置ä¸é€‚用于编辑器和终端。", + "textSeparatorForeground": "文字分隔符的颜色。", + "textLinkForeground": "æ–‡æœ¬ä¸­é“¾æŽ¥çš„å‰æ™¯è‰²ã€‚", + "textLinkActiveForeground": "æ–‡æœ¬ä¸­æ´»åŠ¨é“¾æŽ¥çš„å‰æ™¯è‰²ã€‚", + "textPreformatForeground": "预格å¼åŒ–æ–‡æœ¬æ®µçš„å‰æ™¯è‰²ã€‚", + "textBlockQuoteBackground": "文本中å—引用的背景颜色。", + "textBlockQuoteBorder": "文本中å—引用的边框颜色。", + "textCodeBlockBackground": "文本中代ç å—的背景颜色。", "widgetShadow": "编辑器内å°ç»„件(如查找/替æ¢ï¼‰çš„阴影颜色。", "inputBoxBackground": "输入框背景色。", "inputBoxForeground": "è¾“å…¥æ¡†å‰æ™¯è‰²ã€‚", "inputBoxBorder": "输入框边框。", "inputBoxActiveOptionBorder": "输入字段中已激活选项的边框颜色。", + "inputPlaceholderForeground": "输入框中å ä½ç¬¦çš„剿™¯è‰²ã€‚", "inputValidationInfoBackground": "䏥釿€§ä¸ºä¿¡æ¯æ—¶è¾“入验è¯çš„背景颜色。", "inputValidationInfoBorder": "䏥釿€§ä¸ºä¿¡æ¯æ—¶è¾“入验è¯çš„边框颜色。", "inputValidationWarningBackground": "䏥釿€§ä¸ºè­¦å‘Šæ—¶è¾“入验è¯çš„背景颜色。", @@ -25,12 +36,13 @@ "dropdownForeground": "ä¸‹æ‹‰åˆ—è¡¨å‰æ™¯è‰²ã€‚", "dropdownBorder": "下拉列表边框。", "listFocusBackground": "ç„¦ç‚¹é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", + "listFocusForeground": "ç„¦ç‚¹é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", "listActiveSelectionBackground": "å·²é€‰é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", - "listInactiveSelectionBackground": "å·²é€‰é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘éžæ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", "listActiveSelectionForeground": "å·²é€‰é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„å‰æ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", - "listFocusAndSelectionBackground": "被选中且èšç„¦çš„é¡¹ç›®åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚æ­¤é¢œè‰²æ¯”å•独的选择和焦点颜色的优先级高。", - "listFocusAndSelectionForeground": "被选中且èšç„¦çš„é¡¹ç›®åœ¨åˆ—è¡¨æˆ–æ ‘æ´»åŠ¨æ—¶çš„å‰æ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚æ­¤é¢œè‰²æ¯”å•独的选择和焦点颜色的优先级高。", + "listInactiveSelectionBackground": "å·²é€‰é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘éžæ´»åŠ¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", + "listInactiveSelectionForeground": "å·²é€‰é¡¹åœ¨åˆ—è¡¨æˆ–æ ‘éžæ´»åŠ¨æ—¶çš„å‰æ™¯é¢œè‰²ã€‚æ´»åŠ¨çš„åˆ—è¡¨æˆ–æ ‘å…·æœ‰é”®ç›˜ç„¦ç‚¹ï¼Œéžæ´»åŠ¨çš„æ²¡æœ‰ã€‚", "listHoverBackground": "使用鼠标移动项目时,列表或树的背景颜色。", + "listHoverForeground": "é¼ æ ‡åœ¨é¡¹ç›®ä¸Šæ‚¬åœæ—¶ï¼Œåˆ—è¡¨æˆ–æ ‘çš„å‰æ™¯é¢œè‰²ã€‚", "listDropBackground": "使用鼠标移动项目时,列表或树进行拖放的背景颜色。", "highlight": "在列表或树中æœç´¢æ—¶ï¼Œå…¶ä¸­åŒ¹é…内容的高亮颜色。", "pickerGroupForeground": "快速选å–器分组标签的颜色。", @@ -38,19 +50,29 @@ "buttonForeground": "æŒ‰é’®å‰æ™¯è‰²ã€‚", "buttonBackground": "按钮背景色。", "buttonHoverBackground": "æŒ‰é’®åœ¨æ‚¬åœæ—¶çš„背景颜色。", + "badgeBackground": "Badge 背景色。Badge 是å°åž‹çš„ä¿¡æ¯æ ‡ç­¾ï¼Œå¦‚表示æœç´¢ç»“果数é‡çš„æ ‡ç­¾ã€‚", + "badgeForeground": "Badge 剿™¯è‰²ã€‚Badge 是å°åž‹çš„ä¿¡æ¯æ ‡ç­¾ï¼Œå¦‚表示æœç´¢ç»“果数é‡çš„æ ‡ç­¾ã€‚", "scrollbarShadow": "表示视图被滚动的滚动æ¡é˜´å½±ã€‚", "scrollbarSliderBackground": "滑å—的背景颜色。", "scrollbarSliderHoverBackground": "滑å—åœ¨æ‚¬åœæ—¶çš„背景颜色。", "scrollbarSliderActiveBackground": "滑å—在活动的背景颜色。", + "progressBarBackground": "表示长时间æ“作的进度æ¡çš„背景色。", "editorBackground": "编辑器背景颜色。", "editorForeground": "ç¼–è¾‘å™¨é»˜è®¤å‰æ™¯è‰²ã€‚", + "editorWidgetBackground": "编辑器组件(如查找/替æ¢)背景颜色。", + "editorWidgetBorder": "编辑器å°ç»„件的边框颜色。", "editorSelection": "编辑器所选内容的颜色。", "editorInactiveSelection": "éžæ´»åŠ¨ç¼–è¾‘å™¨ä¸­æ‰€é€‰å†…å®¹çš„é¢œè‰²ã€‚", "editorSelectionHighlight": "与所选内容具有相åŒå†…容的区域颜色。", "editorFindMatch": "当剿œç´¢åŒ¹é…项的颜色。", "findMatchHighlight": "å…¶ä»–æœç´¢åŒ¹é…项的颜色。", "findRangeHighlight": "é™åˆ¶æœç´¢çš„范围的颜色。", + "hoverHighlight": "æ‚¬åœæç¤ºæ˜¾ç¤ºæ—¶æ–‡æœ¬åº•ä¸‹çš„é«˜äº®é¢œè‰²ã€‚", + "hoverBackground": "ç¼–è¾‘å™¨æ‚¬åœæç¤ºçš„èƒŒæ™¯é¢œè‰²ã€‚", + "hoverBorder": "编辑器软键盘边框颜色。", "activeLinkForeground": "活动链接颜色。", - "linkForeground": "链接颜色。", - "editorWidgetBackground": "编辑器组件(如查找/替æ¢)背景颜色。" + "diffEditorInserted": "å·²æ’入文本的背景颜色。", + "diffEditorRemoved": "被删除文本的背景颜色。", + "diffEditorInsertedOutline": "æ’入的文本的轮廓颜色。", + "diffEditorRemovedOutline": "被删除文本的轮廓颜色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..1b83e2539f4 --- /dev/null +++ b/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "ä½¿ç”¨æ‰©å±•ç¨‹åº {1} è¦†ç›–æ‰©å±•ç¨‹åº {0}。", + "extensionUnderDevelopment": "正在 {0} å¤„åŠ è½½å¼€å‘æ‰©å±•程åº" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..d95075ca825 --- /dev/null +++ b/i18n/chs/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "关闭", + "cancel": "å–æ¶ˆ", + "ok": "确定" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/chs/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..dc7534a7060 --- /dev/null +++ b/i18n/chs/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "没有注册 ID 为“{0}â€çš„ TreeExplorerNodeProvider。", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider“{0}â€æ— æ³•æä¾›æ ¹èŠ‚ç‚¹ã€‚" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..7bfb0b886de --- /dev/null +++ b/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +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. +{ + "treeView.notRegistered": "没有注册 ID 为“{0}â€çš„æ ‘形图。", + "treeItem.notFound": "没有在树中找到 ID 为“{0}â€çš„项目。", + "treeView.duplicateElement": "已注册元素 {0}。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/chs/src/vs/workbench/browser/actions/configureLocale.i18n.json index 37269b60c8f..c8f8f1edc8f 100644 --- a/i18n/chs/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,7 @@ "configureLocale": "é…置语言", "displayLanguage": "定义 VSCode 的显示语言。", "doc": "请å‚阅 {0},了解支æŒçš„语言列表。", - "restart": "è¦æ›´æ”¹å€¼éœ€è¦é‡å¯ VSCode。", + "restart": "更改此值需è¦é‡å¯ VSCode。", "fail.createSettings": "无法创建“{0}â€({1})。", "JsonSchema.locale": "è¦ä½¿ç”¨çš„ UI 语言。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index b2df0032ff4..dc267856d02 100644 --- a/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "打开组中上一个最近使用的编辑器", "openNextRecentlyUsedEditorInGroup": "打开组中下一个最近使用的编辑器", "navigateEditorHistoryByInput": "从历å²è®°å½•里打开上一个编辑器", + "openNextRecentlyUsedEditor": "打开下一个最近使用的编辑器", + "openPreviousRecentlyUsedEditor": "打开上一个最近使用的编辑器", "clearEditorHistory": "清除编辑器历å²è®°å½•", "focusLastEditorInStack": "打开组中上一个编辑器", "moveEditorLeft": "å‘左移动编辑器", diff --git a/i18n/chs/src/vs/workbench/common/theme.i18n.json b/i18n/chs/src/vs/workbench/common/theme.i18n.json index bff10399ed5..0f3e7eb1bf9 100644 --- a/i18n/chs/src/vs/workbench/common/theme.i18n.json +++ b/i18n/chs/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "选项å¡å®¹å™¨çš„è¾¹æ¡†é¢œè‰²ã€‚é€‰é¡¹å¡æ˜¯ç¼–辑器区域中编辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥å­˜åœ¨å¤šä¸ªç¼–辑器组。", "tabActiveBackground": "活动选项å¡çš„èƒŒæ™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", "tabInactiveBackground": "éžæ´»åЍ选项å¡çš„èƒŒæ™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", "tabBorder": "用于将选项å¡å½¼æ­¤åˆ†éš”å¼€çš„è¾¹æ¡†ã€‚é€‰é¡¹å¡æ˜¯ç¼–辑器区域中编辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥å­˜åœ¨å¤šä¸ªç¼–辑器组。", "tabActiveEditorGroupActiveForeground": "活动组中活动选项å¡çš„剿™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", - "tabActiveEditorGroupInactiveForeground": "éžæ´»åŠ¨ç»„ä¸­æ´»åŠ¨é€‰é¡¹å¡çš„剿™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", "tabInactiveEditorGroupActiveForeground": "æ´»åŠ¨ç»„ä¸­éžæ´»åЍ选项å¡çš„剿™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", - "tabInactiveEditorGroupInactiveForeground": "éžæ´»åŠ¨ç»„ä¸­éžæ´»åЍ选项å¡çš„剿™¯è‰²ã€‚åœ¨ç¼–è¾‘å™¨åŒºåŸŸï¼Œé€‰é¡¹å¡æ˜¯ç¼–辑器的容器。å¯åœ¨ä¸€ä¸ªç¼–辑器组中打开多个选项å¡ã€‚å¯ä»¥æœ‰å¤šä¸ªç¼–辑器组。", + "editorGroupBackground": "编辑器组的背景颜色。编辑器组是编辑器的容器。此颜色在拖动编辑器组时显示。", + "tabsContainerBackground": "å¯ç”¨é€‰é¡¹å¡æ—¶ç¼–辑器组标题的背景颜色。编辑器组是编辑器的容器。", + "editorGroupHeaderBackground": "ç¦ç”¨é€‰é¡¹å¡æ—¶ç¼–辑器组标题的背景颜色。编辑器组是编辑器的容器。", "editorGroupBorder": "将多个编辑器组彼此分隔开的颜色。编辑器组是编辑器的容器。", - "editorDragAndDropBackground": "éšæ„拖动编辑器时的背景色。", + "editorDragAndDropBackground": "æ‹–åŠ¨ç¼–è¾‘å™¨æ—¶çš„èƒŒæ™¯é¢œè‰²ã€‚æ­¤é¢œè‰²åº”æœ‰é€æ˜Žåº¦ï¼Œä»¥ä¾¿ç¼–辑器内容能é€è¿‡èƒŒæ™¯ã€‚", "panelBackground": "颿¿çš„èƒŒæ™¯è‰²ã€‚é¢æ¿æ˜¾ç¤ºåœ¨ç¼–辑器区域下方,å¯åŒ…å«è¾“出和集æˆç»ˆç«¯ç­‰è§†å›¾ã€‚", "panelBorder": "åˆ†éš”åˆ°ç¼–è¾‘å™¨çš„é¡¶éƒ¨é¢æ¿è¾¹æ¡†è‰²ã€‚颿¿æ˜¾ç¤ºåœ¨ç¼–辑器区域下方,å¯åŒ…å«è¾“出和集æˆç»ˆç«¯ç­‰è§†å›¾ã€‚", "panelActiveTitleForeground": "æ´»åŠ¨é¢æ¿çš„æ ‡é¢˜é¢œè‰²ã€‚颿¿æ˜¾ç¤ºåœ¨ç¼–辑器区域下方,并包å«è¾“出和集æˆç»ˆç«¯ç­‰è§†å›¾ã€‚", @@ -24,15 +24,21 @@ "statusBarNoFolderBackground": "æ²¡æœ‰æ‰“å¼€æ–‡ä»¶å¤¹æ—¶çŠ¶æ€æ çš„èƒŒæ™¯è‰²ã€‚çŠ¶æ€æ æ˜¾ç¤ºåœ¨çª—å£åº•部。", "statusBarItemActiveBackground": "å•å‡»æ—¶çš„çŠ¶æ€æ é¡¹èƒŒæ™¯è‰²ã€‚çŠ¶æ€æ æ˜¾ç¤ºåœ¨çª—å£åº•部。", "statusBarItemHoverBackground": "æ‚¬åœæ—¶çš„çŠ¶æ€æ é¡¹èƒŒæ™¯è‰²ã€‚çŠ¶æ€æ æ˜¾ç¤ºåœ¨çª—å£åº•部。", + "statusBarProminentItemBackground": "çŠ¶æ€æ çªå‡ºæ˜¾ç¤ºé¡¹çš„背景颜色。çªå‡ºæ˜¾ç¤ºé¡¹æ¯”çŠ¶æ€æ ä¸­çš„å…¶ä»–æ¡ç›®æ›´æ˜¾çœ¼ï¼Œè¡¨æ˜Žå…¶é‡è¦æ€§æ›´é«˜ã€‚çŠ¶æ€æ æ˜¾ç¤ºåœ¨çª—å£åº•部。", + "statusBarProminentItemHoverBackground": "çŠ¶æ€æ çªå‡ºæ˜¾ç¤ºé¡¹åœ¨æ‚¬åœæ—¶çš„背景颜色。çªå‡ºæ˜¾ç¤ºé¡¹æ¯”çŠ¶æ€æ ä¸­çš„å…¶ä»–æ¡ç›®æ›´æ˜¾çœ¼ï¼Œè¡¨æ˜Žå…¶é‡è¦æ€§æ›´é«˜ã€‚çŠ¶æ€æ æ˜¾ç¤ºåœ¨çª—å£åº•部。", "activityBarBackground": "活动æ èƒŒæ™¯è‰²ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ çš„视图间切æ¢ã€‚", "activityBarForeground": "活动æ å‰æ™¯è‰²(例如用于图标)ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ çš„视图间切æ¢ã€‚", - "activityBarDragAndDropBackground": "活动æ é¡¹çš„æ‹–放åé¦ˆé¢œè‰²ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ çš„视图间切æ¢ã€‚", + "activityBarDragAndDropBackground": "活动æ é¡¹åœ¨è¢«æ‹–放时的åé¦ˆé¢œè‰²ã€‚æ­¤é¢œè‰²åº”æœ‰é€æ˜Žåº¦ï¼Œä»¥ä¾¿æ´»åŠ¨æ æ¡ç›®èƒ½é€è¿‡æ­¤é¢œè‰²ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ è§†å›¾ä¹‹é—´åˆ‡æ¢ã€‚", "activityBarBadgeBackground": "æ´»åŠ¨é€šçŸ¥å¾½ç« èƒŒæ™¯è‰²ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ çš„视图间切æ¢ã€‚", "activityBarBadgeForeground": "æ´»åŠ¨é€šçŸ¥å¾½ç« å‰æ™¯è‰²ã€‚æ´»åŠ¨æ æ˜¾ç¤ºåœ¨æœ€å·¦ä¾§æˆ–最å³ä¾§ï¼Œå¹¶å…许在侧边æ çš„视图间切æ¢ã€‚", "sideBarBackground": "ä¾§è¾¹æ èƒŒæ™¯è‰²ã€‚ä¾§è¾¹æ æ˜¯èµ„æºç®¡ç†å™¨å’Œæœç´¢ç­‰è§†å›¾çš„容器。", + "sideBarForeground": "ä¾§è¾¹æ å‰æ™¯è‰²ã€‚ä¾§è¾¹æ æ˜¯èµ„æºç®¡ç†å™¨å’Œæœç´¢ç­‰è§†å›¾çš„容器。", "sideBarTitleForeground": "ä¾§è¾¹æ æ ‡é¢˜å‰æ™¯è‰²ã€‚ä¾§è¾¹æ æ˜¯èµ„æºç®¡ç†å™¨å’Œæœç´¢ç­‰è§†å›¾çš„容器。", + "sideBarSectionHeaderBackground": "ä¾§è¾¹æ èŠ‚æ ‡é¢˜çš„èƒŒæ™¯é¢œè‰²ã€‚ä¾§è¾¹æ æ˜¯èµ„æºç®¡ç†å™¨å’Œæœç´¢ç­‰è§†å›¾çš„容器。", "titleBarActiveForeground": "窗å£å¤„äºŽæ´»åŠ¨çŠ¶æ€æ—¶çš„æ ‡é¢˜æ å‰æ™¯è‰²ã€‚请注æ„,该颜色当å‰ä»…在 macOS ä¸Šå—æ”¯æŒã€‚", "titleBarInactiveForeground": "窗å£å¤„äºŽéžæ´»åŠ¨çŠ¶æ€æ—¶çš„æ ‡é¢˜æ å‰æ™¯è‰²ã€‚请注æ„,该颜色当å‰ä»…在 macOS ä¸Šå—æ”¯æŒã€‚", "titleBarActiveBackground": "窗å£å¤„äºŽæ´»åŠ¨çŠ¶æ€æ—¶çš„æ ‡é¢˜æ èƒŒæ™¯è‰²ã€‚请注æ„,该颜色当å‰ä»…在 macOS ä¸Šå—æ”¯æŒã€‚", - "titleBarInactiveBackground": "窗å£å¤„äºŽéžæ´»åŠ¨çŠ¶æ€æ—¶çš„æ ‡é¢˜æ èƒŒæ™¯è‰²ã€‚请注æ„,该颜色当å‰ä»…在 macOS ä¸Šå—æ”¯æŒã€‚" + "titleBarInactiveBackground": "窗å£å¤„äºŽéžæ´»åŠ¨çŠ¶æ€æ—¶çš„æ ‡é¢˜æ èƒŒæ™¯è‰²ã€‚请注æ„,该颜色当å‰ä»…在 macOS ä¸Šå—æ”¯æŒã€‚", + "notificationsForeground": "é€šçŸ¥å‰æ™¯è‰²ã€‚通知从窗å£é¡¶éƒ¨æ»‘入。", + "notificationsBackground": "通知背颜色。通知从窗å£é¡¶éƒ¨æ»‘入。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json index ee33fc5f243..6997449c1ce 100644 --- a/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "查看", "help": "帮助", "file": "文件", + "developer": "å¼€å‘者", "showEditorTabs": "æŽ§åˆ¶æ‰“å¼€çš„ç¼–è¾‘å™¨æ˜¯å¦æ˜¾ç¤ºåœ¨é€‰é¡¹å¡ä¸­ã€‚", "editorTabCloseButton": "控制编辑器的选项å¡å…³é—­æŒ‰é’®çš„ä½ç½®ï¼Œæˆ–当设置为 \"off\" æ—¶ç¦ç”¨å…³é—­å®ƒä»¬ã€‚", "showIcons": "控制打开的编辑器是å¦éšå›¾æ ‡ä¸€èµ·æ˜¾ç¤ºã€‚这还需å¯ç”¨å›¾æ ‡ä¸»é¢˜ã€‚", @@ -41,12 +42,13 @@ "window.newWindowDimensions.inherit": "以与上一个活动窗å£ç›¸åŒçš„尺寸打开新窗å£ã€‚", "window.newWindowDimensions.maximized": "打开最大化的新窗å£ã€‚", "window.newWindowDimensions.fullscreen": "åœ¨å…¨å±æ¨¡å¼ä¸‹æ‰“开新窗å£ã€‚", - "newWindowDimensions": "控制打开新窗å£çš„尺寸。默认情况下,新窗å£å°†ä»¥å°å°ºå¯¸åœ¨å±å¹•的中央打开。当设置为 \"inherit\" 时,窗å£å°†èŽ·å–与上一活动窗å£ç›¸åŒçš„尺寸。当设置为 \"maximized\" 时,窗å£å°†ä»¥æœ€å¤§åŒ–形弿‰“开,如果é…置为 \"fullscreen\",窗å£å°†ä»¥å…¨å±å½¢å¼æ‰“开。", + "newWindowDimensions": "æŽ§åˆ¶åœ¨å·²æœ‰çª—å£æ—¶æ–°æ‰“开窗å£çš„尺寸。默认情况下,新窗å£å°†ä»¥å°å°ºå¯¸åœ¨å±å¹•的中央打开。当设置为“inheritâ€æ—¶ï¼Œæ–°çª—å£å°†ç»§æ‰¿ä¸Šä¸€æ´»åŠ¨çª—å£çš„尺寸,设置为“maximizedâ€æ—¶çª—å£å°†è¢«æœ€å¤§åŒ–,设置为“fullscreenâ€æ—¶åˆ™å˜ä¸ºå…¨å±ã€‚请注æ„ï¼Œæ­¤è®¾ç½®å¯¹ç¬¬ä¸€ä¸ªæ‰“å¼€çš„çª—å£æ— æ•ˆã€‚ç¬¬ä¸€ä¸ªçª—å£æ€»æ˜¯ä¼šæ¢å¤å…³é—­å‰çš„大å°å’Œä½ç½®ã€‚", "window.menuBarVisibility.default": "èœå•ä»…åœ¨å…¨å±æ¨¡å¼ä¸‹éšè—。", "window.menuBarVisibility.visible": "èœå•始终å¯è§ï¼Œå³ä½¿å¤„äºŽå…¨å±æ¨¡å¼ä¸‹ã€‚", "window.menuBarVisibility.toggle": "èœå•éšè—,但å¯ä»¥é€šè¿‡ Alt 键显示。", "window.menuBarVisibility.hidden": "èœå•始终éšè—。", "menuBarVisibility": "控制èœå•æ çš„å¯è§æ€§ã€‚“切æ¢â€è®¾ç½®è¡¨ç¤ºéšè—èœå•æ ï¼ŒæŒ‰ä¸€æ¬¡ Alt 键则将显示此èœå•æ ã€‚默认情况下,除éžçª—å£ä¸ºå…¨å±ï¼Œå¦åˆ™èœå•æ å¯è§ã€‚", + "enableMenuBarMnemonics": "如果å¯ç”¨ï¼Œåˆ™å¯ä½¿ç”¨ Alt å¿«æ·é”®æ‰“开主èœå•。ç¦ç”¨åŠ©è®°é”®å…许将这些 Alt å¿«æ·é”®ç»‘定到编辑器命令。", "autoDetectHighContrast": "如果已å¯ç”¨ï¼Œå°†è‡ªåŠ¨æ›´æ”¹ä¸ºé«˜å¯¹æ¯”åº¦ä¸»é¢˜ï¼›å¦‚æžœ Windows 正在使用高对比度主题,则当离开 Windows 高对比度主题时会更改为深色主题。", "titleBarStyle": "è°ƒæ•´çª—å£æ ‡é¢˜æ çš„外观。更改需è¦åœ¨å®Œå…¨é‡å¯åŽæ‰èƒ½åº”用。", "window.nativeTabs": "\nå¯ç”¨macOS Sierra窗å£é€‰é¡¹å¡ã€‚请注æ„,更改需è¦å®Œå…¨é‡æ–°å¯åŠ¨ç¨‹åºæ‰èƒ½ç”Ÿæ•ˆã€‚如果é…置此选项,本机选项å¡å°†ç¦ç”¨è‡ªå®šä¹‰æ ‡é¢˜æ æ ·å¼ã€‚", diff --git a/i18n/chs/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/shell.i18n.json index 3af5d3e32a6..3f8eff44c3f 100644 --- a/i18n/chs/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/chs/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "ä¸å»ºè®®å°† Code 作为“根â€è¿è¡Œã€‚", - "prof.message": "æˆåŠŸåˆ›å»ºçš„é…置文件。", - "prof.detail": "请创建问题并手动附加以下文件:\n{0}", - "prof.restartAndFileIssue": "创建问题并é‡å¯", - "prof.restart": "é‡å¯" + "runningAsRoot": "ä¸å»ºè®®å°† Code 作为“根â€è¿è¡Œã€‚" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/window.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/window.i18n.json index 365d467f270..0f5f23325d4 100644 --- a/i18n/chs/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/chs/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "粘贴", "selectAll": "全选", "confirmOpen": "是å¦ç¡®å®šè¦æ‰“å¼€ {0} 个文件夹?", - "confirmOpenButton": "打开(&&O)...", - "developer": "å¼€å‘者", - "file": "文件" + "confirmOpenButton": "打开(&&O)..." } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..b163a2de99e 100644 --- a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "å¼€å‘者: 检查键映射" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json index 8d541bedfe0..a7b3e519e7d 100644 --- a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -6,6 +6,6 @@ { "toggle.wordwrap": "查看: 切æ¢è‡ªåЍæ¢è¡Œ", "wordWrap.notInDiffEditor": "ä¸èƒ½åœ¨å·®å¼‚编辑器中切æ¢è‡ªåЍæ¢è¡Œã€‚", - "unwrapMinified": "为此文件ç¦ç”¨æ¢è¡Œ", + "unwrapMinified": "为此文件ç¦ç”¨æŠ˜è¡Œ", "wrapMinified": "为此文件å¯ç”¨æ¢è¡Œ" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 0dcbbe50442..258e88045a6 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "打开 {0}", "launchJsonNeedsConfigurtion": "é…ç½®æˆ–ä¿®å¤ \"launch.json\"", + "noFolderDebugConfig": "请先打开一个文件夹以进行高级调试é…置。", "startDebug": "开始调试", "startWithoutDebugging": "开始执行(ä¸è°ƒè¯•)", "selectAndStartDebugging": "选择并开始调试", @@ -34,6 +35,7 @@ "editConditionalBreakpoint": "编辑断点...", "setValue": "设置值", "addWatchExpression": "添加表达å¼", + "editWatchExpression": "编辑表达å¼", "addToWatchExpressions": "添加到监视", "removeWatchExpression": "删除表达å¼", "removeAllWatchExpressions": "删除所有表达å¼", diff --git a/i18n/chs/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..fd9702e842b 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "调试工具æ èƒŒæ™¯é¢œè‰²ã€‚" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..e0672f811fd --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "点击以跟进(Cmd + 点击打开到侧边)", + "fileLink": "点击以跟进(Ctrl + 点击打开到侧边))" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..8f7407863de --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "内部调试控制å°çš„æŽ§åˆ¶è¡Œä¸ºã€‚" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..b984c5a3f68 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noFolderDebugConfig": "请先打开一个文件夹以进行高级调试é…置。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json index 3cd5741027e..776abd849a7 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -24,7 +24,7 @@ "vscode.extension.contributes.debuggers.osx.runtime": "用于 OSX çš„è¿è¡Œæ—¶ã€‚", "vscode.extension.contributes.debuggers.linux": "Linux 特定的设置。", "vscode.extension.contributes.debuggers.linux.runtime": "用于 Linux çš„è¿è¡Œæ—¶ã€‚", - "vscode.extension.contributes.breakpoints": "贡献断电。", + "vscode.extension.contributes.breakpoints": "添加断点。", "vscode.extension.contributes.breakpoints.language": "对此语言å…许断点。", "app.launch.json.title": "å¯åЍ", "app.launch.json.version": "此文件格å¼çš„版本。", diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index b02aea13f1d..83ff9579591 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "å¤åˆ¶å€¼", "copy": "å¤åˆ¶", + "copyAll": "全部å¤åˆ¶", "copyStackTrace": "å¤åˆ¶è°ƒç”¨å †æ ˆ" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index f8362fa633f..16828d670d2 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "å¯¹è±¡çŠ¶æ€æ•获自第一个评估", - "fileLinkMac": "点击以跟进(Cmd + 点击打开到侧边)", - "fileLink": "点击以跟进(Ctrl + 点击打开到侧边))", "replVariableAriaLabel": "å˜é‡ {0} 具有值 {1}ã€è¯»å– Eval 打å°å¾ªçŽ¯ï¼Œè°ƒè¯•", "replExpressionAriaLabel": "è¡¨è¾¾å¼ {0} 具有值 {1}ï¼Œè¯»å– Eval 打å°å¾ªçŽ¯ï¼Œè°ƒè¯•", "replValueOutputAriaLabel": "{0}ï¼Œè¯»å– Eval 打å°å¾ªçŽ¯ï¼Œè°ƒè¯•", diff --git a/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index e1f50545d94..54243f83ce3 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,12 +7,12 @@ "debugAdapterBinNotFound": "调试适é…噍坿‰§è¡Œçš„“{0}â€ä¸å­˜åœ¨ã€‚", "debugAdapterCannotDetermineExecutable": "无法确定调试适é…器“{0}â€çš„坿‰§è¡Œæ–‡ä»¶ã€‚", "debugType": "é…置类型。", + "debugTypeNotRecognised": "无法识别此调试类型。确ä¿å·²ç»å®‰è£…å¹¶å¯ç”¨ç›¸åº”的调试扩展。", "node2NotSupported": "ä¸å†æ”¯æŒ \"node2\",改用 \"node\",并将 \"protocol\" 属性设为 \"inspector\"。", "debugName": "é…ç½®å称;在å¯åЍé…置下拉èœå•中显示。", "debugRequest": "请求é…置类型。å¯ä»¥æ˜¯â€œå¯åŠ¨â€æˆ–“附加â€ã€‚", "debugServer": "仅用于调试扩展开å‘: 如果已指定端å£ï¼ŒVS 代ç ä¼šå°è¯•连接到在æœåŠ¡å™¨æ¨¡å¼ä¸­è¿è¡Œçš„调试适é…器", "debugPrelaunchTask": "调试会è¯å¼€å§‹å‰è¦è¿è¡Œçš„任务。", - "internalConsoleOptions": "内部调试控制å°çš„æŽ§åˆ¶è¡Œä¸ºã€‚", "debugWindowsConfiguration": "特定于 Windows çš„å¯åЍé…置属性。", "debugOSXConfiguration": "特定于 OS X çš„å¯åЍé…置属性。", "debugLinuxConfiguration": "特定于 Linux çš„å¯åЍé…置属性。", diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..344b7a80602 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: 平衡(å‘内)", + "balanceOutward": "Emmet: 平衡(å‘外)" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..87fec1a103c --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: 上一编辑点", + "nextEditPoint": "Emmet: 下一编辑点" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..f4159d50b0e --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: 求数学表达å¼çš„值" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..dcef9178c36 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: 展开缩写" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..81f7dcfcab1 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: 增加 0.1", + "incrementNumberByOne": "Emmet: 增加 1", + "incrementNumberByTen": "Emmet: 增加 10", + "decrementNumberByOneTenth": "Emmet: å‡å°‘ 0.1", + "decrementNumberByOne": "Emmet: å‡å°‘ 1", + "decrementNumberByTen": "Emmet: å‡å°‘ 10" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..bb3ef016208 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: 转到匹é…对" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..8548113b66b --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: åˆå¹¶è¡Œ" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..1dcfdd7b85c --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: åå°„ CSS 值" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..545f1c107e7 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: 删除标签" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..6d307aadabf --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: 选择上一项", + "selectNextItem": "Emmet: 选择下一项" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..53e4eaafbd9 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: 分离/è”æŽ¥æ ‡ç­¾" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..ecb3f893e89 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: åˆ‡æ¢æ³¨é‡Š" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..d68725525c8 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: 更新图åƒå¤§å°" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..8bf2821c120 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: 更新标签", + "enterTag": "输入标签", + "tag": "标签" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..21f0c06d363 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: 使用缩写进行包围", + "enterAbbreviation": "输入缩写", + "abbreviation": "缩写" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..0701c9f4ae6 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "å¯ç”¨åŽï¼ŒæŒ‰ TAB 键时,将展开 Emmet 缩写。", + "emmetPreferences": "用于修改 Emmet æŸäº›æ“作和解æžç¨‹åºçš„行为的首选项。", + "emmetSyntaxProfiles": "为指定的语法定义é…置文件或使用带有特定规则的é…置文件。", + "emmetExclude": "ä¸åº”展开 Emmet 缩写的语言数组。", + "emmetExtensionsPath": "åŒ…å« Emmet é…置文件ã€ä»£ç æ®µå’Œé¦–选项的文件夹路径" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 7ee7785b781..076eadb1e72 100644 --- a/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "添加自定义视图", + "vscode.extension.contributes.view.id": "用于标识通过 vscode.workspace.createTreeView 创建的视图的唯一 ID", + "vscode.extension.contributes.view.label": "用于呈现视图的人类å¯è¯»çš„字符串", + "vscode.extension.contributes.view.icon": "视图图标的路径", + "vscode.extension.contributes.views": "添加自定义视图", "showViewlet": "显示 {0}", "view": "查看" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 8bcde2a904f..2db4a66e7e7 100644 --- a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,9 @@ "showRecommendations": "显示建议", "neverShowAgain": "ä¸å†æ˜¾ç¤º", "close": "关闭", - "workspaceRecommended": "此工作区具有扩展建议。" + "workspaceRecommended": "此工作区具有扩展建议。", + "ignoreExtensionRecommendations": "你是å¦è¦å¿½ç•¥æ‰€æœ‰æŽ¨è的扩展?", + "ignoreAll": "是,忽略全部", + "no": "å¦", + "cancel": "å–æ¶ˆ" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index e65debf45a6..1320378fc4d 100644 --- a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "扩展", "view": "查看", "extensionsConfigurationTitle": "扩展", - "extensionsAutoUpdate": "自动更新扩展" + "extensionsAutoUpdate": "自动更新扩展", + "extensionsIgnoreRecommendations": "忽略推è的扩展" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..a8554464048 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "是", + "no": "å¦", + "uninstall": "å¸è½½", + "later": "ç¨åŽ" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index b519747f41a..5813db26a24 100644 --- a/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "é…置语言的文件关è”(如: \"*.extension\": \"html\")。这些关è”的优先级高于已安装语言的默认关è”。", "encoding": "读å–和编写文件时将使用的默认字符集编ç ã€‚", "autoGuessEncoding": "å¯ç”¨æ—¶ï¼Œä¼šåœ¨æ‰“开文件时å°è¯•猜测字符集编ç ", - "eol": "默认行尾字符。", "trimTrailingWhitespace": "å¯ç”¨åŽï¼Œå°†åœ¨ä¿å­˜æ–‡ä»¶æ—¶å‰ªè£å°¾éšç©ºæ ¼ã€‚", "insertFinalNewline": "å¯ç”¨åŽï¼Œä¿å­˜æ–‡ä»¶æ—¶åœ¨æ–‡ä»¶æœ«å°¾æ’入一个最终新行。", "files.autoSave.off": "æ°¸ä¸è‡ªåЍä¿å­˜æ›´æ–°åŽçš„æ–‡ä»¶ã€‚", @@ -24,11 +23,11 @@ "files.autoSave.onFocusChange": "编辑器失去焦点时自动ä¿å­˜æ›´æ–°åŽçš„æ–‡ä»¶ã€‚", "files.autoSave.onWindowChange": "窗å£å¤±åŽ»ç„¦ç‚¹æ—¶è‡ªåŠ¨ä¿å­˜æ›´æ–°åŽçš„æ–‡ä»¶ã€‚", "autoSave": "控制已更新文件的自动ä¿å­˜ã€‚接å—的值:“{0}â€ã€\"{1}â€ã€â€œ{2}â€(编辑器失去焦点)ã€â€œ{3}â€(窗å£å¤±åŽ»ç„¦ç‚¹)。如果设置为“{4}â€ï¼Œåˆ™å¯åœ¨ \"files.autoSaveDelay\" 中é…置延迟。", - "autoSaveDelay": "控制延迟(以秒为å•ä½),在该延迟åŽå°†è‡ªåЍä¿å­˜æ›´æ–°åŽçš„æ–‡ä»¶ã€‚仅在 \"files.autoSave'\" 设置为“{0}â€æ—¶é€‚用。", + "autoSaveDelay": "控制在多少毫秒åŽè‡ªåЍä¿å­˜æ›´æ”¹è¿‡çš„æ–‡ä»¶ã€‚仅在“files.autoSaveâ€è®¾ç½®ä¸ºâ€œ{0}â€æ—¶é€‚用。", "watcherExclude": "é…置文件路径的 glob 模å¼ä»¥ä»Žæ–‡ä»¶ç›‘è§†æŽ’é™¤ã€‚æ›´æ”¹æ­¤è®¾ç½®è¦æ±‚é‡å¯ã€‚如果在å¯åŠ¨æ—¶é‡åˆ° Code æ¶ˆè€—å¤§é‡ CPU 时间,则å¯ä»¥æŽ’除大型文件夹以å‡å°‘åˆå§‹åŠ è½½ã€‚", "hotExit.off": "ç¦ç”¨çƒ­é€€å‡ºã€‚", - "hotExit.onExit": "应用程åºå…³é—­æ—¶ - å³å½“ Windows/Linux 上的最åŽä¸€ä¸ªçª—å£å…³é—­æˆ–è§¦å‘ workbench.action.quit 命令时(命令托盘ã€é”®ç»‘定ã€èœå•)- 将触å‘热退出。下次å¯åŠ¨æ—¶å°†è¿˜åŽŸæ‰€æœ‰å·²å¤‡ä»½çš„çª—å£ã€‚", - "hotExit.onExitAndWindowClose": "应用程åºå…³é—­æ—¶ - å³å½“ Windows/Linux 上的最åŽä¸€ä¸ªçª—å£å…³é—­æˆ–è§¦å‘ workbench.action.quit 命令时(命令托盘ã€é”®ç»‘定ã€èœå•)- 将触å‘热退出。下次å¯åŠ¨æ—¶å°†è¿˜åŽŸæ‰€æœ‰æœªæ‰“å¼€æ–‡ä»¶å¤¹çš„æ‰€æœ‰çª—å£ã€‚è‹¥è¦å°†æ–‡ä»¶å¤¹çª—å£è¿˜åŽŸæˆå…³é—­å‰çš„æ¨¡å¼ï¼Œè¯·å°† \"window.reopenFolders\" 设置为“所有â€ã€‚", + "hotExit.onExit": "应用程åºå…³é—­æ—¶å°†è§¦å‘热退出。在 Windows/Linux 上关闭最åŽä¸€ä¸ªçª—壿ˆ–è§¦å‘ workbench.action.quit 命令(命令托盘ã€é”®ç»‘定ã€èœå•)会引起应用程åºå…³é—­ã€‚下次å¯åŠ¨æ—¶å°†è¿˜åŽŸæ‰€æœ‰å·²å¤‡ä»½çš„çª—å£ã€‚", + "hotExit.onExitAndWindowClose": "应用程åºå…³é—­æ—¶å°†è§¦å‘热退出。在 Windows/Linux 上关闭最åŽä¸€ä¸ªçª—å£ã€è§¦å‘ workbench.action.quit 命令(命令托盘ã€é”®ç»‘定ã€èœå•)会引起应用程åºå…³é—­ã€‚对于任何有文件夹打开的窗å£ï¼Œåˆ™ä¸è®ºè¯¥çª—壿˜¯å¦æ˜¯æœ€åŽä¸€ä¸ªçª—å£ã€‚下次å¯åŠ¨æ—¶å°†è¿˜åŽŸæ‰€æœ‰æœªæ‰“å¼€æ–‡ä»¶å¤¹çš„çª—å£ã€‚è‹¥è¦è¿˜åŽŸæ‰“å¼€æœ‰æ–‡ä»¶å¤¹çš„çª—å£ï¼Œè¯·å°†â€œwindow.reopenFoldersâ€è®¾ç½®ä¸ºâ€œallâ€ã€‚", "hotExit": "控制是å¦åœ¨ä¼šè¯é—´è®°ä½æœªä¿å­˜çš„æ–‡ä»¶ï¼Œä»¥å…许在退出编辑器时跳过ä¿å­˜æç¤ºã€‚", "defaultLanguage": "分é…给新文件的默认语言模å¼ã€‚", "editorConfigurationTitle": "编辑器", diff --git a/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json index f4fa6caa5bc..9745dba4538 100644 --- a/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "orphanedFile": "{0} (deleted from disk)" + "orphanedFile": "{0} (ç£ç›˜ä¸Šå·²åˆ é™¤)" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/git/browser/views/empty/emptyView.i18n.json b/i18n/chs/src/vs/workbench/parts/git/browser/views/empty/emptyView.i18n.json index d4d866094c6..e4d4e20d715 100644 --- a/i18n/chs/src/vs/workbench/parts/git/browser/views/empty/emptyView.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/git/browser/views/empty/emptyView.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "noGit": "此工作区尚未在 GIT æºæŽ§ä»¶ä¹‹ä¸‹ã€‚", + "noGit": "此工作区尚未使用 Git æºä»£ç ç®¡ç†ã€‚", "gitinit": "åˆå§‹åŒ– GIT 存储库" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index dbd6be98f3e..bb7e4ea7afa 100644 --- a/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "检测到å¯åŠ¨ç¼“æ…¢", - "slow.detail": "抱歉,出现了å¯åŠ¨ç¼“æ…¢çš„æƒ…å†µã€‚è¯·é‡å¯â€œ{0}â€å¹¶å¯ç”¨åˆ†æžï¼Œå°†åˆ†æžæ–‡ä»¶ä¸Žæˆ‘们共享,我们会努力æé«˜å¯åŠ¨é€Ÿåº¦ã€‚" + "slow.detail": "抱歉,出现了å¯åŠ¨ç¼“æ…¢çš„æƒ…å†µã€‚è¯·é‡å¯â€œ{0}â€å¹¶å¯ç”¨åˆ†æžï¼Œå°†åˆ†æžæ–‡ä»¶ä¸Žæˆ‘们共享,我们会努力æé«˜å¯åŠ¨é€Ÿåº¦ã€‚", + "prof.message": "å·²æˆåŠŸåˆ›å»ºæè¿°æ–‡ä»¶ã€‚", + "prof.detail": "请创建问题并手动附加以下文件:\n{0}", + "prof.restartAndFileIssue": "创建问题并é‡å¯", + "prof.restart": "é‡å¯", + "prof.thanks": "感谢您的帮助。", + "prof.detail.restart": "需è¦é‡æ–°å¯åЍæ‰èƒ½ç»§ç»­ä½¿ç”¨â€œ{0}â€ã€‚冿¬¡æ„Ÿè°¢æ‚¨çš„贡献。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json index d4d305eba54..3461ec0a523 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "keybindingsInputName": "键盘快æ·é”®", + "keybindingsInputName": "é”®ç›˜å¿«æ·æ–¹å¼", "SearchKeybindings.AriaLabel": "æœç´¢é”®ç»‘定", "SearchKeybindings.Placeholder": "æœç´¢é”®ç»‘定", "sortByPrecedene": "按优先级排åº", - "header-message": "用于高级自定义打开和编辑", + "header-message": "高级自定义请打开和编辑", "keybindings-file-name": "keybindings.json", "keybindingsLabel": "键绑定", "changeLabel": "更改键绑定", diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index 0bf6b9af995..72a81c0af68 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "打开用户设置", "openGlobalKeybindings": "æ‰“å¼€é”®ç›˜å¿«æ·æ–¹å¼", + "openGlobalKeybindingsFile": "æ‰“å¼€é”®ç›˜å¿«æ·æ–¹å¼æ–‡ä»¶", "openWorkspaceSettings": "打开工作区设置", "configureLanguageBasedSettings": "é…置语言特定的设置...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 4cefcb62c6f..fe715f38bb4 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "无法写入设置。请更正文件中的错误/警告,然åŽé‡è¯•。", "editTtile": "编辑", "replaceDefaultValue": "在设置中替æ¢", "copyDefaultValue": "å¤åˆ¶åˆ°è®¾ç½®", diff --git a/i18n/chs/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/chs/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 01fb87d2213..bdf7aa2a3b1 100644 --- a/i18n/chs/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "显示所有命令", + "showCommands.label": "命令颿¿...", "entryAriaLabelWithKey": "{0}ã€{1} ,命令", "entryAriaLabel": "{0},命令", "canNotRun": "无法从此处è¿è¡Œå‘½ä»¤â€œ{0}â€ã€‚", diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index ab4166d5cd7..8ea8ff4f96e 100644 --- a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "toggleGitViewlet": "显示 GIT", + "toggleGitViewlet": "显示 Git", + "installAdditionalSCMProviders": "安装其他 SCM æä¾›ç¨‹åº...", "source control": "æºä»£ç ç®¡ç†", "toggleSCMViewlet": "显示 SCM", "view": "查看" diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index f03d74e8c9d..89c41c7a05b 100644 --- a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "switch provider": "åˆ‡æ¢ SCM æä¾›ç¨‹åº..." + "installAdditionalSCMProviders": "安装其他 SCM æä¾›ç¨‹åº...", + "switch provider": "åˆ‡æ¢æºä»£ç ç®¡ç†ç³»ç»Ÿ..." } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/chs/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index cfb58fab2ae..cce9767d1ac 100644 --- a/i18n/chs/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -7,6 +7,6 @@ "searchMatches": "已找到 {0} 个匹é…项", "searchMatch": "已找到 {0} 个匹é…项", "fileMatchAriaLabel": "文件夹 {2} 的文件 {1} 中有 {0} 个匹é…项,æœç´¢ç»“æžœ", - "replacePreviewResultAria": "替æ¢é¢„览结果, {0}", - "searchResultAria": "{0},æœç´¢ç»“æžœ" + "replacePreviewResultAria": "在第 {2} 列替æ¢è¯ç»„ {0} 为 {1},åŒè¡Œæ–‡æœ¬ä¸º {3}", + "searchResultAria": "在第 {1} 列找到è¯ç»„ {0},åŒè¡Œæ–‡æœ¬ä¸º {2}" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 0c4154de4e5..340ee7fc03e 100644 --- a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "vscode.extension.contributes.snippets": "è´¡çŒ®ä»£ç æ®µã€‚", + "vscode.extension.contributes.snippets": "æ·»åŠ ä»£ç æ®µã€‚", "vscode.extension.contributes.snippets-language": "此代ç ç‰‡æ®µå‚与的语言标识符。", "vscode.extension.contributes.snippets-path": "代ç ç‰‡æ®µæ–‡ä»¶çš„路径。该路径相对于扩展文件夹,通常以 \"./snippets/\" 开头。", "invalid.language": "“contributes.{0}.languageâ€ä¸­å­˜åœ¨æœªçŸ¥çš„语言。æä¾›çš„值: {1}", diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index bf5eec2631c..48bcbb508c2 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},任务" + "entryAriaLabel": "{0},任务", + "workspace": "æ¥è‡ªå·¥ä½œåŒº", + "extension": "æ¥è‡ªæ‰©å±•" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 0fb0ed162d4..5ddd907a1c1 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},任务", "tasksAriaLabel": "键入è¦é‡å¯çš„任务的åç§°", "noTasksMatching": "没有匹é…的任务", "noTasksFound": "没有å‘现è¦é‡å¯çš„任务" diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index fd9dbffc710..9094587319a 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},任务", "tasksAriaLabel": "键入è¦è¿è¡Œçš„任务的åç§°", "noTasksMatching": "没有匹é…的任务", "noTasksFound": "找ä¸åˆ°ä»»åŠ¡" diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index af44cd6b112..e8ff5a94c0b 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "选择任务è¿è¡Œç¨‹åº", "ConfigureTaskRunnerAction.autoDetecting": "适用于 {0} 的自动检测任务", "ConfigureTaskRunnerAction.autoDetect": "自动检测系统任务失败。请使用默认模æ¿ã€‚有关详细信æ¯ï¼Œè¯·å‚阅任务输出。", + "ConfigureTaskRunnerAction.autoDetectError": "自动检测任务系统时出现错误。有关详细信æ¯ï¼Œè¯·å‚阅任务输出。", "ConfigureTaskRunnerAction.failed": "无法在 \".vscode\" 文件夹中创建 \"tasks.json\" 文件。查看任务输出了解详细信æ¯ã€‚", "ConfigureTaskRunnerAction.label": "é…置任务è¿è¡Œç¨‹åº", "ConfigureBuildTaskAction.label": "é…置生æˆä»»åŠ¡", @@ -17,7 +18,7 @@ "problems": "问题", "manyMarkers": "99+", "tasks": "任务", - "TaskSystem.noHotSwap": "更改任务执行引擎需è¦é‡å¯ VS 代ç ã€‚已忽略更改。", + "TaskSystem.noHotSwap": "更改任务执行引擎需è¦é‡å¯ VS Code。已忽略更改。", "TaskService.noBuildTask": "未定义任何生æˆä»»åŠ¡ã€‚ä½¿ç”¨ \"isBuildCommand\" 在 tasks.json 文件中标记任务。", "TaskService.noTestTask": "未定义任何测试任务。使用 \"isTestCommand\" 在 tasks.json 文件中标记任务。", "TaskServer.noTask": "æœªæ‰¾åˆ°è¦æ‰§è¡Œçš„请求任务 {0}。", diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 2132313f0b6..f5f009904e1 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,6 @@ { "TerminalTaskSystem.unknownError": "在执行任务时å‘生未知错误。请å‚è§ä»»åŠ¡è¾“å‡ºæ—¥å¿—äº†è§£è¯¦ç»†ä¿¡æ¯ã€‚", "TerminalTaskSystem.terminalName": "任务 - {0}", - "TerminalTaskSystem": "无法对 UNC 驱动器执行 shell 命令。" + "TerminalTaskSystem": "无法对 UNC 驱动器执行 shell 命令。", + "unkownProblemMatcher": "无法解æžé—®é¢˜åŒ¹é…ç¨‹åº {0}。此匹é…程åºå°†è¢«å¿½ç•¥" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index aa659de1014..5b8a86d9c21 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "在执行任务时å‘生未知错误。请å‚è§ä»»åŠ¡è¾“å‡ºæ—¥å¿—äº†è§£è¯¦ç»†ä¿¡æ¯ã€‚", "TaskRunnerSystem.watchingBuildTaskFinished": "\n监视生æˆä»»åŠ¡å·²å®Œæˆ", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\n已根æ®ç”¨æˆ·è¯·æ±‚终止了任务'{0}' " + "TaskRunnerSystem.cancelRequested": "\n已根æ®ç”¨æˆ·è¯·æ±‚终止了任务'{0}' ", + "unkownProblemMatcher": "无法解æžé—®é¢˜åŒ¹é…ç¨‹åº {0}。此匹é…程åºå°†è¢«å¿½ç•¥" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index a90f5c8220c..3b09b277be3 100644 --- a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -26,5 +26,7 @@ "workbench.action.terminal.scrollUp": "å‘上滚动(行)", "workbench.action.terminal.scrollUpPage": "å‘上滚动(页)", "workbench.action.terminal.scrollToTop": "滚动到顶部", - "workbench.action.terminal.clear": "清除" + "workbench.action.terminal.clear": "清除", + "workbench.action.terminal.allowWorkspaceShell": "å…许é…置工作区 Shell", + "workbench.action.terminal.disallowWorkspaceShell": "ç¦æ­¢é…置工作区 Shell" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index bc85c5bd23b..396e41e5c52 100644 --- a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "终端的背景颜色,å…è®¸ç»ˆç«¯çš„é¢œè‰²ä¸Žé¢æ¿ä¸åŒã€‚", + "terminal.foreground": "ç»ˆç«¯çš„å‰æ™¯é¢œè‰²ã€‚", "terminal.ansiColor": "终端中的 ANSI 颜色“{0}â€ã€‚" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index e3d24891a1d..7a4782c7762 100644 --- a/i18n/chs/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,14 @@ { "selectTheme.label": "颜色主题", "installColorThemes": "安装其他颜色主题...", - "problemChangingTheme": "设置主题时出现问题: {0}", - "themes.selectTheme": "选择颜色主题", + "themes.selectTheme": "选择颜色主题(按上下箭头键预览)", "selectIconTheme.label": "文件图标主题", "installIconThemes": "安装其他文件图标主题...", "noIconThemeLabel": "æ— ", "noIconThemeDesc": "ç¦ç”¨æ–‡ä»¶å›¾æ ‡", "problemChangingIconTheme": "设置图标主题时出现问题: {0}", "themes.selectIconTheme": "选择文件图标主题", + "generateColorTheme.label": "使用当å‰è®¾ç½®ç”Ÿæˆé¢œè‰²ä¸»é¢˜", "preferences": "首选项", "developer": "å¼€å‘者" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index a1751e24660..3503db3576a 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -9,35 +9,36 @@ "welcomePage.start": "开始", "welcomePage.newFile": "新建文件", "welcomePage.openFolder": "打开文件夹...", - "welcomePage.cloneGitRepository": "克隆 GIT 存储库...", + "welcomePage.cloneGitRepository": "克隆 Git 存储库...", "welcomePage.recent": "最近", + "welcomePage.moreRecent": "更多...", "welcomePage.noRecentFolders": "无最近使用文件夹", "welcomePage.help": "帮助", - "welcomePage.productDocumentation": "äº§å“æ–‡æ¡£", + "welcomePage.keybindingsCheatsheet": "坿‰“å°çš„键盘速查表", "welcomePage.introductoryVideos": "入门视频", + "welcomePage.productDocumentation": "äº§å“æ–‡æ¡£", "welcomePage.gitHubRepository": "GitHub 存储库", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "å¯åŠ¨æ—¶æ˜¾ç¤ºæ¬¢è¿Žé¡µ", - "welcomePage.quickLinks": "快速链接", - "welcomePage.interactivePlayground": "äº¤äº’å¼æ¼”练场", - "welcomePage.interactivePlaygroundDescription": "在简短演练中试用编辑器的基本功能", - "welcomePage.interfaceOverview": "ç•Œé¢æ¦‚è¿°", - "welcomePage.interfaceOverviewDescription": "查看çªå‡ºæ˜¾ç¤ºä¸»è¦ UI 组件的å åР图", + "welcomePage.customize": "自定义", + "welcomePage.installExtensionPacks": "工具和语言", + "welcomePage.installExtensionPacksDescription": "安装对 {0} å’Œ {1} 的支æŒ", + "welcomePage.moreExtensions": "更多", + "welcomePage.installKeymapDescription": "å®‰è£…é”®ç›˜å¿«æ·æ–¹å¼", + "welcomePage.installKeymapExtension": "安装 {0} å’Œ {1} çš„é”®ç›˜å¿«æ·æ–¹å¼", + "welcomePage.others": "å…¶ä»–", "welcomePage.colorTheme": "颜色主题", "welcomePage.colorThemeDescription": "使编辑器和代ç å‘ˆçŽ°ä½ å–œæ¬¢çš„å¤–è§‚", - "welcomePage.keybindingsReference": "é”®ç›˜å¿«æ·æ–¹å¼å‚考", - "welcomePage.keybindingsReferenceDescription": "包å«å¸¸è§é”®ç›˜å¿«æ·æ–¹å¼çš„坿‰“å° PDF 文件", + "welcomePage.learn": "学习", "welcomePage.showCommands": "查找并è¿è¡Œæ‰€æœ‰å‘½ä»¤", "welcomePage.showCommandsDescription": "ä»ŽæŽ§åˆ¶é¢æ¿å¿«é€Ÿè®¿é—®å¹¶æœç´¢å‘½ä»¤({0})", + "welcomePage.interfaceOverview": "ç•Œé¢æ¦‚è¿°", + "welcomePage.interfaceOverviewDescription": "查看çªå‡ºæ˜¾ç¤ºä¸»è¦ UI 组件的å åР图", + "welcomePage.interactivePlayground": "äº¤äº’å¼æ¼”练场", + "welcomePage.interactivePlaygroundDescription": "在简短演练中试用编辑器的基本功能", + "welcomePage.quickLinks": "快速链接", + "welcomePage.keybindingsReference": "é”®ç›˜å¿«æ·æ–¹å¼å‚考", + "welcomePage.keybindingsReferenceDescription": "包å«å¸¸è§é”®ç›˜å¿«æ·æ–¹å¼çš„坿‰“å° PDF 文件", "welcomePage.configureSettings": "é…置设置", - "welcomePage.configureSettingsDescription": "通过调整设置æ¥è§£é” VS Code 的全部功能", - "welcomePage.installKeymapDescription": "å®‰è£…é”®ç›˜å¿«æ·æ–¹å¼", - "welcomePage.installKeymap": "安装 {0}ã€{1}ã€{2} å’Œ {3} çš„é”®ç›˜å¿«æ·æ–¹å¼", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (当å‰)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (当å‰)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (当å‰)", - "welcomePage.others": "å…¶ä»–" + "welcomePage.configureSettingsDescription": "通过调整设置æ¥è§£é” VS Code 的全部功能" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 71001529b3c..07f438f169e 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,27 @@ // Do not edit this file. It is machine generated. { "welcomePage": "欢迎使用", - "welcome.title": "欢迎使用", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "已安装对 {0} 的支æŒã€‚", + "welcomePage.willReloadAfterInstallingExtensionPack": "安装对 {0} 的支æŒåŽï¼Œå°†é‡è½½çª—å£ã€‚", + "welcomePage.installingExtensionPack": "正在安装对 {0} 的支æŒ...", + "welcomePage.extensionPackNotFound": "找ä¸åˆ°å¯¹ {0} (ID: {1}) 的支æŒã€‚", "welcomePage.keymapAlreadyInstalled": "已安装 {0} é”®ç›˜å¿«æ·æ–¹å¼ã€‚", "welcomePage.willReloadAfterInstallingKeymap": "安装 {0} é”®ç›˜å¿«æ·æ–¹å¼åŽï¼Œå°†é‡è½½çª—å£ã€‚", - "ok": "确定", "welcomePage.installingKeymap": "正在安装 {0} é”®ç›˜å¿«æ·æ–¹å¼...", "welcomePage.keymapNotFound": "找ä¸åˆ° ID 为 {1} çš„ {0} é”®ç›˜å¿«æ·æ–¹å¼ã€‚", - "cancel": "å–æ¶ˆ" + "welcome.title": "欢迎使用", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installedExtension": "{0}(已安装)", + "ok": "确定", + "cancel": "å–æ¶ˆ", + "welcomePage.quickLinkBackground": "欢迎页快速链接的背景颜色。", + "welcomePage.quickLinkHoverBackground": "æ¬¢è¿Žé¡µå¿«é€Ÿé“¾æŽ¥è¢«æ‚¬åœæ—¶çš„背景颜色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 919a9e29fe9..4beaf7510a9 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "未绑定" + "walkThrough.unboundCommand": "未绑定", + "walkThrough.gitNotFound": "你的系统上似乎未安装 Git。", + "walkThrough.embeddedEditorBackground": "åµŒå…¥äºŽäº¤äº’å¼æ¼”练场中的编辑器的背景颜色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/chs/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 78d407bf40b..e8a58d8ccea 100644 --- a/i18n/chs/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "打开设置", + "close": "关闭", + "saveAndRetry": "ä¿å­˜è®¾ç½®å¹¶é‡è¯•", "errorUnknownKey": "无法写入é…置文件(未知密钥)", "errorInvalidTarget": "无法写入到é…置文件(无效的目标)", - "errorNoWorkspaceOpened": "无法写入设置,因为没有打开任何文件夹。请先打开一个文件夹,然åŽé‡è¯•。", + "errorNoWorkspaceOpened": "没有打开任何文件夹,因此无法写入设置。请先打开一个文件夹,然åŽé‡è¯•。", "errorInvalidConfiguration": "无法写入设置。请打开 **用户设置** 更正文件中的错误/警告,然åŽé‡è¯•。", "errorInvalidConfigurationWorkspace": "无法写入设置。请打开 **工作区设置** 更正文件中的错误/警告,然åŽé‡è¯•。", - "errorConfigurationFileDirty": "无法写入设置,因为该文件已更新。请ä¿å­˜ **用户设置** 文件,然åŽé‡è¯•。", - "errorConfigurationFileDirtyWorkspace": "无法写入设置,因为该文件已更新。请ä¿å­˜ **工作区设置** 文件,然åŽé‡è¯•。" + "errorConfigurationFileDirty": "æ–‡ä»¶å·²å˜æ›´ï¼Œå› æ­¤æ— æ³•写入设置。请先ä¿å­˜ **用户设置** 文件,然åŽé‡è¯•。", + "errorConfigurationFileDirtyWorkspace": "æ–‡ä»¶å·²å˜æ›´ï¼Œå› æ­¤æ— æ³•写入设置。请先ä¿å­˜ **工作区设置** 文件,然åŽé‡è¯•。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index bafde878dc4..162baf8c31f 100644 --- a/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Windows 特定的键或键åºåˆ—。", "vscode.extension.contributes.keybindings.when": "é”®å¤„äºŽæ´»åŠ¨çŠ¶æ€æ—¶çš„æ¡ä»¶ã€‚", "vscode.extension.contributes.keybindings": "用于键绑定。", - "openDocumentation": "了解详细信æ¯", - "keybindingMigration.ok": "确定", - "keybindingMigration.prompt": "已为你的键盘布局更改æŸäº›é”®ç›˜å¿«æ·é”®ã€‚", "invalid.keybindings": "无效的“contributes.{0}â€: {1}", "unboundCommands": "以下是其他å¯ç”¨å‘½ä»¤:", "keybindings.json.title": "键绑定é…ç½®", diff --git a/i18n/chs/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/chs/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json index 30dff55c8ca..b21d42c25ac 100644 --- a/i18n/chs/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "invalid": "无效的“contributes.{0}â€ã€‚应为数组。", + "invalid": "“contributes.{0}â€æ— æ•ˆã€‚应为数组。", "invalid.empty": "“contributes.{0}â€çš„值为空", "require.id": "属性“{0}â€æ˜¯å¿…需的,其类型必须是“字符串â€", "opt.extensions": "属性“{0}â€å¯ä»¥çœç•¥ï¼Œå…¶ç±»åž‹å¿…须是 \"string[]\"", diff --git a/i18n/chs/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/chs/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index c9bf9070daa..d745afc2207 100644 --- a/i18n/chs/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/chs/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "语法çªå‡ºæ˜¾ç¤ºé¢œè‰²", "schema.properties.name": "规则æè¿°", - "schema.fontStyle": "规则字体样å¼:“斜体â€ã€â€œç²—体â€å’Œâ€œä¸‹åˆ’线â€ä¸­çš„ä¸€ç§æˆ–者组åˆ" + "schema.fontStyle": "规则字体样å¼:“斜体â€ã€â€œç²—体â€å’Œâ€œä¸‹åˆ’线â€ä¸­çš„ä¸€ç§æˆ–者组åˆ", + "schema.tokenColors.path": "tmTheme æ–‡ä»¶è·¯å¾„ï¼ˆç›¸å¯¹äºŽå½“å‰æ–‡ä»¶ï¼‰" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/chs/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 75fac413043..88cd69f2451 100644 --- a/i18n/chs/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/chs/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "åˆ†æž JSON 主题文件 {0} 时出现问题" + "error.cannotparsejson": "åˆ†æž JSON 主题文件 {0} 时出现问题", + "error.invalidformat.colors": "分æžé¢œè‰²ä¸»é¢˜æ–‡ä»¶æ—¶å‡ºçŽ°é—®é¢˜ï¼š{0}。属性“colorsâ€ä¸æ˜¯â€œobjectâ€ç±»åž‹ã€‚", + "error.invalidformat.tokenColors": "分æžé¢œè‰²ä¸»é¢˜æ–‡ä»¶æ—¶å‡ºçŽ°é—®é¢˜ï¼š{0}。属性“tokenColorsâ€åº”ä¸ºæŒ‡å®šé¢œè‰²çš„æ•°ç»„æˆ–æ˜¯æŒ‡å‘ TextMate 主题文件的路径", + "error.plist.invalidformat": "åˆ†æž tmTheme 文件时出现问题:{0}。“settingsâ€ä¸æ˜¯æ•°ç»„。", + "error.cannotparse": "åˆ†æž tmTheme 文件时出现问题:{0}", + "error.cannotload": "åˆ†æž tmTheme 文件 {0} 时出现问题:{1}" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index f8a9d4a4a14..4abe2dbd4b8 100644 --- a/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -14,16 +14,19 @@ "vscode.extension.contributes.iconThemes.label": "UI 中显示的图标主题的标签。", "vscode.extension.contributes.iconThemes.path": "图标主题定义文件的路径。该路径相对于扩展文件夹,通常是 \"./icons/awesome-icon-theme.json\"。", "migration.completed": "å·²å‘用户设置添加了新的主题设置。{0} 中å¯å¤‡ä»½ã€‚", - "error.cannotloadtheme": "Unable to load {0}: {1}", - "reqarray": "Extension point `{0}` must be an array.", + "error.cannotloadtheme": "无法加载 {0}: {1}", + "reqarray": "扩展点“{0}â€å¿…须是一个数组。", "reqpath": "“contributes.{0}.pathâ€ä¸­åº”为字符串。æä¾›çš„值: {1}", "invalid.path.1": "“contributes.{0}.pathâ€({1})应包å«åœ¨æ‰©å±•的文件夹({2})内。这å¯èƒ½ä¼šä½¿æ‰©å±•ä¸å¯ç§»æ¤ã€‚", "reqid": "“contributes.{0}.idâ€ä¸­åº”为字符串。æä¾›çš„值: {1}", "error.cannotloadicontheme": "Unable to load {0}", "error.cannotparseicontheme": "Problems parsing file icons file: {0}", - "colorTheme": "Specifies the color theme used in the workbench.", - "colorThemeError": "Theme is unknown or not installed.", - "iconTheme": "Specifies the icon theme used in the workbench.", + "colorTheme": "指定工作å°ä¸­ä½¿ç”¨çš„颜色主题。", + "colorThemeError": "主题未知或未安装。", + "iconTheme": "指定在工作å°ä¸­ä½¿ç”¨çš„图标主题。", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "文件图标主题未知或未安装。", + "workbenchColors": "è¦†ç›–å½“å‰æ‰€é€‰é¢œè‰²ä¸»é¢˜çš„颜色。", + "workbenchColors.deprecated": "该设置ä¸å†æ˜¯å®žéªŒæ€§è®¾ç½®ï¼Œå¹¶å·²é‡å‘½å为“workbench.colorCustomizationsâ€", + "workbenchColors.deprecatedDescription": "改用“workbench.colorCustomizationsâ€" } \ No newline at end of file diff --git a/i18n/cht/extensions/git/out/commands.i18n.json b/i18n/cht/extensions/git/out/commands.i18n.json index 1cdcbdecd44..849277aa8fe 100644 --- a/i18n/cht/extensions/git/out/commands.i18n.json +++ b/i18n/cht/extensions/git/out/commands.i18n.json @@ -16,6 +16,11 @@ "confirm discard": "ç¢ºå®šè¦æ¨æ£„ {0} 中的變更嗎?", "confirm discard multiple": "ç¢ºå®šè¦æ¨æ£„ {0} 檔案中的變更嗎?", "discard": "æ¨æ£„變更", + "confirm discard all": "ç¢ºå®šè¦æ¨æ£„所有變更嗎? 此動作無法復原!", + "discardAll": "æ¨æ£„所有變更", + "no staged changes": "沒有暫存變更進行æäº¤\n\n您希望自動暫存您所有變更並直接æäº¤?", + "yes": "是", + "always": "æ°¸é ", "no changes": "沒有任何變更è¦èªå¯ã€‚", "commit message": "èªå¯è¨Šæ¯", "provide commit message": "è«‹æä¾›èªå¯è¨Šæ¯", @@ -31,6 +36,7 @@ "no remotes to publish": "您的存放庫未設定è¦ç™¼è¡Œçš„目標é ç«¯ã€‚", "disabled": "Git å·²åœç”¨ï¼Œæˆ–在此工作å€ä¸å—支æ´", "clean repo": "請先清除您的存放庫工作樹狀å†ç°½å‡ºã€‚", + "cant push": "無法將åƒè€ƒæŽ¨é€åˆ°é ç«¯ã€‚請先執行 [æå–] ä»¥æ•´åˆæ‚¨çš„變更。", "git error details": "Git: {0}", "git error": "Git 錯誤", "open git log": "開啟 Git 記錄" diff --git a/i18n/cht/extensions/git/out/main.i18n.json b/i18n/cht/extensions/git/out/main.i18n.json index 710676d3a31..1a5f7ab3b83 100644 --- a/i18n/cht/extensions/git/out/main.i18n.json +++ b/i18n/cht/extensions/git/out/main.i18n.json @@ -6,5 +6,6 @@ { "using git": "正在使用來自 {1} çš„ git {0}", "updateGit": "æ›´æ–° Git", - "neverShowAgain": "ä¸è¦å†é¡¯ç¤º" + "neverShowAgain": "ä¸è¦å†é¡¯ç¤º", + "git20": "æ‚¨ä¼¼ä¹Žå·²å®‰è£ Git {0}。Code æ­é… Git >= 2 的執行效果最佳" } \ No newline at end of file diff --git a/i18n/cht/extensions/git/out/model.i18n.json b/i18n/cht/extensions/git/out/model.i18n.json index 69c8e98ba19..7a721014864 100644 --- a/i18n/cht/extensions/git/out/model.i18n.json +++ b/i18n/cht/extensions/git/out/model.i18n.json @@ -8,5 +8,7 @@ "merge changes": "åˆä½µè®Šæ›´", "staged changes": "已分段的變更", "changes": "變更", - "ok": "確定" + "ok": "確定", + "neveragain": "ä¸è¦å†é¡¯ç¤º", + "huge": "使–¼ '{0}' çš„ Git 存放庫有éŽå¤šä½¿ç”¨ä¸­çš„è®Šæ›´ï¼Œåªæœƒå•Ÿç”¨ä¸€éƒ¨ä»½ Git 功能。" } \ No newline at end of file diff --git a/i18n/cht/extensions/git/package.i18n.json b/i18n/cht/extensions/git/package.i18n.json index 25e06410e3d..63f725ec183 100644 --- a/i18n/cht/extensions/git/package.i18n.json +++ b/i18n/cht/extensions/git/package.i18n.json @@ -38,5 +38,11 @@ "config.autorefresh": "是å¦å•Ÿç”¨è‡ªå‹•釿–°æ•´ç†", "config.autofetch": "是å¦å•Ÿç”¨è‡ªå‹•æ“·å–", "config.enableLongCommitWarning": "是å¦ç™¼å‡ºé•·èªå¯è¨Šæ¯çš„警告", - "config.confirmSync": "請先確èªå†åŒæ­¥è™•ç† GIT 存放庫" + "config.confirmSync": "請先確èªå†åŒæ­¥è™•ç† GIT 存放庫", + "config.countBadge": "控制 git 徽章計數器。[全部] 會計算所有變更。[已追蹤] åªæœƒè¨ˆç®—追蹤的變更。[關閉] 會將其關閉。", + "config.checkoutType": "控制在執行 [簽出至...] 時,會列出那些類型的分支。[全部] 會顯示所有åƒè€ƒï¼Œ[本機] åªæœƒé¡¯ç¤ºæœ¬æ©Ÿåˆ†æ”¯ï¼Œ[標記] åªæœƒé¡¯ç¤ºæ¨™è¨˜ï¼Œ[é ç«¯] åªæœƒé¡¯ç¤ºé ç«¯åˆ†æ”¯ã€‚", + "config.ignoreLegacyWarning": "ç•¥éŽèˆŠçš„ Git 警告", + "config.ignoreLimitWarning": "當存放庫中有éŽå¤šè®Šæ›´æ™‚,略éŽè­¦å‘Šã€‚", + "config.defaultCloneDirectory": "複製 Git 存放庫的é è¨­ä½ç½®", + "config.enableSmartCommit": "無暫存變更時æäº¤æ‰€æœ‰è®Šæ›´" } \ No newline at end of file diff --git a/i18n/cht/extensions/grunt/out/main.i18n.json b/i18n/cht/extensions/grunt/out/main.i18n.json index 8b6ad71cd4e..39e6cf64ecb 100644 --- a/i18n/cht/extensions/grunt/out/main.i18n.json +++ b/i18n/cht/extensions/grunt/out/main.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "execFailed": "Grunt çš„è‡ªå‹•åµæ¸¬å¤±æ•—。錯誤: {0}" +} \ No newline at end of file diff --git a/i18n/cht/extensions/grunt/package.i18n.json b/i18n/cht/extensions/grunt/package.i18n.json index 8b6ad71cd4e..01c2df22d6d 100644 --- a/i18n/cht/extensions/grunt/package.i18n.json +++ b/i18n/cht/extensions/grunt/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.grunt.autoDetect": "控制 Grunt å·¥ä½œçš„è‡ªå‹•åµæ¸¬ç‚ºé–‹å•Ÿæˆ–關閉。é è¨­ç‚ºé–‹ã€‚" +} \ No newline at end of file diff --git a/i18n/cht/extensions/gulp/out/main.i18n.json b/i18n/cht/extensions/gulp/out/main.i18n.json index 8b6ad71cd4e..019ce972d1c 100644 --- a/i18n/cht/extensions/gulp/out/main.i18n.json +++ b/i18n/cht/extensions/gulp/out/main.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "execFailed": "Gulp çš„è‡ªå‹•åµæ¸¬å¤±æ•—。錯誤: {0}" +} \ No newline at end of file diff --git a/i18n/cht/extensions/gulp/package.i18n.json b/i18n/cht/extensions/gulp/package.i18n.json index 8b6ad71cd4e..e91e1955eec 100644 --- a/i18n/cht/extensions/gulp/package.i18n.json +++ b/i18n/cht/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "控制 Gulp å·¥ä½œçš„è‡ªå‹•åµæ¸¬ç‚ºé–‹å•Ÿæˆ–關閉。é è¨­ç‚ºé–‹ã€‚" +} \ No newline at end of file diff --git a/i18n/cht/extensions/jake/out/main.i18n.json b/i18n/cht/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/extensions/jake/package.i18n.json b/i18n/cht/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/extensions/markdown/out/extension.i18n.json b/i18n/cht/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/extensions/markdown/package.i18n.json b/i18n/cht/extensions/markdown/package.i18n.json index 8944d1dde43..6c7136baba3 100644 --- a/i18n/cht/extensions/markdown/package.i18n.json +++ b/i18n/cht/extensions/markdown/package.i18n.json @@ -16,5 +16,7 @@ "markdown.previewSide.title": "在一å´é–‹å•Ÿé è¦½", "markdown.showSource.title": "顯示來æº", "markdown.styles.dec": "å¯å¾ž Markdown é è¦½ä½¿ç”¨ä¹‹ CSS 樣å¼è¡¨çš„ URL 或本機路徑清單。相å°è·¯å¾‘æ˜¯ç›¸å°æ–¼åœ¨ç¸½ç®¡ä¸­é–‹å•Ÿçš„è³‡æ–™å¤¾ä¾†é€²è¡Œè§£é‡‹ã€‚è‹¥æ²’æœ‰é–‹å•Ÿè³‡æ–™å¤¾ï¼Œè·¯å¾‘å‰‡æ˜¯ç›¸å°æ–¼ Markdown 檔案的ä½ç½®ä¾†é€²è¡Œè§£é‡‹ã€‚所有 '\\' éƒ½å¿…é ˆå¯«æˆ '\\\\'。", - "markdown.showPreviewSecuritySelector.title": "變更 Markdown é è¦½å®‰å…¨æ€§è¨­å®š" + "markdown.showPreviewSecuritySelector.title": "變更 Markdown é è¦½å®‰å…¨æ€§è¨­å®š", + "markdown.preview.enableExperimentalExtensionApi.desc": "[實驗性] å…許延伸模組延伸 Markdown é è¦½ã€‚", + "markdown.trace.desc": "å…許 Markdown 延伸模組進行åµéŒ¯è¨˜éŒ„。" } \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..fd3fc4ee512 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +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. +{ + "acceptCurrentChange": "接å—ç•¶å‰è®Šæ›´", + "acceptIncomingChange": "接å—來æºè®Šæ›´", + "acceptBothChanges": "接å—兩者變更", + "compareChanges": "比較變更" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..b72349a9332 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noConflicts": "檔案內找ä¸åˆ°éœ€è¦åˆä½µè¡çªé …ç›®", + "noOtherConflictsInThisFile": "此檔案內沒有其他的è¡çªåˆä½µé …ç›®" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..1282a1b3de3 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "(來æºè®Šæ›´)" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/package.i18n.json b/i18n/cht/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..1afd0effd3e --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "command.category": "åˆä½µè¡çª", + "command.accept.all-incoming": "æŽ¥å—æ‰€æœ‰ä¾†æº", + "command.accept.all-both": "接å—兩者", + "command.accept.current": "接å—ç•¶å‰é …ç›®", + "command.accept.incoming": "接å—來æº", + "command.accept.selection": "接å—é¸å–é …ç›®", + "command.accept.both": "接å—兩者", + "command.next": "後一個è¡çª", + "command.previous": "å‰ä¸€å€‹è¡çª", + "command.compare": "比較目å‰è¡çª", + "config.title": "åˆä½µè¡çª", + "config.codeLensEnabled": "啟用/åœç”¨ 編輯器CodeLensè¡çªåˆä½µ " +} \ No newline at end of file diff --git a/i18n/cht/extensions/npm/package.i18n.json b/i18n/cht/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..74cbc6cffe4 --- /dev/null +++ b/i18n/cht/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.npm.autoDetect": "控制是å¦è‡ªå‹•檢測npm腳本.é è¨­ç‚ºé–‹å•Ÿ." +} \ No newline at end of file diff --git a/i18n/cht/extensions/php/package.i18n.json b/i18n/cht/extensions/php/package.i18n.json index ea8c697e6aa..5f7fb841954 100644 --- a/i18n/cht/extensions/php/package.i18n.json +++ b/i18n/cht/extensions/php/package.i18n.json @@ -9,5 +9,6 @@ "configuration.validate.executablePath": "æŒ‡å‘ PHP å¯åŸ·è¡Œæª”。", "configuration.validate.run": "是å¦åœ¨å„²å­˜æˆ–輸入時執行 linter。", "configuration.title": "PHP", - "commands.categroy.php": "PHP" + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "ç¦æ­¢ PHP é©—è­‰å¯åŸ·è¡Œæª” (定義為工作å€è¨­å®š)" } \ No newline at end of file diff --git a/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/cht/extensions/typescript/out/typescriptServiceClient.i18n.json index 69c9930b11d..0ac728237d9 100644 --- a/i18n/cht/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/cht/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "路徑 {0} æœªæŒ‡å‘æœ‰æ•ˆçš„ tsserver 安è£ã€‚å³å°‡å›žå¾©ç‚ºé…套的 TypeScript 版本。", "noBundledServerFound": "其他應用程å¼å·²åˆªé™¤äº† VSCode çš„ tsserver,例如行為ä¸ç•¶çš„ç—…æ¯’åµæ¸¬å·¥å…·ã€‚è«‹é‡æ–°å®‰è£ VS Code。", "versionNumber.custom": "自訂", @@ -15,6 +14,8 @@ "learnMore": "深入了解", "selectTsVersion": "é¸å– JavaScript 與 TypeScript 功能使用的 TypeScript 版本", "typescript.openTsServerLog.notSupported": "TS 伺æœå™¨çš„è¨˜éŒ„åŠŸèƒ½éœ€è¦ TS 2.2.2+", + "typescript.openTsServerLog.loggingNotEnabled": "TS 伺æœå™¨è¨˜éŒ„功能已關閉。請設定 `typescript.tsserver.log` 䏦釿–°å•Ÿå‹• TS 伺æœå™¨ï¼Œä»¥å•Ÿç”¨è¨˜éŒ„功能", + "typescript.openTsServerLog.enableAndReloadOption": "å•Ÿç”¨è¨˜éŒ„åŠŸèƒ½ä¸¦é‡æ–°å•Ÿå‹• TS 伺æœå™¨", "typescript.openTsServerLog.noLogFile": "TS 伺æœå™¨å°šæœªé–‹å§‹è¨˜éŒ„。", "openTsServerLog.openFileFailedFailed": "無法開啟 TS 伺æœå™¨è¨˜éŒ„檔", "serverDiedAfterStart": "TypeScript 語言æœå‹™åœ¨å•Ÿå‹•後立å³ä¸­æ­¢ 5 次。æœå‹™å°‡ä¸æœƒé‡æ–°å•Ÿå‹•。", diff --git a/i18n/cht/extensions/typescript/out/utils/logger.i18n.json b/i18n/cht/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/cht/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json index 4f15ff5fc04..1c4d07bd746 100644 --- a/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "正在擷å–資料以改善 TypeScript IntelliSense", + "typesInstallerInitializationFailed.title": "無法安è£éµå…¥æª”案以å–å¾— JavaScript èªžè¨€åŠŸèƒ½ã€‚è«‹ç¢ºèª NPM 已安è£ï¼Œä¸”使–¼æ‚¨çš„ PATH", "typesInstallerInitializationFailed.moreInformation": "詳細資訊", "typesInstallerInitializationFailed.doNotCheckAgain": "ä¸è¦å†æª¢æŸ¥", "typesInstallerInitializationFailed.close": "關閉" diff --git a/i18n/cht/extensions/typescript/package.i18n.json b/i18n/cht/extensions/typescript/package.i18n.json index 474b92a51c1..316f057d5a8 100644 --- a/i18n/cht/extensions/typescript/package.i18n.json +++ b/i18n/cht/extensions/typescript/package.i18n.json @@ -11,6 +11,8 @@ "typescript.tsdk.desc": "指定資料夾路徑,其中包å«è¦ä½¿ç”¨çš„ tsserver å’Œ lib*.d.ts 檔案。", "typescript.disableAutomaticTypeAcquisition": "åœç”¨è‡ªå‹•類型å–å¾—ã€‚éœ€è¦ TypeScript >= 2.0.6,並需è¦åœ¨è®Šæ›´å¾Œé‡æ–°å•Ÿå‹•。", "typescript.check.tscVersion": "è«‹æª¢æŸ¥å…¨åŸŸå®‰è£ TypeScript 編譯器 (例如 tsc) 是å¦ä¸åŒæ–¼ä½¿ç”¨çš„ TypeScript 語言æœå‹™ã€‚", + "typescript.tsserver.log": "å…許 TS 伺æœå™¨è¨˜éŒ„到檔案。此記錄å¯ç”¨ä¾†è¨ºæ–· TS 伺æœå™¨å•題。記錄å¯èƒ½åŒ…嫿ª”案路徑ã€åŽŸå§‹ç¨‹å¼ç¢¼åŠæ‚¨å°ˆæ¡ˆä¸­å¯èƒ½å…·æœ‰æ•感性的其他資訊。", + "typescript.tsserver.trace": "å…許將訊æ¯è¿½è¹¤å‚³é€åˆ° TS 伺æœå™¨ã€‚此追蹤å¯ç”¨ä¾†è¨ºæ–· TS 伺æœå™¨å•題。追蹤å¯èƒ½åŒ…嫿ª”案路徑ã€åŽŸå§‹ç¨‹å¼ç¢¼åŠæ‚¨å°ˆæ¡ˆä¸­å¯èƒ½å…·æœ‰æ•感性的其他資訊。", "typescript.tsserver.experimentalAutoBuild": "å•Ÿç”¨å¯¦é©—æ€§è‡ªå‹•å»ºç½®ã€‚éœ€è¦ 1.9 dev 或 2.x tsserver ç‰ˆæœ¬ï¼Œä¸”åœ¨è®Šæ›´å¾Œå¿…é ˆé‡æ–°å•Ÿå‹• VS Code。", "typescript.validate.enable": "啟用/åœç”¨ TypeScript 驗證。", "typescript.format.enable": "啟用/åœç”¨é è¨­ TypeScript æ ¼å¼å™¨ã€‚", @@ -23,6 +25,7 @@ "format.insertSpaceBeforeFunctionParenthesis": "定義如何處ç†å‡½å¼å¼•數括號之å‰çš„空格。TypeScript å¿…é ˆ >= 2.1.5。", "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "定義左å³éžç©ºç™½æ‹¬å¼§é–“的空格處ç†ã€‚", "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "定義左å³éžç©ºç™½ä¸­æ‹¬å¼§é–“的空格處ç†ã€‚", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "定義範éžç©ºç™½å·¦å³å¤§æ‹¬å¼§é–“的空格處ç†ã€‚éœ€è¦ TypeScript >= 2.3.0。", "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "定義範本字串左å³å¤§æ‹¬å¼§é–“的空格處ç†ã€‚éœ€è¦ TypeScript >= 2.0.6。", "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "定義 JSX é‹ç®—å¼å·¦å³å¤§æ‹¬å¼§é–“的空格處ç†ã€‚éœ€è¦ TypeScript >= 2.0.6。", "format.placeOpenBraceOnNewLineForFunctions": "定義是å¦å°‡å·¦å¤§æ‹¬å¼§æ”¾å…¥å‡½å¼çš„æ–°è¡Œã€‚", @@ -30,6 +33,10 @@ "javascript.validate.enable": "啟用/åœç”¨ JavaScript 驗證。", "typescript.goToProjectConfig.title": "移至專案組態", "javascript.goToProjectConfig.title": "移至專案組態", - "typescript.openTsServerLog.title": "開啟 TS 伺æœå™¨è¨˜éŒ„檔", - "typescript.selectTypeScriptVersion.title": "é¸å– TypeScript 版本" + "typescript.implementationsCodeLens.enabled": "啟用/åœç”¨å¯¦ä½œ CodeLensã€‚éœ€è¦ TypeScript >= 2.2.0。", + "typescript.openTsServerLog.title": "開啟 TS 伺æœå™¨è¨˜éŒ„", + "typescript.selectTypeScriptVersion.title": "é¸å– TypeScript 版本", + "jsDocCompletion.enabled": "啟用/åœç”¨è‡ªå‹• JSDoc 註解", + "javascript.implicitProjectConfig.checkJs": "啟用/åœç”¨ JavaScript æª”æ¡ˆçš„èªžæ„æª¢æŸ¥ã€‚ç¾æœ‰çš„ jsconfig.json 或 tsconfig.json æª”æ¡ˆæœƒè¦†å¯«æ­¤è¨­å®šã€‚éœ€è¦ TypeScript >=2.3.1。", + "typescript.check.npmIsInstalled": "檢查是å¦å·²å®‰è£ NPM,以å–得自動éµå…¥" } \ No newline at end of file diff --git a/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index da6b8c6d2c0..c01f13f3bcb 100644 --- a/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "因為影åƒå¤ªå¤§ï¼Œæ‰€ä»¥ç„¡æ³•在編輯器中顯示。", - "resourceOpenExternalButton": "開啟影åƒ", - "resourceOpenExternalText": " è¦ä½¿ç”¨å¤–部程å¼å—Ž?", "nativeBinaryError": "æª”æ¡ˆç‚ºäºŒé€²ä½æª”ã€éžå¸¸å¤§æˆ–ä½¿ç”¨ä¸æ”¯æ´çš„æ–‡å­—ç·¨ç¢¼ï¼Œå› æ­¤å°‡ä¸æœƒé¡¯ç¤ºæ–¼ç·¨è¼¯å™¨ä¸­ã€‚", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..a131a45e657 --- /dev/null +++ b/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "符號無效", + "error.invalidNumberFormat": "數字格å¼ç„¡æ•ˆ", + "error.propertyNameExpected": "必須有屬性å稱", + "error.valueExpected": "必須有值", + "error.colonExpected": "必須為冒號", + "error.commaExpected": "必須為逗號", + "error.closeBraceExpected": "必須為å³å¤§æ‹¬è™Ÿ", + "error.closeBracketExpected": "必須為å³ä¸­æ‹¬è™Ÿ", + "error.endOfFileExpected": "必須為檔案çµå°¾" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/code/electron-main/menus.i18n.json b/i18n/cht/src/vs/code/electron-main/menus.i18n.json index a0c96430b3e..5961aa8e789 100644 --- a/i18n/cht/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/cht/src/vs/code/electron-main/menus.i18n.json @@ -6,12 +6,15 @@ { "mFile": "檔案 (&&F)", "mEdit": "編輯(&&E)", + "mSelection": "é¸å–é …ç›®(&&S)", "mView": "檢視 (&&V)", + "mGoto": "å‰å¾€(&&G)", "mDebug": "åµéŒ¯ (&&D)", "mWindow": "視窗", "mHelp": "說明 (&&H)", "miNewWindow": "開新視窗(&&W)", "mAbout": "關於 {0}", + "mServices": "æœå‹™", "mHide": "éš±è— {0}", "mHideOthers": "éš±è—å…¶ä»–", "mShowAll": "全部顯示", @@ -29,6 +32,7 @@ "miCloseWindow": "關閉視窗(&&E)", "miCloseFolder": "關閉資料夾(&&F)", "miCloseEditor": "關閉編輯器(&&C)", + "miExit": "çµæŸ(&&X)", "miOpenSettings": "設定(&&S)", "miOpenKeymap": "éµç›¤å¿«é€Ÿéµ(&&K)", "miOpenKeymapExtensions": "按éµå°æ‡‰å»¶ä¼¸æ¨¡çµ„(&&K)", @@ -40,6 +44,7 @@ "miClearRecentOpen": "æ¸…ç†æœ€è¿‘的檔案(&&C)", "miUndo": "復原(&&U)", "miRedo": "é‡åš(&&R)", + "miCut": "剪下(&&T)", "miCopy": "複製(&&C)", "miPaste": "貼上(&&P)", "miFind": "尋找(&&F)", @@ -65,7 +70,6 @@ "miSmartSelectShrink": "壓縮é¸å–範åœ(&&S)", "miViewExplorer": "檔案總管(&&E)", "miViewSearch": "æœå°‹(&&S)", - "miViewGit": "Git(&&G)", "miViewDebug": "åµéŒ¯ (&&D)", "miViewExtensions": "擴充功能(&&X)", "miToggleOutput": "輸出(&&O)", diff --git a/i18n/cht/src/vs/code/electron-main/windows.i18n.json b/i18n/cht/src/vs/code/electron-main/windows.i18n.json index 1a51baff5db..08847b4b8e4 100644 --- a/i18n/cht/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/cht/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "確定", "pathNotExistTitle": "路徑ä¸å­˜åœ¨", "pathNotExistDetail": "ç£ç¢Ÿä¸Šä¼¼ä¹Žå·²æ²’有路徑 '{0}'。", - "accessibilityOptionsWindowTitle": "å”助工具é¸é …", "reopen": "釿–°é–‹å•Ÿ", "wait": "繼續等候", "close": "關閉", diff --git a/i18n/cht/src/vs/editor/browser/widget/diffEditorWidget.i18n.json b/i18n/cht/src/vs/editor/browser/widget/diffEditorWidget.i18n.json index 121381958b1..a4ab50f8f6a 100644 --- a/i18n/cht/src/vs/editor/browser/widget/diffEditorWidget.i18n.json +++ b/i18n/cht/src/vs/editor/browser/widget/diffEditorWidget.i18n.json @@ -4,6 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "diffEditorInserted": "æ’入文字的背景色彩。", + "diffEditorRemoved": "移除文字的背景色彩。", "diffEditorInsertedOutline": "æ’入的文字外框色彩。", "diffEditorRemovedOutline": "移除的文字外框色彩。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json index ec8f05fe340..f06682edb16 100644 --- a/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -40,7 +40,6 @@ "formatOnType": "æŽ§åˆ¶ç·¨è¼¯å™¨æ˜¯å¦æ‡‰åœ¨è¼¸å…¥ä¸€è¡Œå¾Œè‡ªå‹•æ ¼å¼åŒ–", "formatOnPaste": "æŽ§åˆ¶ç·¨è¼¯å™¨æ˜¯å¦æ‡‰è‡ªå‹•設定貼上的內容格å¼ã€‚æ ¼å¼å™¨å¿…é ˆå¯ä¾›ä½¿ç”¨ï¼Œè€Œä¸”æ ¼å¼å™¨æ‡‰è©²èƒ½å¤ è¨­å®šæ–‡ä»¶ä¸­ä¸€å€‹ç¯„åœçš„æ ¼å¼ã€‚", "suggestOnTriggerCharacters": "æŽ§åˆ¶è¼¸å…¥è§¸ç™¼å­—å…ƒæ™‚ï¼Œæ˜¯å¦æ‡‰è‡ªå‹•顯示建議", - "acceptSuggestionOnEnter": "控制除了 'Tab' 外,是å¦ä¹Ÿè—‰ç”±æŒ‰ä¸‹ 'Enter' 接å—建議。如此å¯é¿å…æ··æ·†è¦æ’入新行或接å—建議。", "acceptSuggestionOnCommitCharacter": "控制èªå¯å­—å…ƒæ˜¯å¦æ‡‰æŽ¥å—建議。例如在 JavaScript 中,分號 (';') å¯ä»¥æ˜¯æŽ¥å—建議並éµå…¥è©²å­—元的èªå¯å­—元。", "snippetSuggestions": "控制程å¼ç¢¼ç‰‡æ®µæ˜¯å¦éš¨å…¶ä»–建議顯示,以åŠå…¶æŽ’åºæ–¹å¼ã€‚", "emptySelectionClipboard": "控制複製時ä¸é¸å–ä»»ä½•é …ç›®æ˜¯å¦æœƒè¤‡è£½ç›®å‰ç¨‹å¼è¡Œã€‚", diff --git a/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..f48289922ad --- /dev/null +++ b/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "編輯器內容" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json index 810bd9dd09b..b08c173b100 100644 --- a/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,11 @@ "caret": "編輯器游標的色彩。", "editorWhitespaces": "編輯器中空白字元的色彩。", "editorIndentGuides": "編輯器縮排輔助線的色彩。", - "editorLineNumbers": "編輯器行號的色彩。" + "editorLineNumbers": "編輯器行號的色彩。", + "editorRuler": "編輯器尺è¦çš„色彩", + "editorCodeLensForeground": "編輯器程å¼ç¢¼æ¿¾é¡çš„剿™¯è‰²å½©", + "editorBracketMatchBackground": "æˆå°æ‹¬è™ŸèƒŒæ™¯è‰²å½©", + "editorBracketMatchBorder": "æˆå°æ‹¬è™Ÿé‚Šæ¡†è‰²å½©", + "editorOverviewRulerBorder": "é è¦½æª¢è¦–編輯器尺è¦çš„邊框色彩.", + "editorGutter": "編輯器邊框的背景é¡è‰²,包å«è¡Œè™Ÿèˆ‡å­—形圖示的邊框." } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..26ea0a1761c --- /dev/null +++ b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "找ä¸åˆ° '{0}' 的定義", + "generic.noResults": "找ä¸åˆ°ä»»ä½•定義", + "meta.title": " - {0} 個定義", + "actions.goToDecl.label": "移至定義", + "actions.goToDeclToSide.label": "在一å´é–‹å•Ÿå®šç¾©", + "actions.previewDecl.label": "é è¦½å®šç¾©", + "goToImplementation.noResultWord": "找ä¸åˆ° '{0}' 的任何實作", + "goToImplementation.generic.noResults": "找ä¸åˆ°ä»»ä½•實作", + "meta.implementations.title": " – {0} 個實作", + "actions.goToImplementation.label": "å‰å¾€å¯¦ä½œ", + "actions.peekImplementation.label": "é è¦½å¯¦ä½œ", + "goToTypeDefinition.noResultWord": "找ä¸åˆ° '{0}' 的任何類型定義", + "goToTypeDefinition.generic.noResults": "找ä¸åˆ°ä»»ä½•類型定義", + "meta.typeDefinitions.title": " – {0} 個定義", + "actions.goToTypeDefinition.label": "移至類型定義", + "actions.peekTypeDefinition.label": "é è¦½é¡žåž‹å®šç¾©" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..24cf4f7503f --- /dev/null +++ b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "按一下以顯示 {0} 項定義。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/cht/src/vs/editor/contrib/hover/browser/hover.i18n.json index 43422adfd16..7895cc33c1f 100644 --- a/i18n/cht/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "動態顯示", - "hoverHighlight": "在顯示了動態顯示的單字下方醒目æç¤ºã€‚", - "hoverBackground": "編輯器動態顯示的背景色彩。", - "hoverBorder": "編輯器動態顯示的框線色彩。" + "showHover": "動態顯示" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index 3386dfa6e21..3dca8b60ce1 100644 --- a/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,11 +16,12 @@ "peekViewTitleInfoForeground": "é è¦½æª¢è¦–標題資訊的色彩。", "peekViewBorder": "é è¦½æª¢è¦–之框線與箭頭的色彩。", "peekViewResultsBackground": "é è¦½æª¢è¦–ä¸­çµæžœæ¸…單的背景色彩。", - "peekViewResultsMatchForeground": "在é è¦½æª¢è¦–ä¹‹çµæžœæ¸…單中比å°è¼¸å…¥æ™‚çš„å‰æ™¯ã€‚", - "peekViewResultsFileForeground": "在é è¦½æª¢è¦–ä¹‹çµæžœæ¸…å–®ä¸­è¼¸å…¥æª”æ¡ˆæ™‚çš„å‰æ™¯ã€‚", + "peekViewResultsMatchForeground": "é è¦½æª¢è¦–çµæžœåˆ—è¡¨ä¸­è¡Œç¯€é»žçš„å‰æ™¯è‰²å½©", + "peekViewResultsFileForeground": "é è¦½æª¢è¦–çµæžœåˆ—è¡¨ä¸­æª”æ¡ˆç¯€é»žçš„å‰æ™¯è‰²å½©", "peekViewResultsSelectionBackground": "在é è¦½æª¢è¦–ä¹‹çµæžœæ¸…單中é¸å–項目時的背景色彩。", "peekViewResultsSelectionForeground": "在é è¦½æª¢è¦–ä¹‹çµæžœæ¸…單中é¸å–é …ç›®æ™‚çš„å‰æ™¯è‰²å½©ã€‚", "peekViewEditorBackground": "é è¦½æª¢è¦–編輯器的背景色彩。", + "peekViewEditorGutterBackground": "é è¦½æª¢è¦–編輯器邊框(å«è¡Œè™Ÿæˆ–字形圖示)的背景色彩。", "peekViewResultsMatchHighlight": "在é è¦½æª¢è¦–ç·¨è¼¯å™¨ä¸­æ¯”å°æ™‚çš„å白顯示色彩。", "peekViewEditorMatchHighlight": "é è¦½æª¢è¦–ç·¨è¼¯å™¨ä¸­æ¯”å°æ™‚çš„å白顯示色彩。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 64120957b4f..28f57ee6a5f 100644 --- a/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,7 +12,6 @@ "readMore": "進一步了解...{0}", "suggestionWithDetailsAriaLabel": "{0},建議,有詳細資料", "suggestionAriaLabel": "{0},建議", - "goback": "返回", "suggestWidget.loading": "正在載入...", "suggestWidget.noSuggestions": "無建議。", "suggestionAriaAccepted": "{0},接å—", diff --git a/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index e62440bc202..13c0c141c50 100644 --- a/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,6 @@ "schema.brackets": "定義增加或減少縮排的括弧符號。", "schema.autoClosingPairs": "定義æˆå°æ‹¬å¼§ã€‚輸入左括弧時,å³è‡ªå‹•æ’入峿‹¬å¼§ã€‚", "schema.autoClosingPairs.notIn": "定義åœç”¨è‡ªå‹•é…å°çš„ç¯„åœæ¸…單。", - "schema.surroundingPairs": "定義å¯ç”¨ä»¥æ‹¬ä½æ‰€é¸å­—串的æˆå°æ‹¬å¼§ã€‚" + "schema.surroundingPairs": "定義å¯ç”¨ä»¥æ‹¬ä½æ‰€é¸å­—串的æˆå°æ‹¬å¼§ã€‚", + "schema.wordPattern.flags.errorMessage": "å¿…é ˆç¬¦åˆæ¨£å¼ `/^([gimuy]+)$/`" } \ No newline at end of file diff --git a/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json index d924f278ad0..cd3b3aa69fe 100644 --- a/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,6 @@ "ProblemMatcherParser.noValidIdentifier": "錯誤: 樣å¼å±¬æ€§ {0} 䏿˜¯æœ‰æ•ˆçš„æ¨£å¼è®Šæ•¸å稱。", "ProblemMatcherParser.problemPattern.watchingMatcher": "å•題比å°å™¨å¿…é ˆåŒæ™‚定義監控的開始模å¼å’ŒçµæŸæ¨¡å¼ã€‚", "ProblemMatcherParser.invalidRegexp": "錯誤: 字串 {0} 䏿˜¯æœ‰æ•ˆçš„è¦å‰‡é‹ç®—å¼ã€‚\n", - "WatchingPatternSchema.regexp": "è¦å‰‡é‹ç®—å¼ï¼Œç”¨ä¾†åµæ¸¬ç›£çœ‹å·¥ä½œé–‹å§‹æˆ–çµæŸã€‚", "WatchingPatternSchema.file": "檔案å稱的符åˆç¾¤çµ„索引。å¯ä»¥çœç•¥ã€‚", "PatternTypeSchema.name": "所æä¾›æˆ–é å…ˆå®šç¾©ä¹‹æ¨¡å¼çš„å稱", "PatternTypeSchema.description": "å•é¡Œæ¨¡å¼æˆ–所æä¾›æˆ–é å…ˆå®šç¾©ä¹‹å•題模å¼çš„å稱。如有指定基底,å³å¯ç™¼å‡ºã€‚", @@ -46,7 +45,6 @@ "ProblemMatcherSchema.watching.activeOnStart": "如果設定為 True,監控程å¼åœ¨å·¥ä½œå•Ÿå‹•時處於主動模å¼ã€‚é€™ç›¸ç•¶æ–¼ç™¼å‡ºç¬¦åˆ beginPattern 的行", "ProblemMatcherSchema.watching.beginsPattern": "如果在輸出中相符,則會指示監看工作開始。", "ProblemMatcherSchema.watching.endsPattern": "å¦‚æžœåœ¨è¼¸å‡ºä¸­ç›¸ç¬¦ï¼Œå‰‡æœƒæŒ‡ç¤ºç›£çœ‹å·¥ä½œçµæŸã€‚", - "ProblemMatcherSchema.watching": "這些模å¼å¯ç”¨æ–¼å¾žé ­åˆ°å°¾è¿½è¹¤æ‰€é—œæ³¨çš„æ¨¡å¼ã€‚", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "此屬性å³å°‡æ·˜æ±°ã€‚請改用關注的屬性。", "LegacyProblemMatcherSchema.watchedBegin": "è¦å‰‡é‹ç®—å¼ï¼ŒæŒ‡ç¤ºç›£çœ‹çš„工作開始執行 (é€éŽæª”案監看觸發)。", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "此屬性å³å°‡æ·˜æ±°ã€‚請改用關注的屬性。", diff --git a/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json index 7ab7c658bae..85fdbbbbdf2 100644 --- a/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -7,14 +7,24 @@ "invalid.color": "色彩格å¼ç„¡æ•ˆã€‚請使用 #RGBã€#RGBAã€#RRGGBB 或 #RRGGBBAA", "schema.colors": "工作å°ä¸­ä½¿ç”¨çš„色彩。", "foreground": "æ•´é«”çš„å‰æ™¯è‰²å½©ã€‚åƒ…ç•¶æœªè¢«ä»»ä½•å…ƒä»¶è¦†ç–Šæ™‚ï¼Œæ‰æœƒä½¿ç”¨æ­¤è‰²å½©ã€‚", + "errorForeground": "整體錯誤訊æ¯çš„剿™¯è‰²å½©ã€‚åƒ…ç•¶æœªè¢«ä»»ä½•å…ƒä»¶è¦†è“‹æ™‚ï¼Œæ‰æœƒä½¿ç”¨æ­¤è‰²å½©ã€‚", + "descriptionForeground": "æä¾›é™„加訊æ¯çš„剿™¯é¡è‰²,例如標籤", "focusBorder": "焦點項目的整體邊界色彩。åªåœ¨æ²’æœ‰ä»»ä½•å…ƒä»¶è¦†å¯«æ­¤è‰²å½©æ™‚ï¼Œæ‰æœƒåŠ ä»¥ä½¿ç”¨ã€‚", "contrastBorder": "項目周åœçš„é¡å¤–邊界,å¯å°‡é …目從其他項目中å€éš”出來以æé«˜å°æ¯”。", "activeContrastBorder": "使用中項目周åœçš„é¡å¤–邊界,å¯å°‡é …目從其他項目中å€éš”出來以æé«˜å°æ¯”。", + "selectionBackground": "作業å€åŸŸé¸å–的背景é¡è‰²(例如輸入或文字å€åŸŸ)。請注æ„,這ä¸é©ç”¨æ–¼ç·¨è¼¯å™¨èˆ‡çµ‚端機中的é¸å–。", + "textSeparatorForeground": "文字分隔符號的é¡è‰²ã€‚", + "textLinkForeground": "內文連çµçš„剿™¯è‰²å½©", + "textLinkActiveForeground": "內文使用連çµçš„剿™¯è‰²å½©", + "textPreformatForeground": "æç¤ºåŠå»ºè­°æ–‡å­—çš„å‰æ™¯è‰²å½©ã€‚", + "textBlockQuoteBorder": "引用文字的框線é¡è‰²ã€‚", + "textCodeBlockBackground": "文字å€å¡Šçš„背景é¡è‰²ã€‚", "widgetShadow": "å°å·¥å…·çš„陰影色彩,例如編輯器中的尋找/å–代。", "inputBoxBackground": "輸入方塊的背景。", "inputBoxForeground": "è¼¸å…¥æ–¹å¡Šçš„å‰æ™¯ã€‚", "inputBoxBorder": "輸入方塊的框線。", "inputBoxActiveOptionBorder": "輸入欄ä½ä¸­å¯ä½¿ç”¨ä¹‹é …目的框線色彩。", + "inputPlaceholderForeground": "æ–‡å­—è¼¸å…¥æ›¿ä»£å­—ç¬¦çš„å‰æ™¯é¡è‰²ã€‚", "inputValidationInfoBackground": "è³‡è¨Šåš´é‡æ€§çš„輸入驗證背景色彩。", "inputValidationInfoBorder": "è³‡è¨Šåš´é‡æ€§çš„輸入驗證邊界色彩。", "inputValidationWarningBackground": "資訊警告的輸入驗證背景色彩。", @@ -26,10 +36,9 @@ "dropdownBorder": "ä¸‹æ‹‰å¼æ¸…單的框線。", "listFocusBackground": "當清單/樹狀為使用中狀態時,焦點項目的清單/樹狀背景色彩。使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。", "listActiveSelectionBackground": "當清單/樹狀為使用中狀態時,所é¸é …目的清單/樹狀背景色彩。使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。", - "listInactiveSelectionBackground": "當清單/樹狀為éžä½¿ç”¨ä¸­ç‹€æ…‹æ™‚,所é¸é …目的清單/樹狀背景色彩。使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。", "listActiveSelectionForeground": "當清單/樹狀為使用中狀態時,所é¸é …目的清單/æ¨¹ç‹€å‰æ™¯è‰²å½©ã€‚使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。", - "listFocusAndSelectionBackground": "當清單/樹狀為使用中狀態時,焦點和所é¸é …目的清單/樹狀背景色彩。使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。此色彩優先於個別é¸å–é …ç›®åŠç„¦é»žè‰²å½©ã€‚", - "listFocusAndSelectionForeground": "當清單/樹狀為使用中狀態時,焦點和所é¸é …目的清單/æ¨¹ç‹€å‰æ™¯è‰²å½©ã€‚使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。此色彩優先於個別é¸å–é …ç›®åŠç„¦é»žè‰²å½©ã€‚", + "listInactiveSelectionBackground": "當清單/樹狀為éžä½¿ç”¨ä¸­ç‹€æ…‹æ™‚,所é¸é …目的清單/樹狀背景色彩。使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­è€…則沒有。", + "listInactiveSelectionForeground": "當清單/樹狀為使用中狀態時,所é¸é …目的清單/æ¨¹ç‹€å‰æ™¯è‰²å½©ã€‚使用中的清單/樹狀有éµç›¤ç„¦é»žï¼Œéžä½¿ç”¨ä¸­å‰‡æ²’有。", "listHoverBackground": "使用滑鼠暫留在項目時的清單/樹狀背景。", "listDropBackground": "使用滑鼠四處移動項目時的清單/樹狀拖放背景。", "highlight": "在清單/樹狀內æœå°‹æ™‚,相符醒目æç¤ºçš„æ¸…å–®/æ¨¹ç‹€å‰æ™¯è‰²å½©ã€‚", @@ -38,19 +47,28 @@ "buttonForeground": "æŒ‰éˆ•å‰æ™¯è‰²å½©ã€‚", "buttonBackground": "按鈕背景色彩。", "buttonHoverBackground": "暫留時的按鈕背景色彩。", + "badgeBackground": "標記的背景é¡è‰²ã€‚標記為å°åž‹çš„è¨Šæ¯æ¨™ç±¤,例如æœå°‹çµæžœçš„æ•¸é‡ã€‚", + "badgeForeground": "æ¨™è¨˜çš„å‰æ™¯é¡è‰²ã€‚標記為å°åž‹çš„è¨Šæ¯æ¨™ç±¤,例如æœå°‹çµæžœçš„æ•¸é‡ã€‚", "scrollbarShadow": "指出在æ²å‹•該檢視的æ²è»¸é™°å½±ã€‚", "scrollbarSliderBackground": "滑桿背景色彩。", "scrollbarSliderHoverBackground": "暫留時的滑桿背景色彩。", "scrollbarSliderActiveBackground": "使用中狀態時的滑桿背景色彩。", + "progressBarBackground": "長時間é‹è¡Œé€²åº¦æ¢çš„背景色彩.", "editorBackground": "編輯器的背景色彩。", "editorForeground": "編輯器的é è¨­å‰æ™¯è‰²å½©ã€‚", + "editorWidgetBackground": "編輯器å°å·¥å…·çš„背景色彩,例如尋找/å–代。", "editorSelection": "編輯器é¸å–範åœçš„色彩。", "editorInactiveSelection": "éžä½¿ç”¨ä¸­ä¹‹ç·¨è¼¯å™¨é¸å–範åœçš„色彩。", "editorSelectionHighlight": "é¸å–時,內容相åŒä¹‹å€åŸŸçš„色彩。", "editorFindMatch": "符åˆç›®å‰æœå°‹çš„色彩。", "findMatchHighlight": "符åˆå…¶ä»–æœå°‹çš„色彩。", "findRangeHighlight": "é™åˆ¶æœå°‹ä¹‹ç¯„åœçš„色彩。", + "hoverHighlight": "在顯示了動態顯示的單字下方醒目æç¤ºã€‚", + "hoverBackground": "編輯器動態顯示的背景色彩。", + "hoverBorder": "編輯器動態顯示的框線色彩。", "activeLinkForeground": "使用中之連çµçš„色彩。", - "linkForeground": "連çµçš„色彩。", - "editorWidgetBackground": "編輯器å°å·¥å…·çš„背景色彩,例如尋找/å–代。" + "diffEditorInserted": "æ’入文字的背景色彩。", + "diffEditorRemoved": "移除文字的背景色彩。", + "diffEditorInsertedOutline": "æ’入的文字外框色彩。", + "diffEditorRemovedOutline": "移除的文字外框色彩。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..36b2b7b357e --- /dev/null +++ b/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "正在以 {1} 覆寫延伸模組 {0}。", + "extensionUnderDevelopment": "æ­£åœ¨è¼‰å…¥ä½æ–¼ {0} 的開發延伸模組" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..4d3f09317ea --- /dev/null +++ b/i18n/cht/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "關閉", + "cancel": "å–æ¶ˆ", + "ok": "確定" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/cht/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..24e5da79005 --- /dev/null +++ b/i18n/cht/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "未註冊識別碼為 '{0}' çš„ TreeExplorerNodeProvider。", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider '{0}' 無法æä¾›æ ¹ç¯€é»žã€‚" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..028bfb1a1d0 --- /dev/null +++ b/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeView.duplicateElement": "元件{0}已被註冊" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/cht/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 7262a8948e3..1228bd7f60d 100644 --- a/i18n/cht/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/cht/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "開啟群組中上一個最近使用的編輯器", "openNextRecentlyUsedEditorInGroup": "開啟群組中下一個最近使用的編輯器", "navigateEditorHistoryByInput": "從記錄中開啟上一個編輯器", + "openNextRecentlyUsedEditor": "開啟下一個最近使用的編輯器", + "openPreviousRecentlyUsedEditor": "開啟上一個最近使用的編輯器", "clearEditorHistory": "清除編輯器記錄", "focusLastEditorInStack": "開啟群組中最後一個編輯器", "moveEditorLeft": "將編輯器左移", diff --git a/i18n/cht/src/vs/workbench/common/theme.i18n.json b/i18n/cht/src/vs/workbench/common/theme.i18n.json index 04db8d8c3c7..72a8d8abb7e 100644 --- a/i18n/cht/src/vs/workbench/common/theme.i18n.json +++ b/i18n/cht/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "索引標籤容器的背景色彩。索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", "tabActiveBackground": "使用中之索引標籤的背景色彩。索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", "tabInactiveBackground": "éžä½¿ç”¨ä¸­ä¹‹ç´¢å¼•標籤的背景色彩。索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", "tabBorder": "用以分隔索引標籤彼此的框線。索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", "tabActiveEditorGroupActiveForeground": "ä½¿ç”¨ä¸­çš„ç¾¤çµ„å…§ï¼Œä½¿ç”¨ä¸­ä¹‹ç´¢å¼•æ¨™ç±¤çš„å‰æ™¯è‰²å½©ã€‚索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", - "tabActiveEditorGroupInactiveForeground": "éžä½¿ç”¨ä¸­çš„ç¾¤çµ„å…§ï¼Œä½¿ç”¨ä¸­ä¹‹ç´¢å¼•æ¨™ç±¤çš„å‰æ™¯è‰²å½©ã€‚索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", "tabInactiveEditorGroupActiveForeground": "使用中的群組內,éžä½¿ç”¨ä¸­ä¹‹ç´¢å¼•æ¨™ç±¤çš„å‰æ™¯è‰²å½©ã€‚索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", - "tabInactiveEditorGroupInactiveForeground": "éžä½¿ç”¨ä¸­çš„群組內,éžä½¿ç”¨ä¸­ä¹‹ç´¢å¼•æ¨™ç±¤çš„å‰æ™¯è‰²å½©ã€‚索引標籤是編輯器在編輯器å€åŸŸä¸­çš„容器。åŒä¸€å€‹ç·¨è¼¯å™¨ç¾¤çµ„中的多個索引標籤å¯ä»¥åŒæ™‚開啟。å¯èƒ½æœƒæœ‰å¤šå€‹ç·¨è¼¯å™¨ç¾¤çµ„。", + "editorGroupBackground": "編輯器群組的背景色彩。編輯器群組是編輯器的容器。當拖曳編輯器群組時會顯示背景色彩。", + "editorGroupHeaderBackground": "當索引標籤ç¦ç”¨çš„æ™‚候編輯器群組標題的背景é¡è‰²ã€‚編輯器群組是編輯器的容器。", "editorGroupBorder": "用以分隔多個編輯器群組彼此的色彩。編輯器群組是編輯器的容器。", - "editorDragAndDropBackground": "拖曳編輯器時的背景色彩。", "panelBackground": "颿¿çš„剿™¯è‰²å½©ã€‚颿¿æœƒé¡¯ç¤ºåœ¨ç·¨è¼¯å™¨å€åŸŸçš„下方,其中包å«è«¸å¦‚輸出與整åˆå¼çµ‚端機等檢視。", "panelBorder": "颿¿é ‚ç«¯ç”¨ä»¥åˆ†éš”ç·¨è¼¯å™¨çš„é‚Šæ¡†è‰²å½©ã€‚é¢æ¿æœƒé¡¯ç¤ºåœ¨ç·¨è¼¯å™¨å€åŸŸçš„下方,其中包å«è«¸å¦‚輸出與整åˆå¼çµ‚端機等檢視。", "panelActiveTitleForeground": "ä½¿ç”¨ä¸­ä¹‹é¢æ¿æ¨™é¡Œçš„æ¨™é¡Œè‰²å½©ã€‚颿¿æœƒé¡¯ç¤ºåœ¨ç·¨è¼¯å™¨å€åŸŸçš„下方,其中包å«è«¸å¦‚輸出與整åˆå¼çµ‚端機等檢視。", @@ -24,14 +22,20 @@ "statusBarNoFolderBackground": "當未開啟任何資料夾時,狀態列的背景色彩。狀態列會顯示在視窗的底部。", "statusBarItemActiveBackground": "按下滑鼠按鈕時,狀態列項目的背景色彩。狀態列會顯示在視窗的底部。", "statusBarItemHoverBackground": "動態顯示時,狀態列項目的背景色彩。狀態列會顯示在視窗的底部。", + "statusBarProminentItemBackground": "狀態列çªå‡ºé …目的背景é¡è‰²ã€‚çªå‡ºé …目比狀態列的其他項目更顯眼,用於表示é‡è¦æ€§æ›´é«˜ã€‚狀態列會顯示在視窗的底部。", + "statusBarProminentItemHoverBackground": "狀態列çªå‡ºé …目暫留時的背景é¡è‰²ã€‚çªå‡ºé …目比狀態列的其他項目更顯眼,用於表示é‡è¦æ€§æ›´é«˜ã€‚狀態列會顯示在視窗的底部。", "activityBarBackground": "æ´»å‹•åˆ—èƒŒæ™¯çš„è‰²å½©ã€‚æ´»å‹•åˆ—æœƒé¡¯ç¤ºåœ¨æœ€å·¦å´æˆ–最å³å´ï¼Œä¸¦å¯åˆ‡æ›ä¸åŒçš„æè¦æ¬„使ª¢è¦–。", - "activityBarDragAndDropBackground": "拖放活動列項目之æ„è¦‹å›žæ‡‰æ™‚çš„è‰²å½©ã€‚æ­¤æ´»å‹•åˆ—æœƒé¡¯ç¤ºåœ¨æœ€å·¦å´æˆ–最å³å´ï¼Œè®“您å¯ä»¥åˆ‡æ›æè¦æ¬„ä½çš„ä¸åŒæª¢è¦–。", + "activityBarForeground": "活動列的å‰èƒŒæ™¯è‰²å½©(例如用於圖示)ã€‚æ­¤æ´»å‹•åˆ—æœƒé¡¯ç¤ºåœ¨æœ€å·¦å´æˆ–最å³å´ï¼Œè®“您å¯ä»¥åˆ‡æ›æè¦æ¬„ä½çš„ä¸åŒæª¢è¦–。", "activityBarBadgeBackground": "æ´»å‹•é€šçŸ¥å¾½ç« çš„èƒŒæ™¯è‰²å½©ã€‚æ­¤æ´»å‹•åˆ—æœƒé¡¯ç¤ºåœ¨æœ€å·¦å´æˆ–最å³å´ï¼Œè®“您å¯ä»¥åˆ‡æ›æè¦æ¬„ä½çš„ä¸åŒæª¢è¦–。", "activityBarBadgeForeground": "活動通知徽章的å‰èƒŒæ™¯è‰²å½©ã€‚æ­¤æ´»å‹•åˆ—æœƒé¡¯ç¤ºåœ¨æœ€å·¦å´æˆ–最å³å´ï¼Œè®“您å¯ä»¥åˆ‡æ›æè¦æ¬„ä½çš„ä¸åŒæª¢è¦–。", "sideBarBackground": "æè¦æ¬„ä½çš„背景色彩。æè¦æ¬„使˜¯æª¢è¦– (例如 Explorer 與æœå°‹) 的容器。", + "sideBarForeground": "å´æ¬„çš„å‰æ™¯é¡è‰².å´æ¬„包å«Explorer與æœå°‹.", "sideBarTitleForeground": "æè¦æ¬„使¨™é¡Œçš„剿™¯è‰²å½©ã€‚æè¦æ¬„使˜¯æª¢è¦– (例如 Explorer 與æœå°‹) 的容器。", + "sideBarSectionHeaderBackground": "æè¦æ¬„ä½å€æ®µæ¨™é ­çš„背景色彩。æè¦æ¬„使˜¯æª¢è¦– (例如 Explorer 與æœå°‹) 的容器。", "titleBarActiveForeground": "ä½œç”¨ä¸­è¦–çª—ä¹‹æ¨™é¡Œåˆ—çš„å‰æ™¯ã€‚請注æ„,目å‰åªæœ‰ macOS æ”¯æ´æ­¤è‰²å½©ã€‚", "titleBarInactiveForeground": "éžä½œç”¨ä¸­è¦–çª—ä¹‹æ¨™é¡Œåˆ—çš„å‰æ™¯ã€‚請注æ„,目å‰åªæœ‰ macOS æ”¯æ´æ­¤è‰²å½©ã€‚", "titleBarActiveBackground": "作用中視窗之標題列的背景。請注æ„,目å‰åªæœ‰ macOS æ”¯æ´æ­¤è‰²å½©ã€‚", - "titleBarInactiveBackground": "éžä½œç”¨ä¸­è¦–窗之標題列的背景。請注æ„,目å‰åªæœ‰ macOS æ”¯æ´æ­¤è‰²å½©ã€‚" + "titleBarInactiveBackground": "éžä½œç”¨ä¸­è¦–窗之標題列的背景。請注æ„,目å‰åªæœ‰ macOS æ”¯æ´æ­¤è‰²å½©ã€‚", + "notificationsForeground": "é€šçŸ¥çš„å‰æ™¯è‰²å½©ã€‚通知從視窗的上方滑入。", + "notificationsBackground": "通知的背景色彩。通知從視窗的上方滑入。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json index f9a78df4032..bced8b136e5 100644 --- a/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "檢視", "help": "說明", "file": "檔案", + "developer": "開發人員", "showEditorTabs": "æŽ§åˆ¶å·²é–‹å•Ÿçš„ç·¨è¼¯å™¨æ˜¯å¦æ‡‰é¡¯ç¤ºåœ¨ç´¢å¼•標籤中。", "editorTabCloseButton": "控制編輯器的索引標籤關閉按鈕ä½ç½®ï¼Œæˆ–在設為 'off' 時將其åœç”¨ã€‚", "showIcons": "æŽ§åˆ¶é–‹å•Ÿçš„ç·¨è¼¯å™¨æ˜¯å¦æ­é…圖示顯示。這需è¦åŒæ™‚啟用圖示佈景主題。", @@ -20,6 +21,7 @@ "statusBarVisibility": "控制 Workbench 底端狀態列的å¯è¦–性。", "activityBarVisibility": "控制活動列在 workbench 中的å¯è¦‹åº¦ã€‚", "closeOnFileDelete": "æŽ§åˆ¶é¡¯ç¤ºæª”æ¡ˆçš„ç·¨è¼¯å™¨æ˜¯å¦æ‡‰åœ¨å…¶ä»–處ç†åºåˆªé™¤æˆ–釿–°å‘½å該檔案時自動關閉。若åœç”¨æ­¤é¸é …,當發生å‰è¿°ç‹€æ³æ™‚ï¼Œç·¨è¼¯å™¨æœƒä¿æŒé–‹å•Ÿï¼Œä¸¦å‘ˆç¾å·²è®Šæ›´çš„狀態。請注æ„,從應用程å¼å…§åˆªé™¤ä¸€å¾‹æœƒé—œé–‰ç·¨è¼¯å™¨ï¼Œä½†å·²è®Šæ›´çš„æª”案在資料未儲存å‰ä¸€å¾‹ä¸æœƒé—œé–‰ã€‚", + "swipeToNavigate": "利用三指水平撥動在開啟的檔案間ç€è¦½ã€‚", "workbenchConfigurationTitle": "工作å°", "window.openFilesInNewWindow.on": "檔案會在新視窗中開啟", "window.openFilesInNewWindow.off": "檔案會在開啟了檔案資料夾的視窗,或在上一個使用中的視窗中開啟", @@ -40,7 +42,6 @@ "window.newWindowDimensions.inherit": "ä»¥ç›¸åŒæ–¼ä¸Šä¸€å€‹ä½¿ç”¨ä¸­ä¹‹è¦–窗的維度開啟新視窗。", "window.newWindowDimensions.maximized": "開啟並最大化新視窗。", "window.newWindowDimensions.fullscreen": "在全螢幕模å¼ä¸‹é–‹å•Ÿæ–°è¦–窗。", - "newWindowDimensions": "控制開啟新視窗的維度。根據é è¨­ï¼Œæ–°è¦–窗會以å°åž‹ç¶­åº¦åœ¨ç•«é¢ä¸­å¤®é–‹å•Ÿã€‚設為 'inherit' 時,視窗的維度會和上一個使用中視窗相åŒã€‚設為 'maximized' 時,視窗會開到最大,若設為 'fullscreen' 則全螢幕開啟。", "window.menuBarVisibility.default": "åªåœ¨å…¨èž¢å¹•æ¨¡å¼æ™‚éš±è—功能表。", "window.menuBarVisibility.visible": "一律顯示功能表,å³ä½¿åœ¨å…¨èž¢å¹•æ¨¡å¼æ™‚亦然。", "window.menuBarVisibility.toggle": "éš±è—功能表,但å¯ç¶“ç”± Alt éµåŠ ä»¥é¡¯ç¤ºã€‚", @@ -48,10 +49,12 @@ "menuBarVisibility": "控制功能表列的å¯è¦‹åº¦ã€‚[切æ›] 設定表示會隱è—功能表列,按一下 Alt éµå‰‡æœƒé¡¯ç¤ºã€‚除éžè¦–窗是全螢幕,å¦å‰‡é è¨­æœƒé¡¯ç¤ºåŠŸèƒ½è¡¨åˆ—ã€‚", "autoDetectHighContrast": "若啟用,如果 Windows ä½¿ç”¨é«˜å°æ¯”ä½ˆæ™¯ä¸»é¡Œï¼Œå°±æœƒè‡ªå‹•è®Šæ›´ç‚ºé«˜å°æ¯”ä½ˆæ™¯ä¸»é¡Œï¼Œåˆ‡æ›æŽ‰ Windows é«˜å°æ¯”佈景主題時則變更為深色佈景主題。", "titleBarStyle": "調整視窗標題列的外觀。變更需è¦å®Œæ•´é‡æ–°å•Ÿå‹•æ‰æœƒå¥—用。", + "window.nativeTabs": "啟用 macOS Sierra 視窗索引標籤。請注æ„需è¦å®Œå…¨é‡æ–°å•Ÿå‹•æ‰èƒ½å¥—用變更,並且完æˆè¨­å®šå¾ŒåŽŸå§‹ç´¢å¼•æ¨™ç±¤å°‡æœƒåœç”¨è‡ªè¨‚標題列樣å¼ã€‚", "windowConfigurationTitle": "視窗", "zenModeConfigurationTitle": "Zen Mode", "zenMode.fullScreen": "控制開啟 Zen Mode 是å¦ä¹Ÿæœƒå°‡ Workbench 轉æ›ç‚ºå…¨èž¢å¹•模å¼ã€‚", "zenMode.hideTabs": "控制開啟 Zen Mode 是å¦ä¹Ÿæœƒéš±è— Workbench 索引標籤。", "zenMode.hideStatusBar": "控制開啟 Zen Mode 是å¦ä¹Ÿæœƒéš±è— Workbench 底部的狀態列。", + "zenMode.hideActivityBar": "控制開啟 Zen Mode 是å¦ä¹Ÿæœƒéš±è— Workbench 左方的活動列。", "zenMode.restore": "控制視窗如果在 Zen Mode ä¸‹çµæŸï¼Œæ˜¯å¦æ‡‰é‚„原為 Zen Mode。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/shell.i18n.json index cd49d332f0d..5a00c198549 100644 --- a/i18n/cht/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/cht/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "建議ä¸è¦ä»¥ 'root' 身分執行 Code。", - "prof.message": "å·²æˆåŠŸå»ºç«‹è¨­å®šæª”ã€‚", - "prof.detail": "請建立å•題,並手動附加下列檔案:\n{0}", - "prof.restartAndFileIssue": "建立å•é¡Œä¸¦é‡æ–°å•Ÿå‹•", - "prof.restart": "釿–°å•Ÿå‹•" + "runningAsRoot": "建議ä¸è¦ä»¥ 'root' 身分執行 Code。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/window.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/window.i18n.json index 89eb6c3653d..091cf1f44e4 100644 --- a/i18n/cht/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/cht/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "貼上", "selectAll": "å…¨é¸", "confirmOpen": "確定è¦é–‹å•Ÿ {0} 資料夾嗎?", - "confirmOpenButton": "開啟(&&O)...", - "developer": "開發人員", - "file": "檔案" + "confirmOpenButton": "開啟(&&O)..." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..ff6f3d234e9 100644 --- a/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "開發人員: 檢查按éµå°æ‡‰" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index e61ce405342..c2ab22390ca 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "編輯中斷點...", "setValue": "設定值", "addWatchExpression": "加入é‹ç®—å¼", + "editWatchExpression": "編輯é‹ç®—å¼", "addToWatchExpressions": "加入監看", "removeWatchExpression": "移除é‹ç®—å¼", "removeAllWatchExpressions": "移除所有é‹ç®—å¼", diff --git a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..8bd875c749d 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "åµéŒ¯å·¥å…·åˆ—背景色彩。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..e2098f79ad8 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "按一下以追蹤 (Cmd + 按一下滑鼠左éµé–‹è‡³å´é‚Š)", + "fileLink": "按一下以追蹤 (Ctrl + 按一下滑鼠左éµé–‹è‡³å´é‚Š)" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..63a60fc01a2 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "內部åµéŒ¯ä¸»æŽ§å°çš„æŽ§åˆ¶é …行為。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json index 02c3d441b7f..da46c1cbcd0 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -15,5 +15,6 @@ "allowBreakpointsEverywhere": "å…許在任何檔案設定中斷點", "openExplorerOnEnd": "自動於åµéŒ¯å·¥ä½œéšŽæ®µçµæŸæ™‚開啟總管檢視", "inlineValues": "在åµéŒ¯æ™‚於編輯器以內嵌方å¼é¡¯ç¤ºè®Šæ•¸å€¼", - "hideActionBar": "æŽ§åˆ¶æ˜¯å¦æ‡‰éš±è—浮點åµéŒ¯å‹•作列" + "hideActionBar": "æŽ§åˆ¶æ˜¯å¦æ‡‰éš±è—浮點åµéŒ¯å‹•作列", + "launch": "全域åµéŒ¯å•Ÿå‹•組態。應當åšåœ¨å·¥ä½œå€ä¹‹é–“共用的 'launch.json' 替代方案使用" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 1c7a91ba5c9..e7982d93dfd 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "第一次評估會擷å–物件狀態", - "fileLinkMac": "按一下以追蹤 (Cmd + 按一下滑鼠左éµé–‹è‡³å´é‚Š)", - "fileLink": "按一下以追蹤 (Ctrl + 按一下滑鼠左éµé–‹è‡³å´é‚Š)", "replVariableAriaLabel": "變數 {0} 具有值 {1},「讀å–ã€æ±‚值ã€è¼¸å‡ºã€è¿´åœˆï¼ŒåµéŒ¯", "replExpressionAriaLabel": "é‹ç®—å¼ {0} 具有值 {1},「讀å–ã€æ±‚值ã€è¼¸å‡ºã€è¿´åœˆï¼ŒåµéŒ¯", "replValueOutputAriaLabel": "{0},「讀å–ã€æ±‚值ã€è¼¸å‡ºã€è¿´åœˆï¼ŒåµéŒ¯", diff --git a/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index f41f30d5524..fbd7d7b23df 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "è¦æ±‚組態的類型。å¯ä»¥æ˜¯ [啟動] 或 [附加]。", "debugServer": "僅é™åµéŒ¯å»¶ä¼¸æ¨¡çµ„開發: 如果指定了連接埠,VS Code 會嘗試連線至以伺æœå™¨æ¨¡å¼åŸ·è¡Œçš„åµéŒ¯é…接器", "debugPrelaunchTask": "åµéŒ¯å·¥ä½œéšŽæ®µå•Ÿå‹•å‰è¦åŸ·è¡Œçš„工作。", - "internalConsoleOptions": "內部åµéŒ¯ä¸»æŽ§å°çš„æŽ§åˆ¶é …行為。", "debugWindowsConfiguration": "Windows 特定的啟動設定屬性。", "debugOSXConfiguration": "OS X 特定的啟動設定屬性。", "debugLinuxConfiguration": "Linux 特定的啟動設定屬性。", diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..71f6e49ff95 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: 平衡 (å‘å…§)", + "balanceOutward": "Emmet: 平衡 (å‘外)" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..9c79dedc0ca --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: 上一個編輯端點", + "nextEditPoint": "Emmet: 下一個編輯端點" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..2fd101d6104 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: 評估數學é‹ç®—å¼" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..e44c6de8d4a --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: 展開縮寫" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..64cf880ae48 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: ä¾ 0.1 éžå¢ž", + "incrementNumberByOne": "Emmet: ä¾ 1 éžå¢ž", + "incrementNumberByTen": "Emmet: ä¾ 10 éžå¢ž", + "decrementNumberByOneTenth": "Emmet: ä¾ 0.1 éžæ¸›", + "decrementNumberByOne": "Emmet: ä¾ 1 éžæ¸›", + "decrementNumberByTen": "Emmet: ä¾ 10 éžæ¸›" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..211f58191fe --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: å‰å¾€ç›¸ç¬¦çš„é…å°" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..3e491126dc2 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: åˆä½µè¡Œ" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..1dcfdd7b85c --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: åå°„ CSS 值" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..0c12d23d41a --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: 移除標記" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..2674e2efa4e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: é¸å–上一個項目", + "selectNextItem": "Emmet: é¸å–下一個項目" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..b861468d52e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: 分割/è¯çµæ¨™è¨˜" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..9980a634fb8 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: 切æ›è¨»è§£" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..11fbb1e13ba --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: æ›´æ–°å½±åƒå¤§å°" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..659656b1b2b --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: 更新標記", + "enterTag": "輸入標記", + "tag": "標記" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..78eafe156b1 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: 以縮寫包è£", + "enterAbbreviation": "輸入縮寫", + "abbreviation": "縮寫" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..fa22b35c419 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "如有啟用,åªè¦æŒ‰ Tab éµå°±èƒ½å±•é–‹ Emmet 縮寫。", + "emmetPreferences": "喜好設定,用以修改æŸäº›å‹•ä½œçš„è¡Œç‚ºåŠ Emmet 的解æžç¨‹å¼ã€‚", + "emmetSyntaxProfiles": "為指定的語法定義設定檔,或é€éŽç‰¹å®šè¦å‰‡ä½¿ç”¨è‡ªå·±çš„設定檔。", + "emmetExclude": "䏿‡‰å±•é–‹ Emmet 縮寫的語言陣列。", + "emmetExtensionsPath": "åŒ…å« Emmet 設定檔ã€ç¨‹å¼ç¢¼ç‰‡æ®µåŠåƒè€ƒçš„資料夾路徑" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 83e61cd9ea9..71c9d68e192 100644 --- a/i18n/cht/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "æä¾›è‡ªè¨‚檢視", + "vscode.extension.contributes.view.id": "用以識別é€éŽ vscode.workspace.createTreeView 建立之檢視的唯一識別碼", + "vscode.extension.contributes.view.label": "用以轉譯檢視的易讀字串", + "vscode.extension.contributes.view.icon": "連到檢視圖示的路徑", + "vscode.extension.contributes.views": "æä¾›è‡ªè¨‚檢視", "showViewlet": "顯示 {0}", "view": "檢視" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index c4ae560325b..7855f3a13f5 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -4,8 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "reallyRecommended2": "å»ºè­°å°æ­¤æª”案類型使用 '{0}' 延伸模組。", "showRecommendations": "顯示建議", "neverShowAgain": "ä¸è¦å†é¡¯ç¤º", "close": "關閉", - "workspaceRecommended": "此工作å€å…·æœ‰æ“´å……功能建議。" + "workspaceRecommended": "此工作å€å…·æœ‰æ“´å……功能建議。", + "no": "å¦", + "cancel": "å–æ¶ˆ" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..6394eecabd8 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "是", + "no": "å¦", + "uninstall": "解除安è£", + "later": "ç¨å¾Œ" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index d18aa96ecaf..5b044579208 100644 --- a/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "將檔案關è¯è¨­å®šç‚ºèªžè¨€ (例如 \"*.extension\": \"html\")。這些語言優先於已安è£èªžè¨€çš„é è¨­é—œè¯ã€‚", "encoding": "讀å–與寫入檔案時è¦ä½¿ç”¨çš„é è¨­å­—元集編碼。", "autoGuessEncoding": "如有啟用,將會在開啟檔案時,嘗試猜測字元集編碼", - "eol": "é è¨­è¡Œå°¾å­—元。", "trimTrailingWhitespace": "若啟用,將在儲存檔案時修剪尾端空白。", "insertFinalNewline": "啟用時,請在儲存檔案時在其çµå°¾æ’入最後一個新行。", "files.autoSave.off": "å·²è®Šæ›´çš„æª”æ¡ˆä¸€å¾‹ä¸æœƒè‡ªå‹•儲存。", @@ -27,8 +26,6 @@ "autoSaveDelay": "控制è¦è‡ªå‹•儲存已變更之檔案å‰å¿…須經éŽçš„延鲿™‚é–“ (毫秒)。僅當 'files.autoSave' 設為 \"{0}\" 時æ‰é©ç”¨ã€‚", "watcherExclude": "將檔案路徑的 Glob 模å¼è¨­å®šç‚ºå¾žæª”案監控排除。需è¦é‡æ–°å•Ÿå‹•æ‰èƒ½è®Šæ›´æ­¤è¨­å®šã€‚ç•¶æ‚¨ç™¼ç¾ Code åœ¨å•Ÿå‹•æ™‚ä½¿ç”¨å¤§é‡ CPU 時間時,å¯ä»¥æŽ’除較大的資料夾以é™ä½Žåˆå§‹è² è¼‰ã€‚", "hotExit.off": "åœç”¨ Hot Exit。", - "hotExit.onExit": "Hot Exit å°‡æœƒåœ¨é—œé–‰æ‡‰ç”¨ç¨‹å¼æ™‚觸發,也就是在 Windows/Linux 上關閉上一個視窗,或是觸發 workbench.action.quit 命令 (命令鏿“‡å€ã€æŒ‰éµç¹«çµé—œä¿‚ã€åŠŸèƒ½è¡¨) 時觸發。具有備份的所有視窗都會在下次啟動時還原。", - "hotExit.onExitAndWindowClose": "Hot Exit å°‡æœƒåœ¨é—œé–‰æ‡‰ç”¨ç¨‹å¼æ™‚觸發,也就是在 Windows/Linux 上關閉上一個視窗,或是觸發 workbench.action.quit 命令 (命令鏿“‡å€ã€æŒ‰éµç¹«çµé—œä¿‚ã€åŠŸèƒ½è¡¨) 時觸發,也會é‡å°å·²é–‹å•Ÿè³‡æ–™å¤¾çš„任何視窗觸發,而ä¸è«–其是å¦ç‚ºä¸Šä¸€å€‹è¦–窗。具有備份的所有視窗都會在下次啟動時還原。若è¦å°‡è³‡æ–™å¤¾è¦–窗還原æˆé—œæ©Ÿå‰çš„狀態,請將 \"window.reopenFolders\" 設定為 \"all\"。", "hotExit": "控制是å¦è®“ä¸åŒå·¥ä½œéšŽæ®µè¨˜ä½æœªå„²å­˜çš„æª”案,並å…è¨±åœ¨çµæŸç·¨è¼¯å™¨æ™‚è·³éŽå„²å­˜æç¤ºã€‚", "defaultLanguage": "指派給新檔案的é è¨­èªžè¨€æ¨¡å¼ã€‚", "editorConfigurationTitle": "編輯器", diff --git a/i18n/cht/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json b/i18n/cht/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json index 84b98eb14e0..4a54d52ef90 100644 --- a/i18n/cht/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json @@ -11,5 +11,6 @@ "genericSaveError": "無法儲存 '{0}': {1}", "staleSaveError": "無法儲存 '{0}': ç£ç¢Ÿä¸Šçš„內容較新。請按一下 [比較],比較您的版本與ç£ç¢Ÿä¸Šçš„版本。", "compareChanges": "比較", + "saveConflictDiffLabel": "{0} (使–¼ç£ç¢Ÿ) ↔ {1} (在 {2} 中) - 解決儲存è¡çª", "userGuide": "ä½¿ç”¨ç·¨è¼¯å™¨å·¥å…·åˆ—ä¸­çš„å‹•ä½œä¾†ã€Œå¾©åŽŸã€æ‚¨çš„變更,或以您的變更「覆寫ã€ç£ç¢Ÿä¸Šçš„內容" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 1c615781faa..f36b3a04dba 100644 --- a/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "嵿¸¬åˆ°å•Ÿå‹•速度慢", - "slow.detail": "抱歉! å…ˆå‰çš„å•Ÿå‹•é€Ÿåº¦éŽæ…¢ã€‚è«‹é‡æ–°å•Ÿå‹• '{0}' 並啟用剖æžåŠŸèƒ½ï¼ŒåŒæ™‚將設定檔æä¾›çµ¦æˆ‘們,我們將努力æå‡å•Ÿå‹•çš„å“質。" + "slow.detail": "抱歉! å…ˆå‰çš„å•Ÿå‹•é€Ÿåº¦éŽæ…¢ã€‚è«‹é‡æ–°å•Ÿå‹• '{0}' 並啟用剖æžåŠŸèƒ½ï¼ŒåŒæ™‚將設定檔æä¾›çµ¦æˆ‘們,我們將努力æå‡å•Ÿå‹•çš„å“質。", + "prof.message": "å·²æˆåŠŸå»ºç«‹è¨­å®šæª”ã€‚", + "prof.detail": "請建立å•題,並手動附加下列檔案:\n{0}", + "prof.restartAndFileIssue": "建立å•é¡Œä¸¦é‡æ–°å•Ÿå‹•", + "prof.restart": "釿–°å•Ÿå‹•" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json index c3aa093a86d..45b8b75fa83 100644 --- a/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -7,6 +7,7 @@ "keybindingsInputName": "éµç›¤å¿«é€Ÿéµ(&&K)", "SearchKeybindings.AriaLabel": "æœå°‹æŒ‰éµç¹«çµé—œä¿‚", "SearchKeybindings.Placeholder": "æœå°‹æŒ‰éµç¹«çµé—œä¿‚", + "sortByPrecedene": "ä¾å„ªå…ˆé †åºæŽ’åº", "header-message": "開啟åŠç·¨è¼¯é€²éšŽè‡ªè¨‚項目時使用", "keybindings-file-name": "keybindings.json", "keybindingsLabel": "按éµç¹«çµé—œä¿‚", @@ -14,6 +15,7 @@ "addLabel": "新增按éµç¹«çµé—œä¿‚", "removeLabel": "移除按éµç¹«çµé—œä¿‚", "resetLabel": "é‡è¨­æŒ‰éµç¹«çµé—œä¿‚", + "showConflictsLabel": "顯示è¡çª", "copyLabel": "複製", "error": "編輯按éµç¹«çµé—œä¿‚時發生錯誤 '{0}'。請開啟 'keybindings.json' 檔案加以檢查。", "command": "Command", diff --git a/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index ae979e3f753..a92d2c49e8b 100644 --- a/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "開啟使用者設定", "openGlobalKeybindings": "開啟éµç›¤å¿«é€Ÿéµ", + "openGlobalKeybindingsFile": "開啟éµç›¤å¿«é€Ÿéµæª”案", "openWorkspaceSettings": "開啟工作å€è¨­å®š", "configureLanguageBasedSettings": "設定語言專屬設定...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/cht/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/cht/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json index 6ecaf06064a..c9a1d537022 100644 --- a/i18n/cht/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -6,5 +6,6 @@ { "default": "é è¨­", "user": "使用者", + "meta": "中繼", "option": "é¸é …" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index c0bccd6864c..cafed393010 100644 --- a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "顯示 Git", + "installAdditionalSCMProviders": "安è£é¡å¤–SCMæä¾›è€…...", "source control": "原始檔控制", "toggleSCMViewlet": "顯示 SCM", "view": "檢視" diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index d1872f571b1..5450727934a 100644 --- a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "安è£é¡å¤–SCMæä¾›è€…...", "switch provider": "åˆ‡æ› SCM æä¾›è€…..." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index e2c76d595ed..0dacece4839 100644 --- a/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "找到 {0} 個相符", "searchMatch": "找到 {0} 個相符", - "fileMatchAriaLabel": "資料夾 {2} 的檔案 {1} 中有 {0} 個相符,æœå°‹çµæžœ", - "replacePreviewResultAria": "å–代é è¦½çµæžœï¼Œ{0}", - "searchResultAria": "{0},æœå°‹çµæžœ" + "fileMatchAriaLabel": "資料夾 {2} 的檔案 {1} 中有 {0} 個相符,æœå°‹çµæžœ" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index e35a0884650..c9f6c178105 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},工作" + "entryAriaLabel": "{0},工作", + "workspace": "從工作å€", + "extension": "從擴充功能" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index a6d7f30447a..b0cd09ce051 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},工作", "tasksAriaLabel": "è«‹éµå…¥è¦é‡æ–°å•Ÿå‹•的工作å稱", "noTasksMatching": "沒有工作相符", "noTasksFound": "找ä¸åˆ°å·¥ä½œå¯é‡æ–°å•Ÿå‹•" diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 7eb3693cef9..c6d5f5a478b 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},工作", "tasksAriaLabel": "輸入è¦åŸ·è¡Œçš„工作å稱", "noTasksMatching": "No tasks matching", "noTasksFound": "找ä¸åˆ°å·¥ä½œ" diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 7758b0a3da0..f73c9b1e8a6 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "é¸å–工作執行器", "ConfigureTaskRunnerAction.autoDetecting": "è‡ªå‹•åµæ¸¬ {0} 的工作", "ConfigureTaskRunnerAction.autoDetect": "è‡ªå‹•åµæ¸¬å·¥ä½œç³»çµ±å¤±æ•—。正在使用é è¨­ç¯„本。如需詳細資料,請åƒé–±å·¥ä½œè¼¸å‡ºã€‚", + "ConfigureTaskRunnerAction.autoDetectError": "è‡ªå‹•åµæ¸¬å·¥ä½œç³»çµ±ç”¢ç”ŸéŒ¯èª¤ã€‚如需詳細資料,請åƒé–±å·¥ä½œè¼¸å‡ºã€‚", "ConfigureTaskRunnerAction.failed": "無法在 '.vscode' 資料夾中建立 'tasks.json' 檔案。如需詳細資訊,請åƒé–±å·¥ä½œè¼¸å‡ºã€‚", "ConfigureTaskRunnerAction.label": "設定工作執行器", "ConfigureBuildTaskAction.label": "設定建置工作", @@ -17,7 +18,6 @@ "problems": "å•題", "manyMarkers": "99+", "tasks": "工作", - "TaskSystem.noHotSwap": "變更工作執行引擎需è¦é‡æ–°å•Ÿå‹• VS Code。已略éŽè®Šæ›´ã€‚", "TaskService.noBuildTask": "未定義任何建置工作。請使用 'isBuildCommand' 標記 tasks.json 檔案中的工作。", "TaskService.noTestTask": "未定義任何建置工作。請使用 'isTestCommand' 標記 tasks.json 檔案中的工作。", "TaskServer.noTask": "找ä¸åˆ°æ‰€è¦æ±‚è¦åŸ·è¡Œçš„工作 {0}。", diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json index e9ec0d1fe54..38cbc1a135f 100644 --- a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -16,6 +16,7 @@ "terminal.integrated.fontLigatures": "控制是å¦åœ¨çµ‚端機中啟用連字字型。", "terminal.integrated.fontSize": "æŽ§åˆ¶çµ‚ç«¯æ©Ÿçš„å­—åž‹å¤§å° (以åƒç´ ç‚ºå–®ä½)。", "terminal.integrated.lineHeight": "控制終端機的行高,此數字會乘上終端機字型大å°ï¼Œä»¥å–得以åƒç´ ç‚ºå–®ä½çš„實際行高。", + "terminal.integrated.enableBold": "是å¦è¦åœ¨çµ‚端機內啟用粗體文字。此動作需è¦çµ‚端機殼層的支æ´ã€‚", "terminal.integrated.cursorBlinking": "控制終端機資料指標是å¦é–ƒçˆã€‚", "terminal.integrated.cursorStyle": "控制終端機資料指標的樣å¼ã€‚", "terminal.integrated.scrollback": "控制終端機ä¿ç•™åœ¨å…¶ç·©è¡å€ä¸­çš„行數上é™ã€‚", diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json index 1ed48f98d58..8d475ec0701 100644 --- a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.integrated.allowWorkspaceShell": "è¦å…許 {0} (定義為工作å€è¨­å®š) 在終端機中啟動嗎?", "allow": "Allow", "disallow": "Disallow" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 7cd1aafa6f1..ae636e70679 100644 --- a/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,14 @@ { "selectTheme.label": "色彩佈景主題", "installColorThemes": "安è£å…¶ä»–的色彩佈景主題...", - "problemChangingTheme": "設定佈景主題時發生å•題: {0}", - "themes.selectTheme": "é¸å–色彩佈景主題", + "themes.selectTheme": "é¸å–色彩主題(上/下éµé è¦½)", "selectIconTheme.label": "檔案圖示佈景主題", "installIconThemes": "安è£å…¶ä»–的檔案圖示主題...", "noIconThemeLabel": "ç„¡", "noIconThemeDesc": "åœç”¨æª”案圖示", "problemChangingIconTheme": "設定圖示佈景主題時發生å•題: {0}", "themes.selectIconTheme": "é¸å–檔案圖示佈景主題", + "generateColorTheme.label": "ä¾ç›®å‰çš„設定產生色彩佈景主題", "preferences": "喜好設定", "developer": "開發人員" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 5e5be1740d8..9a00f615c32 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,33 +11,30 @@ "welcomePage.openFolder": "開啟資料夾...", "welcomePage.cloneGitRepository": "複製 Git 存放庫...", "welcomePage.recent": "最近使用", + "welcomePage.moreRecent": "更多...", "welcomePage.noRecentFolders": "沒有最近使用的資料夾", "welcomePage.help": "說明", - "welcomePage.productDocumentation": "ç”¢å“æ–‡ä»¶", "welcomePage.introductoryVideos": "簡介影片", + "welcomePage.productDocumentation": "ç”¢å“æ–‡ä»¶", "welcomePage.gitHubRepository": "GitHub 存放庫", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "啟動時顯示歡迎é é¢", - "welcomePage.quickLinks": "快速連çµ", - "welcomePage.interactivePlayground": "Interactive Playground", - "welcomePage.interactivePlaygroundDescription": "å˜—è©¦ä½¿ç”¨é€æ­¥è§£èªªçŸ­ç‰‡ä¸­çš„一些基本編輯器功能", - "welcomePage.interfaceOverview": "介颿¦‚è§€", - "welcomePage.interfaceOverviewDescription": "使用視覺覆疊效果強調顯示 UI 的主è¦å…ƒä»¶", + "welcomePage.customize": "自訂", + "welcomePage.moreExtensions": "更多", + "welcomePage.installKeymapDescription": "安è£éµç›¤å¿«é€Ÿéµ", + "welcomePage.others": "å…¶ä»–", "welcomePage.colorTheme": "彩色佈景主題", "welcomePage.colorThemeDescription": "å°‡ç·¨è¼¯å™¨åŠæ‚¨çš„程å¼ç¢¼è¨­å®šæˆæ‚¨å–œæ„›çš„外觀", - "welcomePage.keybindingsReference": "éµç›¤å¿«é€Ÿéµåƒè€ƒ", - "welcomePage.keybindingsReferenceDescription": "å¯åˆ—å°çš„ PDF,附有最常用的éµç›¤å¿«é€Ÿéµ", + "welcomePage.learn": "深入了解", "welcomePage.showCommands": "尋找åŠåŸ·è¡Œæ‰€æœ‰å‘½ä»¤", "welcomePage.showCommandsDescription": "從控制å°å¿«é€Ÿå­˜å–åŠæœå°‹å‘½ä»¤ ({0})", + "welcomePage.interfaceOverview": "介颿¦‚è§€", + "welcomePage.interfaceOverviewDescription": "使用視覺覆疊效果強調顯示 UI 的主è¦å…ƒä»¶", + "welcomePage.interactivePlayground": "Interactive Playground", + "welcomePage.interactivePlaygroundDescription": "å˜—è©¦ä½¿ç”¨é€æ­¥è§£èªªçŸ­ç‰‡ä¸­çš„一些基本編輯器功能", + "welcomePage.quickLinks": "快速連çµ", + "welcomePage.keybindingsReference": "éµç›¤å¿«é€Ÿéµåƒè€ƒ", + "welcomePage.keybindingsReferenceDescription": "å¯åˆ—å°çš„ PDF,附有最常用的éµç›¤å¿«é€Ÿéµ", "welcomePage.configureSettings": "組態設定", - "welcomePage.configureSettingsDescription": "å¾®èª¿è¨­å®šå°±èƒ½ç™¼æ® VS Code 的所有功能", - "welcomePage.installKeymapDescription": "安è£éµç›¤å¿«é€Ÿéµ", - "welcomePage.installKeymap": "安è£éµç›¤å¿«é€Ÿéµ {0}ã€{1}ã€{2} åŠ {3}", - "welcomePage.vim": "活力", - "welcomePage.vimCurrent": "活力 (ç›®å‰)", - "welcomePage.sublime": "壯麗", - "welcomePage.sublimeCurrent": "壯麗 (ç›®å‰)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (ç›®å‰)", - "welcomePage.others": "å…¶ä»–" + "welcomePage.configureSettingsDescription": "å¾®èª¿è¨­å®šå°±èƒ½ç™¼æ® VS Code 的所有功能" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index aceea3407e3..dfce04ba61a 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,22 @@ // Do not edit this file. It is machine generated. { "welcomePage": "歡迎使用", - "welcome.title": "歡迎使用", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "活力", + "welcomePage.sublime": "壯麗", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "å·²å®‰è£ {0} éµç›¤å¿«é€Ÿéµã€‚", "welcomePage.willReloadAfterInstallingKeymap": "{0} éµç›¤å¿«é€Ÿéµå®‰è£å®Œæˆå¾Œï¼Œå°‡æœƒé‡æ–°è¼‰å…¥æ­¤è¦–窗。", - "ok": "確定", "welcomePage.installingKeymap": "æ­£åœ¨å®‰è£ {0} éµç›¤å¿«é€Ÿéµ...", "welcomePage.keymapNotFound": "找ä¸åˆ°è­˜åˆ¥ç¢¼ç‚º {1} çš„ {0} éµç›¤å¿«é€Ÿéµã€‚", - "cancel": "å–æ¶ˆ" + "welcome.title": "歡迎使用", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installedExtension": "{0}(已安è£)", + "ok": "確定", + "cancel": "å–æ¶ˆ", + "welcomePage.quickLinkBackground": "èµ·å§‹é é¢é€£çµçš„背景色彩." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 88da29e3eed..920973ad063 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "未繫çµ" + "walkThrough.unboundCommand": "未繫çµ", + "walkThrough.gitNotFound": "æ‚¨çš„ç³»çµ±ä¸Šä¼¼ä¹Žæœªå®‰è£ Git。", + "walkThrough.embeddedEditorBackground": "編輯器互動å€å¡Šçš„背景色彩." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 377d6da8f30..66d7f136aff 100644 --- a/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "開啟設定", + "close": "關閉", "errorUnknownKey": "無法寫入組態檔 (䏿˜Žçš„æŒ‰éµ)", - "errorInvalidTarget": "無法寫入組態檔 (目標無效)", - "errorNoWorkspaceOpened": "因為未開啟任何資料夾,所以無法寫入設定。請開啟資料夾後å†è©¦ä¸€æ¬¡ã€‚", - "errorInvalidConfiguration": "無法寫入設定。請開啟 **使用者設定** 以修正檔案中的錯誤/警告後å†è©¦ä¸€æ¬¡ã€‚", - "errorInvalidConfigurationWorkspace": "無法寫入設定。請開啟 **工作å€è¨­å®š** 以修正檔案中的錯誤/警告後å†è©¦ä¸€æ¬¡ã€‚", - "errorConfigurationFileDirty": "因為檔案已變更,所以無法寫入設定。請儲存 **使用者設定** 檔案後å†è©¦ä¸€æ¬¡ã€‚", - "errorConfigurationFileDirtyWorkspace": "因為檔案已變更,所以無法寫入設定。請儲存 **工作å€è¨­å®š** 檔案後å†è©¦ä¸€æ¬¡ã€‚" + "errorInvalidTarget": "無法寫入組態檔 (目標無效)" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/cht/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 02d0580da76..783e4921558 100644 --- a/i18n/cht/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/cht/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Windows ç‰¹å®šæŒ‰éµæˆ–按éµé †åºã€‚", "vscode.extension.contributes.keybindings.when": "按éµç‚ºä½¿ç”¨ä¸­æ™‚çš„æ¢ä»¶ã€‚", "vscode.extension.contributes.keybindings": "æä¾›æŒ‰éµç¹«çµé—œä¿‚。", - "openDocumentation": "深入了解", - "keybindingMigration.ok": "確定", - "keybindingMigration.prompt": "您的éµç›¤é…置已有一些éµç›¤å¿«é€Ÿéµè®Šæ›´äº†ã€‚", "invalid.keybindings": "`contributes.{0}` 無效: {1}", "unboundCommands": "å…¶ä»–å¯ç”¨å‘½ä»¤å¦‚下: ", "keybindings.json.title": "按éµç¹«çµé—œä¿‚組態", diff --git a/i18n/cht/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/cht/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index b0807315760..fe793cb749a 100644 --- a/i18n/cht/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/cht/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "å白顯示語法時的色彩", "schema.properties.name": "è¦å‰‡æè¿°", - "schema.fontStyle": "è¦å‰‡çš„字型樣å¼:「斜體ã€ã€ã€Œç²—é«”ã€æˆ–「底線ã€ä¹‹ä¸€æˆ–其組åˆ" + "schema.fontStyle": "è¦å‰‡çš„字型樣å¼:「斜體ã€ã€ã€Œç²—é«”ã€æˆ–「底線ã€ä¹‹ä¸€æˆ–其組åˆ", + "schema.tokenColors.path": "tmTheme 檔案的路徑 (ç›¸å°æ–¼ç›®å‰æª”案)。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/cht/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 9fba242d4b9..7c45152f8a5 100644 --- a/i18n/cht/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/cht/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "å‰–æž JSON 佈景主題檔案時發生å•題: {0}" + "error.cannotparsejson": "å‰–æž JSON 佈景主題檔案時發生å•題: {0}", + "error.invalidformat.colors": "剖æžå½©è‰²ä½ˆæ™¯ä¸»é¡Œæª”案 {0} 時出ç¾å•題。屬性 'settings' 䏿˜¯ 'object' 類型。", + "error.invalidformat.tokenColors": "剖æžå½©è‰²ä½ˆæ™¯ä¸»é¡Œæª”案 {0} 時出ç¾å•題。屬性 'tokenColors' 應為指定é¡è‰²çš„陣列,或為通往文字é…å°ä½ˆæ™¯ä¸»é¡Œæª”案的路徑", + "error.plist.invalidformat": "å‰–æž tmTheme 檔案 {0} 時出ç¾å•題。'settings' 䏿˜¯é™£åˆ—。", + "error.cannotparse": "å‰–æž tmTheme 檔案 {0} 時發生å•題", + "error.cannotload": "載入 tmTheme 檔案 {0} 時發生å•題: {1}" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/cht/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 1940ac12b6a..cc25166bd67 100644 --- a/i18n/cht/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/cht/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "ä¾ç›®å‰é¸æ“‡çš„彩色佈景主題覆寫é¡è‰²", + "workbenchColors.deprecated": "此設定ä¸å†ç‚ºå¯¦é©—æ€§ï¼Œä¸”å·²è¢«é‡æ–°å‘½å為 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "改用'workbench.colorCustomizations'" } \ No newline at end of file diff --git a/i18n/deu/extensions/git/out/commands.i18n.json b/i18n/deu/extensions/git/out/commands.i18n.json index 3470905699d..1a8943807b8 100644 --- a/i18n/deu/extensions/git/out/commands.i18n.json +++ b/i18n/deu/extensions/git/out/commands.i18n.json @@ -16,6 +16,11 @@ "confirm discard": "Möchten Sie die Änderungen in {0} wirklich verwerfen?", "confirm discard multiple": "Möchten Sie wirklich Änderungen in {0} Dateien verwerfen?", "discard": "Änderungen verwerfen", + "confirm discard all": "Möchten Sie wirklich ALLE Änderungen verwerfen? Dieser Vorgang kann nicht rückgängig gemacht werden!", + "discardAll": "ALLE Änderungen verwerfen", + "no staged changes": "Es sind keine Änderungen bereitgestellt.\n\nMöchten Sie alle Ihre Änderungen automatisch bereitstellen und direkt committen?", + "yes": "Ja", + "always": "Immer", "no changes": "Keine Änderungen zum Speichern vorhanden.", "commit message": "Commit-Nachricht", "provide commit message": "Geben Sie eine Commit-Nachrichte ein.", @@ -31,6 +36,7 @@ "no remotes to publish": "In Ihrem Repository wurden keine Remoteelemente für die Veröffentlichung konfiguriert.", "disabled": "Git ist deaktiviert oder wird in diesem Arbeitsbereich nicht unterstützt.", "clean repo": "Bereinigen Sie Ihre Repository-Arbeitsstruktur vor Auftragsabschluss.", + "cant push": "Verweise können nicht per Push an einen Remotespeicherort übertragen werden. Führen Sie zuerst \"Pull\" aus, um Ihre Änderungen zu integrieren.", "git error details": "Git: {0}", "git error": "Git-Fehler", "open git log": "Git-Protokoll öffnen" diff --git a/i18n/deu/extensions/git/out/main.i18n.json b/i18n/deu/extensions/git/out/main.i18n.json index 6cf07d1824f..58ab0b365d0 100644 --- a/i18n/deu/extensions/git/out/main.i18n.json +++ b/i18n/deu/extensions/git/out/main.i18n.json @@ -7,5 +7,5 @@ "using git": "Verwenden von Git {0} von {1}", "updateGit": "Git aktualisieren", "neverShowAgain": "Nicht mehr anzeigen", - "git20": "Sie haben anscheinend Git {0} installiert. Der Code funktioniert am besten mit Git 2 oder älter" + "git20": "Sie haben anscheinend Git {0} installiert. Code funktioniert am besten mit Git 2 oder neuer" } \ No newline at end of file diff --git a/i18n/deu/extensions/git/package.i18n.json b/i18n/deu/extensions/git/package.i18n.json index 3ea04a9fbbc..26ab785ffbf 100644 --- a/i18n/deu/extensions/git/package.i18n.json +++ b/i18n/deu/extensions/git/package.i18n.json @@ -11,21 +11,21 @@ "command.openFile": "Datei öffnen", "command.stage": "Änderungen bereitstellen", "command.stageAll": "Alle Änderungen bereitstellen", - "command.stageSelectedRanges": "Gewählte Bereiche staffeln", + "command.stageSelectedRanges": "Gewählte Bereiche bereitstellen", "command.revertSelectedRanges": "Ausgewählte Bereiche zurücksetzen", "command.unstage": "Bereitstellung der Änderungen aufheben", "command.unstageAll": "Bereitstellung aller Änderungen aufheben", - "command.unstageSelectedRanges": "Staffelung gewählter Bereiche aufheben", + "command.unstageSelectedRanges": "Bereitstellung gewählter Bereiche aufheben", "command.clean": "Änderungen verwerfen", "command.cleanAll": "Alle Änderungen verwerfen", "command.commit": "Commit", "command.commitStaged": "Commit bereitgestellt", - "command.commitStagedSigned": "Gestaffelt committen (abgemeldet)", + "command.commitStagedSigned": "Bereitgestelltes committen (unterzeichnet)", "command.commitAll": "Commit für alle ausführen", "command.commitAllSigned": "Alle committen (abgemeldet)", "command.undoCommit": "Letzten Commit rückgängig machen", "command.checkout": "Auschecken an...", - "command.branch": "Branch wird erstellt...", + "command.branch": "Branch erstellen...", "command.pull": "Pull", "command.pullRebase": "Pull (Rebase)", "command.push": "Push", @@ -39,6 +39,9 @@ "config.autofetch": "Gibt an, ob automatischer Abruf aktiviert ist.", "config.enableLongCommitWarning": "Gibt an, ob Warnungen zu langen Commitnachrichten erfolgen sollen.", "config.confirmSync": "Vor dem Synchronisieren von Git-Repositorys bestätigen.", + "config.countBadge": "Steuert die Git-Badgeanzahl. \"Alle\" zählt alle Änderungen. \"tracked\" (Nachverfolgt) zählt nur die nachverfolgten Änderungen. \"off\" (Aus) deaktiviert dies.", + "config.checkoutType": "Steuert, welcher Branchtyp beim Ausführen von \"Auschecken an...\" aufgelistet wird. \"Alle\" zeigt alle Verweise an, \"Lokal\" nur die lokalen Branches, \"Tags\" zeigt nur Tags an, und \"Remote\" zeigt nur Remotebranches an.", "config.ignoreLegacyWarning": "Ignoriert die Legacy-Git-Warnung.", - "config.ignoreLimitWarning": "Ignoriert Warnung bei zu hoher Anzahl von Änderungen in einem Repository" + "config.ignoreLimitWarning": "Ignoriert Warnung bei zu hoher Anzahl von Änderungen in einem Repository", + "config.enableSmartCommit": "Alle Änderungen committen, wenn keine Änderungen bereitgestellt sind." } \ No newline at end of file diff --git a/i18n/deu/extensions/gulp/package.i18n.json b/i18n/deu/extensions/gulp/package.i18n.json index 8b6ad71cd4e..b6b5c532278 100644 --- a/i18n/deu/extensions/gulp/package.i18n.json +++ b/i18n/deu/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Steuert, ob die automatische Erkennung von Gulp-Tasks aktiviert oder deaktiviert ist. Standardmäßig ist die Funktion aktiviert." +} \ No newline at end of file diff --git a/i18n/deu/extensions/jake/out/main.i18n.json b/i18n/deu/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/jake/package.i18n.json b/i18n/deu/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/markdown/out/extension.i18n.json b/i18n/deu/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/package.i18n.json b/i18n/deu/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/npm/package.i18n.json b/i18n/deu/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/npm/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/deu/extensions/typescript/out/typescriptServiceClient.i18n.json index d2333f5052c..5cda5156ae6 100644 --- a/i18n/deu/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/deu/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "Der Pfad \"{0}\" zeigt nicht auf eine gültige tsserver-Installation. Fallback auf gebündelte TypeScript-Version wird durchgeführt.", "noBundledServerFound": "Der tsserver von VSCode wurde von einer anderen Anwendung wie etwa einem fehlerhaften Tool zur Viruserkennung gelöscht. Führen Sie eine Neuinstallation von VS Code durch.", "versionNumber.custom": "benutzerdefiniert", diff --git a/i18n/deu/extensions/typescript/out/utils/logger.i18n.json b/i18n/deu/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/deu/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json index 6d936266697..abc0ee901f8 100644 --- a/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Daten werden zum Optimieren von TypeScript IntelliSense abgerufen", + "typesInstallerInitializationFailed.title": "Typisierungsdateien für JavaScript-Sprachfunktionen konnten nicht installiert werden. Stellen Sie sicher, das NPM installiert ist und sich in Ihrem PFAD befindet.", "typesInstallerInitializationFailed.moreInformation": "Weitere Informationen", "typesInstallerInitializationFailed.doNotCheckAgain": "Nicht erneut überprüfen", "typesInstallerInitializationFailed.close": "Schließen" diff --git a/i18n/deu/extensions/typescript/package.i18n.json b/i18n/deu/extensions/typescript/package.i18n.json index 61d500f2b84..d48740fd4d3 100644 --- a/i18n/deu/extensions/typescript/package.i18n.json +++ b/i18n/deu/extensions/typescript/package.i18n.json @@ -33,9 +33,7 @@ "javascript.validate.enable": "JavaScript-Überprüfung aktivieren/deaktivieren.", "typescript.goToProjectConfig.title": "Zur Projektkonfiguration wechseln", "javascript.goToProjectConfig.title": "Zur Projektkonfiguration wechseln", - "typescript.referencesCodeLens.enabled": "Aktiviert oder deaktiviert CodeLens-Verweise. Erfordert TypeScript 2.0.6 oder höher.", "typescript.implementationsCodeLens.enabled": "Aktiviert oder deaktiviert CodeLens-Implementierungen. Erfordert TypeScript 2.2.0 oder höher.", - "typescript.openTsServerLog.title": "TS Server-Protokolldatei öffnen", "typescript.selectTypeScriptVersion.title": "TypeScript-Version wählen", "jsDocCompletion.enabled": "Automatische JSDoc-Kommentare aktivieren/deaktivieren", "javascript.implicitProjectConfig.checkJs": "Aktiviert/deaktiviert die Semantikprüfung bei JavaScript-Dateien. Diese Einstellung wird von vorhandenen \"jsconfig.json\"- oder \"tsconfig.json\"-Dateien außer Kraft gesetzt. Erfordert TypeScript 2.3.1 oder höher.", diff --git a/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index a2b0a61e0fa..24c2e906e90 100644 --- a/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "Das Bild ist zu groß für den Editor. ", - "resourceOpenExternalButton": "Bild öffnen", - "resourceOpenExternalText": " mit externem Programm?", "nativeBinaryError": "Die Datei wird nicht im Editor angezeigt, weil sie binär oder sehr groß ist oder eine nicht unterstützte Textcodierung verwendet.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/deu/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/deu/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..e4b0b451c6c --- /dev/null +++ b/i18n/deu/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "Ungültiges Symbol", + "error.invalidNumberFormat": "Ungültiges Zahlenformat.", + "error.propertyNameExpected": "Ein Eigenschaftenname wurde erwartet.", + "error.valueExpected": "Ein Wert wurde erwartet.", + "error.colonExpected": "Ein Doppelpunkt wurde erwartet.", + "error.commaExpected": "Ein Komma wurde erwartet.", + "error.closeBraceExpected": "Eine schließende geschweifte Klammer wurde erwartet.", + "error.closeBracketExpected": "Eine schließende Klammer wurde erwartet.", + "error.endOfFileExpected": "Das Dateiende wurde erwartet." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/code/electron-main/menus.i18n.json b/i18n/deu/src/vs/code/electron-main/menus.i18n.json index 55751eba867..2a26af07f79 100644 --- a/i18n/deu/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/deu/src/vs/code/electron-main/menus.i18n.json @@ -6,7 +6,7 @@ { "mFile": "&&Datei", "mEdit": "&&Bearbeiten", - "mSelection": "&&Aktion auswählen", + "mSelection": "&&Auswahl", "mView": "&&Anzeigen", "mGoto": "Los", "mDebug": "&&Debuggen", @@ -69,7 +69,6 @@ "miSmartSelectShrink": "Au&&swahl verkleinern", "miViewExplorer": "&&Explorer", "miViewSearch": "&&Suchen", - "miViewGit": "&&Git", "miViewDebug": "&&Debuggen", "miViewExtensions": "E&&xtensions", "miToggleOutput": "&&Ausgabe", @@ -116,7 +115,7 @@ "miGotoDefinition": "Gehe &&zu Definition", "miGotoLine": "Gehe zu &&Zeile...", "miStartDebugging": "&&Debugging starten", - "miStartWithoutDebugging": "&&Ohne Debuggen starten", + "miStartWithoutDebugging": "&&Ohne Debugging starten", "miStopDebugging": "&&Debugging beenden", "miRestart Debugging": "&&Debugging erneut starten", "miOpenConfigurations": "&&Konfigurationen öffnen", diff --git a/i18n/deu/src/vs/code/electron-main/windows.i18n.json b/i18n/deu/src/vs/code/electron-main/windows.i18n.json index 19ea01ffe2b..b31c876e930 100644 --- a/i18n/deu/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/deu/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "OK", "pathNotExistTitle": "Der Pfad ist nicht vorhanden.", "pathNotExistDetail": "Der Pfad \"{0}\" scheint auf dem Datenträger nicht mehr vorhanden zu sein.", - "accessibilityOptionsWindowTitle": "Optionen für erleichterte Bedienung", "reopen": "Erneut öffnen", "wait": "Bitte warten.", "close": "Schließen", diff --git a/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json index 2fe70e62eed..a01ec274ece 100644 --- a/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -40,7 +40,6 @@ "formatOnType": "Steuert, ob der Editor Zeilen automatisch nach der Eingabe formatiert.", "formatOnPaste": "Steuert, ob der Editor den eingefügten Inhalt automatisch formatiert.", "suggestOnTriggerCharacters": "Steuert, ob Vorschläge automatisch bei der Eingabe von Triggerzeichen angezeigt werden.", - "acceptSuggestionOnEnter": "Steuert, ob Vorschläge über die Eingabetaste (zusätzlich zur TAB-Taste) angenommen werden sollen. Vermeidet Mehrdeutigkeit zwischen dem Einfügen neuer Zeilen oder dem Annehmen von Vorschlägen.", "acceptSuggestionOnCommitCharacter": "Steuert, ob Vorschläge über Commitzeichen angenommen werden sollen. In JavaScript kann ein Semikolon (\";\") beispielsweise ein Commitzeichen sein, das einen Vorschlag annimmt und dieses Zeichen eingibt.", "snippetSuggestions": "Steuert, ob Codeausschnitte mit anderen Vorschlägen angezeigt und wie diese sortiert werden.", "emptySelectionClipboard": "Steuert, ob ein Kopiervorgang ohne Auswahl die aktuelle Zeile kopiert.", diff --git a/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..2e06d6b808a --- /dev/null +++ b/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Editor-Inhalt" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json index aff2b6db4db..de766791c87 100644 --- a/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,7 @@ "caret": "Farbe des Cursors im Editor.", "editorWhitespaces": "Farbe der Leerzeichen im Editor.", "editorIndentGuides": "Farbe der Führungslinien für Einzüge im Editor.", - "editorLineNumbers": "Zeilennummernfarbe im Editor." + "editorLineNumbers": "Zeilennummernfarbe im Editor.", + "editorCodeLensForeground": "Vordergrundfarbe der CodeLens-Links im Editor", + "editorBracketMatchBackground": "Hintergrundfarbe für zusammengehörige Klammern" } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..ffee2c2fa36 --- /dev/null +++ b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "Keine Definition gefunden für \"{0}\".", + "generic.noResults": "Keine Definition gefunden", + "meta.title": " – {0} Definitionen", + "actions.goToDecl.label": "Gehe zu Definition", + "actions.goToDeclToSide.label": "Definition an der Seite öffnen", + "actions.previewDecl.label": "Peek-Definition", + "goToImplementation.noResultWord": "Keine Implementierung gefunden für \"{0}\"", + "goToImplementation.generic.noResults": "Keine Implementierung gefunden", + "meta.implementations.title": "{0} Implementierungen", + "actions.goToImplementation.label": "Zur Implementierung wechseln", + "actions.peekImplementation.label": "Vorschau der Implementierung anzeigen", + "goToTypeDefinition.noResultWord": "Keine Typendefinition gefunden für \"{0}\"", + "goToTypeDefinition.generic.noResults": "Keine Typendefinition gefunden", + "meta.typeDefinitions.title": "{0} Typdefinitionen", + "actions.goToTypeDefinition.label": "Zur Typdefinition wechseln", + "actions.peekTypeDefinition.label": "Vorschau der Typdefinition anzeigen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..2d5f00609a8 --- /dev/null +++ b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Klicken Sie, um {0} Definitionen anzuzeigen." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/deu/src/vs/editor/contrib/hover/browser/hover.i18n.json index d1a57ea3274..44bcefc0805 100644 --- a/i18n/deu/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "Hovern anzeigen", - "hoverHighlight": "Hervorhebung eines Worts, unter dem ein Mauszeiger angezeigt wird.", - "hoverBackground": "Background color of the editor hover.", - "hoverBorder": "Rahmenfarbe des Editor-Mauszeigers." + "showHover": "Hovern anzeigen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 103994c5799..ff88046159d 100644 --- a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "Symbol in {0} in Zeile {1}, Spalte {2}", + "aria.fileReferences.1": "1 Symbol in {0}", + "aria.fileReferences.N": "{0} Symbole in {1}", "aria.result.0": "Es wurden keine Ergebnisse gefunden.", "aria.result.1": "1 Symbol in {0} gefunden", "aria.result.n1": "{0} Symbole in {1} gefunden", diff --git a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index 5423f336ae3..d115a4e214a 100644 --- a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,8 +16,6 @@ "peekViewTitleInfoForeground": "Farbe der Titelinformationen in der Peek-Ansicht.", "peekViewBorder": "Farbe der Peek-Ansichtsränder und des Pfeils.", "peekViewResultsBackground": "Hintergrundfarbe der Ergebnisliste in der Peek-Ansicht.", - "peekViewResultsMatchForeground": "Vordergrund für Übereinstimmungseinträge in der Ergebnisliste der Peek-Ansicht.", - "peekViewResultsFileForeground": "Vordergrund für Dateieinträge in der Ergebnisliste der Peek-Ansicht.", "peekViewResultsSelectionBackground": "Hintergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.", "peekViewResultsSelectionForeground": "Vordergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.", "peekViewEditorBackground": "Hintergrundfarbe des Peek-Editors.", diff --git a/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 99e30e1b037..73686f1e295 100644 --- a/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,12 @@ { "editorSuggestWidgetBackground": "Hintergrundfarbe des Vorschlagswidgets.", "editorSuggestWidgetBorder": "Rahmenfarbe des Vorschlagswidgets.", + "editorSuggestWidgetForeground": "Vordergrundfarbe des Vorschlagswidgets.", + "editorSuggestWidgetSelectedBackground": "Hintergrundfarbe des ausgewählten Eintrags im Vorschlagswidget.", + "editorSuggestWidgetHighlightForeground": "Farbe der Trefferhervorhebung im Vorschlagswidget.", "readMore": "Mehr anzeigen...{0}", "suggestionWithDetailsAriaLabel": "{0}, Vorschlag, hat Details", "suggestionAriaLabel": "{0}, Vorschlag", - "goback": "Zurück", "suggestWidget.loading": "Wird geladen...", "suggestWidget.noSuggestions": "Keine Vorschläge.", "suggestionAriaAccepted": "{0}, angenommen", diff --git a/i18n/deu/src/vs/platform/environment/node/argv.i18n.json b/i18n/deu/src/vs/platform/environment/node/argv.i18n.json index 8104fc70ba0..058d98933af 100644 --- a/i18n/deu/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/deu/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "Zeigt Versionen der installierten Erweiterungen an, wenn \"--list-extension\" verwendet wird.", "installExtension": "Installiert eine Extension.", "uninstallExtension": "Deinstalliert eine Extension.", + "experimentalApis": "Aktiviert vorgeschlagene API-Features für eine Erweiterung.", "disableExtensions": "Deaktiviert alle installierten Extensions.", "disableGPU": "Deaktiviert die GPU-Hardwarebeschleunigung.", "version": "Gibt die Version aus.", diff --git a/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json index 1955c94d40b..565c50e40d1 100644 --- a/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,6 @@ "ProblemMatcherParser.noValidIdentifier": "Fehler: Die Mustereigenschaft {0} ist kein gültiger Name für eine Mustervariable.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Ein Problemmatcher muss ein Anfangsmuster und ein Endmuster für die Überwachung definieren.", "ProblemMatcherParser.invalidRegexp": "Fehler: Die Zeichenfolge {0} ist kein gültiger regulärer Ausdruck.\n", - "WatchingPatternSchema.regexp": "Der reguläre Ausdruck zum Erkennen des Anfangs oder Endes eines Überwachungstasks.", "WatchingPatternSchema.file": "Der Übereinstimmungsgruppenindex des Dateinamens. Kann ausgelassen werden.", "PatternTypeSchema.name": "Der Name eines beigetragenen oder vordefinierten Musters", "PatternTypeSchema.description": "Ein Problemmuster oder der Name eines beigetragenen oder vordefinierten Problemmusters. Kann ausgelassen werden, wenn die Basis angegeben ist.", @@ -46,7 +45,6 @@ "ProblemMatcherSchema.watching.activeOnStart": "Wenn dieser Wert auf \"true\" festgelegt wird, befindet sich die Überwachung im aktiven Modus, wenn der Task gestartet wird. Dies entspricht dem Ausgeben einer Zeile, die mit dem \"beginPattern\" übereinstimmt.", "ProblemMatcherSchema.watching.beginsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird der Start eines Überwachungstasks signalisiert.", "ProblemMatcherSchema.watching.endsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird das Ende eines Überwachungstasks signalisiert.", - "ProblemMatcherSchema.watching": "Muster zum Nachverfolgen des Beginns und Endes eines Beobachtungsmusters.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Diese Eigenschaft ist veraltet. Verwenden Sie stattdessen die Überwachungseigenschaft.", "LegacyProblemMatcherSchema.watchedBegin": "Ein regulärer Ausdruck, der signalisiert, dass die Ausführung eines überwachten Tasks (ausgelöst durch die Dateiüberwachung) beginnt.", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Diese Eigenschaft ist veraltet. Verwenden Sie stattdessen die Überwachungseigenschaft.", diff --git a/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json index 43f87d649f5..e8bca8886d1 100644 --- a/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,70 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "Ungültiges Farbformat. Verwenden Sie #RGB, #RGBA, #RRGGBB oder #RRGGBBAA.", "schema.colors": "In der Workbench verwendete Farben.", "foreground": "Allgemeine Vordergrundfarbe. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.", + "errorForeground": "Allgemeine Vordergrundfarbe. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.", + "descriptionForeground": "Vordergrundfarbe für Beschreibungstexte, die weitere Informationen anzeigen, z. B. für ein Label.", + "focusBorder": "Allgemeine Rahmenfarbe für fokussierte Elemente. Diese Farbe wird nur verwendet, wenn sie nicht durch eine Komponente überschrieben wird.", + "contrastBorder": "Ein zusätzlicher Rahmen um Elemente, mit dem diese von anderen getrennt werden, um einen größeren Kontrast zu erreichen.", + "activeContrastBorder": "Ein zusätzlicher Rahmen um aktive Elemente, mit dem diese von anderen getrennt werden, um einen größeren Kontrast zu erreichen.", + "textSeparatorForeground": "Farbe für Text-Trennzeichen.", + "textLinkForeground": "Vordergrundfarbe für Links im Text.", + "textLinkActiveForeground": "Vordergrundfarbe für aktive Links im Text.", + "textPreformatForeground": "Vordergrundfarbe für vorformatierte Textsegmente.", + "textBlockQuoteBackground": "Hintergrundfarbe für block quotes im Text.", + "textBlockQuoteBorder": "Rahmenfarbe für block quotes im Text.", + "textCodeBlockBackground": "Hintergrundfarbe für Code-Blöcke im Text.", + "widgetShadow": "Schattenfarbe von Widgets wie zum Beispiel Suchen/Ersetzen innerhalb des Editors.", "inputBoxBackground": "Hintergrund für Eingabefeld.", "inputBoxForeground": "Vordergrund für Eingabefeld.", "inputBoxBorder": "Rahmen für Eingabefeld.", "inputBoxActiveOptionBorder": "Rahmenfarbe für aktivierte Optionen in Eingabefeldern.", + "inputPlaceholderForeground": "Input box - Vordergrundfarbe für Platzhalter-Text.", + "inputValidationInfoBackground": "Hintergrundfarbe bei der Eingabevalidierung für den Schweregrad der Information.", + "inputValidationInfoBorder": "Rahmenfarbe bei der Eingabevalidierung für den Schweregrad der Information.", + "inputValidationWarningBackground": "Hintergrundfarbe bei der Eingabevalidierung für eine Warnung zur Information.", + "inputValidationWarningBorder": "Rahmenfarbe bei der Eingabevalidierung für den Schweregrad der Warnung.", + "inputValidationErrorBackground": "Hintergrundfarbe bei der Eingabevalidierung für den Schweregrad des Fehlers.", + "inputValidationErrorBorder": "Rahmenfarbe bei der Eingabevalidierung für den Schweregrad des Fehlers.", "dropdownBackground": "Hintergrund für Dropdown.", "dropdownForeground": "Vordergrund für Dropdown.", "dropdownBorder": "Rahmen für Dropdown.", + "listFocusBackground": "Hintergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listActiveSelectionBackground": "Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listActiveSelectionForeground": "Vordergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listInactiveSelectionBackground": "Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur inaktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listInactiveSelectionForeground": "Liste/Baumstruktur - Vordergrundfarbe für das ausgewählte Element, wenn die Liste/Baumstruktur inaktiv ist. Eine aktive Liste/Baumstruktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listHoverBackground": "Hintergrund der Liste/Struktur, wenn mit der Maus auf Elemente gezeigt wird.", + "listDropBackground": "Drag & Drop-Hintergrund der Liste/Struktur, wenn Elemente mithilfe der Maus verschoben werden.", + "highlight": "Vordergrundfarbe der Liste/Struktur zur Trefferhervorhebung beim Suchen innerhalb der Liste/Struktur.", "pickerGroupForeground": "Schnellauswahlfarbe für das Gruppieren von Bezeichnungen.", "pickerGroupBorder": "Schnellauswahlfarbe für das Gruppieren von Rahmen.", + "buttonForeground": "Vordergrundfarbe der Schaltfläche.", + "buttonBackground": "Hintergrundfarbe der Schaltfläche.", + "buttonHoverBackground": "Hintergrundfarbe der Schaltfläche, wenn darauf gezeigt wird.", + "badgeBackground": "Badge - Hintergrundfarbe. Badges sind kurze Info-Texte, z. B. für Anzahl Suchergebnisse.", + "badgeForeground": "Badge - Vordergrundfarbe. Badges sind kurze Info-Texte, z. B. für Anzahl Suchergebnisse.", + "scrollbarShadow": "Schatten der Scrollleiste, um anzuzeigen, dass die Ansicht gescrollt wird.", + "scrollbarSliderBackground": "Hintergrundfarbe des Schiebereglers.", + "scrollbarSliderHoverBackground": "Hintergrundfarbe des Schiebereglers, wenn darauf gezeigt wird.", + "scrollbarSliderActiveBackground": "Hintergrundfarbe des Schiebereglers, wenn dieser aktiv ist.", "editorBackground": "Hintergrundfarbe des Editors.", "editorForeground": "Standardvordergrundfarbe des Editors.", + "editorWidgetBackground": "Hintergrundfarbe von Editor-Widgets wie zum Beispiel Suchen/Ersetzen.", "editorSelection": "Farbe der Editor-Auswahl.", "editorInactiveSelection": "Farbe der Auswahl in einem inaktiven Editor.", "editorSelectionHighlight": "Farbe für Bereiche, deren Inhalt der Auswahl entspricht.", "editorFindMatch": "Farbe des aktuellen Suchergebnisses.", "findMatchHighlight": "Farbe der anderen Suchtreffer.", "findRangeHighlight": "Farbe des Bereichs zur Einschränkung der Suche.", + "hoverHighlight": "Hervorhebung eines Worts, unter dem ein Mauszeiger angezeigt wird.", + "hoverBackground": "Background color of the editor hover.", + "hoverBorder": "Rahmenfarbe des Editor-Mauszeigers.", "activeLinkForeground": "Farbe der aktiven Links.", - "linkForeground": "Farbe der Links.", - "editorWidgetBackground": "Hintergrundfarbe von Editor-Widgets wie zum Beispiel Suchen/Ersetzen." + "diffEditorInserted": "Hintergrundfarbe für eingefügten Text.", + "diffEditorRemoved": "Hintergrundfarbe für entfernten Text.", + "diffEditorInsertedOutline": "Konturfarbe für eingefügten Text.", + "diffEditorRemovedOutline": "Konturfarbe für entfernten Text." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..1d3dbda78ae --- /dev/null +++ b/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "Die Erweiterung \"{0}\" wird mit \"{1}\" überschrieben.", + "extensionUnderDevelopment": "Die Entwicklungserweiterung unter \"{0}\" wird geladen." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..d76b48e30db --- /dev/null +++ b/i18n/deu/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Schließen", + "cancel": "Abbrechen", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/deu/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..c6eed83d999 --- /dev/null +++ b/i18n/deu/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "Es ist kein TreeExplorerNodeProvider mit ID \"{0}\" registriert.", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider \"{0}\" hat keinen Stammknoten bereitgestellt." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json index 32abf05f8cb..a6835e15a6d 100644 --- a/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,6 @@ "configureLocale": "Sprache konfigurieren", "displayLanguage": "Definiert die Anzeigesprache von VSCode.", "doc": "Unter {0} finden Sie eine Liste der unterstützten Sprachen.", - "restart": "Das Ändern des Werts erfordert einen Neustart von VSCode.", "fail.createSettings": "{0} ({1}) kann nicht erstellt werden.", "JsonSchema.locale": "Die zu verwendende Sprache der Benutzeroberfläche." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/deu/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 818cf12465e..fa4ed406834 100644 --- a/i18n/deu/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "Vorherigen zuletzt verwendeten Editor in der Gruppe öffnen", "openNextRecentlyUsedEditorInGroup": "Nächsten zuletzt verwendeten Editor in der Gruppe öffnen", "navigateEditorHistoryByInput": "Vorherigen Editor aus Verlauf öffnen", + "openNextRecentlyUsedEditor": "Nächsten zuletzt verwendeten Editor öffnen", + "openPreviousRecentlyUsedEditor": "Vorherigen zuletzt verwendeten Editor öffnen", "clearEditorHistory": "Editor-Verlauf löschen", "focusLastEditorInStack": "Letzten Editor in der Gruppe öffnen", "moveEditorLeft": "Editor nach links verschieben", diff --git a/i18n/deu/src/vs/workbench/common/theme.i18n.json b/i18n/deu/src/vs/workbench/common/theme.i18n.json index 0fcf7d8cb71..825c4c4c377 100644 --- a/i18n/deu/src/vs/workbench/common/theme.i18n.json +++ b/i18n/deu/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "Hintergrundfarbe der aktiven Registerkarte. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabActiveBackground": "Hintergrundfarbe der aktiven Registerkarte. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabInactiveBackground": "Hintergrundfarbe der inaktiven Registerkarte. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabBorder": "Rahmen zum Trennen von Registerkarten. Registerkarten sind die Container für Editoren im Editor-Bereich. In einer Editor-Gruppe können mehrere Registerkarten geöffnet werden. Mehrere Editor-Gruppen sind möglich.", "tabActiveEditorGroupActiveForeground": "Vordergrundfarbe der aktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", - "tabActiveEditorGroupInactiveForeground": "Vordergrundfarbe der aktiven Registerkarte in einer inaktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabInactiveEditorGroupActiveForeground": "Vordergrundfarbe der inaktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", - "tabInactiveEditorGroupInactiveForeground": "Vordergrundfarbe der inaktiven Registerkarte in einer inaktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", + "editorGroupBackground": "Hintergrundfarbe einer Editor-Gruppe. Editor-Gruppen sind die Container der Editoren. Die Hintergrundfarbe wird beim Ziehen von Editoren angezeigt.", + "editorGroupHeaderBackground": "Hintergrundfarbe der Titelüberschrift des Editors, wenn die Registerkarten deaktiviert sind. Editor-Gruppen sind die Container der Editoren.", "editorGroupBorder": "Farbe zum Trennen mehrerer Editor-Gruppen. Editor-Gruppen sind die Container der Editoren.", - "editorDragAndDropBackground": "Hintergrundfarbe beim Ziehen von Editoren.", "panelBackground": "Hintergrundfarbe des Panels. Panels werden unter dem Editorbereich angezeigt und enthalten Ansichten wie die Ausgabe und das integrierte Terminal.", "panelBorder": "Farbe des oberen Panelrahmens, der das Panel vom Editor abtrennt. Panels werden unter dem Editorbereich angezeigt und enthalten Ansichten wie die Ausgabe und das integrierten Terminal.", "panelActiveTitleForeground": "Titelfarbe für den aktiven Bereich. Bereiche werden unter dem Editorbereich angezeigt und enthalten Ansichten wie Ausgabe und integriertes Terminal.", @@ -24,15 +22,19 @@ "statusBarNoFolderBackground": "Hintergrundfarbe der Statusleiste, wenn kein Ordner geöffnet ist. Die Statusleiste wird unten im Fenster angezeigt.", "statusBarItemActiveBackground": "Hintergrundfarbe für Statusleistenelemente beim Klicken. Die Statusleiste wird am unteren Rand des Fensters angezeigt.", "statusBarItemHoverBackground": "Hintergrundfarbe der Statusleistenelemente beim Daraufzeigen. Die Statusleiste wird am unteren Seitenrand angezeigt.", + "statusBarProminentItemBackground": "Hintergrundfarbe für markante Elemente der Statusleiste. Markante Elemente sind im Vergleich zu anderen Statusleisteneinträgen hervorgehoben, um auf ihre Bedeutung hinzuweisen. Die Statusleiste wird unten im Fenster angezeigt.", + "statusBarProminentItemHoverBackground": "Hintergrundfarbe für markante Elemente der Statusleiste, wenn auf diese gezeigt wird. Markante Elemente sind im Vergleich zu anderen Statusleisteneinträgen hervorgehoben, um auf ihre Bedeutung hinzuweisen. Die Statusleiste wird unten im Fenster angezeigt.", "activityBarBackground": "Hintergrundfarbe der Aktivitätsleiste. Die Aktivitätsleiste wird ganz links oder rechts angezeigt und ermöglicht das Wechseln zwischen verschiedenen Ansichten der Seitenleiste.", "activityBarForeground": "Vordergrundfarbe der Aktivitätsleiste (z. B. für Symbole). Die Aktivitätsleiste wird ganz links oder rechts angezeigt und ermöglicht das Wechseln zwischen verschiedenen Ansichten der Seitenleiste.", - "activityBarDragAndDropBackground": "Drag Drop-Feedbackfarbe für Elemente der Aktivitätsleiste. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "activityBarBadgeBackground": "Hintergrundfarbe für Aktivitätsinfobadge. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "activityBarBadgeForeground": "Vordergrundfarbe für Aktivitätsinfobadge. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "sideBarBackground": "Hintergrundfarbe der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", "sideBarTitleForeground": "Vordergrundfarbe der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", + "sideBarSectionHeaderBackground": "Hintergrundfarbe der Abschnittsüberschrift der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", "titleBarActiveForeground": "Vordergrund der Titelleiste, wenn das Fenster aktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", "titleBarInactiveForeground": "Vordergrund der Titelleiste, wenn das Fenster inaktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", "titleBarActiveBackground": "Hintergrund der Titelleiste, wenn das Fenster aktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", - "titleBarInactiveBackground": "Hintergrund der Titelleiste, wenn das Fenster inaktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt." + "titleBarInactiveBackground": "Hintergrund der Titelleiste, wenn das Fenster inaktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", + "notificationsForeground": "Vordergrundfarbe für Benachrichtigungen. Benachrichtigungen werden oben im Fenster eingeblendet.", + "notificationsBackground": "Hintergrundfarbe für Benachrichtigungen. Benachrichtigungen werden oben im Fenster eingeblendet." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json index 9f73db52ca6..15f166829b2 100644 --- a/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Anzeigen", "help": "Hilfe", "file": "Datei", + "developer": "Entwickler", "showEditorTabs": "Steuert, ob geöffnete Editoren auf Registerkarten angezeigt werden sollen.", "editorTabCloseButton": "Steuert die Position der Schließen-Schaltflächen der Editor-Registerkarten oder deaktiviert sie bei der Einstellung \"off\".", "showIcons": "Steuert, ob geöffnete Editoren mit einem Symbol angezeigt werden sollen. Hierzu muss auch ein Symboldesign aktiviert werden.", @@ -41,7 +42,6 @@ "window.newWindowDimensions.inherit": "Öffnet neue Fenster mit den gleichen Abmessungen wie das letzte aktive Fenster.", "window.newWindowDimensions.maximized": "Öffnet neue Fenster maximiert.", "window.newWindowDimensions.fullscreen": "Öffnet neue Fenster im Vollbildmodus.", - "newWindowDimensions": "Steuert die Abmessungen beim Öffnen eines neuen Fensters. Standardmäßig wird in der Mitte des Bildschirms ein neues Fenster mit kleinen Abmessungen geöffnet. Bei der Einstellung \"inherit\" erhält das Fenster die gleichen Abmessungen wie das letzte aktive Fenster. Bei der Einstellung \"maximized\" wird das Fenster maximiert geöffnet, und bei \"fullscreen\" wird es im Vollbildmodus geöffnet.", "window.menuBarVisibility.default": "Das Menü ist nur im Vollbildmodus ausgeblendet.", "window.menuBarVisibility.visible": "Das Menu wird immer angezeigt, auch im Vollbildmodus.", "window.menuBarVisibility.toggle": "Das Menu ist ausgeblendet, kann aber mit der Alt-Taste angezeigt werden.", diff --git a/i18n/deu/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/shell.i18n.json index dd4ad3fcbb9..b225b8a0012 100644 --- a/i18n/deu/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/deu/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "Es wird empfohlen, Code nicht als \"root\" auszuführen.", - "prof.message": "Profile wurden erfolgreich erstellt.", - "prof.detail": "Erstellen Sie ein Problem, und fügen Sie die folgenden Dateien manuell an:\n{0}", - "prof.restartAndFileIssue": "Problem erstellen und neu starten", - "prof.restart": "Neu starten" + "runningAsRoot": "Es wird empfohlen, Code nicht als \"root\" auszuführen." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/electron-browser/window.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/window.i18n.json index 1c580a18212..41496cf43a0 100644 --- a/i18n/deu/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/deu/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "Einfügen", "selectAll": "Alles auswählen", "confirmOpen": "Möchten Sie \"{0}\" Ordner wirklich öffnen?", - "confirmOpenButton": "&&Öffnen", - "developer": "Entwickler", - "file": "Datei" + "confirmOpenButton": "&&Öffnen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..60061e85504 100644 --- a/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "Entwickler: Wichtige Zuordnungen prüfen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index c2e596b3296..11b3d69c656 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "Haltepunkt bearbeiten...", "setValue": "Wert festlegen", "addWatchExpression": "Ausdruck hinzufügen", + "editWatchExpression": "Ausdruck bearbeiten", "addToWatchExpressions": "Zur Überwachung hinzufügen", "removeWatchExpression": "Ausdruck entfernen", "removeAllWatchExpressions": "Alle Ausdrücke entfernen", diff --git a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..e3b17702d86 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "Hintergrundfarbe der Debug-Symbolleiste." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..0506a861bbf --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Zum Öffnen klicken (CMD+KLICKEN für seitliche Anzeige)", + "fileLink": "Zum Öffnen klicken (STRG+KLICKEN für seitliche Anzeige)" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..a4c31f57de4 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "Steuert das Verhalten der internen Debugging-Konsole." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index a145fe55185..dded802b64c 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "Der Objektstatus wird aus der ersten Auswertung erfasst.", - "fileLinkMac": "Zum Öffnen klicken (CMD+KLICKEN für seitliche Anzeige)", - "fileLink": "Zum Öffnen klicken (STRG+KLICKEN für seitliche Anzeige)", "replVariableAriaLabel": "Variable {0} besitzt den Wert {1}, Read Eval Print-Loop, Debuggen", "replExpressionAriaLabel": "Ausdruck {0} besitzt den Wert {1}, Read Eval Print-Loop, Debuggen", "replValueOutputAriaLabel": "{0}, Read Eval Print-Loop, Debuggen", diff --git a/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 213056c17ed..094d1188c24 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "Der Anforderungstyp der Konfiguration. Der Wert kann \"launch\" oder \"attach\" sein.", "debugServer": "Nur für die Entwicklung von Debugerweiterungen: Wenn ein Port angegeben ist, versucht der VS-Code, eine Verbindung mit einem Debugadapter herzustellen, der im Servermodus ausgeführt wird.", "debugPrelaunchTask": "Ein Task, der ausgeführt werden soll, bevor die Debugsitzung beginnt.", - "internalConsoleOptions": "Steuert das Verhalten der internen Debugging-Konsole.", "debugWindowsConfiguration": "Windows-spezifische Startkonfigurationsattribute.", "debugOSXConfiguration": "OS X-spezifische Startkonfigurationsattribute.", "debugLinuxConfiguration": "Linux-spezifische Startkonfigurationsattribute.", diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..e0afee42485 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: Ausgleichen (einwärts)", + "balanceOutward": "Emmet: Ausgleichen (auswärts)" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..35ffc123f14 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: Vorheriger Bearbeitungspunkt", + "nextEditPoint": "Emmet: Nächster Bearbeitungspunkt" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..a3f778d565a --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: Mathematischen Ausdruck auswerten" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..278d10a21dc --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: Abkürzung erweitern" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..2aab3f2af7c --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: Um 0,1 inkrementieren", + "incrementNumberByOne": "Emmet: Um 1 inkrementieren", + "incrementNumberByTen": "Emmet: Um 10 inkrementieren", + "decrementNumberByOneTenth": "Emmet: Um 0,1 dekrementieren", + "decrementNumberByOne": "Emmet: Um 1 dekrementieren", + "decrementNumberByTen": "Emmet: Um 10 dekrementieren" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..158b074c05b --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: Gehe zu übereinstimmendem Paar" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..e6f2b3e1ba7 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: Zeilen mergen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..1569d015669 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: CSS-Wert reflektieren" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..bb2a97fd42e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: Tag entfernen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..0ddd0df478e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: Vorheriges Element auswählen", + "selectNextItem": "Emmet: Nächstes Element auswählen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..a214ce3766a --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: Tag teilen/verknüpfen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..118d88c7df8 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: Kommentar umschalten" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..b682f5d97c3 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: Bildgröße aktualisieren" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..bba2b0b703e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: Tag aktualisieren", + "enterTag": "Tag eingeben", + "tag": "Tag" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..45013796dd3 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: Mit Abkürzung umschließen", + "enterAbbreviation": "Abkürzung eingeben", + "abbreviation": "Abkürzung" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..5beaa142e9f --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Wenn aktiviert, werden Emmet-Abkürzungen beim Drücken der TAB-TASTE erweitert.", + "emmetPreferences": "Einstellungen, die zum Ändern des Verhaltens einiger Aktionen und Konfliktlöser von Emmet verwendet werden.", + "emmetSyntaxProfiles": "Definieren Sie das Profil für die angegebene Syntax, oder verwenden Sie Ihr eigenes Profil mit bestimmten Regeln.", + "emmetExclude": "Ein Array von Sprachen, in dem Emmet-Abkürzungen nicht erweitert werden sollen.", + "emmetExtensionsPath": "Pfad zu einem Ordner mit Emmet-Profilen, Ausschnitten und Voreinstellungen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 83d8c9273d1..88f9247b746 100644 --- a/i18n/deu/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "Trägt eine benutzerdefinierte Ansicht bei", + "vscode.extension.contributes.view.id": "Eindeutige ID zum Identifizieren der über vscode.workspace.createTreeView erstellten Ansicht", + "vscode.extension.contributes.view.label": "Visuell lesbare Zeichenfolge zum Rendern der Ansicht", + "vscode.extension.contributes.view.icon": "Pfad zum Ansichtssymbol", + "vscode.extension.contributes.views": "Trägt benutzerdefinierte Ansichten bei", "showViewlet": "{0} anzeigen", "view": "Anzeigen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 66aee761ca9..c893534d59c 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -15,7 +15,7 @@ "changelog": "ChangeLog", "dependencies": "Abhängigkeiten", "noReadme": "Keine INFODATEI verfügbar.", - "noChangelog": "Es ist kein Änderungsprotokoll verfügbar.", + "noChangelog": "Es ist kein ChangeLog verfügbar.", "noContributions": "Keine Beiträge", "noDependencies": "Keine Abhängigkeiten", "settings": "Einstellungen ({0})", diff --git a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index d87f46daa42..3fc196fe64e 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,7 +22,7 @@ "disableGloballyAction": "Immer", "disableAction": "Deaktivieren", "checkForUpdates": "Nach Updates suchen", - "updateAll": "Alle Extensions aktualisieren", + "updateAll": "Alle Erweiterungen aktualisieren", "reloadAction": "Neu starten", "postUpdateTooltip": "Zum Aktualisieren erneut laden", "postUpdateMessage": "Dieses Fenster erneut laden, um die aktualisierte Erweiterung \"{0}\" zu aktivieren?", @@ -33,15 +33,15 @@ "postUninstallTooltip": "Zum Deaktivieren erneut laden", "postUninstallMessage": "Dieses Fenster erneut laden, um die deinstallierte Erweiterung \"{0}\" zu deaktivieren?", "reload": "Fenster &&erneut laden", - "toggleExtensionsViewlet": "Extensions anzeigen", - "installExtensions": "Extensions installieren", - "showInstalledExtensions": "Installierte Extensions anzeigen", + "toggleExtensionsViewlet": "Erweiterungen anzeigen", + "installExtensions": "Erweiterungen installieren", + "showInstalledExtensions": "Installierte Erweiterungen anzeigen", "showDisabledExtensions": "Deaktivierte Erweiterungen anzeigen", "clearExtensionsInput": "Extensioneingabe löschen", - "showOutdatedExtensions": "Veraltete Extensions anzeigen", - "showPopularExtensions": "Beliebte Extensions anzeigen", - "showRecommendedExtensions": "Empfohlene Extensions anzeigen", - "showWorkspaceRecommendedExtensions": "Für den Arbeitsbereich empfohlene Extensions anzeigen", + "showOutdatedExtensions": "Veraltete Erweiterungen anzeigen", + "showPopularExtensions": "Beliebte Erweiterungen anzeigen", + "showRecommendedExtensions": "Empfohlene Erweiterungen anzeigen", + "showWorkspaceRecommendedExtensions": "Für den Arbeitsbereich empfohlene Erweiterungen anzeigen", "showRecommendedKeymapExtensions": "Empfohlene Tastenzuordnungen anzeigen", "showRecommendedKeymapExtensionsShort": "Tastenzuordnungen", "configureWorkspaceRecommendedExtensions": "Empfohlene Erweiterungen konfigurieren (Arbeitsbereich)", diff --git a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json index e5f434b98b2..6772e6da405 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "manage": "Drücken Sie die EINGABETASTE, um Ihre Extensions zu verwalten.", + "manage": "Drücken Sie die EINGABETASTE, um Ihre Erweiterungen zu verwalten.", "searchFor": "Drücken Sie die EINGABETASTE, um nach \"{0}\" in Marketplace zu suchen.", - "noExtensionsToInstall": "Geben Sie einen Extensionnamen ein." + "noExtensionsToInstall": "Geben Sie einen Erweiterungsnamen ein." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json index d2cb0550504..0e1519f5cd4 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "extensionsInputName": "Extension: {0}" + "extensionsInputName": "Erweiterung: {0}" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index e734318d0be..b580aff8fbe 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,9 @@ "showRecommendations": "Empfehlungen anzeigen", "neverShowAgain": "Nicht mehr anzeigen", "close": "Schließen", - "workspaceRecommended": "Für diesen Arbeitsbereich sind Extensionempfehlungen verfügbar." + "workspaceRecommended": "Für diesen Arbeitsbereich sind Erweiterungsempfehlungen verfügbar.", + "ignoreExtensionRecommendations": "Möchten Sie alle Erweiterungsempfehlungen ignorieren?", + "ignoreAll": "Ja, alles ignorieren", + "no": "Nein", + "cancel": "Abbrechen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index b2acacf886c..952bcc59803 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -4,11 +4,12 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "extensionsCommands": "Extensions verwalten", - "galleryExtensionsCommands": "Katalogextensions installieren", - "extension": "Extension", + "extensionsCommands": "Erweiterungen verwalten", + "galleryExtensionsCommands": "Katalogerweiterungen installieren", + "extension": "Erweiterung", "extensions": "Extensions", "view": "Anzeigen", "extensionsConfigurationTitle": "Extensions", - "extensionsAutoUpdate": "Extensions automatisch aktualisieren" + "extensionsAutoUpdate": "Erweiterungen automatisch aktualisieren", + "extensionsIgnoreRecommendations": "Erweiterungsempfehlungen ignorieren" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json index b323c51e402..56a40560962 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openExtensionsFolder": "Extensionordner öffnen", + "openExtensionsFolder": "Erweiterungsordner öffnen", "installVSIX": "Aus VSIX installieren...", "InstallVSIXAction.success": "Die Erweiterung wurde erfolgreich installiert. Führen Sie einen Neustart aus, um sie zu aktivieren.", "InstallVSIXAction.reloadNow": "Jetzt erneut laden" diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..4769dc3fe1e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "Ja", + "no": "Nein", + "uninstall": "Deinstallieren", + "later": "Später" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json index ae64fcc4f47..154eb0da6ad 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "searchExtensions": "Nach Extensions in Marketplace suchen", + "searchExtensions": "Nach Erweiterungen im Marketplace suchen", "extensions": "Extensions", "sort by installs": "Sortieren nach: Installationsanzahl", "sort by rating": "Sortieren nach: Bewertung", "sort by name": "Sortieren nach: Name", "no extensions found": "Es wurden keine Erweiterungen gefunden.", "suggestProxyError": "Marketplace hat \"ECONNREFUSED\" zurückgegeben. Überprüfen Sie die Einstellung \"http.proxy\".", - "outdatedExtensions": "{0} veraltete Extensions" + "outdatedExtensions": "{0} veraltete Erweiterungen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 6613fe557a2..8153f54254b 100644 --- a/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "Konfigurieren Sie Dateizuordnungen zu Sprachen (beispielsweise \"*.extension\": \"html\"). Diese besitzen Vorrang vor den Standardzuordnungen der installierten Sprachen.", "encoding": "Die Standardzeichensatz-Codierung, die beim Lesen und Schreiben von Dateien verwendet werden soll.", "autoGuessEncoding": "Ist diese Option aktiviert, wird beim Öffnen von Dateien versucht, die Zeichensatzcodierung automatisch zu ermitteln.", - "eol": "Das Zeilenende-Standardzeichen.", "trimTrailingWhitespace": "Bei Aktivierung werden nachgestellte Leerzeichen beim Speichern einer Datei gekürzt.", "insertFinalNewline": "Bei Aktivierung wird beim Speichern einer Datei eine abschließende neue Zeile am Dateiende eingefügt.", "files.autoSave.off": "Eine geänderte Datei wird nie automatisch gespeichert.", @@ -27,8 +26,6 @@ "autoSaveDelay": "Steuert die Verzögerung in Millisekunden, nach der eine geänderte Datei automatisch gespeichert wird. Nur gültig, wenn \"files.autoSave\" auf \"{0}\" festgelegt ist.", "watcherExclude": "Konfigurieren Sie Globmuster von Dateipfaden, die aus der Dateiüberwachung ausgeschlossen werden sollen. Das Ändern dieser Einstellung erfordert einen Neustart. Wenn Ihr Code beim Starten viel CPU-Zeit benötigt, können Sie große Ordner ausschließen, um die Anfangslast zu verringern.", "hotExit.off": "Hot Exit deaktivieren.", - "hotExit.onExit": "Hot Exit wird beim Schließen der Anwendung ausgelöst, d. h. wenn unter Windows/Linux das letzte Fenster geschlossen wird oder wenn der Befehl \"workbench.action.quit\" ausgelöst wird (Befehlspalette, Tastenzuordnung, Menü). Alle Fenster mit Sicherungen werden beim nächsten Start wiederhergestellt.", - "hotExit.onExitAndWindowClose": "Hot Exit wird beim Schließen der Anwendung ausgelöst, d. h. wenn unter Windows/Linux das letzte Fenster geschlossen wird oder wenn der Befehl \"workbench.action.quit\" ausgelöst wird (Befehlspalette, Tastenzuordnung, Menü) sowie für jedes Fenster mit einem geöffneten Ordner, unabhängig davon, ob dies das letzte Fenster ist. Alle Fenster ohne geöffnete Ordner werden beim nächsten Start wiederhergestellt. Legen Sie \"window.reopenFolders\" auf \"all\" fest, damit die Ordnerfenster wie vor dem Heruntergefahren wiederhergestellt werden.", "hotExit": "Steuert, ob nicht gespeicherten Dateien zwischen den Sitzungen beibehlten werden, die Aufforderung zum Speichern wird beim Beenden des Editors übersprungen.", "defaultLanguage": "Der Standardsprachmodus, der neuen Dateien zugewiesen wird.", "editorConfigurationTitle": "Editor", diff --git a/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 96d83227f67..687359bd486 100644 --- a/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "Langsamer Start erkannt", - "slow.detail": "Es tut uns leid, dass Ihr Start so langsam war. Starten Sie \"{0}\" mit aktivierter Profilerstellung neu, geben Sie die Profile für uns frei, und wir tun unser Bestes, damit der Start bald wieder perfekt funktioniert." + "slow.detail": "Es tut uns leid, dass Ihr Start so langsam war. Starten Sie \"{0}\" mit aktivierter Profilerstellung neu, geben Sie die Profile für uns frei, und wir tun unser Bestes, damit der Start bald wieder perfekt funktioniert.", + "prof.message": "Profile wurden erfolgreich erstellt.", + "prof.detail": "Erstellen Sie ein Problem, und fügen Sie die folgenden Dateien manuell an:\n{0}", + "prof.restartAndFileIssue": "Problem erstellen und neu starten", + "prof.restart": "Neu starten" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index b3f77a860db..157325389a5 100644 --- a/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "Benutzereinstellungen öffnen", "openGlobalKeybindings": "Tastaturkurzbefehle öffnen", + "openGlobalKeybindingsFile": "Datei mit Tastaturkurzbefehlen öffnen", "openWorkspaceSettings": "Arbeitsbereichseinstellungen öffnen", "configureLanguageBasedSettings": "Sprachspezifische Einstellungen konfigurieren...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index c15dc7a27b9..e7724dc5035 100644 --- a/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "{0} Übereinstimmungen gefunden", "searchMatch": "{0} Übereinstimmung gefunden", - "fileMatchAriaLabel": "{0} Übereinstimmungen in der Datei \"{1}\" des Ordners \"{2}\", Suchergebnis", - "replacePreviewResultAria": "Vorschauergebnis ersetzen, {0}", - "searchResultAria": "{0}, Suchergebnis" + "fileMatchAriaLabel": "{0} Übereinstimmungen in der Datei \"{1}\" des Ordners \"{2}\", Suchergebnis" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 272bcf769ea..5c23eff8b3c 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Name einer neu zu startenden Aufgabe eingeben", "noTasksMatching": "Keine übereinstimmenden Aufgaben", "noTasksFound": "Keine neu zu startenden Aufgaben gefunden." diff --git a/i18n/deu/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 7add7130d90..6a58cd9cf4c 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Geben Sie den Namen des auszuführenden Tasks ein.", "noTasksMatching": "Keine übereinstimmenden Tasks", "noTasksFound": "Es wurden keine Tasks gefunden." diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 5eb77bdab0b..aedbe077c16 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Taskausführung auswählen", "ConfigureTaskRunnerAction.autoDetecting": "Tasks für {0} werden automatisch erkannt.", "ConfigureTaskRunnerAction.autoDetect": "Fehler bei der automatischen Erkennung des Tasksystems. Die Standardvorlage wird verwendet. Einzelheiten finden Sie in der Taskausgabe.", + "ConfigureTaskRunnerAction.autoDetectError": "Bei der automatischen Erkennung des Tasksystems sind Fehler aufgetreten. Einzelheiten finden Sie in der Taskausgabe.", "ConfigureTaskRunnerAction.failed": "Die Datei \"tasks.json\" kann nicht im Ordner \".vscode\" erstellt werden. Einzelheiten finden Sie in der Taskausgabe.", "ConfigureTaskRunnerAction.label": "Taskausführung konfigurieren", "ConfigureBuildTaskAction.label": "Buildtask konfigurieren", @@ -17,7 +18,6 @@ "problems": "Probleme", "manyMarkers": "mehr als 99", "tasks": "Aufgaben", - "TaskSystem.noHotSwap": "Zum Ändern des Aufgabenausführungsmoduls muss VS Code neu gestartet werden. Die Änderung wird ignoriert.", "TaskService.noBuildTask": "Keine Buildaufgabe definiert. Markieren Sie eine Aufgabe mit 'isBuildCommand' in der tasks.json-Datei.", "TaskService.noTestTask": "Keine Testaufgabe definiert. Markieren Sie eine Aufgabe mit 'isTestCommand' in der tasks.json-Datei.", "TaskServer.noTask": "Die angeforderte auszuführende Aufgabe {0} wurde nicht gefunden.", diff --git a/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index f973ef7e798..cc616e88ee2 100644 --- a/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,13 @@ { "selectTheme.label": "Farbdesign", "installColorThemes": "Zusätzliche Farbschemas installieren...", - "problemChangingTheme": "Problem beim Festlegen des Designs: {0}", - "themes.selectTheme": "Farbdesign auswählen", "selectIconTheme.label": "Dateisymboldesign", "installIconThemes": "Zusätzliche Dateisymbolschemas installieren...", "noIconThemeLabel": "Keine", "noIconThemeDesc": "Dateisymbole deaktivieren", "problemChangingIconTheme": "Problem beim Festlegen des Symboldesigns: {0}", "themes.selectIconTheme": "Dateisymboldesign auswählen", + "generateColorTheme.label": "Farbdesign aus aktuellen Einstellungen erstellen", "preferences": "Einstellungen", "developer": "Entwickler" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 96b687256c6..b167d91d677 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "welcomePage.vscode": "Visual Studio-Code", + "welcomePage.vscode": "Visual Studio Code", "welcomePage.editingEvolved": "Fortschrittliche Bearbeitung", "welcomePage.start": "Starten", "welcomePage.newFile": "Neue Datei", @@ -13,31 +13,25 @@ "welcomePage.recent": "Zuletzt verwendet", "welcomePage.noRecentFolders": "Keine kürzlich verwendeten Ordner", "welcomePage.help": "Hilfe", - "welcomePage.productDocumentation": "Produktdokumentation", "welcomePage.introductoryVideos": "Einführungsvideos", + "welcomePage.productDocumentation": "Produktdokumentation", "welcomePage.gitHubRepository": "GitHub-Repository", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Willkommensseite beim Start anzeigen", - "welcomePage.quickLinks": "Direktlinks", - "welcomePage.interactivePlayground": "Interaktiver Playground", - "welcomePage.interactivePlaygroundDescription": "Testen Sie die wichtigsten Editorfunktionen in einer kurzen exemplarischen Vorgehensweise.", - "welcomePage.interfaceOverview": "Überblick über die Schnittstelle", - "welcomePage.interfaceOverviewDescription": "Erhalten Sie eine visuelle Überlagerung, die die wichtigsten Komponenten der Benutzeroberfläche hervorhebt.", + "welcomePage.customize": "Anpassen", + "welcomePage.installKeymapDescription": "Tastenkombinationen installieren", + "welcomePage.others": "Andere", "welcomePage.colorTheme": "Farbdesign", "welcomePage.colorThemeDescription": "Passen Sie das Aussehen des Editors und Ihres Codes an Ihre Wünsche an.", - "welcomePage.keybindingsReference": "Referenz für Tastenkombinationen", - "welcomePage.keybindingsReferenceDescription": "Eine druckbare PDF mit den wichtigsten Tastenkombinationen", "welcomePage.showCommands": "Alle Befehle suchen und ausführen", "welcomePage.showCommandsDescription": "Über die Einstellungen ({0}) können Sie Befehle schnell suchen und darauf zugreifen.", + "welcomePage.interfaceOverview": "Überblick über die Schnittstelle", + "welcomePage.interfaceOverviewDescription": "Erhalten Sie eine visuelle Überlagerung, die die wichtigsten Komponenten der Benutzeroberfläche hervorhebt.", + "welcomePage.interactivePlayground": "Interaktiver Playground", + "welcomePage.interactivePlaygroundDescription": "Testen Sie die wichtigsten Editorfunktionen in einer kurzen exemplarischen Vorgehensweise.", + "welcomePage.quickLinks": "Direktlinks", + "welcomePage.keybindingsReference": "Referenz für Tastenkombinationen", + "welcomePage.keybindingsReferenceDescription": "Eine druckbare PDF mit den wichtigsten Tastenkombinationen", "welcomePage.configureSettings": "Einstellungen konfigurieren", - "welcomePage.configureSettingsDescription": "Optimieren Sie die Einstellungen, um VS Code bestmöglich zu nutzen.", - "welcomePage.installKeymapDescription": "Tastenkombinationen installieren", - "welcomePage.installKeymap": "Installieren Sie die Tastenkombinationen von {0} {1}, {2} und {3}.", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (aktuell)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (aktuell)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (aktuell)", - "welcomePage.others": "Andere" + "welcomePage.configureSettingsDescription": "Optimieren Sie die Einstellungen, um VS Code bestmöglich zu nutzen." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index ce4f274eb90..5693a1f5b13 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,16 @@ // Do not edit this file. It is machine generated. { "welcomePage": "Willkommen", - "welcome.title": "Willkommen", + "welcomePage.typeScript": "TypeScript", + "welcomePage.php": "PHP", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "Die {0} Tastenkombinationen sind bereits installiert.", "welcomePage.willReloadAfterInstallingKeymap": "Das Fenster wird nach der Installation der {0}-Tastaturbefehle neu geladen.", - "ok": "OK", "welcomePage.installingKeymap": "Die {0}-Tastenkombinationen werden installiert...", "welcomePage.keymapNotFound": "Die {0} Tastenkombinationen mit der ID {1} wurden nicht gefunden.", + "welcome.title": "Willkommen", + "ok": "OK", "cancel": "Abbrechen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 72f63890999..197be5e3800 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "Ungebunden" + "walkThrough.unboundCommand": "Ungebunden", + "walkThrough.gitNotFound": "Git scheint auf Ihrem System nicht installiert zu sein." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 58ed1dbea5c..0c8e653b4e5 100644 --- a/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "Einstellungen öffnen", + "close": "Schließen", "errorUnknownKey": "Die Konfigurationsdatei kann nicht geschrieben werden (unbekannter Schlüssel).", - "errorInvalidTarget": "In die Konfigurationsdatei kann nicht geschrieben werden (ungültiges Ziel).", - "errorNoWorkspaceOpened": "Einstellungen können nicht geschrieben werden, weil kein Ordner geöffnet ist. Öffnen Sie zuerst einen Ordner, und versuchen Sie es erneut.", - "errorInvalidConfiguration": "Einstellungen können nicht geschrieben werden. Öffnen Sie **Benutzereinstellungen**, um Fehler/Warnungen in der Datei zu korrigieren, und versuchen Sie es erneut.", - "errorInvalidConfigurationWorkspace": "Einstellungen können nicht geschrieben werden. Öffnen Sie **Arbeitsbereichseinstellungen**, um Fehler/Warnungen in der Datei zu korrigieren, und versuchen Sie es erneut.", - "errorConfigurationFileDirty": "Einstellungen können nicht geschrieben werden, weil die Datei geändert wurde. Speichern Sie die Datei **Benutzereinstellungen\", und versuchen Sie es erneut.", - "errorConfigurationFileDirtyWorkspace": "Einstellungen können nicht geschrieben werden, weil die Datei geändert wurde. Speichern Sie die Datei **Arbeitsbereichseinstellungen\", und versuchen Sie es erneut." + "errorInvalidTarget": "In die Konfigurationsdatei kann nicht geschrieben werden (ungültiges Ziel)." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/deu/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 96626f238f8..2bf19b5b050 100644 --- a/i18n/deu/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/deu/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Der Windows-spezifische Schlüssel oder die Schlüsselsequenz.", "vscode.extension.contributes.keybindings.when": "Die Bedingung, wann der Schlüssel aktiv ist.", "vscode.extension.contributes.keybindings": "Trägt Tastenbindungen bei.", - "openDocumentation": "Weitere Informationen", - "keybindingMigration.ok": "OK", - "keybindingMigration.prompt": "Für Ihr Tastaturlayout haben sich einige Tastenkombinationen geändert.", "invalid.keybindings": "Ungültige Angabe \"contributes.{0}\": {1}", "unboundCommands": "Die folgenden weiteren Befehle sind verfügbar: ", "keybindings.json.title": "Tastenbindungskonfiguration", diff --git a/i18n/deu/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/deu/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index 125841ae856..132f19f4c7b 100644 --- a/i18n/deu/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/deu/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "Farben für die Syntaxhervorhebung", "schema.properties.name": "Beschreibung der Regel", - "schema.fontStyle": "Schriftschnitt der Regel: kursiv, fett und unterstrichen (einzeln oder in Kombination)" + "schema.fontStyle": "Schriftschnitt der Regel: kursiv, fett und unterstrichen (einzeln oder in Kombination)", + "schema.tokenColors.path": "Pfad zu einer tmTheme-Designdatei (relativ zur aktuellen Datei)" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/deu/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index ef53547d993..2d04a1d985b 100644 --- a/i18n/deu/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/deu/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "Probleme beim Analysieren der JSON-Designdatei: {0}" + "error.cannotparsejson": "Probleme beim Analysieren der JSON-Designdatei: {0}", + "error.invalidformat.colors": "Probleme beim Analysieren der Farbdesigndatei: {0}. Die Eigenschaft \"colors\" ist nicht vom Typ \"object\".", + "error.invalidformat.tokenColors": "Probleme beim Analysieren der Farbdesigndatei: {0}. Die Eigenschaft \"tokenColors\" muss entweder ein Array sein, das Farben angibt, oder ein Pfad zu einer TextMate-Designdatei.", + "error.plist.invalidformat": "Probleme beim Analysieren der tmTheme-Designdatei: {0}. \"settings\" ist kein Array", + "error.cannotparse": "Probleme beim Analysieren der tmTheme-Designdatei: {0}", + "error.cannotload": "Probleme beim Laden der tmTheme-Designdatei {0}: {1}" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/deu/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index e0608f31971..f9fa891eed3 100644 --- a/i18n/deu/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/deu/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "Überschreibt Farben aus dem derzeit ausgewählte Farbdesign.", + "workbenchColors.deprecated": "Diese Einstellung ist nicht mehr experimentell und wurde in \"workbench.colorCustomizations\" umbenannt.", + "workbenchColors.deprecatedDescription": "Verwenden Sie stattdessen \"workbench.colorCustomizations\"." } \ No newline at end of file diff --git a/i18n/esn/extensions/git/out/commands.i18n.json b/i18n/esn/extensions/git/out/commands.i18n.json index c27d7b65351..6ace96fe6d2 100644 --- a/i18n/esn/extensions/git/out/commands.i18n.json +++ b/i18n/esn/extensions/git/out/commands.i18n.json @@ -16,11 +16,19 @@ "confirm discard": "¿Está seguro de que quiere descartar los cambios de {0}?", "confirm discard multiple": "¿Está seguro de que quiere descartar los cambios de {0} archivos?", "discard": "Descartar cambios", + "confirm discard all": "¿Está seguro de que quiere descartar TODOS los cambios? Esta acción es irreversible.", + "discardAll": "Descartar cambios", + "no staged changes": "No hay elementos almacenados provisionalmente.\n\n¿Desea almacenar de forma provisional todos sus cambios y confirmarlos directamente?", + "yes": "Sí", + "always": "Siempre", "no changes": "No hay cambios para confirmar.", "commit message": "Mensaje de confirmación", "provide commit message": "Proporcione un mensaje de confirmación", "branch name": "Nombre de rama", "provide branch name": "Especifique un nombre para la rama", + "select branch to delete": "Seleccione una rama para borrar", + "confirm force delete branch": "La rama '{0}' no está completamente fusionada. ¿Borrarla de todas formas?", + "delete branch": "Borrar rama...", "no remotes to pull": "El repositorio no tiene remotos configurados de los que extraer.", "no remotes to push": "El repositorio no tiene remotos configurados en los que insertar.", "nobranch": "Extraiga del repositorio una rama para insertar un remoto.", @@ -31,6 +39,7 @@ "no remotes to publish": "El repositorio no tiene remotos configurados en los que publicar.", "disabled": "GIT está deshabilitado o no se admite en esta área de trabajo", "clean repo": "Limpie el árbol de trabajo del repositorio antes de la desprotección.", + "cant push": " No puede ejecutar la solicitud de inserción remotamente. Solicite un Pull para integrar los cambios.", "git error details": "GIT: {0}", "git error": "Error de GIT", "open git log": "Abrir registro de GIT" diff --git a/i18n/esn/extensions/git/package.i18n.json b/i18n/esn/extensions/git/package.i18n.json index 4e347b85640..afda046fe5a 100644 --- a/i18n/esn/extensions/git/package.i18n.json +++ b/i18n/esn/extensions/git/package.i18n.json @@ -26,6 +26,7 @@ "command.undoCommit": "Deshacer última confirmación", "command.checkout": "Desproteger en...", "command.branch": "Crear rama...", + "command.deleteBranch": "Borrar rama...", "command.pull": "Incorporación de cambios", "command.pullRebase": "Incorporación de cambios (fusionar mediante cambio de base)", "command.push": "Insertar", @@ -39,6 +40,10 @@ "config.autofetch": "Si la búsqueda automática está habilitada", "config.enableLongCommitWarning": "Si se debe advertir sobre los mensajes de confirmación largos", "config.confirmSync": "Confirmar antes de sincronizar repositorios GIT", + "config.countBadge": "Controla el contador de insignia de Git. \"Todo\" cuenta todos los cambios. \"Seguimiento\" solamente cuenta los cambios realizados. \"Desactivado\" lo desconecta.", + "config.checkoutType": "Controla el tipo de ramas listadas cuando ejecuta \"Desproteger\". \"Todo\" muetra todas las referencias, \"local\" solamente las ramas locales y \"remoto\" las ramas remotas.", "config.ignoreLegacyWarning": "Ignora las advertencias hereradas de Git", - "config.ignoreLimitWarning": "\nIgnora advertencias cuando se encuentran muchos cambios en un repositorio." + "config.ignoreLimitWarning": "\nIgnora advertencias cuando se encuentran muchos cambios en un repositorio.", + "config.defaultCloneDirectory": "La ubicación predeterminada en la que se clona un repositorio git", + "config.enableSmartCommit": "Confirmar todos los cambios cuando no hay elementos almacenados provisionalmente." } \ No newline at end of file diff --git a/i18n/esn/extensions/gulp/package.i18n.json b/i18n/esn/extensions/gulp/package.i18n.json index 8b6ad71cd4e..b8595f4e95f 100644 --- a/i18n/esn/extensions/gulp/package.i18n.json +++ b/i18n/esn/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Controla si la detección automática de tareas Gulp esta activada/desactivada. El valor predeterminado es \"activada\"." +} \ No newline at end of file diff --git a/i18n/esn/extensions/jake/out/main.i18n.json b/i18n/esn/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..1b387f27070 --- /dev/null +++ b/i18n/esn/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "La detección automática de Jake falló con el error: {0}" +} \ No newline at end of file diff --git a/i18n/esn/extensions/jake/package.i18n.json b/i18n/esn/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..c22d4c52c92 --- /dev/null +++ b/i18n/esn/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.jake.autoDetect": "Controla si la detección automática de tareas Jake estan activada/desactivada. El valor predeterminado es \"activada\"." +} \ No newline at end of file diff --git a/i18n/esn/extensions/markdown/out/extension.i18n.json b/i18n/esn/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..360f0b974b7 --- /dev/null +++ b/i18n/esn/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "onPreviewStyleLoadError": "No se pudo cargar 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..22ca13053b5 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +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. +{ + "acceptCurrentChange": "Aceptar cambio actual", + "acceptIncomingChange": "Aceptar cambio entrante", + "acceptBothChanges": "Aceptar ambos cambios", + "compareChanges": "Comparar cambios" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..eb8028b1717 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "El cursor de edición no se encuentra en un conflicto de fusión", + "compareChangesTitle": "{0}: Cambios actuales \\u2194 Cambios entrantes", + "cursorOnSplitterRange": "El cursor del editor está dentro del separador de conflictos de fusión, muévalo al bloque \"actual\" o al \"entrante\" ", + "noConflicts": "No se encontraron conflictos en este archivo", + "noOtherConflictsInThisFile": "No hay más conflictos en este archivo" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..9cf24c3ecc5 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "(Cambio actual)", + "incomingChange": "(Cambio entrante)" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/package.i18n.json b/i18n/esn/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..880711d45ac --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Fusionar conflicto", + "command.accept.all-incoming": "Aceptar todos los entrantes", + "command.accept.all-both": "Aceptar todos ambos", + "command.accept.current": "Aceptar actual", + "command.accept.incoming": "Aceptar entrante", + "command.accept.selection": "Aceptar selección", + "command.accept.both": "Aceptar ambos", + "command.next": "Siguiente conflicto", + "command.previous": "Conflicto anterior", + "command.compare": "Comparar conflicto actual", + "config.title": "Fusionar conflicto", + "config.codeLensEnabled": "Habilitar/deshabilitar CodeLens de fusionar bloque de conflictos en el editor", + "config.decoratorsEnabled": "Habilitar/deshabilitar decoradores de conflictos de fusión en el editor" +} \ No newline at end of file diff --git a/i18n/esn/extensions/npm/package.i18n.json b/i18n/esn/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..d71e21915da --- /dev/null +++ b/i18n/esn/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.npm.autoDetect": "Controla si la detección automática de scripts npm está activada o desactivada. Por defecto está activada." +} \ No newline at end of file diff --git a/i18n/esn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/esn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..e9580039979 --- /dev/null +++ b/i18n/esn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +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. +{ + "ts-check": "Habilita la verificación semántica en un archivo de JavaScript. Debe estar al principio del archivo.", + "ts-nocheck": "Deshabilita la verificación semántica en un archivo de JavaScript. Debe estar al principio del archivo.", + "ts-ignore": "Suprime los errores @ts-check en la siguiente línea de un archivo. " +} \ No newline at end of file diff --git a/i18n/esn/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/esn/extensions/typescript/out/typescriptServiceClient.i18n.json index 404195c7bb3..dd6d27fed4a 100644 --- a/i18n/esn/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/esn/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "La ruta de acceso {0} no apunta a una instalación válida de tsserver. Se usará la versión de TypeScript del paquete.", "noBundledServerFound": "Otra aplicación (por ejemplo, una herramienta de detección de virus con un comportamiento erróneo) eliminó el tsserver de VSCode. Debe reinstalar VS Code.", "versionNumber.custom": "personalizada", diff --git a/i18n/esn/extensions/typescript/out/utils/logger.i18n.json b/i18n/esn/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/esn/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json index 0d39c772a73..f522401a83d 100644 --- a/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Recuperando cambios en los datos para un mejor rendimiento de TypeScript IntelliSense", + "typesInstallerInitializationFailed.title": "No se pudieron instalar los archivos de lenguaje para las características de lenguaje JavaScript. Asegúrese que NPM está instalado y en su ruta de acceso", "typesInstallerInitializationFailed.moreInformation": "Más información", "typesInstallerInitializationFailed.doNotCheckAgain": "No volver a comprobar", "typesInstallerInitializationFailed.close": "Cerrar" diff --git a/i18n/esn/extensions/typescript/package.i18n.json b/i18n/esn/extensions/typescript/package.i18n.json index 28c86fc6060..4ff6892a0a6 100644 --- a/i18n/esn/extensions/typescript/package.i18n.json +++ b/i18n/esn/extensions/typescript/package.i18n.json @@ -33,11 +33,14 @@ "javascript.validate.enable": "Habilita o deshabilita la validación de JavaScript.", "typescript.goToProjectConfig.title": "Ir a configuración del proyecto", "javascript.goToProjectConfig.title": "Ir a configuración del proyecto", - "typescript.referencesCodeLens.enabled": "Habilita o deshabilita referencias de CodeLens. Requiere TypeScript >= 2.0.6.", + "javascript.referencesCodeLens.enabled": "Habilitar/deshabilitar las referencias de CodeLens en los archivos de JavaScript.", + "typescript.referencesCodeLens.enabled": "Habilitar/deshabilitar las referencias de CodeLens en los archivos de TypeScript. Requiere TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Habilita o deshabilita implementaciones de CodeLens. Requiere TypeScript >= 2.2.0.", - "typescript.openTsServerLog.title": "Abrir archivo de registro del servidor de TS", + "typescript.openTsServerLog.title": "Abrir registro del servidor de TS", + "typescript.restartTsServer": "Reiniciar servidor TS", "typescript.selectTypeScriptVersion.title": "Seleccionar versión de TypeScript", "jsDocCompletion.enabled": "Habilita o deshabilita comentarios automaticos de JSDoc", "javascript.implicitProjectConfig.checkJs": "Habilita/deshabilita la comprobación semántica de los archivos JavaScript. Los archivos jsconfig.json o tsconfig.json reemplazan esta configuración. Se requiere TypeScript >=2.3.1.", - "typescript.check.npmIsInstalled": "Comprueba si NPM esta instalado para recibir adquisiciones automaticas de Typings" + "typescript.check.npmIsInstalled": "Comprueba si NPM esta instalado para recibir adquisiciones automaticas de Typings", + "javascript.nameSuggestions": "Habilitar/deshabilitar nombres únicos de la lista de sugerencias en los archivos de JavaScript. " } \ No newline at end of file diff --git a/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index f7060053115..8029ab0b3bd 100644 --- a/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0} x {1} {2}", "largeImageError": "La imagen es muy grande para mostrar en el editor", - "resourceOpenExternalButton": "Abrir imagen", - "resourceOpenExternalText": "usar programa externo?", "nativeBinaryError": "El archivo no se mostrará en el editor porque es binario, muy grande o usa una codificación de texto no compatible.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/esn/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/esn/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..a9b302bfa97 --- /dev/null +++ b/i18n/esn/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "Símbolo no válido", + "error.invalidNumberFormat": "Formato de número no válido", + "error.propertyNameExpected": "Se esperaba el nombre de la propiedad", + "error.valueExpected": "Se esperaba un valor", + "error.colonExpected": "Se esperaban dos puntos", + "error.commaExpected": "Se esperaba una coma", + "error.closeBraceExpected": "Se esperaba una llave de cierre", + "error.closeBracketExpected": "Se esperaba un corchete de cierre", + "error.endOfFileExpected": "Se esperaba un fin de archivo" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/code/electron-main/menus.i18n.json b/i18n/esn/src/vs/code/electron-main/menus.i18n.json index 5e16ab703c7..44ff7a3f5f1 100644 --- a/i18n/esn/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/esn/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "Ayuda", "miNewWindow": "&&Nueva ventana", "mAbout": "Acerca de {0}", + "mServices": "Servicios", "mHide": "Ocultar {0}", "mHideOthers": "Ocultar otros", "mShowAll": "Mostrar todo", @@ -69,7 +70,7 @@ "miSmartSelectShrink": "&&Reducir selección", "miViewExplorer": "&&Explorador", "miViewSearch": "&&Buscar", - "miViewGit": "&&Git", + "miViewSCM": "S&&CM", "miViewDebug": "&&Depurar", "miViewExtensions": "E&&xtensiones", "miToggleOutput": "&&Salida", @@ -114,6 +115,8 @@ "miGotoSymbolInFile": "Ir al &&símbolo en el archivo...", "miGotoSymbolInWorkspace": "Ir al símbolo en el área de &&trabajo...", "miGotoDefinition": "Ir a &&definición", + "miGotoTypeDefinition": "Ir a la definición de &&Tipo", + "miGotoImplementation": "Ir a la &&Implementación", "miGotoLine": "Ir a la &&línea...", "miStartDebugging": "I&&niciar depuración", "miStartWithoutDebugging": "Iniciar &&sin depurar", @@ -140,6 +143,7 @@ "miAccessibilityOptions": "&&Opciones de accesibilidad", "miReportIssues": "&&Notificar problemas", "miWelcome": "&&Bienvenido", + "miInteractivePlayground": "Ãrea de juegos &&interactiva", "miDocumentation": "&&Documentación", "miReleaseNotes": "&&Notas de la versión", "miKeyboardShortcuts": "&&Referencia de métodos abreviados de teclado", diff --git a/i18n/esn/src/vs/code/electron-main/windows.i18n.json b/i18n/esn/src/vs/code/electron-main/windows.i18n.json index fd891dfad94..80fb2bc32dc 100644 --- a/i18n/esn/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/esn/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "Aceptar", "pathNotExistTitle": "La ruta no existe", "pathNotExistDetail": "Parece que la ruta '{0}' ya no existe en el disco.", - "accessibilityOptionsWindowTitle": "Opciones de accesibilidad", "reopen": "Volver a abrir", "wait": "Siga esperando", "close": "Cerrar", diff --git a/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json index deeb605c6a6..8fe058e55ce 100644 --- a/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Controla el grosor de la fuente.", "fontSize": "Controla el tamaño de fuente en píxeles.", "lineHeight": "Controla la altura de línea. Utilice 0 para calcular el valor de lineHeight a partir de fontSize.", + "letterSpacing": "Controla el espacio entre letras en pixels.", "lineNumbers": "Controla la presentación de los números de línea. Los valores posibles son \"on\", \"off\" y \"relative\". \"relative\" muestra el número de líneas desde la posición actual del cursor.", "rulers": "Columnas en las que mostrar reglas verticales", "wordSeparators": "Caracteres que se usarán como separadores de palabras al realizar operaciones o navegaciones relacionadas con palabras.", @@ -40,7 +41,6 @@ "formatOnType": "Controla si el editor debe dar formato automáticamente a la línea después de escribirla", "formatOnPaste": "Controla si el editor debe formatear automáticamente el contenido pegado. Debe haber disponible un formateador capaz de aplicar formato a un intervalo dentro de un documento.", "suggestOnTriggerCharacters": "Controla si las sugerencias deben aparecer de forma automática al escribir caracteres desencadenadores", - "acceptSuggestionOnEnter": "Controla si las sugerencias deben aceptarse en \"Entrar\" (además de \"TAB\"). Ayuda a evitar la ambigüedad entre insertar nuevas líneas o aceptar sugerencias.", "acceptSuggestionOnCommitCharacter": "Controla si se deben aceptar sugerencias en los caracteres de confirmación. Por ejemplo, en Javascript, el punto y coma (\";\") puede ser un carácter de confirmación que acepta una sugerencia y escribe ese carácter.", "snippetSuggestions": "Controla si se muestran los fragmentos de código con otras sugerencias y cómo se ordenan.", "emptySelectionClipboard": "Controla si al copiar sin selección se copia la línea actual.", @@ -62,6 +62,7 @@ "renderLineHighlight": "Controla cómo el editor debe presentar el resaltado de línea. Las posibilidades son \"ninguno\", \"margen\", \"línea\" y \"todo\".", "codeLens": "Controla si el editor muestra lentes de código", "folding": "Controla si el editor tiene habilitado el plegado de código.", + "showFoldingControls": "Controla cuándo los controles de plegado del margen son ocultados automáticamente.", "matchBrackets": "Resaltar corchetes coincidentes cuando se seleccione uno de ellos.", "glyphMargin": "Controla si el editor debe representar el margen de glifo vertical. El margen de glifo se usa, principalmente, para depuración.", "useTabStops": "La inserción y eliminación del espacio en blanco sigue a las tabulaciones.", diff --git a/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..b1da401aa98 --- /dev/null +++ b/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Contenido del editor" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json index 6c525e9a528..fcdba2ee5ad 100644 --- a/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,11 @@ "caret": "Color del cursor del editor.", "editorWhitespaces": "Color de los caracteres de espacio en blanco del editor.", "editorIndentGuides": "Color de las guías de sangría del editor.", - "editorLineNumbers": "Color de números de línea del editor." + "editorLineNumbers": "Color de números de línea del editor.", + "editorRuler": "Color de las reglas del editor", + "editorCodeLensForeground": "Color principal de lentes de código en el editor", + "editorBracketMatchBackground": "Color de fondo tras corchetes coincidentes", + "editorBracketMatchBorder": "Color de bloques con corchetes coincidentes", + "editorOverviewRulerBorder": "Color del borde de la regla de visión general.", + "editorGutter": "Color de fondo del margen del editor. Este espacio contiene los márgenes de glifos y los números de línea." } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..d9243b76135 --- /dev/null +++ b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "No se encontró ninguna definición para \"{0}\"", + "generic.noResults": "No se encontró ninguna definición", + "meta.title": " – {0} definiciones", + "actions.goToDecl.label": "Ir a definición", + "actions.goToDeclToSide.label": "Abrir definición en el lateral", + "actions.previewDecl.label": "Ver la definición", + "goToImplementation.noResultWord": "No se encontró ninguna implementación para \"{0}\"", + "goToImplementation.generic.noResults": "No se encontró ninguna implementación", + "meta.implementations.title": "{0} implementaciones", + "actions.goToImplementation.label": "Ir a implementación", + "actions.peekImplementation.label": "Inspeccionar implementación", + "goToTypeDefinition.noResultWord": "No se encontró ninguna definición de tipo para \"{0}\"", + "goToTypeDefinition.generic.noResults": "No se encontró ninguna definición de tipo", + "meta.typeDefinitions.title": " – {0} definiciones de tipo", + "actions.goToTypeDefinition.label": "Ir a la definición de tipo", + "actions.peekTypeDefinition.label": "Inspeccionar definición de tipo" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..d35f93e7fae --- /dev/null +++ b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Haga clic para mostrar {0} definiciones." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/esn/src/vs/editor/contrib/hover/browser/hover.i18n.json index 0ed29121cae..c190af1321d 100644 --- a/i18n/esn/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "Mostrar al mantener el puntero", - "hoverHighlight": "Resaltado debajo de la palabra para la que se muestra un recuadro al mantener el puntero.", - "hoverBackground": "Color de fondo al mantener el puntero en el editor.", - "hoverBorder": "Color del borde al mantener el puntero en el editor." + "showHover": "Mostrar al mantener el puntero" } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 9622f6f18de..515c40c0c1d 100644 --- a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "símbolo en {0} linea {1} en la columna {2}", + "aria.fileReferences.1": "1 símbolo en {0}", + "aria.fileReferences.N": "{0} símbolos en {1}", "aria.result.0": "No se encontraron resultados", "aria.result.1": "Encontró 1 símbolo en {0}", "aria.result.n1": "Encontró {0} símbolos en {1}", diff --git a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index 21b8d8ce3d6..1e3309b1cf6 100644 --- a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,11 +16,12 @@ "peekViewTitleInfoForeground": "Color de la información del título de la vista de inspección.", "peekViewBorder": "Color de los bordes y la flecha de la vista de inspección.", "peekViewResultsBackground": "Color de fondo de la lista de resultados de vista de inspección.", - "peekViewResultsMatchForeground": "Buscar coincidencia con el primer plano de entrada de la lista de resultados de vista de inspección.", - "peekViewResultsFileForeground": "Primer plano de la entrada de archivo en la lista de resultados de vista de inspección.", + "peekViewResultsMatchForeground": "Color de primer plano de los nodos de inspección en la lista de resultados.", + "peekViewResultsFileForeground": "Color de primer plano de los archivos de inspección en la lista de resultados.", "peekViewResultsSelectionBackground": "Color de fondo de la entrada seleccionada en la lista de resultados de vista de inspección.", "peekViewResultsSelectionForeground": "Color de primer plano de la entrada seleccionada en la lista de resultados de vista de inspección.", "peekViewEditorBackground": "Color de fondo del editor de vista de inspección.", + "peekViewEditorGutterBackground": "Color de fondo del margen en el editor de vista de inspección.", "peekViewResultsMatchHighlight": "Buscar coincidencia con el color de resaltado de la lista de resultados de vista de inspección.", "peekViewEditorMatchHighlight": "Buscar coincidencia del color de resultado del editor de vista de inspección." } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 92df4e9611f..bf3d8015426 100644 --- a/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,13 @@ { "editorSuggestWidgetBackground": "Color de fondo del widget sugerido.", "editorSuggestWidgetBorder": "Color de borde del widget sugerido.", + "editorSuggestWidgetForeground": "Color de primer plano del widget sugerido.", + "editorSuggestWidgetSelectedBackground": "Color de fondo de la entrada seleccionada del widget sugerido.", + "editorSuggestWidgetHighlightForeground": "Color del resaltado coincidido en el widget sugerido.", "readMore": "Leer más...{0}", "suggestionWithDetailsAriaLabel": "{0}, sugerencia, con detalles", "suggestionAriaLabel": "{0}, sugerencia", - "goback": "Volver", + "readLess": "Leer menos...{0}", "suggestWidget.loading": "Cargando...", "suggestWidget.noSuggestions": "No hay sugerencias.", "suggestionAriaAccepted": "{0}, aceptada", diff --git a/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index df256b0ca88..43ec87cbde1 100644 --- a/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Define los corchetes que aumentan o reducen la sangría.", "schema.autoClosingPairs": "Define el par de corchetes. Cuando se escribe un corchete de apertura, se inserta automáticamente el corchete de cierre.", "schema.autoClosingPairs.notIn": "Define una lista de ámbitos donde los pares automáticos están deshabilitados.", - "schema.surroundingPairs": "Define los pares de corchetes que se pueden usar para encerrar una cadena seleccionada." + "schema.surroundingPairs": "Define los pares de corchetes que se pueden usar para encerrar una cadena seleccionada.", + "schema.wordPattern": " La definición de la palabra en el idioma.", + "schema.wordPattern.pattern": "El patrón de expresión regular utilizado para localizar palabras.", + "schema.wordPattern.flags": "Los flags de expresión regular utilizados para localizar palabras.", + "schema.wordPattern.flags.errorMessage": "Debe coincidir con el patrón `/^([gimuy]+)$/`." } \ No newline at end of file diff --git a/i18n/esn/src/vs/platform/environment/node/argv.i18n.json b/i18n/esn/src/vs/platform/environment/node/argv.i18n.json index 7023f1d6e99..1a1f18154df 100644 --- a/i18n/esn/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/esn/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "Muestra las versiones de las extensiones instaladas cuando se usa --list-extension.", "installExtension": "Instala una extensión.", "uninstallExtension": "Desinstala una extensión.", + "experimentalApis": "Habilita características de API propuestas para una extensión.", "disableExtensions": "Deshabilite todas las extensiones instaladas.", "disableGPU": "Deshabilita la aceleración de hardware de GPU.", "version": "Versión de impresión.", diff --git a/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json index dac52437515..1c9dfefb5cb 100644 --- a/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Error: La propiedad pattern {0} no es un nombre de variable de patrón válido.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un buscador de coincidencias de problemas debe definir tanto un patrón de inicio como un patrón de finalización para la inspección.", "ProblemMatcherParser.invalidRegexp": "Error: La cadena {0} no es una expresión regular válida.\n", - "WatchingPatternSchema.regexp": "Expresión regular para detectar el principio o el final de una tarea de inspección.", + "WatchingPatternSchema.regexp": "Expresión regular para detectar el principio o el final de una tarea en segundo plano.", "WatchingPatternSchema.file": "Ãndice de grupo de coincidencias del nombre de archivo. Se puede omitir.", "PatternTypeSchema.name": "Nombre de un patrón aportado o predefinido", "PatternTypeSchema.description": "Patrón de problema o nombre de un patrón de problema que se ha aportado o predefinido. Se puede omitir si se especifica la base.", @@ -43,10 +43,15 @@ "ProblemMatcherSchema.severity": "Gravedad predeterminada para los problemas de capturas. Se usa si el patrón no define un grupo de coincidencias para \"severity\".", "ProblemMatcherSchema.applyTo": "Controla si un problema notificado en un documento de texto se aplica solamente a los documentos abiertos, cerrados o a todos los documentos.", "ProblemMatcherSchema.fileLocation": "Define cómo deben interpretarse los nombres de archivo notificados en un patrón de problema.", + "ProblemMatcherSchema.background": "Patrones para hacer seguimiento del comienzo y el final en un comprobador activo de la tarea en segundo plano.", + "ProblemMatcherSchema.background.activeOnStart": "Si se establece en True, el monitor está en modo activo cuando la tarea empieza. Esto es equivalente a emitir una línea que coincide con beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Si se encuentran coincidencias en la salida, se señala el inicio de una tarea en segundo plano.", + "ProblemMatcherSchema.background.endsPattern": "Si se encuentran coincidencias en la salida, se señala el fin de una tarea en segundo plano.", + "ProblemMatcherSchema.watching.deprecated": "Esta propiedad está en desuso. Use la propiedad en segundo plano.", + "ProblemMatcherSchema.watching": "Patrones para hacer un seguimiento del comienzo y el final de un patrón de supervisión.", "ProblemMatcherSchema.watching.activeOnStart": "Si se establece en true, el monitor está en modo activo cuando la tarea empieza. Esto es equivalente a emitir una línea que coincide con beginPattern", "ProblemMatcherSchema.watching.beginsPattern": "Si se encuentran coincidencias en la salida, se señala el inicio de una tarea de inspección.", "ProblemMatcherSchema.watching.endsPattern": "Si se encuentran coincidencias en la salida, se señala el fin de una tarea de inspección", - "ProblemMatcherSchema.watching": "Patrones para hacer un seguimiento del comienzo y el final de un patrón de supervisión.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "This property is deprecated. Use the watching property instead.", "LegacyProblemMatcherSchema.watchedBegin": "Expresión regular que señala que una tarea inspeccionada comienza a ejecutarse desencadenada a través de la inspección de archivos.", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "This property is deprecated. Use the watching property instead.", diff --git a/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json index a2b4777b597..889a845a813 100644 --- a/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,75 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "Formato de color no válido. Use #TGB, #RBGA, #RRGGBB o #RRGGBBAA", "schema.colors": "Colores usados en el área de trabajo.", "foreground": "Color de primer plano general. Este color solo se usa si un componente no lo invalida.", + "errorForeground": "Color de primer plano general para los mensajes de erroe. Este color solo se usa si un componente no lo invalida.", + "descriptionForeground": "Color de primer plano para el texto descriptivo que proporciona información adicional, por ejemplo para una etiqueta.", + "focusBorder": "Color de borde de los elementos con foco. Este color solo se usa si un componente no lo invalida.", + "contrastBorder": "Un borde adicional alrededor de los elementos para separarlos unos de otros y así mejorar el contraste.", + "activeContrastBorder": "Un borde adicional alrededor de los elementos activos para separarlos unos de otros y así mejorar el contraste.", + "selectionBackground": "El color de fondo del texto seleccionado en la área de trabajo (por ejemplo, campos de entrada o áreas de texto). Esto no se aplica a las selecciones dentro del editor o el terminal.", + "textSeparatorForeground": "Color para los separadores de texto.", + "textLinkForeground": "Color de primer plano para los vínculos en el texto.", + "textLinkActiveForeground": "Color de primer plano para los vínculos activos en el texto.", + "textPreformatForeground": "Color de primer plano para los segmentos de texto con formato previo.", + "textBlockQuoteBackground": "Color de fondo para los bloques en texto.", + "textBlockQuoteBorder": "Color de borde para los bloques en texto.", + "textCodeBlockBackground": "Color de fondo para los bloques de código en el texto.", + "widgetShadow": "Color de sombra de los widgets dentro del editor, como buscar/reemplazar", "inputBoxBackground": "Fondo de cuadro de entrada.", "inputBoxForeground": "Primer plano de cuadro de entrada.", "inputBoxBorder": "Borde de cuadro de entrada.", "inputBoxActiveOptionBorder": "Color de borde de opciones activadas en campos de entrada.", + "inputPlaceholderForeground": "Color de primer plano para el marcador de posición de texto", + "inputValidationInfoBackground": "Color de fondo de validación de entrada para gravedad de información.", + "inputValidationInfoBorder": "Color de borde de validación de entrada para gravedad de información.", + "inputValidationWarningBackground": "Color de fondo de validación de entrada para advertencia de información.", + "inputValidationWarningBorder": "Color de borde de validación de entrada para gravedad de advertencia.", + "inputValidationErrorBackground": "Color de fondo de validación de entrada para gravedad de error.", + "inputValidationErrorBorder": "Color de borde de valdación de entrada para gravedad de error.", "dropdownBackground": "Fondo de lista desplegable.", "dropdownForeground": "Primer plano de lista desplegable.", "dropdownBorder": "Borde de lista desplegable.", + "listFocusBackground": "Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listFocusForeground": "Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listActiveSelectionBackground": "Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listActiveSelectionForeground": "Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listInactiveSelectionBackground": "Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están inactivos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listInactiveSelectionForeground": "Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol esta inactiva. Una lista o un árbol tiene el foco del teclado cuando está activo, cuando esta inactiva no.", + "listHoverBackground": "Fondo de la lista o el árbol al mantener el mouse sobre los elementos.", + "listHoverForeground": "Color de primer plano de la lista o el árbol al pasar por encima de los elementos con el ratón.", + "listDropBackground": "Fondo de arrastrar y colocar la lista o el árbol al mover los elementos con el mouse.", + "highlight": "Color de primer plano de la lista o el árbol de las coincidencias resaltadas al buscar dentro de la lista o el ábol.", "pickerGroupForeground": "Selector de color rápido para la agrupación de etiquetas.", "pickerGroupBorder": "Selector de color rápido para la agrupación de bordes.", + "buttonForeground": "Color de primer plano del botón.", + "buttonBackground": "Color de fondo del botón.", + "buttonHoverBackground": "Color de fondo del botón al mantener el puntero.", + "badgeBackground": "Color de fondo de la insignia. Las insignias son pequeñas etiquetas de información, por ejemplo los resultados de un número de resultados.", + "badgeForeground": "Color de fondo de la insignia. Las insignias son pequeñas etiquetas de información, por ejemplo los resultados de un número de resultados.", + "scrollbarShadow": "Sombra de la barra de desplazamiento indica que la vista se ha despazado.", + "scrollbarSliderBackground": "Color de fondo del control deslizante.", + "scrollbarSliderHoverBackground": "Color de fondo del control deslizante al mantener el puntero.", + "scrollbarSliderActiveBackground": "Color de fondo del control deslizante cuando está activo.", + "progressBarBackground": "Color de fondo para la barra de progreso que se puede mostrar para las operaciones de larga duración.", "editorBackground": "Color de fondo del editor.", "editorForeground": "Color de primer plano predeterminado del editor.", + "editorWidgetBackground": "Color de fondo del editor de widgets como buscar/reemplazar", + "editorWidgetBorder": "Color de borde del editor de widget.", "editorSelection": "Color de la selección del editor.", "editorInactiveSelection": "Color de la selección en un editor inactivo.", "editorSelectionHighlight": "Color de las regiones con el mismo contenido que la selección.", "editorFindMatch": "Color de la coincidencia de búsqueda actual.", "findMatchHighlight": "Color de las demás coincidencias de búsqueda.", "findRangeHighlight": "Color del intervalo que limita la búsqueda.", + "hoverHighlight": "Resaltado debajo de la palabra para la que se muestra un recuadro al mantener el puntero.", + "hoverBackground": "Color de fondo al mantener el puntero en el editor.", + "hoverBorder": "Color del borde al mantener el puntero en el editor.", "activeLinkForeground": "Color de los vínculos activos.", - "linkForeground": "Color de los vínculos.", - "editorWidgetBackground": "Color de fondo del editor de widgets como buscar/reemplazar" + "diffEditorInserted": "Color de fondo para el texto insertado.", + "diffEditorRemoved": "Color de fondo para el texto quitado.", + "diffEditorInsertedOutline": "Color de contorno para el texto insertado.", + "diffEditorRemovedOutline": "Color de contorno para el texto quitado." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..c8303dca7e8 --- /dev/null +++ b/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "Sobrescribiendo la extensión {0} con {1}.", + "extensionUnderDevelopment": "Cargando la extensión de desarrollo en {0}" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..68632e8f819 --- /dev/null +++ b/i18n/esn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Cerrar", + "cancel": "Cancelar", + "ok": "Aceptar" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/esn/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..7d556561528 --- /dev/null +++ b/i18n/esn/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "No hay registrado ningún TreeExplorerNodeProvider con el identificador \"{0}\".", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider \"{0}\" no pudo proporcionar el nodo raíz." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..1127a4ec4f8 --- /dev/null +++ b/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +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. +{ + "treeView.notRegistered": "No se ha registrado ninga vista del árbol con id '{0}'.", + "treeItem.notFound": "No se encontró ningún item del árbol con id '{0}'.", + "treeView.duplicateElement": "El elemento '{0}' ya está registrado" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/esn/src/vs/workbench/browser/actions/configureLocale.i18n.json index 21745b9eaa0..949ae20646f 100644 --- a/i18n/esn/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,7 @@ "configureLocale": "Configurar idioma", "displayLanguage": "Define el lenguaje para mostrar de VSCode.", "doc": "Consulte {0} para obtener una lista de idiomas compatibles.", - "restart": "Al cambiar el valor, es necesario reiniciar VSCode.", + "restart": "Al cambiar el valor se requiere reiniciar VSCode.", "fail.createSettings": "No se puede crear '{0}' ({1}).", "JsonSchema.locale": "Idioma de la interfaz de usuario que debe usarse." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/esn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 88b1764fba9..c59c8f1f1b3 100644 --- a/i18n/esn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "Abrir el editor recientemente usado anterior en el grupo", "openNextRecentlyUsedEditorInGroup": "Abrir el siguiente editor recientemente usado en el grupo", "navigateEditorHistoryByInput": "Abrir el editor anterior desde el historial", + "openNextRecentlyUsedEditor": "Abrir el siguiente editor recientemente usado", + "openPreviousRecentlyUsedEditor": "Abrir el anterior editor recientemente usado", "clearEditorHistory": "Borrar historial del editor", "focusLastEditorInStack": "Abrir el último editor del grupo", "moveEditorLeft": "Mover el editor a la izquierda", diff --git a/i18n/esn/src/vs/workbench/common/theme.i18n.json b/i18n/esn/src/vs/workbench/common/theme.i18n.json index 9d8d6d091ae..40dfe03ebb6 100644 --- a/i18n/esn/src/vs/workbench/common/theme.i18n.json +++ b/i18n/esn/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "Color de fondo del contenedor de las pestañas. Las pestañas son contenedores de editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores y puede haber varios grupos de editores.", "tabActiveBackground": "Color de fondo de la pestaña activa. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabInactiveBackground": "Color de fondo de la pestaña inactiva. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabBorder": "Borde para separar las pestañas entre sí. Las pestañas son contenedores de editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabActiveEditorGroupActiveForeground": "Color de primer plano de la pestaña activa en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", - "tabActiveEditorGroupInactiveForeground": "Color de primer plano de la pestaña activa en un grupo inactivo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabInactiveEditorGroupActiveForeground": "Color de primer plano de la pestaña inactiva en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", - "tabInactiveEditorGroupInactiveForeground": "Color de primer plano de la pestaña inactiva en un grupo inactivo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", + "editorGroupBackground": "Color de fondo de un grupo de editores. Los grupos de editores son los contenedores de los editores. El color de fondo se ve cuando se mueven arrastrando los grupos de editores.", + "tabsContainerBackground": "Color de fondo del encabezado del título del grupo de editores cuando las fichas están habilitadas. Los grupos de editores son contenedores de editores.", + "editorGroupHeaderBackground": "Color de fondo del encabezado del título del grupo de editores cuando las fichas están deshabilitadas. Los grupos de editores son contenedores de editores.", "editorGroupBorder": "Color para separar varios grupos de editores entre sí. Los grupos de editores son los contenedores de los editores.", - "editorDragAndDropBackground": "Color de fondo cuando se arrastran editores.", + "editorDragAndDropBackground": "Color de fondo cuando se arrastran los editores. El color debería tener transparencia para que el contenido del editor pueda brillar a su través.", "panelBackground": "Color de fondo del panel. Los paneles se muestran debajo del área de editores y contienen vistas, como Salida y Terminal integrado.", "panelBorder": "Color del borde superior del panel que lo separa del editor. Los paneles se muestran debajo del área de editores y contienen vistas, como Salida y Terminal integrado.", "panelActiveTitleForeground": "Color del título del panel activo. Los paneles se muestran debajo del área del editor y contienen vistas como Salida y Terminal integrado.", @@ -24,15 +24,21 @@ "statusBarNoFolderBackground": "Color de fondo de la barra de estado cuando no hay ninguna carpeta abierta. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarItemActiveBackground": "Color de fondo de un elemento de la barra de estado al hacer clic. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarItemHoverBackground": "Color de fondo de un elemento de la barra de estado al mantener el puntero. La barra de estado se muestra en la parte inferior de la ventana.", + "statusBarProminentItemBackground": "Color de fondo de los elementos destacados en la barra de estado. Estos elementos sobresalen para indicar importancia. La barra de estado está ubicada en la parte inferior de la ventana.", + "statusBarProminentItemHoverBackground": "Color de fondo de los elementos destacados en la barra de estado cuando se mantiene el mouse sobre estos elementos. Estos elementos sobresalen para indicar importancia. La barra de estado está ubicada en la parte inferior de la ventana.", "activityBarBackground": "Color de fondo de la barra de actividad, que se muestra en el lado izquierdo o derecho y que permite cambiar entre diferentes vistas de la barra lateral.", "activityBarForeground": "Color de fondo de la barra de actividad (por ejemplo utilizado por los iconos). La barra de actividad muestra en el lado izquierdo o derecho y permite cambiar entre diferentes vistas de la barra lateral.", - "activityBarDragAndDropBackground": "Color de arrastrar y colocar comentarios de la barra de actividad. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre vistas de la barra lateral.", + "activityBarDragAndDropBackground": "Arrastre y suelte el color de las sugerencias para los elementos de la barra de actividad. El color debería tener transparencias, de forma que los elementos de la barra continúen siendo visibles a través de él. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre distintas vistas de la barra lateral.", "activityBarBadgeBackground": "Color de fondo de distintivo de notificación de actividad. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre vistas de la barra lateral.", "activityBarBadgeForeground": "Color de primer plano de distintivo de notificación de actividad. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre vistas de la barra lateral.", "sideBarBackground": "Color de fondo de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", + "sideBarForeground": "Color de primer plano de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", "sideBarTitleForeground": "Color de primer plano del título de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", + "sideBarSectionHeaderBackground": "Color de fondo del encabezado de sección de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", "titleBarActiveForeground": "Color de primer plano de la barra de título cuando la ventana está activa. Tenga en cuenta que, actualmente, este clor solo se admite en macOS.", "titleBarInactiveForeground": "Color de primer plano de la barra de título cuando la ventana está inactiva. Tenga en cuenta que, actualmente, este color solo se admite en macOS.", "titleBarActiveBackground": "Fondo de la barra de título cuando la ventana está activa. Tenga en cuenta que, actualmente, este color solo se admite en macOS.", - "titleBarInactiveBackground": "Color de fondo de la barra de título cuando la ventana está inactiva. Tenga en cuenta que, actualmente, este color solo se admite en macOS." + "titleBarInactiveBackground": "Color de fondo de la barra de título cuando la ventana está inactiva. Tenga en cuenta que, actualmente, este color solo se admite en macOS.", + "notificationsForeground": "Color de primer plano de las notificaciones. Estas se deslizan en la parte superior de la ventana. ", + "notificationsBackground": "Color de fondo de las notificaciones. Estas se deslizan en la parte superior de la ventana. " } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json index 4ebbc371d0d..543d5451907 100644 --- a/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Ver", "help": "Ayuda", "file": "Archivo", + "developer": "Desarrollador", "showEditorTabs": "Controla si los editores abiertos se deben mostrar o no en pestañas.", "editorTabCloseButton": "Controla la posición de los botones de cierre de pestañas del editor o los deshabilita si se establece en \"off\".", "showIcons": "Controla si los editores abiertos deben mostrarse o no con un icono. Requiere que también se habilite un tema de icono.", @@ -41,12 +42,13 @@ "window.newWindowDimensions.inherit": "Abrir las nuevas ventanas con la misma dimensión que la última activa.", "window.newWindowDimensions.maximized": "Abrir las nuevas ventanas maximizadas.", "window.newWindowDimensions.fullscreen": "Abrir las nuevas ventanas en modo de pantalla completa.", - "newWindowDimensions": "Controla las dimensiones de la apertura de una nueva ventana. De manera predeterminada, una nueva ventana se abrirá en el centro de la pantalla con dimensiones reducidas. Si se establece en \"inherit\", la ventana tendrá las mismas dimensiones que la última activa. Si se establece en \"maximized\", la ventana se abrirá en su valor máximo y a pantalla completa si se establece en \"fullscreen\".", + "newWindowDimensions": "Controla las dimensiones de la nueva ventana cuando ya existe alguna ventana abierta. Por defecto, una nueva ventana se abrirá en el centro de la pantalla con dimensiones pequeñas. Cuando se establece como 'heredar', la ventana tomará las dimensiones de la última ventana activa. Cuando se establece a 'maximizar', la ventana se abrirá maximizada, y a pantalla completa si fue configurada como 'pantalla completa'. Tenga en cuenta que esta configuración no afecta a la primera ventana abierta. La primera ventana siempre restaurará el tamaño y posición en la que quedó antes de ser cerrada.", "window.menuBarVisibility.default": "El menú solo está oculto en modo de pantalla completa.", "window.menuBarVisibility.visible": "El menú está siempre visible incluso en modo de pantalla completa.", "window.menuBarVisibility.toggle": "El menú está oculto pero se puede mostrar mediante la tecla Alt.", "window.menuBarVisibility.hidden": "El menú está siempre oculto.", "menuBarVisibility": "Controla la visibilidad de la barra de menús. El valor \"alternar\" significa que la barra de menús está oculta y que se mostrará al presionar una sola vez la tecla Alt. La barra de menús estará visible de forma predeterminada, a menos que se use el modo de pantalla completa para la ventana.", + "enableMenuBarMnemonics": "Si se activa, los menús principales se pueden abrir por mediación de los métodos abreviados Alt-tecla. Desactivar los mnemónicos permite vincular estos métodos Alt-tecla a comandos del editor.", "autoDetectHighContrast": "Si está habilitado, se cambiará automáticamente al tema de contraste alto si Windows utiliza un tema de contraste alto, y al tema oscuro si cambia desde un tema de contraste alto de Windows.", "titleBarStyle": "Ajuste la apariencia de la barra de título de la ventana. Se debe realizar un reinicio completo para aplicar los cambios.", "window.nativeTabs": "Habilita las fichas de ventana en macOS Sierra. Note que los cambios requieren que reinicie el equipo y las fichas nativas deshabilitan cualquier estilo personalizado que haya configurado.", diff --git a/i18n/esn/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/shell.i18n.json index b9f16ccb05c..403b7012cbe 100644 --- a/i18n/esn/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/esn/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "Se recomienda no ejecutar Code como 'root'.", - "prof.message": "Los perfiles se crearon correctamente.", - "prof.detail": "Cree un problema y asóciele manualmente los siguientes archivos: {0}", - "prof.restartAndFileIssue": "Crear problema y reiniciar", - "prof.restart": "Reiniciar" + "runningAsRoot": "Se recomienda no ejecutar Code como 'root'." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/electron-browser/window.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/window.i18n.json index f3b1f414ce3..8622e2e3d7d 100644 --- a/i18n/esn/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/esn/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "Pegar", "selectAll": "Seleccionar todo", "confirmOpen": "¿Seguro que desea abrir {0} carpetas?", - "confirmOpenButton": "&&Abrir...", - "developer": "Desarrollador", - "file": "Archivo" + "confirmOpenButton": "&&Abrir..." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..1a9d83970b8 100644 --- a/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "Desarrollador: inspeccionar asignaciones de teclas " +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 5850e2e3bb2..f03e5fb4d1c 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "Abrir {0}", "launchJsonNeedsConfigurtion": "Configurar o reparar 'launch.json'", + "noFolderDebugConfig": "Abra una carpeta para trabajar con la configuración avanzada de depuración.", "startDebug": "Iniciar depuración", "startWithoutDebugging": "Iniciar sin depurar", "selectAndStartDebugging": "Seleccionar e iniciar la depuración", @@ -34,6 +35,7 @@ "editConditionalBreakpoint": "Editar punto de interrupción...", "setValue": "Establecer valor", "addWatchExpression": "Agregar expresión", + "editWatchExpression": "Editar expresión", "addToWatchExpressions": "Agregar a inspección", "removeWatchExpression": "Quitar expresión", "removeAllWatchExpressions": "Quitar todas las expresiones", diff --git a/i18n/esn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..807b2b2952e 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "Color de fondo de la barra de herramientas de depuración" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..7b43ce773f7 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Clic para seguir (Cmd + clic se abre en el lateral)", + "fileLink": "Clic para seguir (Ctrl + clic se abre en el lateral)" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..ba49f6334da --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "Controla el comportamiento de la consola de depuración interna." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..516affc1204 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noFolderDebugConfig": "Abra una carpeta para trabajar con la configuración avanzada de depuración." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index 62859637baa..8155a083b75 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "Copiar valor", "copy": "Copiar", + "copyAll": "Copiar todo", "copyStackTrace": "Copiar pila de llamadas" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index e430f864249..c71edc9f51f 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "El estado del objeto se captura desde la primera evaluación", - "fileLinkMac": "Clic para seguir (Cmd + clic se abre en el lateral)", - "fileLink": "Clic para seguir (Ctrl + clic se abre en el lateral)", "replVariableAriaLabel": "La variable {0} tiene el valor {1}, read–eval–print loop, depuración", "replExpressionAriaLabel": "La expresión {0} tiene el valor {1}, read–eval–print loop, depuración", "replValueOutputAriaLabel": "{0}, read–eval–print loop, depuración", diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 916ac3e4884..ff677b59a60 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Color de fondo de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana" + "statusBarDebuggingBackground": "Color de fondo de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana", + "statusBarDebuggingForeground": "Color de primer plano de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 3ebe0e22808..00a55728fff 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,12 +7,12 @@ "debugAdapterBinNotFound": "El ejecutable del adaptador de depuración \"{0}\" no existe.", "debugAdapterCannotDetermineExecutable": "No se puede determinar el ejecutable para el adaptador de depuración \"{0}\".", "debugType": "Tipo de configuración.", + "debugTypeNotRecognised": "Este tipo de depuración no se reconoce. Compruebe que tiene instalada la correspondiente extensión de depuración y que está habilitada.", "node2NotSupported": "\"node2\" ya no se admite; use \"node\" en su lugar y establezca el atributo \"protocol\" en \"inspector\".", "debugName": "Nombre de la configuración. Aparece en el menú desplegable de la configuración de inicio.", "debugRequest": "Tipo de solicitud de la configuración. Puede ser \"launch\" o \"attach\".", "debugServer": "Solo para el desarrollo de extensiones de depuración: si se especifica un puerto, VS Code intenta conectarse a un adaptador de depuración que se ejecuta en modo servidor", "debugPrelaunchTask": "Tarea que se va a ejecutar antes de iniciarse la sesión de depuración.", - "internalConsoleOptions": "Controla el comportamiento de la consola de depuración interna.", "debugWindowsConfiguration": "Atributos de configuración de inicio específicos de Windows.", "debugOSXConfiguration": "Atributos de configuración de inicio específicos de OS X.", "debugLinuxConfiguration": "Atributos de configuración de inicio específicos de Linux.", diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..80bd75c0a09 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: Equilibrio (entrante)", + "balanceOutward": "Emmet: Equilibrio (saliente)" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..328583915c4 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: Punto de edición anterior", + "nextEditPoint": "Emmet: Punto de edición siguiente" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..0cc657ddc14 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: Evaluar expresión matemática" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..89f65c5221b --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: Expandir abreviatura" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..ad86576118f --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: Aumentar por 0.1", + "incrementNumberByOne": "Emmet: Aumentar por 1", + "incrementNumberByTen": "Emmet: Aumentar por 10", + "decrementNumberByOneTenth": "Emmet: Disminuir por 0.1", + "decrementNumberByOne": "Emmet: Disminuir por 1", + "decrementNumberByTen": "Emmet: Disminuir por 10" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..d87b661b4e8 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: Ir al par coincidente" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..c0708b46d94 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: Combinar líneas" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..13ab5650e82 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: Reflejar valor CSS" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..376b817f89e --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: Quitar etiqueta" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..632ec2d3325 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: Seleccionar elemento anterior", + "selectNextItem": "Emmet: Seleccionar elemento siguiente" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..7daa5503951 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: Dividir/combinar etiqueta" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..4c135de0f9c --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: Alternar comentario" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..7e29db17919 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: Actualizar tamaño de la imagen" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..b09f7caa8be --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: Actualizar etiqueta", + "enterTag": "Ingresar etiqueta", + "tag": "Etiqueta" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..5b686426df5 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: Encapsular con abreviatura", + "enterAbbreviation": "Ingresar abreviatura", + "abbreviation": "Abreviatura" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..176ecb884a1 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Cuando se habilita, se expande la abreviación Emmet al presionar la tecla TAB.", + "emmetPreferences": "Preferencias usadas para modificar el comportamiento de algunas acciones y resoluciones de Emmet.", + "emmetSyntaxProfiles": "Defina el perfil de la sintaxis especificada o use su propio perfil con reglas específicas.", + "emmetExclude": "Matriz de lenguajes donde no deben expandirse la abreviación Emmet.", + "emmetExtensionsPath": "Ruta de acceso a una carpeta que contiene perfiles de Emmet, fragmentos de código y preferencias" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index feb00418ee7..37239ff3cca 100644 --- a/i18n/esn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "Aporta una vista personalizada", + "vscode.extension.contributes.view.id": "Identificador único usado para identificar la vista creada a través de vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Cadena en lenguaje natural usada para representar la vista.", + "vscode.extension.contributes.view.icon": "Ruta de acceso al icono de la vista", + "vscode.extension.contributes.views": "Aporta vistas personalizada", "showViewlet": "Mostrar {0}", "view": "Ver" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index e9448e4adfd..845e8de1c17 100644 --- a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,9 @@ "showRecommendations": "Mostrar recomendaciones", "neverShowAgain": "No volver a mostrar", "close": "Cerrar", - "workspaceRecommended": "Esta área de trabajo tiene recomendaciones de extensión." + "workspaceRecommended": "Esta área de trabajo tiene recomendaciones de extensión.", + "ignoreExtensionRecommendations": "¿Desea despreciar todas las recomendaciones de extensión?", + "ignoreAll": "Sí, despreciar todas.", + "no": "No", + "cancel": "Cancelar" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index c7bb64b9c26..cfbe38f24db 100644 --- a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "Extensiones", "view": "Ver", "extensionsConfigurationTitle": "Extensiones", - "extensionsAutoUpdate": "Actualizar extensiones automáticamente" + "extensionsAutoUpdate": "Actualizar extensiones automáticamente", + "extensionsIgnoreRecommendations": "No tener en cuenta las recomendaciones de extensión." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..f9f715ea4a9 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "Sí", + "no": "No", + "uninstall": "Desinstalación", + "later": "Más tarde" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index d7457f5305a..923353af133 100644 --- a/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Configure asociaciones de archivo para los lenguajes (por ejemplo, \"*.extension\": \"html\"). Estas asociaciones tienen prioridad sobre las asociaciones predeterminadas de los lenguajes instalados.", "encoding": "La codificación del juego de caracteres predeterminada que debe utilizarse al leer y escribir archivos.", "autoGuessEncoding": "Si está opción está habilitada, se intentará adivinar la codificación del juego de caracteres al abrir los archivos", - "eol": "Carácter predeterminado de final de línea.", + "eol": "Carácter predeterminado de final de línea. Utilice \\n para LF y \\r\\n para CRLF.", "trimTrailingWhitespace": "Si se habilita, se recortará el espacio final cuando se guarde un archivo.", "insertFinalNewline": "Si se habilita, inserte una nueva línea final al final del archivo cuando lo guarde.", "files.autoSave.off": "Un archivo con modificaciones no se guarda nunca automáticamente.", @@ -27,8 +27,8 @@ "autoSaveDelay": "Controla el retraso en MS tras el cual un archivo con modificaciones se guarda automáticamente. Solo se aplica si \"files.autoSave\" está establecido en \"{0}\"", "watcherExclude": "Configure patrones globales de las rutas de acceso de archivo que se van a excluir de la inspección de archivos. Al cambiar esta configuración, es necesario reiniciar. Si observa que Code consume mucho tiempo de CPU al iniciarse, puede excluir las carpetas grandes para reducir la carga inicial.", "hotExit.off": "Deshabilita la salida rápida.", - "hotExit.onExit": "La salida rápida se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows o Linux, o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). Todas las ventanas con copias de seguridad se restaurarán en el próximo inicio.", - "hotExit.onExitAndWindowClose": "hotExit se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows/Linux o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). También para cualquier ventana que tenga una carpeta abierta, independientemente de que sea o no la última ventana. Todas las ventanas sin carpetas abiertas se restaurarán la próxima vez que se inicie. Para restaurar las ventanas con carpetas tal cual estaban antes de cerrarse, establezca \"window.reopenFolders\" en \"all\".", + "hotExit.onExit": "hotExit se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows/Linux o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). Todas las ventanas con copias de seguridad se restaurarán la próxima vez que se inicie.", + "hotExit.onExitAndWindowClose": "HotExit se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows/Linux o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). También para cualquier ventana que tenga una carpeta abierta, independientemente de que sea o no la última ventana. Todas las ventanas sin carpetas abiertas se restaurarán la próxima vez que se inicie. Para restaurar las ventanas con carpetas tal cual estaban antes de cerrarse, establezca \"window.reopenFolders\" en \"all\".", "hotExit": "Controla si los archivos no guardados se recuerdan entre las sesiones, lo que permite omitir el mensaje para guardar al salir del editor.", "defaultLanguage": "El modo de lenguaje predeterminado que se asigna a nuevos archivos.", "editorConfigurationTitle": "Editor", diff --git a/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 712641fcab1..81f5a667ca8 100644 --- a/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "Inicio lento detectado", - "slow.detail": "Lamentamos que haya tenido un inicio lento. Reinicie \"{0}\" con la generación de perfiles habilitada, comparta los perfiles con nosotros y trabajaremos a fondo para que vuelva a disfrutar de un inicio increíble." + "slow.detail": "Lamentamos que haya tenido un inicio lento. Reinicie \"{0}\" con la generación de perfiles habilitada, comparta los perfiles con nosotros y trabajaremos a fondo para que vuelva a disfrutar de un inicio increíble.", + "prof.message": "Los perfiles se crearon correctamente.", + "prof.detail": "Cree un problema y asóciele manualmente los siguientes archivos: {0}", + "prof.restartAndFileIssue": "Crear problema y reiniciar", + "prof.restart": "Reiniciar", + "prof.thanks": "Gracias por ayudarnos.", + "prof.detail.restart": "Se necesita un reinicio final para continuar utilizando '{0}'. De nuevo, gracias por su aportación." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index 7ef1283f9ad..31318057630 100644 --- a/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "Abrir configuración de usuario", "openGlobalKeybindings": "Abrir métodos abreviados de teclado", + "openGlobalKeybindingsFile": "Abrir el archivo de métodos abreviados de teclado", "openWorkspaceSettings": "Abrir configuración del área de trabajo", "configureLanguageBasedSettings": "Configurar opciones específicas del lenguaje...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 7f0f754882e..abfe36e35ad 100644 --- a/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "No se puede escribir la configuración. Corrija los errores o advertencias del archivo y vuelva a intentarlo.", "editTtile": "Editar", "replaceDefaultValue": "Reemplazar en Configuración", "copyDefaultValue": "Copiar en Configuración", diff --git a/i18n/esn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/esn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 787f634d287..08fdf2cfd2e 100644 --- a/i18n/esn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "Mostrar todos los comandos", + "showCommands.label": "Paleta de comandos...", "entryAriaLabelWithKey": "{0}, {1}, comandos", "entryAriaLabel": "{0}, comandos", "canNotRun": "El comando '{0}' no puede ejecutarse desde aquí.", diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 2d44f58d514..a77a2211780 100644 --- a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Mostrar GIT", + "installAdditionalSCMProviders": "Instalar proveedores adicionales de SCM...", "source control": "Control de código fuente", "toggleSCMViewlet": "Mostrar SCM", "view": "Ver" diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 58e5c2559c8..048db5a28d0 100644 --- a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Instalar proveedores adicionales de SCM...", "switch provider": "Cambiar proveedor de SCM..." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/esn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index c7aea1a3bf6..06b841c9cab 100644 --- a/i18n/esn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -7,6 +7,6 @@ "searchMatches": "{0} coincidencias encontradas", "searchMatch": "{0} coincidencia encontrada", "fileMatchAriaLabel": "{0} coincidencias en el archivo {1} de la carpeta {2}, resultados de la búsqueda", - "replacePreviewResultAria": "Reemplazar resultado de vista previa, {0}", - "searchResultAria": "{0}, resultado de la búsqueda" + "replacePreviewResultAria": "Reemplazar el termino {0} con {1} en la columna con posición {2} en la línea de texto {3}", + "searchResultAria": "Encontró el término {0} en la columna de posición {1} en la línea con el texto {2}." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index e5995f59713..30e2262eef7 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tareas" + "entryAriaLabel": "{0}, tareas", + "workspace": "De área de trabajo", + "extension": "De extensiones" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 7050d4b2731..743e9be299c 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tareas", "tasksAriaLabel": "Escriba el nombre de una tarea para reiniciar", "noTasksMatching": "No tasks matching", "noTasksFound": "No se encontró ninguna tarea para reiniciar" diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index d4bed99f1a2..e6855cb8a9c 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tareas", "tasksAriaLabel": "Escribir el nombre de una tarea para ejecutar", "noTasksMatching": "No tasks matching", "noTasksFound": "No se encontraron tareas" diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index b8ae0ec102f..05a4cfef6c7 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Seleccionar un ejecutador de tareas", "ConfigureTaskRunnerAction.autoDetecting": "Detectando tareas automáticamente para {0}", "ConfigureTaskRunnerAction.autoDetect": "Error de detección automática del sistema de tareas. Se usa la plantilla predeterminada. Consulte el resultado de la tarea para obtener más detalles", + "ConfigureTaskRunnerAction.autoDetectError": "Error de detección automática del sistema de tareas. Consulte el resultado de la tarea para obtener más detalles", "ConfigureTaskRunnerAction.failed": "No se puede crear el archivo \"tasks.json\" dentro de la carpeta \".vscode\". Consulte el resultado de la tarea para obtener más detalles.", "ConfigureTaskRunnerAction.label": "Configurar ejecutor de tareas", "ConfigureBuildTaskAction.label": "Configurar tarea de compilación", diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 930b60298c1..58c4eca7cfe 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,6 @@ { "TerminalTaskSystem.unknownError": "Error desconocido durante la ejecución de una tarea. Vea el registro de resultados de la tarea para obtener más detalles.", "TerminalTaskSystem.terminalName": "Tarea - {0}", - "TerminalTaskSystem": "No se puede ejecutar un comando shell en una unidad UNC." + "TerminalTaskSystem": "No se puede ejecutar un comando shell en una unidad UNC.", + "unkownProblemMatcher": "No puede resolver el comprobador de problemas {0}. Será omitido." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 651c8b00513..b300e0e061a 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "Error desconocido durante la ejecución de una tarea. Vea el registro de resultados de la tarea para obtener más detalles.", "TaskRunnerSystem.watchingBuildTaskFinished": "La inspección de las tareas de compilación ha finalizado.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "La tarea '{0}' se finalizó por solicitud del usuario." + "TaskRunnerSystem.cancelRequested": "La tarea '{0}' se finalizó por solicitud del usuario.", + "unkownProblemMatcher": "No puede resolver el comprobador de problemas {0}. Será omitido" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 29e623a5d20..50e571af89f 100644 --- a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -26,5 +26,7 @@ "workbench.action.terminal.scrollUp": "Desplazar hacia arriba (línea)", "workbench.action.terminal.scrollUpPage": "Desplazar hacia arriba (página)", "workbench.action.terminal.scrollToTop": "Desplazar al principio", - "workbench.action.terminal.clear": "Borrar" + "workbench.action.terminal.clear": "Borrar", + "workbench.action.terminal.allowWorkspaceShell": "Permitir la configuración del área de trabajo Shell", + "workbench.action.terminal.disallowWorkspaceShell": "No permitir la configuración del área de trabajo Shell" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index eb668d70a13..d371b1e3d8c 100644 --- a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "El color de fondo del terminal, esto permite colorear el terminal de forma diferente al panel.", + "terminal.foreground": "El color de primer plano del terminal.", "terminal.ansiColor": "Color ANSI \"{0}\" en el terminal." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 329fe3c8b20..107a0eecf8a 100644 --- a/i18n/esn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,14 @@ { "selectTheme.label": "Tema de color", "installColorThemes": "Instalar temas de color adicionales...", - "problemChangingTheme": "Problema al configurar el tema: {0}", - "themes.selectTheme": "Seleccionar tema de color", + "themes.selectTheme": "Seleccione el tema de color (flecha arriba/abajo para vista previa)", "selectIconTheme.label": "Tema de icono de archivo", "installIconThemes": "Instalar temas de icono de archivo adicionles...", "noIconThemeLabel": "Ninguno", "noIconThemeDesc": "Deshabilitar iconos de archivo", "problemChangingIconTheme": "Problema al configurar el tema de icono: {0}", "themes.selectIconTheme": "Seleccionar tema de icono de archivo", + "generateColorTheme.label": "General el tema de color desde la configuración actual", "preferences": "Preferencias", "developer": "Desarrollador" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 560b16de17c..2438b3e1709 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,33 +11,34 @@ "welcomePage.openFolder": "Abrir carpeta...", "welcomePage.cloneGitRepository": "Clonar el repositorio GIT...", "welcomePage.recent": "Reciente", + "welcomePage.moreRecent": "Más...", "welcomePage.noRecentFolders": "No hay ninguna carpeta reciente", "welcomePage.help": "Ayuda", - "welcomePage.productDocumentation": "Documentación del producto", + "welcomePage.keybindingsCheatsheet": "Hoja imprimible con ayudas de teclado", "welcomePage.introductoryVideos": "Vídeos de introducción", + "welcomePage.productDocumentation": "Documentación del producto", "welcomePage.gitHubRepository": "Repositorio de GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Mostrar página principal al inicio", - "welcomePage.quickLinks": "Vínculos rápidos", - "welcomePage.interactivePlayground": "Ãrea de juegos interactiva", - "welcomePage.interactivePlaygroundDescription": "Pruebe las características esenciales del editor en un tutorial corto", - "welcomePage.interfaceOverview": "Introducción a la interfaz", - "welcomePage.interfaceOverviewDescription": "Obtenga una superposición que resalta los componentes principales de la interfaz de usuario", + "welcomePage.customize": "Personalizar", + "welcomePage.installExtensionPacks": "Herramientas y lenguajes", + "welcomePage.installExtensionPacksDescription": "Instalar soporte para {0} y {1}", + "welcomePage.moreExtensions": "más", + "welcomePage.installKeymapDescription": "Instalar los métodos abreviados de teclado", + "welcomePage.installKeymapExtension": "Instalar los métodos abreviados de teclado de {0} y {1}", + "welcomePage.others": "otros", "welcomePage.colorTheme": "Tema de color", "welcomePage.colorThemeDescription": "Modifique a su gusto la apariencia del editor y el código", - "welcomePage.keybindingsReference": "Referencia de métodos abreviados de teclado", - "welcomePage.keybindingsReferenceDescription": "Un PDF imprimible con los métodos abreviados de teclado más comunes", + "welcomePage.learn": "Más información", "welcomePage.showCommands": "Buscar y ejecutar todos los comandos", "welcomePage.showCommandsDescription": "Acceda rápidamente y busque comandos desde el panel de control ({0})", + "welcomePage.interfaceOverview": "Introducción a la interfaz", + "welcomePage.interfaceOverviewDescription": "Obtenga una superposición que resalta los componentes principales de la interfaz de usuario", + "welcomePage.interactivePlayground": "Ãrea de juegos interactiva", + "welcomePage.interactivePlaygroundDescription": "Pruebe las características esenciales del editor en un tutorial corto", + "welcomePage.quickLinks": "Vínculos rápidos", + "welcomePage.keybindingsReference": "Referencia de métodos abreviados de teclado", + "welcomePage.keybindingsReferenceDescription": "Un PDF imprimible con los métodos abreviados de teclado más comunes", "welcomePage.configureSettings": "Definir la configuración", - "welcomePage.configureSettingsDescription": "Revele el poder total de VS Code cambiando la configuración", - "welcomePage.installKeymapDescription": "Instalar los métodos abreviados de teclado", - "welcomePage.installKeymap": "Instale los métodos abreviados de teclado de {0}, {1} {2} y {3}", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (actual)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (actual)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (actual)", - "welcomePage.others": "otros" + "welcomePage.configureSettingsDescription": "Revele el poder total de VS Code cambiando la configuración" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 78fdb50afd6..57b34bdf736 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,27 @@ // Do not edit this file. It is machine generated. { "welcomePage": "Bienvenido", - "welcome.title": "Bienvenido", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "El soporte para '{0}' ya está instalado.", + "welcomePage.willReloadAfterInstallingExtensionPack": "La ventana se volverá a cargar después de instalar el soporte para {0}.", + "welcomePage.installingExtensionPack": "Instalando soporte para {0}...", + "welcomePage.extensionPackNotFound": "No se pudo encontrar el soporte para {0} con id {1}.", "welcomePage.keymapAlreadyInstalled": "Los métodos abreviados de teclado {0} ya están instalados.", "welcomePage.willReloadAfterInstallingKeymap": "La ventana se volverá a cargar después de instalar los métodos abreviados de teclado {0}.", - "ok": "Aceptar", "welcomePage.installingKeymap": "Instalando los métodos abreviados de teclado de {0}...", "welcomePage.keymapNotFound": "No se pudieron encontrar los métodos abreviados de teclado {0} con el identificador {1}.", - "cancel": "Cancelar" + "welcome.title": "Bienvenido", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installedExtension": "{0} (instalado)", + "ok": "Aceptar", + "cancel": "Cancelar", + "welcomePage.quickLinkBackground": "Color de fondo de los vínculos rápidos en la página principal.", + "welcomePage.quickLinkHoverBackground": "Mantener el puntero sobre el color de fondo para acceder los vínculos rápidos en la página principal." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index b18644a031a..7dc0e8efbdf 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "sin enlazar" + "walkThrough.unboundCommand": "sin enlazar", + "walkThrough.gitNotFound": "Parece que GIT no está instalado en el sistema.", + "walkThrough.embeddedEditorBackground": "Color de fondo de los editores incrustrados en la área de juegos" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/esn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index e1dbe78e59e..c8e25212f8b 100644 --- a/i18n/esn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/esn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "Abrir configuración", + "close": "Cerrar", + "saveAndRetry": "Guardar la configuración y reintentar. ", "errorUnknownKey": "No se puede escribir en el archivo de configuración (clave desconocida)", "errorInvalidTarget": "No se puede escribir en el archivo de configuración (destino no válido).", - "errorNoWorkspaceOpened": "No se puede escribir la configuración porque no hay ninguna carpeta abierta. Abra una carpeta primero y vuelva a intentarlo.", - "errorInvalidConfiguration": "No se puede escribir la configuración. Abra el archivo **Configuración de usuario** para corregir los errores o advertencias del archivo y vuelva a intentarlo.", - "errorInvalidConfigurationWorkspace": "No se puede escribir la configuración. Abra **Configuración de área de trabajo** para corregir los errores o advertencias del archivo y vuelva a intentarlo.", - "errorConfigurationFileDirty": "No se puede escribir la configuración porque el archivo se ha modificado. Guarde el archivo **Configuración de usuario** y vuelva a intentarlo.", - "errorConfigurationFileDirtyWorkspace": "No se puede escribir la configuración porque el archivo se ha modificado. Guarde el archivo **Configuración de área de trabajo** y vuelva a intentarlo." + "errorNoWorkspaceOpened": "No se pudo guardar la configuración porque no tiene una carpeta abierta. Abra una carpeta primero y vuelva a intentarlo.", + "errorInvalidConfiguration": "No se pudo guardar la configuración. Abra el archivo **Configuración de usuario** para corregir los errores o advertencias del archivo y vuelva a intentarlo.", + "errorInvalidConfigurationWorkspace": "No se pudo guardar la configuración. Abra **Configuración de área de trabajo** para corregir los errores o advertencias del archivo y vuelva a intentarlo.", + "errorConfigurationFileDirty": "No se pudo guardar la configuración porque el archivo se ha modificado. Guarde el archivo **Configuración de usuario** y vuelva a intentarlo.", + "errorConfigurationFileDirtyWorkspace": "No se pudo guardar la configuración porque el archivo se ha modificado. Guarde el archivo **Configuración de área de trabajo** y vuelva a intentarlo." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/esn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 0ae924e1932..587fdef7461 100644 --- a/i18n/esn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/esn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Tecla o secuencia de teclas específica de Windows.", "vscode.extension.contributes.keybindings.when": "Condición cuando la tecla está activa.", "vscode.extension.contributes.keybindings": "Aporta enlaces de teclado.", - "openDocumentation": "Más información", - "keybindingMigration.ok": "Aceptar", - "keybindingMigration.prompt": "Algunos métodos abreviados de teclado han cambiado para su distribución de teclado.", "invalid.keybindings": "Valor de \"contributes.{0}\" no válido: {1}", "unboundCommands": "Aquí hay otros comandos disponibles: ", "keybindings.json.title": "Configuración de enlaces de teclado", diff --git a/i18n/esn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/esn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index a9799ee79c8..a21b957751a 100644 --- a/i18n/esn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/esn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "Colores para resaltado de sintaxis", "schema.properties.name": "Descripción de la regla", - "schema.fontStyle": "Estilo de fuente de la regla: una opción de \"italic\", \"bold\" y \"underline\", o una combinación de ellas." + "schema.fontStyle": "Estilo de fuente de la regla: una opción de \"italic\", \"bold\" y \"underline\", o una combinación de ellas.", + "schema.tokenColors.path": "Ruta de acceso de la archivo de tema (relativa al archivo actual)" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/esn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index d94eb7af67c..464fd1a886e 100644 --- a/i18n/esn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/esn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "Problemas al analizar el archivo de tema JSON: {0}" + "error.cannotparsejson": "Problemas al analizar el archivo de tema JSON: {0}", + "error.invalidformat.colors": "Problema al analizar el archivo de tema: {0}. La propiedad \"colors\" no es tipo \"object\".", + "error.invalidformat.tokenColors": "Problema al analizar el archivo de tema: {0}. La propiedad 'tokenColors' debería ser una matriz de colores o una ruta de acceso a un archivo texto de tema.", + "error.plist.invalidformat": "Problema al analizar el archivo de tema: {0}. \"settings\" no es una matriz.", + "error.cannotparse": "Problemas al analizar el archivo de tema: {0}", + "error.cannotload": "Problemas al analizar el archivo de tema: {0}:{1}" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/esn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 5d3877ecd7a..1dd28c717de 100644 --- a/i18n/esn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/esn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "Reemplaza los colores del tema de color actual", + "workbenchColors.deprecated": "Esta configuracion no es experimental y se ha cambiado de nombre a 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "Utilice 'workbench.colorCustomizations' en su lugar" } \ No newline at end of file diff --git a/i18n/fra/extensions/git/out/commands.i18n.json b/i18n/fra/extensions/git/out/commands.i18n.json index 738f408aeaa..3601e044f8b 100644 --- a/i18n/fra/extensions/git/out/commands.i18n.json +++ b/i18n/fra/extensions/git/out/commands.i18n.json @@ -16,6 +16,10 @@ "confirm discard": "Voulez-vous vraiment abandonner les changements apportés à {0} ?", "confirm discard multiple": "Voulez-vous vraiment abandonner les changements apportés à {0} fichiers ?", "discard": "Ignorer les modifications", + "confirm discard all": "Voulez-vous vraiment ignorer TOUTES les modifications ? Cette action est IRRÉVERSIBLE.", + "discardAll": "Ignorer TOUTES les modifications", + "yes": "Oui", + "always": "Toujours", "no changes": "Il n'existe aucun changement à valider.", "commit message": "Message de validation", "provide commit message": "Indiquez un message de validation", @@ -31,6 +35,7 @@ "no remotes to publish": "Votre dépôt n'a aucun dépôt distant configuré pour une publication.", "disabled": "Git est désactivé ou non pris en charge dans cet espace de travail", "clean repo": "Nettoyez l'arborescence de travail de votre dépôt avant l'extraction.", + "cant push": "Push impossible des références vers la branche distante. Exécutez d'abord 'Extraire' pour intégrer vos modifications.", "git error details": "Git : {0}", "git error": "Erreur Git", "open git log": "Ouvrir le journal Git" diff --git a/i18n/fra/extensions/git/package.i18n.json b/i18n/fra/extensions/git/package.i18n.json index a2aa4ce8ddf..801419a6433 100644 --- a/i18n/fra/extensions/git/package.i18n.json +++ b/i18n/fra/extensions/git/package.i18n.json @@ -39,6 +39,8 @@ "config.autofetch": "Indique si la récupération automatique est activée", "config.enableLongCommitWarning": "Indique si les longs messages de validation doivent faire l'objet d'un avertissement", "config.confirmSync": "Confirmer avant de synchroniser des dépôts git", + "config.countBadge": "Contrôle le compteur de badges Git. La valeur 'toutes' compte toutes les modifications. La valeur 'suivies' compte uniquement les modifications suivies. La valeur 'désactivé' désactive le compteur.", + "config.checkoutType": "Contrôle le type des branches répertoriées pendant l'exécution de 'Extraire vers...'. La valeur 'toutes' montre toutes les références, la valeur 'locales' montre uniquement les branches locales, la valeur 'balises' montre uniquement les balises et la valeur 'distantes' montre uniquement les branches distantes.", "config.ignoreLegacyWarning": "Ignore l'avertissement Git hérité", "config.ignoreLimitWarning": "Ignore l'avertissement quand il y a trop de modifications dans un dépôt" } \ No newline at end of file diff --git a/i18n/fra/extensions/gulp/package.i18n.json b/i18n/fra/extensions/gulp/package.i18n.json index 8b6ad71cd4e..98a28783ec8 100644 --- a/i18n/fra/extensions/gulp/package.i18n.json +++ b/i18n/fra/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Contrôle si la détection automatique des tâches Gulp est activée ou désactivée. La valeur par défaut est activée." +} \ No newline at end of file diff --git a/i18n/fra/extensions/jake/out/main.i18n.json b/i18n/fra/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/jake/package.i18n.json b/i18n/fra/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/markdown/out/extension.i18n.json b/i18n/fra/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/package.i18n.json b/i18n/fra/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/npm/package.i18n.json b/i18n/fra/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/npm/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/fra/extensions/typescript/out/typescriptServiceClient.i18n.json index 3707e724af7..85899be0806 100644 --- a/i18n/fra/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/fra/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "Le chemin {0} ne pointe pas vers une installation tsserver valide. Utilisation par défaut de la version TypeScript groupée.", "noBundledServerFound": "Le tsserver de VSCode a été supprimé par une autre application, par exemple un outil de détection de virus mal configuré. Réinstallez VS Code.", "versionNumber.custom": "personnalisé", diff --git a/i18n/fra/extensions/typescript/out/utils/logger.i18n.json b/i18n/fra/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/fra/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json index 0b61796218c..d9cc787276c 100644 --- a/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Récupération (fetch) des données pour l'amélioration de TypeScript IntelliSense", + "typesInstallerInitializationFailed.title": "Impossible d'installer des fichiers de typages pour les fonctionnalités du langage JavaScript. Vérifiez que NPM est installé et se trouve dans votre chemin", "typesInstallerInitializationFailed.moreInformation": "Informations", "typesInstallerInitializationFailed.doNotCheckAgain": "Ne plus vérifier", "typesInstallerInitializationFailed.close": "Fermer" diff --git a/i18n/fra/extensions/typescript/package.i18n.json b/i18n/fra/extensions/typescript/package.i18n.json index 5fc1a277d93..d60399d9b5b 100644 --- a/i18n/fra/extensions/typescript/package.i18n.json +++ b/i18n/fra/extensions/typescript/package.i18n.json @@ -33,9 +33,7 @@ "javascript.validate.enable": "Activez/désactivez la validation JavaScript.", "typescript.goToProjectConfig.title": "Accéder à la configuration du projet", "javascript.goToProjectConfig.title": "Accéder à la configuration du projet", - "typescript.referencesCodeLens.enabled": "Activer/désactiver CodeLens dans les références. Nécessite TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Activer/désactiver CodeLens dans les implémentations. Nécessite TypeScript >= 2.2.0.", - "typescript.openTsServerLog.title": "Ouvrir le fichier journal du serveur TS", "typescript.selectTypeScriptVersion.title": "Sélectionner la version de TypeScript", "jsDocCompletion.enabled": "Activer/désactiver les commentaires JSDoc automatiques", "javascript.implicitProjectConfig.checkJs": "Activer/désactiver la vérification sémantique des fichiers JavaScript. Les fichiers jsconfig.json ou tsconfig.json existants remplacent ce paramètre. Nécessite TypeScript >=2.3.1.", diff --git a/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index d6968482f68..b6faf1c8af7 100644 --- a/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "L'image est trop grande pour être affichée dans l'éditeur. ", - "resourceOpenExternalButton": "Ouvrir l'image", - "resourceOpenExternalText": " en utilisant un programme externe ?", "nativeBinaryError": "Impossible d'afficher le fichier dans l'éditeur : soit il est binaire, soit il est très volumineux, soit il utilise un encodage de texte non pris en charge.", "sizeB": "{0} o", "sizeKB": "{0} Ko", diff --git a/i18n/fra/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/fra/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..5c2fcbf92b8 --- /dev/null +++ b/i18n/fra/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "Symbole non valide", + "error.invalidNumberFormat": "Format de nombre non valide", + "error.propertyNameExpected": "Nom de propriété attendu", + "error.valueExpected": "Valeur attendue", + "error.colonExpected": "Signe des deux points attendu", + "error.commaExpected": "Virgule attendue", + "error.closeBraceExpected": "Accolade fermante attendue", + "error.closeBracketExpected": "Crochet fermant attendu", + "error.endOfFileExpected": "Fin de fichier attendue" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/code/electron-main/menus.i18n.json b/i18n/fra/src/vs/code/electron-main/menus.i18n.json index 6f57138a058..767d8088cca 100644 --- a/i18n/fra/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/fra/src/vs/code/electron-main/menus.i18n.json @@ -69,7 +69,6 @@ "miSmartSelectShrink": "&&Réduire la sélection", "miViewExplorer": "&&Explorateur", "miViewSearch": "&&Rechercher", - "miViewGit": "&&Git", "miViewDebug": "&&Déboguer", "miViewExtensions": "E&&xtensions", "miToggleOutput": "&&Sortie", diff --git a/i18n/fra/src/vs/code/electron-main/windows.i18n.json b/i18n/fra/src/vs/code/electron-main/windows.i18n.json index 7893fb77cc3..af0778db015 100644 --- a/i18n/fra/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/fra/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "OK", "pathNotExistTitle": "Le chemin d'accès n'existe pas", "pathNotExistDetail": "Le chemin d'accès '{0}' ne semble plus exister sur le disque.", - "accessibilityOptionsWindowTitle": "Options d'accessibilité", "reopen": "Rouvrir", "wait": "Continuer à attendre", "close": "Fermer", diff --git a/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json index 93596cccabe..16acf6481b0 100644 --- a/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Contrôle l'épaisseur de police.", "fontSize": "Contrôle la taille de police en pixels.", "lineHeight": "Contrôle la hauteur de ligne. Utilisez 0 pour calculer lineHeight à partir de fontSize.", + "letterSpacing": "Définit l'espacement des caractères en pixels.", "lineNumbers": "Contrôle l'affichage des numéros de ligne. Les valeurs possibles sont 'activé', 'désactivé' et 'relatif'. La valeur 'relatif' indique le numéro de ligne à partir de la position actuelle du curseur.", "rulers": "Colonnes où afficher les règles verticales", "wordSeparators": "Caractères utilisés comme séparateurs de mots durant la navigation ou les opérations basées sur les mots", @@ -40,7 +41,6 @@ "formatOnType": "Contrôle si l'éditeur doit automatiquement mettre en forme la ligne après la saisie", "formatOnPaste": "Contrôle si l'éditeur doit automatiquement mettre en forme le contenu collé. Un formateur doit être disponible et doit pouvoir mettre en forme une plage dans un document.", "suggestOnTriggerCharacters": "Contrôle si les suggestions doivent s'afficher automatiquement durant la saisie de caractères de déclenchement", - "acceptSuggestionOnEnter": "Contrôle si les suggestions peuvent être acceptées avec Entrée (en plus de Tab). Cela permet d'éviter toute ambiguïté entre l'insertion de nouvelles lignes et l'acceptation de suggestions.", "acceptSuggestionOnCommitCharacter": "Contrôle si les suggestions doivent être acceptées avec des caractères de validation. Par exemple, en JavaScript, le point-virgule (';') peut être un caractère de validation qui permet d'accepter une suggestion et de taper ce caractère.", "snippetSuggestions": "Contrôle si les extraits de code s'affichent en même temps que d'autres suggestions, ainsi que leur mode de tri.", "emptySelectionClipboard": "Contrôle si la copie sans sélection permet de copier la ligne actuelle.", diff --git a/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..bf45d0601aa --- /dev/null +++ b/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Contenu d'éditeur" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json index b8302d62f69..77ca0b5bb8f 100644 --- a/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,11 @@ "caret": "Couleur du curseur de l'éditeur.", "editorWhitespaces": "Couleur des espaces blancs dans l'éditeur.", "editorIndentGuides": "Couleur des repères de retrait de l'éditeur.", - "editorLineNumbers": "Couleur des numéros de ligne de l'éditeur." + "editorLineNumbers": "Couleur des numéros de ligne de l'éditeur.", + "editorRuler": "Couleur des règles de l'éditeur", + "editorCodeLensForeground": "Couleur pour les indicateurs CodeLens", + "editorBracketMatchBackground": "Couleur d'arrière-plan pour les accolades associées", + "editorBracketMatchBorder": "Couleur pour le contour des accolades associées", + "editorOverviewRulerBorder": "Couleur de la bordure de la règle d'apperçu.", + "editorGutter": "Couleur de fond pour la bordure de l'éditeur. La bordure contient les marges pour les symboles et les numéros de ligne." } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..0488ff48354 --- /dev/null +++ b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "Définition introuvable pour '{0}'", + "generic.noResults": "Définition introuvable", + "meta.title": " – {0} définitions", + "actions.goToDecl.label": "Atteindre la définition", + "actions.goToDeclToSide.label": "Ouvrir la définition sur le côté", + "actions.previewDecl.label": "Apercu de définition", + "goToImplementation.noResultWord": "Implémentation introuvable pour '{0}'", + "goToImplementation.generic.noResults": "Implémentation introuvable", + "meta.implementations.title": "– Implémentations {0}", + "actions.goToImplementation.label": "Accéder à l'implémentation", + "actions.peekImplementation.label": "Aperçu de l'implémentation", + "goToTypeDefinition.noResultWord": "Définition de type introuvable pour '{0}'", + "goToTypeDefinition.generic.noResults": "Définition de type introuvable", + "meta.typeDefinitions.title": " – Définitions de type {0}", + "actions.goToTypeDefinition.label": "Atteindre la définition de type", + "actions.peekTypeDefinition.label": "Aperçu de la définition du type" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..247bd9d24da --- /dev/null +++ b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Cliquez pour afficher {0} définitions." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/fra/src/vs/editor/contrib/hover/browser/hover.i18n.json index c2d6b7a05c8..f2c7ed17560 100644 --- a/i18n/fra/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "Afficher par pointage", - "hoverHighlight": "Mettez en surbrillance ci-dessous le mot pour lequel un pointage s'affiche.", - "hoverBackground": "Couleur d'arrière-plan du pointage de l'éditeur.", - "hoverBorder": "Couleur de bordure du pointage de l'éditeur." + "showHover": "Afficher par pointage" } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 6440507bb59..e4871d36b89 100644 --- a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "symbole dans {0} sur la ligne {1}, colonne {2}", + "aria.fileReferences.1": "1 symbole dans {0}", + "aria.fileReferences.N": "{0} symboles dans {1}", "aria.result.0": "Résultats introuvables", "aria.result.1": "1 symbole dans {0}", "aria.result.n1": "{0} symboles dans {1}", diff --git a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index bb2792bf3e4..b2ba0b9ad35 100644 --- a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,8 +16,6 @@ "peekViewTitleInfoForeground": "Couleur des informations sur le titre de l'affichage d'aperçu.", "peekViewBorder": "Couleur des bordures et de la flèche de l'affichage d'aperçu.", "peekViewResultsBackground": "Couleur d'arrière-plan de la liste des résultats de l'affichage d'aperçu.", - "peekViewResultsMatchForeground": "Premier plan de l'entrée correspondante dans la liste des résultats de l'affichage d'aperçu.", - "peekViewResultsFileForeground": "Premier plan de l'entrée de fichier dans la liste des résultats de l'affichage d'aperçu.", "peekViewResultsSelectionBackground": "Couleur d'arrière-plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.", "peekViewResultsSelectionForeground": "Couleur de premier plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.", "peekViewEditorBackground": "Couleur d'arrière-plan de l'éditeur d'affichage d'aperçu.", diff --git a/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index cae2864bf7a..e38b8d1bf14 100644 --- a/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,12 @@ { "editorSuggestWidgetBackground": "Couleur d'arrière-plan du widget de suggestion.", "editorSuggestWidgetBorder": "Couleur de bordure du widget de suggestion.", + "editorSuggestWidgetForeground": "Couleur de premier plan du widget de suggestion.", + "editorSuggestWidgetSelectedBackground": "Couleur d'arrière-plan de l'entrée sélectionnée dans le widget de suggestion.", + "editorSuggestWidgetHighlightForeground": "Couleur de la surbrillance des correspondances dans le widget de suggestion.", "readMore": "En savoir plus...{0}", "suggestionWithDetailsAriaLabel": "{0}, suggestion, avec détails", "suggestionAriaLabel": "{0}, suggestion", - "goback": "Précédent", "suggestWidget.loading": "Chargement...", "suggestWidget.noSuggestions": "Pas de suggestions.", "suggestionAriaAccepted": "{0}, accepté", diff --git a/i18n/fra/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/fra/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index bdd70d229db..1d2d1988d2f 100644 --- a/i18n/fra/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/fra/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Définit les symboles de type crochet qui augmentent ou diminuent le retrait.", "schema.autoClosingPairs": "Définit les paires de crochets. Quand vous entrez un crochet ouvrant, le crochet fermant est inséré automatiquement.", "schema.autoClosingPairs.notIn": "Définit une liste d'étendues où les paires automatiques sont désactivées.", - "schema.surroundingPairs": "Définit les paires de crochets qui peuvent être utilisées pour entourer la chaîne sélectionnée." + "schema.surroundingPairs": "Définit les paires de crochets qui peuvent être utilisées pour entourer la chaîne sélectionnée.", + "schema.wordPattern": "La définition du mot dans le langage", + "schema.wordPattern.pattern": "L'expression régulière utilisée pour la recherche", + "schema.wordPattern.flags": "Les options d'expression régulière utilisées pour la recherche", + "schema.wordPattern.flags.errorMessage": "Doit valider l'expression régulière `/^([gimuy]+)$/`." } \ No newline at end of file diff --git a/i18n/fra/src/vs/platform/environment/node/argv.i18n.json b/i18n/fra/src/vs/platform/environment/node/argv.i18n.json index 49e7a265668..b4a7b53c42b 100644 --- a/i18n/fra/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/fra/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "Affichez les versions des extensions installées, quand --list-extension est utilisé.", "installExtension": "Installe une extension.", "uninstallExtension": "Désinstalle une extension.", + "experimentalApis": "Active les fonctionnalités d'API proposées pour une extension.", "disableExtensions": "Désactivez toutes les extensions installées.", "disableGPU": "Désactivez l'accélération matérielle du GPU.", "version": "Affichez la version.", diff --git a/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json index 144b90a8319..985f7884334 100644 --- a/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,6 @@ "ProblemMatcherParser.noValidIdentifier": "Erreur : la propriété de modèle {0} n'est pas un nom de variable de modèle valide.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un détecteur de problèmes de correspondance doit définir un modèle de début et un modèle de fin à observer.", "ProblemMatcherParser.invalidRegexp": "Erreur : la chaîne {0} est une expression régulière non valide.\n", - "WatchingPatternSchema.regexp": "Expression régulière permettant de détecter le début ou la fin d'une tâche de suivi.", "WatchingPatternSchema.file": "Index de groupe de correspondance du nom de fichier. Peut être omis.", "PatternTypeSchema.name": "Nom d'un modèle faisant l'objet d'une contribution ou prédéfini", "PatternTypeSchema.description": "Modèle de problème ou bien nom d'un modèle de problème faisant l'objet d'une contribution ou prédéfini. Peut être omis si base est spécifié.", @@ -46,7 +45,6 @@ "ProblemMatcherSchema.watching.activeOnStart": "Si la valeur est true, le mode espion est actif au démarrage de la tâche. Cela revient à émettre une ligne qui correspond à beginPattern", "ProblemMatcherSchema.watching.beginsPattern": "En cas de correspondance dans la sortie, le début d'une tâche de suivi est signalé.", "ProblemMatcherSchema.watching.endsPattern": "En cas de correspondance dans la sortie, la fin d'une tâche de suivi est signalée.", - "ProblemMatcherSchema.watching": "Modèles de suivi du début et de la fin d'un modèle espion.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Cette propriété est déconseillée. Utilisez la propriété espion à la place.", "LegacyProblemMatcherSchema.watchedBegin": "Expression régulière signalant qu'une tâche faisant l'objet d'un suivi commence à s'exécuter via le suivi d'un fichier.", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Cette propriété est déconseillée. Utilisez la propriété espion à la place.", diff --git a/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json index 1fad25c1f71..4977fe04f0b 100644 --- a/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,66 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "Format de couleur non valide. Utilisez #RGB, #RGBA, #RRGGBB ou #RRGGBBAA", "schema.colors": "Couleurs utilisées dans le banc d'essai.", "foreground": "Couleur de premier plan globale. Cette couleur est utilisée si elle n'est pas remplacée par un composant.", + "errorForeground": "Couleur principale de premier plan pour les messages d'erreur. Cette couleur est utilisée uniquement si elle n'est pas redéfinie par un composant.", + "descriptionForeground": "Couleur de premier plan du texte descriptif fournissant des informations supplémentaires, par exemple pour un label.", + "focusBorder": "Couleur de bordure globale des éléments ayant le focus. Cette couleur est utilisée si elle n'est pas remplacée par un composant.", + "contrastBorder": "Bordure supplémentaire autour des éléments pour les séparer des autres et obtenir un meilleur contraste.", + "activeContrastBorder": "Bordure supplémentaire autour des éléments actifs pour les séparer des autres et obtenir un meilleur contraste.", + "textSeparatorForeground": "Couleur pour les séparateurs de texte.", + "textLinkForeground": "Couleur des liens dans le texte.", + "textLinkActiveForeground": "Couleur des liens actifs dans le texte.", + "textPreformatForeground": "Couleur des segments de texte préformatés.", + "widgetShadow": "Couleur de l'ombre des widgets, comme rechercher/remplacer, au sein de l'éditeur.", "inputBoxBackground": "Arrière-plan de la zone d'entrée.", "inputBoxForeground": "Premier plan de la zone d'entrée.", "inputBoxBorder": "Bordure de la zone d'entrée.", "inputBoxActiveOptionBorder": "Couleur de la bordure des options activées dans les champs d'entrée.", + "inputValidationInfoBackground": "Couleur d'arrière-plan de la validation d'entrée pour la gravité des informations.", + "inputValidationInfoBorder": "Couleur de bordure de la validation d'entrée pour la gravité des informations.", + "inputValidationWarningBackground": "Couleur d'arrière-plan de la validation d'entrée pour l'avertissement sur les informations.", + "inputValidationWarningBorder": "Couleur de bordure de la validation d'entrée pour la gravité de l'avertissement.", + "inputValidationErrorBackground": "Couleur d'arrière-plan de la validation d'entrée pour la gravité de l'erreur.", + "inputValidationErrorBorder": "Couleur de bordure de la validation d'entrée pour la gravité de l'erreur. ", "dropdownBackground": "Arrière-plan de la liste déroulante.", "dropdownForeground": "Premier plan de la liste déroulante.", "dropdownBorder": "Bordure de la liste déroulante.", + "listFocusBackground": "Couleur d'arrière-plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listActiveSelectionBackground": "Couleur d'arrière-plan de la liste/l'arborescence de l'élément sélectionné quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listActiveSelectionForeground": "Couleur de premier plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listInactiveSelectionBackground": "Couleur d'arrière-plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est inactive. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listHoverBackground": "Arrière-plan de la liste/l'arborescence pendant le pointage sur des éléments avec la souris.", + "listDropBackground": "Arrière-plan de l'opération de glisser-déplacer dans une liste/arborescence pendant le déplacement d'éléments avec la souris.", + "highlight": "Couleur de premier plan dans la liste/l'arborescence pour la surbrillance des correspondances pendant la recherche dans une liste/arborescence.", "pickerGroupForeground": "Couleur du sélecteur rapide pour les étiquettes de regroupement.", "pickerGroupBorder": "Couleur du sélecteur rapide pour les bordures de regroupement.", + "buttonForeground": "Couleur de premier plan du bouton.", + "buttonBackground": "Couleur d'arrière-plan du bouton.", + "buttonHoverBackground": "Couleur d'arrière-plan du bouton pendant le pointage.", + "badgeBackground": "Couleur de fond des badges. Les badges sont de courts libelés d'information, ex. le nombre de résultats de recherche.", + "badgeForeground": "Couleur des badges. Les badges sont de courts libelés d'information, ex. le nombre de résultats de recherche.", + "scrollbarShadow": "Ombre de la barre de défilement pour indiquer que la vue défile.", + "scrollbarSliderBackground": "Couleur d'arrière-plan du curseur.", + "scrollbarSliderHoverBackground": "Couleur d'arrière-plan du curseur pendant le pointage.", + "scrollbarSliderActiveBackground": "Couleur d'arrière-plan du curseur actif.", + "progressBarBackground": "Couleur de fond pour la barre de progression qui peut s'afficher lors d'opérations longues.", "editorBackground": "Couleur d'arrière-plan de l'éditeur.", "editorForeground": "Couleur de premier plan par défaut de l'éditeur.", + "editorWidgetBackground": "Couleur d'arrière-plan des gadgets de l'éditeur tels que rechercher/remplacer.", "editorSelection": "Couleur de la sélection de l'éditeur.", "editorInactiveSelection": "Couleur de la sélection dans un éditeur inactif.", "editorSelectionHighlight": "Couleur des régions dont le contenu est identique à la sélection.", "editorFindMatch": "Couleur du résultat de recherche actif.", "findMatchHighlight": "Couleur des autres résultats de recherche.", "findRangeHighlight": "Couleur de la plage limitant la recherche.", + "hoverHighlight": "Mettez en surbrillance ci-dessous le mot pour lequel un pointage s'affiche.", + "hoverBackground": "Couleur d'arrière-plan du pointage de l'éditeur.", + "hoverBorder": "Couleur de bordure du pointage de l'éditeur.", "activeLinkForeground": "Couleur des liens actifs.", - "linkForeground": "Couleur des liens.", - "editorWidgetBackground": "Couleur d'arrière-plan des gadgets de l'éditeur tels que rechercher/remplacer." + "diffEditorInserted": "Couleur d'arrière-plan du texte inséré.", + "diffEditorRemoved": "Couleur d'arrière-plan du texte supprimé.", + "diffEditorInsertedOutline": "Couleur de contour du texte inséré.", + "diffEditorRemovedOutline": "Couleur de contour du texte supprimé." } \ No newline at end of file diff --git a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css b/i18n/fra/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json similarity index 62% rename from src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css rename to i18n/fra/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json index 5bdbf170008..7e050bb0177 100644 --- a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css +++ b/i18n/fra/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -2,7 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -.monaco-editor.vs .valueSetReplacement { outline: solid 2px #888; } -.monaco-editor.vs-dark .valueSetReplacement { outline: solid 2px #888; } -.monaco-editor.hc-black .valueSetReplacement { outline: none; } +// Do not edit this file. It is machine generated. +{ + "overwritingExtension": "Remplacement de l'extension {0} par {1}.", + "extensionUnderDevelopment": "Chargement de l'extension de développement sur {0}" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/fra/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..560eb4d7f26 --- /dev/null +++ b/i18n/fra/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Fermer", + "cancel": "Annuler", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/fra/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..ff14373fbdc --- /dev/null +++ b/i18n/fra/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "Aucun TreeExplorerNodeProvider ayant l'ID '{0}' n'est inscrit.", + "treeExplorer.failedToProvideRootNode": "Le TreeExplorerNodeProvider '{0}' n'a pas pu fournir le nÅ“ud racine." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json index 97d34c7a9e9..ef4f2686d9e 100644 --- a/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,6 @@ "configureLocale": "Configurer la langue", "displayLanguage": "Définit le langage affiché par VSCode.", "doc": "Consultez {0} pour connaître la liste des langues prises en charge.", - "restart": "Si la valeur change, VSCode doit redémarrer.", "fail.createSettings": "Impossible de créer '{0}' ({1}).", "JsonSchema.locale": "Langue d'interface utilisateur (IU) à utiliser." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/fra/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 461dbd7c73b..044f984b1ac 100644 --- a/i18n/fra/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "Ouvrir l'éditeur précédent du groupe", "openNextRecentlyUsedEditorInGroup": "Ouvrir l'éditeur suivant du groupe", "navigateEditorHistoryByInput": "Ouvrir l'éditeur précédent dans l'historique", + "openNextRecentlyUsedEditor": "Ouvrir l'éditeur suivant", + "openPreviousRecentlyUsedEditor": "Ouvrir l'éditeur précédent", "clearEditorHistory": "Effacer l'historique de l'éditeur", "focusLastEditorInStack": "Ouvrir le dernier éditeur du groupe", "moveEditorLeft": "Déplacer l'éditeur vers la gauche", diff --git a/i18n/fra/src/vs/workbench/common/theme.i18n.json b/i18n/fra/src/vs/workbench/common/theme.i18n.json index d27b5b34976..8363fa14b9a 100644 --- a/i18n/fra/src/vs/workbench/common/theme.i18n.json +++ b/i18n/fra/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "Couleur d'arrière-plan du conteneur d'onglets. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabActiveBackground": "Couleur d'arrière-plan de l'onglet actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabInactiveBackground": "Couleur d'arrière-plan de l'onglet inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabBorder": "Bordure séparant les onglets les uns des autres. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabActiveEditorGroupActiveForeground": "Couleur de premier plan de l'onglet actif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", - "tabActiveEditorGroupInactiveForeground": "Couleur de premier plan de l'onglet actif dans un groupe inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabInactiveEditorGroupActiveForeground": "Couleur de premier plan de l'onglet inactif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", - "tabInactiveEditorGroupInactiveForeground": "Couleur de premier plan de l'onglet inactif dans un groupe inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", + "editorGroupBackground": "Couleur d'arrière-plan d'un groupe d'éditeurs. Les groupes d'éditeurs sont les conteneurs des éditeurs. La couleur d'arrière-plan s'affiche pendant le glissement de groupes d'éditeurs.", + "editorGroupHeaderBackground": "Couleur d'arrière-plan de l'en-tête du titre du groupe d'éditeurs quand les onglets sont désactivés. Les groupes d'éditeurs sont les conteneurs des éditeurs.", "editorGroupBorder": "Couleur séparant plusieurs groupes d'éditeurs les uns des autres. Les groupes d'éditeurs sont les conteneurs des éditeurs.", - "editorDragAndDropBackground": "Couleur d'arrière-plan durant le déplacement des éditeurs.", "panelBackground": "Couleur d'arrière-plan du panneau. Les panneaux s'affichent sous la zone d'éditeurs et contiennent des affichages tels que la sortie et le terminal intégré.", "panelBorder": "Couleur de bordure de panneau dans la partie supérieure de séparation de l'éditeur. Les panneaux s'affichent sous la zone d'éditeurs et contiennent des affichages tels que la sortie et le terminal intégré.", "panelActiveTitleForeground": "Couleur du titre du panneau actif. Les panneaux se situent sous la zone de l'éditeur et contiennent des affichages comme la sortie et le terminal intégré.", @@ -24,15 +22,19 @@ "statusBarNoFolderBackground": "Couleur d'arrière-plan de la barre d'état quand aucun dossier n'est ouvert. La barre d'état est affichée en bas de la fenêtre.", "statusBarItemActiveBackground": "Couleur d'arrière-plan de l'élément de la barre d'état durant un clic. La barre d'état est affichée en bas de la fenêtre.", "statusBarItemHoverBackground": "Couleur d'arrière-plan de l'élément de la barre d'état durant un pointage. La barre d'état est affichée en bas de la fenêtre.", + "statusBarProminentItemBackground": "Couleur d'arrière-plan des éléments importants de la barre d'état. Les éléments importants se différencient des autres entrées de la barre d'état pour indiquer l'importance. La barre d'état est affichée en bas de la fenêtre.", + "statusBarProminentItemHoverBackground": "Couleur d'arrière-plan des éléments importants de la barre d'état pendant le pointage. Les éléments importants se différencient des autres entrées de la barre d'état pour indiquer l'importance. La barre d'état est affichée en bas de la fenêtre.", "activityBarBackground": "Couleur d'arrière-plan de la barre d'activités. La barre d'activités s'affiche complètement à gauche ou à droite, et permet de naviguer entre les affichages de la barre latérale.", "activityBarForeground": "Couleur de premier plan de la barre d'activités (par ex., utilisée pour les icônes). La barre d'activités s'affiche complètement à gauche ou à droite, et permet de parcourir les vues de la barre latérale.", - "activityBarDragAndDropBackground": "Couleur des commentaires sur une opération de glisser-déplacer pour les éléments de la barre d'activités. La barre d'activités, située à l'extrême gauche ou droite, permet de basculer entre les affichages de la barre latérale.", "activityBarBadgeBackground": "Couleur d'arrière-plan du badge de notification d'activité. La barre d'activités, située à l'extrême gauche ou droite, permet de basculer entre les affichages de la barre latérale.", "activityBarBadgeForeground": "Couleur de premier plan du badge de notification d'activité. La barre d'activités, située à l'extrême gauche ou droite, permet de basculer entre les affichages de la barre latérale.", "sideBarBackground": "Couleur d'arrière-plan de la barre latérale. La barre latérale est le conteneur des affichages tels que ceux de l'exploration et la recherche.", "sideBarTitleForeground": "Couleur de premier plan du titre de la barre latérale. La barre latérale est le conteneur des affichages tels que ceux de l'exploration et la recherche.", + "sideBarSectionHeaderBackground": "Couleur d'arrière-plan de l'en-tête de section de la barre latérale. La barre latérale est le conteneur des vues comme celles de l'explorateur et la recherche.", "titleBarActiveForeground": "Premier plan de la barre de titre quand la fenêtre est active. Notez que cette couleur est uniquement prise en charge sur macOS.", "titleBarInactiveForeground": "Premier plan de la barre de titre quand la fenêtre est inactive. Notez que cette couleur est uniquement prise en charge sur macOS.", "titleBarActiveBackground": "Arrière-plan de la barre de titre quand la fenêtre est active. Notez que cette couleur est uniquement prise en charge sur macOS.", - "titleBarInactiveBackground": "Arrière-plan de la barre de titre quand la fenêtre est inactive. Notez que cette couleur est uniquement prise en charge sur macOS." + "titleBarInactiveBackground": "Arrière-plan de la barre de titre quand la fenêtre est inactive. Notez que cette couleur est uniquement prise en charge sur macOS.", + "notificationsForeground": "Couleur de premier plan des notifications. Les notifications défilent à partir du haut de la fenêtre.", + "notificationsBackground": "Couleur d'arrière-plan des notifications. Les notifications défilent à paritr du haut de la fenêtre." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json index e03298e0044..d1fbda145ce 100644 --- a/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Affichage", "help": "Aide", "file": "Fichier", + "developer": "Développeur", "showEditorTabs": "Contrôle si les éditeurs ouverts doivent s'afficher ou non sous des onglets.", "editorTabCloseButton": "Contrôle la position des boutons de fermeture des onglets de l'éditeur, ou les désactive quand le paramètre a la valeur 'off'.", "showIcons": "Contrôle si les éditeurs ouverts doivent s'afficher ou non avec une icône. Cela implique notamment l'activation d'un thème d'icône.", @@ -41,7 +42,6 @@ "window.newWindowDimensions.inherit": "Permet d'ouvrir les nouvelles fenêtres avec la même dimension que la dernière fenêtre active.", "window.newWindowDimensions.maximized": "Permet d'ouvrir les nouvelles fenêtres de manière agrandie.", "window.newWindowDimensions.fullscreen": "Permet d'ouvrir les nouvelles fenêtres en mode plein écran.", - "newWindowDimensions": "Contrôle les dimensions d'ouverture d'une nouvelle fenêtre. Par défaut, une nouvelle fenêtre s'ouvre au centre de l'écran avec des dimensions réduites. Quand le paramètre a la valeur 'inherit', la fenêtre a les mêmes dimensions que la dernière fenêtre active. Quand le paramètre a la valeur 'maximized', la fenêtre s'ouvre en mode plein écran et dans sa taille maximale, si elle est configurée avec la valeur 'fullscreen'.", "window.menuBarVisibility.default": "Le menu n'est masqué qu'en mode plein écran.", "window.menuBarVisibility.visible": "Le menu est toujours visible même en mode plein écran.", "window.menuBarVisibility.toggle": "Le menu est masqué mais il peut être affiché via la touche Alt.", diff --git a/i18n/fra/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/shell.i18n.json index 6a2b2ffff3f..a24bedcde3d 100644 --- a/i18n/fra/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/fra/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "Il est déconseillé d'exécuter du code en tant qu'utilisateur 'root'.", - "prof.message": "Création réussie des profils.", - "prof.detail": "Créez un problème et joignez manuellement les fichiers suivants :\n{0}", - "prof.restartAndFileIssue": "Créer le problème et redémarrer", - "prof.restart": "Redémarrer" + "runningAsRoot": "Il est déconseillé d'exécuter du code en tant qu'utilisateur 'root'." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/electron-browser/window.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/window.i18n.json index 133473eb180..4bb9062991d 100644 --- a/i18n/fra/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/fra/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "Coller", "selectAll": "Tout Sélectionner", "confirmOpen": "Voulez-vous vraiment ouvrir {0} dossiers ?", - "confirmOpenButton": "&&Ouvrir...", - "developer": "Développeur", - "file": "Fichier" + "confirmOpenButton": "&&Ouvrir..." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..e677c5f3571 100644 --- a/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "Développeur : Inspecter les mappages de touches" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index e52f1c8e8ea..1783ec559cb 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "Modifier un point d'arrêt...", "setValue": "Définir la valeur", "addWatchExpression": "Ajouter une expression", + "editWatchExpression": "Modifier l'expression", "addToWatchExpressions": "Ajouter à la fenêtre Espion", "removeWatchExpression": "Supprimer une expression", "removeAllWatchExpressions": "Supprimer toutes les expressions", diff --git a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..2cfe628ea39 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "Couleur d'arrière-plan de la barre d'outils de débogage." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..7b029bfc1e7 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Cliquez pour suivre (Commande + clic permet d'ouvrir sur le côté)", + "fileLink": "Cliquez pour suivre (Ctrl + clic permet d'ouvrir sur le côté)" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..23ae9b5eef6 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "Contrôle le comportement de la console de débogage interne." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 837c20b08ff..9fa5e84fe4a 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "L'état de l'objet est capturé à partir de la première évaluation", - "fileLinkMac": "Cliquez pour suivre (Commande + clic permet d'ouvrir sur le côté)", - "fileLink": "Cliquez pour suivre (Ctrl + clic permet d'ouvrir sur le côté)", "replVariableAriaLabel": "La variable {0} a la valeur {1}, boucle REPL (Read Eval Print Loop), débogage", "replExpressionAriaLabel": "L'expression {0} a la valeur {1}, boucle REPL (Read Eval Print Loop), débogage", "replValueOutputAriaLabel": "{0}, boucle REPL (Read Eval Print Loop), débogage", diff --git a/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 37eac1f9620..b52cacf9ab2 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "Type de requête de configuration. Il peut s'agir de \"launch\" ou \"attach\".", "debugServer": "Pour le développement d'une extension de débogage uniquement : si un port est spécifié, VS Code tente de se connecter à un adaptateur de débogage s'exécutant en mode serveur", "debugPrelaunchTask": "Tâche à exécuter avant le démarrage de la session de débogage.", - "internalConsoleOptions": "Contrôle le comportement de la console de débogage interne.", "debugWindowsConfiguration": "Attributs de configuration de lancement spécifiques à Windows.", "debugOSXConfiguration": "Attributs de configuration de lancement spécifiques à OS X.", "debugLinuxConfiguration": "Attributs de configuration de lancement spécifiques à Linux.", diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..b64bb8a15cc --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet : Balance (inward)", + "balanceOutward": "Emmet : Balance (outward)" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..a8c57987711 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet : Previous Edit Point", + "nextEditPoint": "Emmet : Next Edit Point" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..4f8041f2fb1 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet : Evaluate Math Expression" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..29b06df4dce --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet : Expand Abbreviation" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..89cee185d4d --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet : Increment by 0.1", + "incrementNumberByOne": "Emmet : Increment by 1", + "incrementNumberByTen": "Emmet : Increment by 10", + "decrementNumberByOneTenth": "Emmet : Decrement by 0.1", + "decrementNumberByOne": "Emmet : Decrement by 1", + "decrementNumberByTen": "Emmet : Decrement by 10" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..fd27599315a --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet : Go to Matching Pair" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..172231ee72c --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet : Merge Lines" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..e15d8ff52bc --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet : Reflect CSS Value" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..1764345605f --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet : Remove Tag" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..b53add87909 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet : Select Previous Item", + "selectNextItem": "Emmet : Select Next Item" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..701bd61f9b9 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet : Split/Join Tag" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..46ab423bdfc --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet : Toggle Comment" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..ce110b0e82d --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet : Update Image Size" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..948679f37cf --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet : Update Tag", + "enterTag": "Entrer une balise", + "tag": "Balise" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..4e4c925168c --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet : Wrap with Abbreviation", + "enterAbbreviation": "Entrer une abréviation", + "abbreviation": "Abréviation" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..33db3866d0c --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Une fois les abréviations Emmet activées, elles se développent quand vous appuyez sur la touche Tab.", + "emmetPreferences": "Préférences utilisées pour modifier le comportement de certaines actions et résolveurs d'Emmet.", + "emmetSyntaxProfiles": "Définissez le profil pour la syntaxe spécifiée ou utilisez votre propre profil avec des règles spécifiques.", + "emmetExclude": "Ensemble de langages où les abréviations emmet ne doivent pas être développées.", + "emmetExtensionsPath": "Chemin d'un dossier contenant les profils, extraits et préférences Emmet" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index c0fac8346b8..82bea9c4375 100644 --- a/i18n/fra/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "Ajoute une vue personnalisée", + "vscode.extension.contributes.view.id": "ID unique utilisé pour identifier la vue créée avec vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Chaîne contrôlable de visu permettant d'afficher la vue", + "vscode.extension.contributes.view.icon": "Chemin de l'icône de la vue", + "vscode.extension.contributes.views": "Ajoute des vues personnalisées", "showViewlet": "Afficher {0}", "view": "Affichage" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 46cfb8cb55b..c4a2f4bc59d 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,7 @@ "showRecommendations": "Afficher les recommandations", "neverShowAgain": "Ne plus afficher", "close": "Fermer", - "workspaceRecommended": "Cet espace de travail a des recommandations d'extension." + "workspaceRecommended": "Cet espace de travail a des recommandations d'extension.", + "no": "Non", + "cancel": "Annuler" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..8fa1a11d54a --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "Oui", + "no": "Non", + "uninstall": "Désinstaller", + "later": "Plus tard" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 13f0487e367..6f916235625 100644 --- a/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "Configurez les associations entre les fichiers et les langages (par exemple, \"*.extension\": \"html\"). Celles-ci ont priorité sur les associations par défaut des langages installés.", "encoding": "Encodage du jeu de caractères par défaut à utiliser durant la lecture et l'écriture des fichiers.", "autoGuessEncoding": "Quand cette option est activée, tente de deviner l'encodage du jeu de caractères à l'ouverture des fichiers", - "eol": "Caractère de fin de ligne par défaut.", "trimTrailingWhitespace": "Si l'option est activée, l'espace blanc de fin est supprimé au moment de l'enregistrement d'un fichier.", "insertFinalNewline": "Quand l'option est activée, une nouvelle ligne finale est insérée à la fin du fichier au moment de son enregistrement.", "files.autoSave.off": "Un fichier dont l'intégrité est compromise n'est jamais enregistré automatiquement.", @@ -27,8 +26,6 @@ "autoSaveDelay": "Contrôle le délai en ms au bout duquel un fichier à l'intégrité compromise est enregistré automatiquement. S'applique uniquement quand 'files.autoSave' a la valeur '{0}'", "watcherExclude": "Configurez les modèles Glob des chemins de fichiers à exclure de la surveillance des fichiers. La modification de ce paramètre nécessite un redémarrage. Si vous constatez que le code consomme beaucoup de temps processeur au démarrage, excluez les dossiers volumineux pour réduire la charge initiale.", "hotExit.off": "Désactivez la sortie à chaud.", - "hotExit.onExit": "La sortie à chaud se déclenche à la fermeture de l'application, c'est-à-dire quand la dernière fenêtre est fermée dans Windows/Linux, ou quand la commande workbench.action.quit se déclenche (palette de commandes, combinaison de touches, menu). Toutes les fenêtres avec des sauvegardes sont restaurées au prochain lancement.", - "hotExit.onExitAndWindowClose": "La sortie à chaud se déclenche à la fermeture de l'application, c'est-à-dire quand la dernière fenêtre est fermée dans Windows/Linux, ou quand la commande workbench.action.quit se déclenche (palette de commandes, combinaison de touches, menu), ainsi que toute fenêtre comportant un dossier ouvert, qu'il s'agisse ou non de la dernière fenêtre. Toutes les fenêtres qui n'ont pas de dossiers ouverts sont restaurées au prochain lancement. Pour restaurer les fenêtres de dossiers telles qu'elles étaient avant l'arrêt, affectez à \"window.reopenFolders\" la valeur \"all\".", "hotExit": "Contrôle si les fichiers non enregistrés sont mémorisés entre les sessions, ce qui permet d'ignorer la demande d'enregistrement à la sortie de l'éditeur.", "defaultLanguage": "Mode de langage par défaut affecté aux nouveaux fichiers.", "editorConfigurationTitle": "Éditeur", diff --git a/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index fb432045fcc..56c9603dba7 100644 --- a/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "Démarrage lent détecté", - "slow.detail": "Le démarrage a été très lent. Redémarrez '{0}' en ayant activé le profilage, partagez les profils avec nous, et nous ferons en sorte que le démarrage retrouve sa rapidité d'exécution." + "slow.detail": "Le démarrage a été très lent. Redémarrez '{0}' en ayant activé le profilage, partagez les profils avec nous, et nous ferons en sorte que le démarrage retrouve sa rapidité d'exécution.", + "prof.message": "Création réussie des profils.", + "prof.detail": "Créez un problème et joignez manuellement les fichiers suivants :\n{0}", + "prof.restartAndFileIssue": "Créer le problème et redémarrer", + "prof.restart": "Redémarrer" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index 5f3ed88ebd2..61742507b36 100644 --- a/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "Ouvrir les paramètres utilisateur", "openGlobalKeybindings": "Ouvrir les raccourcis clavier", + "openGlobalKeybindingsFile": "Ouvrir le fichier des raccourcis clavier", "openWorkspaceSettings": "Ouvrir les paramètres d'espace de travail", "configureLanguageBasedSettings": "Configurer les paramètres spécifiques au langage...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index ea443e85fbe..b89dba6f17f 100644 --- a/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "{0} correspondances trouvées", "searchMatch": "{0} correspondance trouvée", - "fileMatchAriaLabel": "{0} correspondances dans le fichier {1} du dossier {2}, Résultat de la recherche", - "replacePreviewResultAria": "Résultat de l'aperçu du remplacement, {0}", - "searchResultAria": "{0}, Résultat de la recherche" + "fileMatchAriaLabel": "{0} correspondances dans le fichier {1} du dossier {2}, Résultat de la recherche" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 523b1b3eedf..03c80a19e00 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Tapez le nom d'une tâche à redémarrer", "noTasksMatching": "Aucune tâche correspondante", "noTasksFound": "Aucune tâche à recommencer n'a été trouvée" diff --git a/i18n/fra/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index dbe8afe6d87..f1a32f4b7bf 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Tapez le nom d'une tâche à exécuter", "noTasksMatching": "No tasks matching", "noTasksFound": "Tâches introuvables" diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 0c1b20136ea..e59f5fcb09a 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Sélectionner un exécuteur de tâches", "ConfigureTaskRunnerAction.autoDetecting": "Détection automatique des tâches pour {0}", "ConfigureTaskRunnerAction.autoDetect": "En raison de l'échec de la détection automatique du système de tâche, le modèle par défaut va être utilisé. Pour plus d'informations, consultez la sortie de la tâche.", + "ConfigureTaskRunnerAction.autoDetectError": "La détection automatique du système de tâche a produit des erreurs. Consultez la sortie de la tâche pour plus d'informations.", "ConfigureTaskRunnerAction.failed": "Impossible de créer le fichier 'tasks.json' dans le dossier '.vscode'. Pour plus d'informations, consultez la sortie de la tâche.", "ConfigureTaskRunnerAction.label": "Configurer l'exécuteur de tâches", "ConfigureBuildTaskAction.label": "Configurer une tâche de build", @@ -17,7 +18,6 @@ "problems": "Problèmes", "manyMarkers": "99", "tasks": "Tâches", - "TaskSystem.noHotSwap": "Le changement du moteur d'exécution de tâches nécessite le redémarrage de VS Code. Changement ignoré.", "TaskService.noBuildTask": "Aucune tâche de build définie. Marquez une tâche avec 'isBuildCommand' dans le fichier tasks.json.", "TaskService.noTestTask": "Aucune tâche de test définie. Marquez une tâche avec 'isTestCommand' dans le fichier tasks.json.", "TaskServer.noTask": "La tâche {0} à exécuter est introuvable.", diff --git a/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 8ad3a81eb90..515d4f6f9c5 100644 --- a/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,13 @@ { "selectTheme.label": "Thème de couleur", "installColorThemes": "Installer des thèmes de couleurs supplémentaires...", - "problemChangingTheme": "Problème de définition du thème : {0}", - "themes.selectTheme": "Sélectionner le thème de couleur", "selectIconTheme.label": "Thème d'icône de fichier", "installIconThemes": "Installer des thèmes d'icônes de fichiers supplémentaires...", "noIconThemeLabel": "Aucun", "noIconThemeDesc": "Désactiver les icônes de fichiers", "problemChangingIconTheme": "Problème de définition du thème d'icône : {0}", "themes.selectIconTheme": "Sélectionner un thème d'icône de fichier", + "generateColorTheme.label": "Générer le thème de couleur à partir des paramètres actuels", "preferences": "Préférences", "developer": "Développeur" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 2c738238b0d..88d26394dcf 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -13,31 +13,25 @@ "welcomePage.recent": "Récent", "welcomePage.noRecentFolders": "Aucun dossier récent", "welcomePage.help": "Aide", - "welcomePage.productDocumentation": "Documentation du produit", "welcomePage.introductoryVideos": "Vidéos d'introduction", + "welcomePage.productDocumentation": "Documentation du produit", "welcomePage.gitHubRepository": "Dépôt GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Afficher la page d'accueil au démarrage", - "welcomePage.quickLinks": "Liens rapides", - "welcomePage.interactivePlayground": "Terrain de jeu interactif", - "welcomePage.interactivePlaygroundDescription": "Essayez les fonctionnalités essentielles de l'éditeur en suivant une brève procédure pas à pas", - "welcomePage.interfaceOverview": "Vue d'ensemble de l'interface", - "welcomePage.interfaceOverviewDescription": "Obtenez une superposition visuelle mettant en évidence les principaux composants de l'IU", + "welcomePage.customize": "Personnaliser", + "welcomePage.installKeymapDescription": "Installer les raccourcis clavier", + "welcomePage.others": "autres", "welcomePage.colorTheme": "Thème de couleur", "welcomePage.colorThemeDescription": "Personnalisez l'apparence de l'éditeur et de votre code", - "welcomePage.keybindingsReference": "Référence des raccourcis clavier", - "welcomePage.keybindingsReferenceDescription": "Fichier PDF imprimable avec les raccourcis clavier les plus usuels", "welcomePage.showCommands": "Rechercher et exécuter toutes les commandes", "welcomePage.showCommandsDescription": "Utilisez et recherchez rapidement des commandes dans le Panneau de configuration ({0})", + "welcomePage.interfaceOverview": "Vue d'ensemble de l'interface", + "welcomePage.interfaceOverviewDescription": "Obtenez une superposition visuelle mettant en évidence les principaux composants de l'IU", + "welcomePage.interactivePlayground": "Terrain de jeu interactif", + "welcomePage.interactivePlaygroundDescription": "Essayez les fonctionnalités essentielles de l'éditeur en suivant une brève procédure pas à pas", + "welcomePage.quickLinks": "Liens rapides", + "welcomePage.keybindingsReference": "Référence des raccourcis clavier", + "welcomePage.keybindingsReferenceDescription": "Fichier PDF imprimable avec les raccourcis clavier les plus usuels", "welcomePage.configureSettings": "Configurer les paramètres", - "welcomePage.configureSettingsDescription": "Déverrouillez toute la puissance de VS Code en adaptant les paramètres", - "welcomePage.installKeymapDescription": "Installer les raccourcis clavier", - "welcomePage.installKeymap": "Installez les raccourcis clavier de {0}, {1}, {2} et {3}", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (actuel)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (actuel)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (actuel)", - "welcomePage.others": "autres" + "welcomePage.configureSettingsDescription": "Déverrouillez toute la puissance de VS Code en adaptant les paramètres" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 3d4de6c3ca3..66bb9f2ab66 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,16 @@ // Do not edit this file. It is machine generated. { "welcomePage": "Bienvenue", - "welcome.title": "Bienvenue", + "welcomePage.typeScript": "TypeScript", + "welcomePage.php": "PHP", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "Les raccourcis clavier {0} sont déjà installés.", "welcomePage.willReloadAfterInstallingKeymap": "La fenêtre se recharge après l'installation des raccourcis clavier {0}.", - "ok": "OK", "welcomePage.installingKeymap": "Installation des raccourcis clavier de {0}...", "welcomePage.keymapNotFound": "Les raccourcis clavier {0} ayant l'ID {1} sont introuvables.", + "welcome.title": "Bienvenue", + "ok": "OK", "cancel": "Annuler" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 1b65f474a56..a27dad756b1 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "indépendant" + "walkThrough.unboundCommand": "indépendant", + "walkThrough.gitNotFound": "Git semble ne pas être installé sur votre système." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index df367cb95ef..8c86edbfa40 100644 --- a/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "Ouvrir les paramètres", + "close": "Fermer", "errorUnknownKey": "Impossible d'écrire dans le fichier de configuration (clé inconnue)", - "errorInvalidTarget": "Impossible d'écrire dans le fichier config (cible non valide)", - "errorNoWorkspaceOpened": "Impossible d'écrire les paramètres, car aucun dossier n'est ouvert. Ouvrez d'abord un dossier, puis réessayez.", - "errorInvalidConfiguration": "Impossible d'écrire les paramètres. Ouvrez les **Paramètres utilisateur** pour corriger les erreurs/avertissements présents dans le fichier, puis réessayez.", - "errorInvalidConfigurationWorkspace": "Impossible d'écrire les paramètres. Ouvrez les **Paramètres d'espace de travail** pour corriger les erreurs/avertissements présents dans le fichier, puis réessayez.", - "errorConfigurationFileDirty": "Impossible d'écrire les paramètres, car l'intégrité du fichier est compromise. Enregistrez le fichier des **Paramètres utilisateur**, puis réessayez.", - "errorConfigurationFileDirtyWorkspace": "Impossible d'écrire les paramètres, car l'intégrité du fichier est compromise. Enregistrez le fichier des **Paramètres d'espace de travail**, puis réessayez." + "errorInvalidTarget": "Impossible d'écrire dans le fichier config (cible non valide)" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/fra/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index e70e749cfa8..60ec894aa9e 100644 --- a/i18n/fra/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/fra/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Touche ou séquence de touches spécifique à Windows.", "vscode.extension.contributes.keybindings.when": "Condition quand la touche est active.", "vscode.extension.contributes.keybindings": "Ajoute des combinaisons de touches.", - "openDocumentation": "En savoir plus", - "keybindingMigration.ok": "OK", - "keybindingMigration.prompt": "Certains raccourcis clavier ont changé pour votre disposition de clavier.", "invalid.keybindings": "'contributes.{0}' non valide : {1}", "unboundCommands": "Voici d'autres commandes disponibles : ", "keybindings.json.title": "Configuration des combinaisons de touches", diff --git a/i18n/fra/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/fra/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index d48cbf383ce..2eb42546905 100644 --- a/i18n/fra/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/fra/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "Couleurs de la coloration syntaxique", "schema.properties.name": "Description de la règle", - "schema.fontStyle": "Style de police de la règle : 'italique', 'gras' ou 'souligné', ou une combinaison de ces styles" + "schema.fontStyle": "Style de police de la règle : 'italique', 'gras' ou 'souligné', ou une combinaison de ces styles", + "schema.tokenColors.path": "Chemin d'un fichier tmTheme (relatif au fichier actuel)" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/fra/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 4849a048ec4..2d6a6848e27 100644 --- a/i18n/fra/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/fra/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "Problèmes durant l'analyse du fichier de thème JSON : {0}" + "error.cannotparsejson": "Problèmes durant l'analyse du fichier de thème JSON : {0}", + "error.invalidformat.colors": "Problème pendant l'analyse du fichier de thème de couleur : {0}. La propriété 'colors' n'est pas de type 'object'.", + "error.invalidformat.tokenColors": "Problème pendant l'analyse du fichier de thème de couleur : {0}. La propriété 'tokenColors' doit être un tableau spécifiant des couleurs ou le chemin d'un fichier de thème TextMate", + "error.plist.invalidformat": "Problème pendant l'analyse du fichier tmTheme : {0}. 'settings' n'est pas un tableau.", + "error.cannotparse": "Problèmes pendant l'analyse du fichier tmTheme : {0}", + "error.cannotload": "Problèmes pendant le chargement du fichier tmTheme {0} : {1}" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/fra/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 3181391a3b2..01dfa20dfb8 100644 --- a/i18n/fra/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/fra/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "Remplace les couleurs du thème de couleur sélectionné.", + "workbenchColors.deprecated": "Le paramètre n'est plus expérimental et a été renommé 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "Utiliser 'workbench.colorCustomizations' à la place" } \ No newline at end of file diff --git a/i18n/ita/extensions/git/out/commands.i18n.json b/i18n/ita/extensions/git/out/commands.i18n.json index 341133e5827..530bbe4a409 100644 --- a/i18n/ita/extensions/git/out/commands.i18n.json +++ b/i18n/ita/extensions/git/out/commands.i18n.json @@ -16,6 +16,11 @@ "confirm discard": "Rimuovere le modifiche in {0}?", "confirm discard multiple": "Rimuovere le modifiche in {0} file?", "discard": "Rimuovi modifiche", + "confirm discard all": "Sei sicuro di voler annullare TUTTE le modifiche? Quest'azione è IRREVERSIBILE!", + "discardAll": "Rimuovi TUTTE le modifiche", + "no staged changes": "Non ci sono modifiche in stage di cui eseguire il commit.\n\nSI desidera mettere in stage automaticamente tutte le modifiche ed eseguirne il commit direttamente?", + "yes": "Sì", + "always": "Sempre", "no changes": "Non ci sono modifiche di cui eseguire il commit.", "commit message": "Messaggio di commit", "provide commit message": "Specificare un messaggio di commit", @@ -31,6 +36,7 @@ "no remotes to publish": "Il repository non contiene elementi remoti configurati come destinazione della pubblicazione.", "disabled": "GIT è disabilitato oppure non supportato in quest'area di lavoro", "clean repo": "Pulire l'albero di lavoro del repository prima dell'estrazione.", + "cant push": "Impossibile effettuare il push in remoto. Effettua prima un 'pull' per integrare le tue modifiche.", "git error details": "GIT: {0}", "git error": "Errore GIT", "open git log": "Apri log GIT" diff --git a/i18n/ita/extensions/git/package.i18n.json b/i18n/ita/extensions/git/package.i18n.json index c514f38f714..3ba24f908e9 100644 --- a/i18n/ita/extensions/git/package.i18n.json +++ b/i18n/ita/extensions/git/package.i18n.json @@ -9,11 +9,14 @@ "command.refresh": "Aggiorna", "command.openChange": "Apri modifiche", "command.openFile": "Apri file", + "command.stage": "Prepara modifiche per commit", + "command.stageAll": "Prepara tutte le modifiche per commit", "command.stageSelectedRanges": "Prepara per il commit intervalli selezionati", "command.revertSelectedRanges": "Ripristina intervalli selezionati", "command.unstage": "Annulla preparazione modifiche per commit", "command.unstageAll": "Annulla preparazione di tutte le modifiche per commit", "command.unstageSelectedRanges": "Annulla preparazione per il commit di intervalli selezionati", + "command.clean": "Rimuovi modifiche", "command.cleanAll": "Rimuovi tutte le modifiche", "command.commit": "Commit", "command.commitStaged": "Esegui commit dei file preparati", @@ -36,6 +39,10 @@ "config.autofetch": "Indica se il recupero automatico è abilitato", "config.enableLongCommitWarning": "Indica se visualizzare un avviso in caso di messaggi di commit lunghi", "config.confirmSync": "Conferma prima di sincronizzare i repository GIT", + "config.countBadge": "Controlla il contatore delle notifiche git. Con `all` vengono conteggiate tutte le modifiche. Con `tracked` vengono conteggiate solo le revisioni. Con `off` il contatore è disattivato.", + "config.checkoutType": "Controlla il tipo di branch mostrati eseguendo il comando `Checkout in...`. `all` mostra tutti i refs, `local` mostra solamente i branch locali, `tags` mostra solamente i tag e `remote` mostra solamente i branch remoti.", "config.ignoreLegacyWarning": "Ignora l'avvertimento legacy di Git", - "config.ignoreLimitWarning": "Ignora il messaggio di avviso quando ci sono troppi cambiamenti in un repository" + "config.ignoreLimitWarning": "Ignora il messaggio di avviso quando ci sono troppi cambiamenti in un repository", + "config.defaultCloneDirectory": "Il percorso predefinito dove clonare un repository GIT", + "config.enableSmartCommit": "Eseguire il commit di tutte le modifiche quando non ci sono cambiamenti in stage." } \ No newline at end of file diff --git a/i18n/ita/extensions/gulp/package.i18n.json b/i18n/ita/extensions/gulp/package.i18n.json index 8b6ad71cd4e..c9bd05d8b62 100644 --- a/i18n/ita/extensions/gulp/package.i18n.json +++ b/i18n/ita/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Controlla se la rilevazione automatica delle attività gulp è on/off. L'impostazione predefinita è 'on'." +} \ No newline at end of file diff --git a/i18n/ita/extensions/jake/out/main.i18n.json b/i18n/ita/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/jake/package.i18n.json b/i18n/ita/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/markdown/out/extension.i18n.json b/i18n/ita/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/package.i18n.json b/i18n/ita/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/npm/package.i18n.json b/i18n/ita/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/extensions/npm/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/ita/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..39fde0fced3 --- /dev/null +++ b/i18n/ita/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +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. +{ + "ts-check": "Attiva il controllo semantico in un file JavaScript. Deve essere all'inizio del file.", + "ts-nocheck": "Disattiva il controllo semantico in un file JavaScript. Deve essere all'inizio del file.", + "ts-ignore": "Elimina errori di @ts-check sulla riga successiva di un file." +} \ No newline at end of file diff --git a/i18n/ita/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/ita/extensions/typescript/out/typescriptServiceClient.i18n.json index 97e691e49af..4261bf8e881 100644 --- a/i18n/ita/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/ita/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "Il percorso {0} non punta a un'installazione valida di tsserver. Verrà eseguito il fallback alla versione in bundle di TypeScript.", "noBundledServerFound": "Il file tsserver di VSCode è stato eliminato da un'altra applicazione, ad esempio uno strumento di rilevamento virus che non funziona correttamente. Reinstallare VSCode.", "versionNumber.custom": "personalizzato", diff --git a/i18n/ita/extensions/typescript/out/utils/logger.i18n.json b/i18n/ita/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/ita/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json index 4cc0b902ae3..ede347b5776 100644 --- a/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Recupero dei dati per ottimizzare IntelliSense in TypeScript", + "typesInstallerInitializationFailed.title": "Non è stato possibile installare i file di definizione tipi per le funzionalità del linguaggio JavaScript. Verificare che NPM sia installato e che sia incluso nel PATH", "typesInstallerInitializationFailed.moreInformation": "Altre informazioni", "typesInstallerInitializationFailed.doNotCheckAgain": "Non eseguire più la verifica", "typesInstallerInitializationFailed.close": "Chiudi" diff --git a/i18n/ita/extensions/typescript/package.i18n.json b/i18n/ita/extensions/typescript/package.i18n.json index 00ac1f3529e..36ff2654b3e 100644 --- a/i18n/ita/extensions/typescript/package.i18n.json +++ b/i18n/ita/extensions/typescript/package.i18n.json @@ -33,11 +33,13 @@ "javascript.validate.enable": "Abilita/Disabilita la convalida JavaScript.", "typescript.goToProjectConfig.title": "Passa a Configurazione progetto", "javascript.goToProjectConfig.title": "Passa a Configurazione progetto", - "typescript.referencesCodeLens.enabled": "Abilita/Disabilita le finestre CodeLens per i riferimenti. Richiede una versione di TypeScript uguale o successiva alla 2.0.6.", + "javascript.referencesCodeLens.enabled": "Abilita/disabilita riferimenti CodeLens nei file JavaScript.", + "typescript.referencesCodeLens.enabled": "Abilita/disabilita riferimenti CodeLens nei file TypeScript. Richiede TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Abilita/Disabilita le finestre CodeLens per le implementazioni. Richiede una versione di TypeScript uguale o successiva alla 2.2.0.", - "typescript.openTsServerLog.title": "Apri file di log del server TypeScript", + "typescript.openTsServerLog.title": "Apri il log del server TypeScript", "typescript.selectTypeScriptVersion.title": "Seleziona la versione di TypeScript", "jsDocCompletion.enabled": "Abilita/Disabilita commenti automatici JSDoc", "javascript.implicitProjectConfig.checkJs": "Abilita/disabilita il controllo semantico di file JavaScript. File jsconfig.json o tsconfig.json esistenti sovrascrivono su questa impostazione. Richiede TypeScript >= 2.3.1.", - "typescript.check.npmIsInstalled": "Controllare se NPM è installato per l'acquisizione automatica delle definizioni di tipi" + "typescript.check.npmIsInstalled": "Controllare se NPM è installato per l'acquisizione automatica delle definizioni di tipi", + "javascript.nameSuggestions": "Abilita/disabilita l'inclusione di nomi univoci dal file negli elenchi di suggerimento di JavaScript." } \ No newline at end of file diff --git a/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index 0ccb13bf8a7..c64a07b4379 100644 --- a/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "L'immagine è troppo grande per essere visualizzata nell'editor", - "resourceOpenExternalButton": "Apri immagine", - "resourceOpenExternalText": " con il programma esterno?", "nativeBinaryError": "Il file non verrà visualizzato nell'editor perché è binario, è molto grande o usa una codifica testo non supportata.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/ita/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/ita/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..2ffc2a9d464 --- /dev/null +++ b/i18n/ita/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "Simbolo non valido", + "error.invalidNumberFormat": "Formato di numero non valido", + "error.propertyNameExpected": "È previsto un nome di proprietà", + "error.valueExpected": "È previsto un valore", + "error.colonExpected": "Sono previsti i due punti", + "error.commaExpected": "È prevista la virgola", + "error.closeBraceExpected": "È prevista la parentesi graffa di chiusura", + "error.closeBracketExpected": "È prevista la parentesi quadra di chiusura", + "error.endOfFileExpected": "È prevista la fine del file" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/code/electron-main/menus.i18n.json b/i18n/ita/src/vs/code/electron-main/menus.i18n.json index 0647c24f408..86c52fb5640 100644 --- a/i18n/ita/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/ita/src/vs/code/electron-main/menus.i18n.json @@ -69,7 +69,6 @@ "miSmartSelectShrink": "&&Riduci selezione", "miViewExplorer": "&&Esplora risorse", "miViewSearch": "Cerca", - "miViewGit": "&&Git", "miViewDebug": "&&Debug", "miViewExtensions": "E&&stensioni", "miToggleOutput": "&&Output", diff --git a/i18n/ita/src/vs/code/electron-main/windows.i18n.json b/i18n/ita/src/vs/code/electron-main/windows.i18n.json index 2d2cdf7fee4..6add23a4257 100644 --- a/i18n/ita/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/ita/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "OK", "pathNotExistTitle": "Il percorso non esiste", "pathNotExistDetail": "Il percorso '{0}' sembra non esistere più sul disco.", - "accessibilityOptionsWindowTitle": "Opzioni accessibilità", "reopen": "Riapri", "wait": "Continua ad attendere", "close": "Chiudi", diff --git a/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json index 99cb8b5cd77..06ec2510c3a 100644 --- a/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Controlla lo spessore del carattere.", "fontSize": "Controlla le dimensioni del carattere in pixel.", "lineHeight": "Controlla l'altezza della riga. Usare 0 per calcolare l'altezza della riga dalle dimensioni del carattere.", + "letterSpacing": "Controlla la spaziatura tra le lettere in pixel.", "lineNumbers": "Consente di controllare la visualizzazione dei numeri di riga. I valori possibili sono 'on', 'off' e 'relative'. Con 'relative' viene visualizzato il conteggio delle righe a partire dalla posizione corrente del cursore.", "rulers": "Colonne in corrispondenza delle quali visualizzare i righelli verticali", "wordSeparators": "Caratteri che verranno usati come separatori di parola quando si eseguono operazioni o spostamenti correlati a parole", @@ -40,7 +41,6 @@ "formatOnType": "Controlla se l'editor deve formattare automaticamente la riga dopo la digitazione", "formatOnPaste": "Controlla se l'editor deve formattare automaticamente il contenuto incollato. Deve essere disponibile un formattatore che deve essere in grado di formattare un intervallo in un documento.", "suggestOnTriggerCharacters": "Controlla se i suggerimenti devono essere visualizzati automaticamente durante la digitazione dei caratteri trigger", - "acceptSuggestionOnEnter": "Controlla se i suggerimenti devono essere accettati con 'INVIO' in aggiunta a 'TAB'. In questo modo è possibile evitare ambiguità tra l'inserimento di nuove righe e l'accettazione di suggerimenti.", "acceptSuggestionOnCommitCharacter": "Controlla se accettare i suggerimenti con i caratteri di commit. Ad esempio, in JavaScript il punto e virgola (';') può essere un carattere di commit che accetta un suggerimento e digita tale carattere.", "snippetSuggestions": "Controlla se i frammenti di codice sono visualizzati con altri suggerimenti e il modo in cui sono ordinati.", "emptySelectionClipboard": "Consente di controllare se, quando si copia senza aver effettuato una selezione, viene copiata la riga corrente.", @@ -62,6 +62,7 @@ "renderLineHighlight": "Consente di controllare in che modo l'editor deve eseguire il rendering dell'evidenziazione di riga corrente. Le opzioni possibili sono 'none', 'gutter', 'line' e 'all'.", "codeLens": "Controlla se nell'editor sono visualizzate le finestre di CodeLens", "folding": "Controlla se per l'editor è abilitata la riduzione del codice", + "showFoldingControls": "Controlla se i controlli di riduzione sul margine della barra di scorrimento sono automaticamente nascosti.", "matchBrackets": "Evidenzia le parentesi corrispondenti quando se ne seleziona una.", "glyphMargin": "Controlla se l'editor deve eseguire il rendering del margine verticale del glifo. Il margine del glifo viene usato principalmente per il debug.", "useTabStops": "Inserimento ed eliminazione dello spazio vuoto dopo le tabulazioni", diff --git a/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..9c443a0f33d --- /dev/null +++ b/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Contenuto editor" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json index 6cf52ddd21e..48a155767d2 100644 --- a/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,11 @@ "caret": "Colore del cursore dell'editor.", "editorWhitespaces": "Colore dei caratteri di spazio vuoto nell'editor.", "editorIndentGuides": "Colore delle guide per i rientri dell'editor.", - "editorLineNumbers": "Colore dei numeri di riga dell'editor." + "editorLineNumbers": "Colore dei numeri di riga dell'editor.", + "editorRuler": "Colore dei righelli dell'editor.", + "editorCodeLensForeground": "Colore primo piano delle finestre di CodeLens dell'editor", + "editorBracketMatchBackground": "Colore di sfondo delle parentesi corrispondenti", + "editorBracketMatchBorder": "Colore delle caselle di parentesi corrispondenti", + "editorOverviewRulerBorder": "Colore del bordo del righello delle annotazioni.", + "editorGutter": "Colore di sfondo della barra di navigazione dell'editor. La barra contiene i margini di glifo e i numeri di riga." } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..9df481ec1b5 --- /dev/null +++ b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "Non è stata trovata alcuna definizione per '{0}'", + "generic.noResults": "Non è stata trovata alcuna definizione", + "meta.title": " - Definizioni di {0}", + "actions.goToDecl.label": "Vai alla definizione", + "actions.goToDeclToSide.label": "Apri definizione lateralmente", + "actions.previewDecl.label": "Visualizza la definizione", + "goToImplementation.noResultWord": "Non sono state trovate implementazioni per '{0}'", + "goToImplementation.generic.noResults": "Non sono state trovate implementazioni", + "meta.implementations.title": "- {0} implementazioni", + "actions.goToImplementation.label": "Vai all'implementazione", + "actions.peekImplementation.label": "Anteprima implementazione", + "goToTypeDefinition.noResultWord": "Non sono state trovate definizioni di tipi per '{0}'", + "goToTypeDefinition.generic.noResults": "Non sono state trovate definizioni di tipi", + "meta.typeDefinitions.title": " - {0} definizioni di tipo", + "actions.goToTypeDefinition.label": "Vai alla definizione di tipo", + "actions.peekTypeDefinition.label": "Anteprima definizione di tipo" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..fa526a1f9e6 --- /dev/null +++ b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Fare clic per visualizzare {0} definizioni." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/ita/src/vs/editor/contrib/hover/browser/hover.i18n.json index b5b21cc37d7..385b42e5290 100644 --- a/i18n/ita/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "Visualizza passaggio del mouse", - "hoverHighlight": "Evidenzia sotto la parola di cui viene mostrata un'area sensibile al passaggio", - "hoverBackground": "Colore di sfondo dell'area sensibile al passaggio del mouse dell'editor", - "hoverBorder": "Colore di sfondo dell'area sensibile al passaggio del mouse dell'editor" + "showHover": "Visualizza passaggio del mouse" } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index c826bb2090e..63fbdbdb30f 100644 --- a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "simbolo in {0} alla riga {1} colonna {2}", + "aria.fileReferences.1": "1 simbolo in {0}", + "aria.fileReferences.N": "{0} simboli in {1}", "aria.result.0": "Non sono stati trovati risultati", "aria.result.1": "Trovato 1 simbolo in {0}", "aria.result.n1": "Trovati {0} simboli in {1}", diff --git a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index b86cbe1b982..1b3c14ffa2f 100644 --- a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,11 +16,12 @@ "peekViewTitleInfoForeground": "Colore delle informazioni del titolo della visualizzazione rapida.", "peekViewBorder": "Colore dei bordi e della freccia della visualizzazione rapida.", "peekViewResultsBackground": "Colore di sfondo dell'elenco risultati della visualizzazione rapida.", - "peekViewResultsMatchForeground": "Primo piano per l'immissione di corrispondenze nell'elenco risultati della visualizzazione rapida.", - "peekViewResultsFileForeground": "Primo piano per l'immissione di file nell'elenco risultati della visualizzazione rapida.", + "peekViewResultsMatchForeground": "Colore primo piano dei nodi riga nell'elenco risultati della visualizzazione rapida.", + "peekViewResultsFileForeground": "Colore primo piano dei nodi file nell'elenco risultati della visualizzazione rapida.", "peekViewResultsSelectionBackground": "Colore di sfondo della voce selezionata nell'elenco risultati della visualizzazione rapida.", "peekViewResultsSelectionForeground": "Colore primo piano della voce selezionata nell'elenco risultati della visualizzazione rapida.", "peekViewEditorBackground": "Colore di sfondo dell'editor di visualizzazioni rapide.", + "peekViewEditorGutterBackground": "Colore di sfondo della barra di navigazione nell'editor visualizzazione rapida.", "peekViewResultsMatchHighlight": "Colore dell'evidenziazione delle corrispondenze nell'elenco risultati della visualizzazione rapida.", "peekViewEditorMatchHighlight": "Colore dell'evidenziazione delle corrispondenze nell'editor di visualizzazioni rapide." } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/ita/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 8bd52bf0652..eb519f2c5dd 100644 --- a/i18n/ita/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,13 @@ { "editorSuggestWidgetBackground": "Colore di sfondo del widget dei suggerimenti.", "editorSuggestWidgetBorder": "Colore del bordo del widget dei suggerimenti.", + "editorSuggestWidgetForeground": "Colore primo piano del widget dei suggerimenti.", + "editorSuggestWidgetSelectedBackground": "Colore di sfondo della voce selezionata del widget dei suggerimenti.", + "editorSuggestWidgetHighlightForeground": "Colore delle evidenziazioni corrispondenze nel widget dei suggerimenti.", "readMore": "Altre informazioni...{0}", "suggestionWithDetailsAriaLabel": "{0}, suggerimento, con dettagli", "suggestionAriaLabel": "{0}, suggerimento", - "goback": "Indietro", + "readLess": "Meno informazioni... {0}", "suggestWidget.loading": "Caricamento...", "suggestWidget.noSuggestions": "Non ci sono suggerimenti.", "suggestionAriaAccepted": "{0}, accettato", diff --git a/i18n/ita/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/ita/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 50520a5626e..0a974d14915 100644 --- a/i18n/ita/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/ita/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Definisce i simboli di parentesi quadra che aumentano o riducono il rientro.", "schema.autoClosingPairs": "Definisce le coppie di parentesi quadre. Quando viene immessa una parentesi quadra di apertura, quella di chiusura viene inserita automaticamente.", "schema.autoClosingPairs.notIn": "Definisce un elenco di ambiti in cui la corrispondenza automatica delle coppie è disabilitata.", - "schema.surroundingPairs": "Definisce le coppie di parentesi quadre che possono essere usate per racchiudere una stringa selezionata." + "schema.surroundingPairs": "Definisce le coppie di parentesi quadre che possono essere usate per racchiudere una stringa selezionata.", + "schema.wordPattern": "La definizione di parola per il linguaggio.", + "schema.wordPattern.pattern": "Il modello di RegExp utilizzato per trovare parole.", + "schema.wordPattern.flags": "I flag di RegExp utilizzati per trovare parole.", + "schema.wordPattern.flags.errorMessage": "Deve corrispondere al modello `/^([gimuy]+)$/`." } \ No newline at end of file diff --git a/i18n/ita/src/vs/platform/environment/node/argv.i18n.json b/i18n/ita/src/vs/platform/environment/node/argv.i18n.json index ef50677325d..e9a4ecff7e0 100644 --- a/i18n/ita/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/ita/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "Mostra le versioni delle estensioni installate, quando si usa --list-extension.", "installExtension": "Installa un'estensione.", "uninstallExtension": "Disinstalla un'estensione.", + "experimentalApis": "Abilita funzionalità di API proposte per un'estensione specifica.", "disableExtensions": "Disabilita tutte le estensioni installate.", "disableGPU": "Disabilita l'accelerazione hardware della GPU.", "version": "Visualizza la versione.", diff --git a/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json index a69fc6f95b3..87b88acd388 100644 --- a/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Errore: la proprietà {0} del criterio non è un nome di variabile criterio valido.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un matcher problemi deve definire un criterio di inizio e un criterio di fine per il controllo.", "ProblemMatcherParser.invalidRegexp": "Errore: la stringa {0} non è un'espressione regolare valida.\n", - "WatchingPatternSchema.regexp": "Espressione regolare per rilevare l'inizio o la fine di un'attività di controllo.", + "WatchingPatternSchema.regexp": "L'espressione regolare per rilevare l'inizio o la fine di un'attività in background.", "WatchingPatternSchema.file": "Indice del gruppo di corrispondenze del nome file. Può essere omesso.", "PatternTypeSchema.name": "Nome di un criterio predefinito o aggiunto come contributo", "PatternTypeSchema.description": "Criterio di problema o nome di un criterio di problema predefinito o aggiunto come contributo. Può essere omesso se si specifica base.", @@ -43,10 +43,15 @@ "ProblemMatcherSchema.severity": "Gravità predefinita per i problemi di acquisizione. Viene usato se il criterio non definisce un gruppo di corrispondenze per la gravità.", "ProblemMatcherSchema.applyTo": "Controlla se un problema segnalato in un documento di testo è valido solo per i documenti aperti o chiusi oppure per tutti i documenti.", "ProblemMatcherSchema.fileLocation": "Consente di definire come interpretare i nomi file indicati in un criterio di problema.", + "ProblemMatcherSchema.background": "Criteri per tenere traccia dell'inizio e della fine di un matcher attivo su un'attività in background.", + "ProblemMatcherSchema.background.activeOnStart": "Se impostato a true, il monitor in backbround è in modalità attiva quando l'attività inizia. Equivale a inviare una riga che corrisponde al beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Se corrisponde nell'output, viene segnalato l'avvio di un'attività in background.", + "ProblemMatcherSchema.background.endsPattern": "Se corrisponde nell'output, viene segnalata la fine di un'attività in background.", + "ProblemMatcherSchema.watching.deprecated": "La proprietà watching è deprecata. In alternativa, utilizzare background (sfondo).", + "ProblemMatcherSchema.watching": "Criteri per tenere traccia dell'inizio e della fine di un matcher watching.", "ProblemMatcherSchema.watching.activeOnStart": "Se impostato su true, indica che il watcher è in modalità attiva all'avvio dell'attività. Equivale a inviare una riga che corrisponde al criterio di avvio", "ProblemMatcherSchema.watching.beginsPattern": "Se corrisponde nell'output, viene segnalato l'avvio di un'attività di controllo.", "ProblemMatcherSchema.watching.endsPattern": "Se corrisponde nell'output, viene segnalata la fine di un'attività di controllo.", - "ProblemMatcherSchema.watching": "Criteri per tenere traccia dell'inizio e della fine di un criterio di controllo.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Questa proprietà è deprecata. In alternativa, usare la proprietà watching.", "LegacyProblemMatcherSchema.watchedBegin": "Espressione regolare con cui viene segnalato l'avvio dell'esecuzione di un'attività controllata attivato tramite il controllo dei file.", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Questa proprietà è deprecata. In alternativa, usare la proprietà watching.", diff --git a/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json index 1f6ffb780e6..e1d1005789b 100644 --- a/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,75 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "Formato colore non valido. Usare #RGB, #RGBA, #RRGGBB o #RRGGBBAA", "schema.colors": "Colori usati nell'area di lavoro.", "foreground": "Colore primo piano. Questo colore è utilizzato solo se non viene sovrascritto da un componente.", + "errorForeground": "Colore primo piano globale per i messaggi di errore. Questo colore è utilizzato solamente se non viene sottoposto a override da un componente.", + "descriptionForeground": "Colore primo piano del testo che fornisce informazioni aggiuntive, ad esempio per un'etichetta di testo.", + "focusBorder": "Colore dei bordi degli elementi evidenziati. Questo colore è utilizzato solo se non viene sovrascritto da un componente.", + "contrastBorder": "Un bordo supplementare attorno agli elementi per contrastarli maggiormente rispetto agli altri.", + "activeContrastBorder": "Un bordo supplementare intorno agli elementi attivi per contrastarli maggiormente rispetto agli altri.", + "selectionBackground": "Il colore di sfondo delle selezioni di testo nel workbench (ad esempio per i campi di input o aree di testo). Si noti che questo non si applica alle selezioni all'interno dell'editor e del terminale.", + "textSeparatorForeground": "Colore dei separatori di testo.", + "textLinkForeground": "Colore primo piano dei link nel testo.", + "textLinkActiveForeground": "Colore primo piano dei link attivi nel testo.", + "textPreformatForeground": "Colore primo piano dei segmenti di testo preformattato.", + "textBlockQuoteBackground": "Colore di sfondo per le citazioni nel testo.", + "textBlockQuoteBorder": "Colore bordo per citazioni nel testo.", + "textCodeBlockBackground": "Colore sfondo per blocchi di codice nel testo.", + "widgetShadow": "Colore ombreggiatura dei widget, ad es. Trova/Sostituisci all'interno dell'editor.", "inputBoxBackground": "Sfondo della casella di input.", "inputBoxForeground": "Primo piano della casella di input.", "inputBoxBorder": "Bordo della casella di input.", "inputBoxActiveOptionBorder": "Colore del bordo di opzioni attivate nei campi di input.", + "inputPlaceholderForeground": "Colore primo piano di casella di input per il testo segnaposto.", + "inputValidationInfoBackground": "Colore di sfondo di convalida dell'input di tipo Informazione.", + "inputValidationInfoBorder": "Colore bordo di convalida dell'input di tipo Informazione.", + "inputValidationWarningBackground": "Colore di sfondo di convalida dell'input di tipo Avviso.", + "inputValidationWarningBorder": "Colore bordo di convalida dell'input di tipo Avviso.", + "inputValidationErrorBackground": "Colore di sfondo di convalida dell'input di tipo Errore.", + "inputValidationErrorBorder": "Colore bordo di convalida dell'input di tipo Errore.", "dropdownBackground": "Sfondo dell'elenco a discesa.", "dropdownForeground": "Primo piano dell'elenco a discesa.", "dropdownBorder": "Bordo dell'elenco a discesa.", + "listFocusBackground": "Colore sfondo Elenco/Struttura ad albero per l'elemento evidenziato quando l'Elenco/Struttura ad albero è attivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listFocusForeground": "Colore primo piano Elenco/Struttura ad albero per l'elemento con stato attivo quando l'Elenco/Struttura ad albero è attivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listActiveSelectionBackground": "Colore sfondo Elenco/Struttura ad albero per l'elemento selezionato quando l'Elenco/Struttura ad albero è attivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listActiveSelectionForeground": "Colore primo piano Elenco/Struttura ad albero per l'elemento selezionato quando l'Elenco/Struttura ad albero è attivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listInactiveSelectionBackground": "Colore sfondo Elenco/Struttura ad albero per l'elemento selezionato quando l'Elenco/Struttura ad albero è inattivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listInactiveSelectionForeground": "Colore primo piano Elenco/Struttura ad albero per l'elemento selezionato quando l'Elenco/Struttura ad albero è inattivo. Un Elenco/Struttura ad albero attivo\nha il focus della tastiera, uno inattivo no.", + "listHoverBackground": "Sfondo Elenco/Struttura ad albero al passaggio del mouse sugli elementi.", + "listHoverForeground": "Primo piano Elenco/Struttura ad albero al passaggio del mouse sugli elementi.", + "listDropBackground": "Sfondo Elenco/Struttura ad albero durante il trascinamento degli elementi selezionati.", + "highlight": "Colore primo piano Elenco/Struttura ad albero delle occorrenze trovate durante la ricerca nell'Elenco/Struttura ad albero.", "pickerGroupForeground": "Colore di selezione rapida per il raggruppamento delle etichette.", "pickerGroupBorder": "Colore di selezione rapida per il raggruppamento dei bordi.", + "buttonForeground": "Colore primo piano del pulsante.", + "buttonBackground": "Colore di sfondo del pulsante.", + "buttonHoverBackground": "Colore di sfondo del pulsante al passaggio del mouse.", + "badgeBackground": "Colore di sfondo del badge. I badge sono piccole etichette informative, ad esempio per mostrare il conteggio dei risultati di una ricerca.", + "badgeForeground": "Colore primo piano del badge. I badge sono piccole etichette informative, ad esempio per mostrare il conteggio dei risultati di una ricerca.", + "scrollbarShadow": "Ombra di ScrollBar per indicare lo scorrimento della visualizzazione.", + "scrollbarSliderBackground": "Colore di sfondo dello Slider.", + "scrollbarSliderHoverBackground": "Colore di sfondo dello Slider al passaggio del mouse", + "scrollbarSliderActiveBackground": "Colore di sfondo dello Slider quando attivo.", + "progressBarBackground": "Colore di sfondo dell'indicatore di stato che può essere mostrato durante l'esecuzione di operazioni lunghe.", "editorBackground": "Colore di sfondo dell'editor.", "editorForeground": "Colore primo piano predefinito dell'editor.", + "editorWidgetBackground": "Colore di sfondo dei widget dell'editor, ad esempio Trova/Sostituisci.", + "editorWidgetBorder": "Colore del bordo del widget editor.", "editorSelection": "Colore della selezione dell'editor.", "editorInactiveSelection": "Colore della selezione in un editor inattivo.", "editorSelectionHighlight": "Colore delle aree con lo stesso contenuto della selezione.", "editorFindMatch": "Colore della corrispondenza di ricerca corrente.", "findMatchHighlight": "Colore delle altre corrispondenze di ricerca.", "findRangeHighlight": "Colore dell'intervallo di ricerca.", + "hoverHighlight": "Evidenziazione sotto la parola per cui è visualizzata un'area sensibile al passaggio del mouse.", + "hoverBackground": "Colore di sfondo dell'area sensibile al passaggio del mouse dell'editor.", + "hoverBorder": "Colore del bordo dell'area sensibile al passaggio del mouse dell'editor.", "activeLinkForeground": "Colore dei collegamenti attivi.", - "linkForeground": "Colore dei collegamenti.", - "editorWidgetBackground": "Colore di sfondo dei widget dell'editor, ad esempio Trova/Sostituisci." + "diffEditorInserted": "Colore di sfondo del testo che è stato inserito.", + "diffEditorRemoved": "Colore di sfondo del testo che è stato rimosso.", + "diffEditorInsertedOutline": "Colore del contorno del testo che è stato inserito.", + "diffEditorRemovedOutline": "Colore del contorno del testo che è stato rimosso." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..606de953f3a --- /dev/null +++ b/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "Sovrascrittura dell'estensione {0} con {1}.", + "extensionUnderDevelopment": "Caricamento dell'estensione di sviluppo in {0}" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..e2fbc59847f --- /dev/null +++ b/i18n/ita/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Chiudi", + "cancel": "Annulla", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/ita/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..8905123ff84 --- /dev/null +++ b/i18n/ita/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "Non è stato registrato alcun elemento TreeExplorerNodeProvider con ID '{0}'.", + "treeExplorer.failedToProvideRootNode": "Con l'elemento TreeExplorerNodeProvider '{0}' non è stato possibile fornire il nodo radice." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json index a124f7f6f31..c9c8c1ec3e5 100644 --- a/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,6 @@ "configureLocale": "Configura lingua", "displayLanguage": "Definisce la lingua visualizzata di VSCode.", "doc": "Per un elenco delle lingue supportate, vedere {0}.", - "restart": "Se si modifica il valore, è necessario riavviare VSCode.", "fail.createSettings": "Non è possibile creare '{0}' ({1}).", "JsonSchema.locale": "Linguaggio dell'interfaccia utente da usare." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/ita/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 5bfe3f067f4..7f7ba33c59b 100644 --- a/i18n/ita/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "Apri editor precedente usato di recente nel gruppo", "openNextRecentlyUsedEditorInGroup": "Apri editor successivo usato di recente nel gruppo", "navigateEditorHistoryByInput": "Apri editor precedente dalla cronologia", + "openNextRecentlyUsedEditor": "Apri editor successivo usato di recente", + "openPreviousRecentlyUsedEditor": "Apri editor precedente usato di recente", "clearEditorHistory": "Cancella cronologia degli editor", "focusLastEditorInStack": "Apri ultimo editor del gruppo", "moveEditorLeft": "Sposta editor a sinistra", diff --git a/i18n/ita/src/vs/workbench/common/theme.i18n.json b/i18n/ita/src/vs/workbench/common/theme.i18n.json index b194775f979..05253aee2c4 100644 --- a/i18n/ita/src/vs/workbench/common/theme.i18n.json +++ b/i18n/ita/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "Colore di sfondo del contenitore delle scehde. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabActiveBackground": "Colore di sfondo delle schede attive. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabInactiveBackground": "Colore di sfondo delle schede inattive. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabBorder": "Bordo per separare le schede l'una dall'altra. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabActiveEditorGroupActiveForeground": "Colore di primo piano delle schede attive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", - "tabActiveEditorGroupInactiveForeground": "Colore di primo piano delle schede attive in un gruppo inattivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabInactiveEditorGroupActiveForeground": "Colore di primo piano delle schede inattive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", - "tabInactiveEditorGroupInactiveForeground": "Colore di primo piano delle schede inattiva in un gruppo inattivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", + "editorGroupBackground": "Colore di sfondo di un gruppo di editor. I gruppi di editor sono contenitori di editor. Il colore di sfondo viene visualizzato quando si trascinano i gruppi di editor in un'altra posizione.", + "editorGroupHeaderBackground": "Colore di sfondo dell'intestazione del titolo dell'editor quando le schede sono disabilitate. I gruppi di editor sono contenitori di editor.", "editorGroupBorder": "Colore per separare più gruppi di editor l'uno dall'altro. I gruppi di editor sono i contenitori degli editor.", - "editorDragAndDropBackground": "Colore di sfondo durante lo spostamento degli editor.", "panelBackground": "Colore di sfondo dei pannelli. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e del terminale integrato.", "panelBorder": "Colore del bordo dei pannelli nella parte superiore di separazione dall'editor. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e del terminale integrato.", "panelActiveTitleForeground": "Colore del titolo del pannello attivo. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e quella del terminale integrato.", @@ -24,15 +22,19 @@ "statusBarNoFolderBackground": "Colore di sfondo della barra di stato quando non ci sono cartelle aperte. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarItemActiveBackground": "Colore di sfondo degli elementi della barra di stato quando si fa clic. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarItemHoverBackground": "Colore di sfondo degli elementi della barra di stato al passaggio del mouse. La barra di stato è visualizzata nella parte inferiore della finestra.", + "statusBarProminentItemBackground": "Colore di sfondo degli elementi rilevanti della barra di stato. Gli elementi rilevanti spiccano rispetto ad altre voci della barra di stato. La barra di stato è visualizzata nella parte inferiore della finestra.", + "statusBarProminentItemHoverBackground": "Colore di sfondo degli elementi rilevanti della barra di stato al passaggio del mouse. Gli elementi rilevanti spiccano rispetto ad altre voci della barra di stato. La barra di stato è visualizzata nella parte inferiore della finestra.", "activityBarBackground": "Colore di sfondo della barra attività. La barra attività viene visualizzata nella parte inferiore sinistra/destra e consente il passaggio tra diverse visualizzazioni della barra laterale", "activityBarForeground": "Colore primo piano della barra attività (ad es. quello utilizzato per le icone). La barra attività viene mostrata all'estrema sinistra o destra e permette di alternare le visualizzazioni della barra laterale.", - "activityBarDragAndDropBackground": "Colore feedback drag and drop degli elementi della barra attività. La barra attività viene visualizzata nella parte inferiore sinistra/destra e consente il passaggio tra diverse visualizzazioni della barra laterale", "activityBarBadgeBackground": "Colore di sfondo della notifica utente dell'attività. La barra attività viene visualizzata all'estrema sinistra o all'estrema destra e consente di spostarsi tra le visualizzazioni della barra laterale.", "activityBarBadgeForeground": "Colore primo piano della notifica utente dell'attività. La barra attività viene visualizzata all'estrema sinistra o all'estrema destra e consente di spostarsi tra le visualizzazioni della barra laterale.", "sideBarBackground": "Colore di sfondo della barra laterale. La barra laterale è il contenitore per visualizzazioni come Explorer e ricerca.", "sideBarTitleForeground": "Colore primo piano del titolo della barra laterale. La barra laterale è il contenitore per visualizzazioni come Explorer e ricerca.", + "sideBarSectionHeaderBackground": "Colore di sfondo dell'intestazione di sezione della barra laterale. La barra laterale è il contenitore di visualizzazioni quali Esplora risorse e Cerca.", "titleBarActiveForeground": "Colore primo piano della barra del titolo quando la finestra è attiva. Si noti che questo colore è attualmente supportato solo su macOS.", "titleBarInactiveForeground": "Colore primo piano della barra del titolo quando la finestra è inattiva. Si noti che questo colore è attualmente supportato solo su macOS.", "titleBarActiveBackground": "Colore di sfondo della barra di titolo quando la finestra è attiva. Si noti che questo colore è attualmente solo supportati su macOS.", - "titleBarInactiveBackground": "Colore di sfondo della barra del titolo quando la finestra è inattiva. Si noti che questo colore è attualmente supportato solo su macOS." + "titleBarInactiveBackground": "Colore di sfondo della barra del titolo quando la finestra è inattiva. Si noti che questo colore è attualmente supportato solo su macOS.", + "notificationsForeground": "Colore primo piano delle notifiche. Le notifiche scorrono dalla parte superiore della finestra.", + "notificationsBackground": "Colore di sfondo delle notifiche. Le notifiche scorrono dalla parte superiore della finestra." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json index caac04b4d8e..b13e3a07bdd 100644 --- a/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Visualizza", "help": "Guida", "file": "File", + "developer": "Sviluppatore", "showEditorTabs": "Controlla se visualizzare o meno gli editor aperti in schede.", "editorTabCloseButton": "Controlla la posizione dei pulsanti di chiusura delle schede dell'editor oppure li disabilita quando è impostata su 'off'.", "showIcons": "Controlla se visualizzare o meno un'icona per gli editor aperti. Richiede l'abilitazione anche di un tema dell'icona.", @@ -41,7 +42,6 @@ "window.newWindowDimensions.inherit": "Apre nuove finestre le cui dimensioni sono uguali a quelle dell'ultima finestra attiva.", "window.newWindowDimensions.maximized": "Apre nuove finestre ingrandite a schermo intero.", "window.newWindowDimensions.fullscreen": "Apre nuove finestre nella modalità a schermo intero.", - "newWindowDimensions": "Controlla le dimensioni relative all'apertura di una nuova finestra. Per impostazione predefinita, una nuova finestra di dimensioni ridotte viene aperta al centro della schermata. Se è impostata su 'inherit', la finestra assumerà le stesse dimensioni dell'ultima finestra attiva. Se è impostata su 'maximized', la finestra aperta risulterà ingrandita, mentre con 'fullscreen' verrà visualizzata a schermo intero.", "window.menuBarVisibility.default": "Il menu è nascosto solo nella modalità a schermo intero.", "window.menuBarVisibility.visible": "Il menu è sempre visibile, anche nella modalità a schermo intero.", "window.menuBarVisibility.toggle": "Il menu è nascosto ma può essere visualizzato premendo ALT.", diff --git a/i18n/ita/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/shell.i18n.json index c0bbd0ba75e..efda81182a1 100644 --- a/i18n/ita/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/ita/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "È consigliabile non eseguire il codice come 'radice'.", - "prof.message": "I profili sono stati creati.", - "prof.detail": "Creare un problema e allegare manualmente i file seguenti:\n{0}", - "prof.restartAndFileIssue": "Crea problema e riavvia", - "prof.restart": "Riavvia" + "runningAsRoot": "È consigliabile non eseguire il codice come 'radice'." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/electron-browser/window.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/window.i18n.json index e4fdc2f801a..c3698933985 100644 --- a/i18n/ita/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/ita/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "Incolla", "selectAll": "Seleziona tutto", "confirmOpen": "Aprire le cartelle di {0}?", - "confirmOpenButton": "&&Apri", - "developer": "Sviluppatore", - "file": "File" + "confirmOpenButton": "&&Apri" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..e11f9e61fe0 100644 --- a/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "Sviluppatore: controlla mapping tasti" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index f0e210641bf..d4c6f2a6486 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "Modifica punto di interruzione...", "setValue": "Imposta valore", "addWatchExpression": "Aggiungi espressione", + "editWatchExpression": "Modifica espressione", "addToWatchExpressions": "Aggiungi a espressione di controllo", "removeWatchExpression": "Rimuovi espressione", "removeAllWatchExpressions": "Rimuovi tutte le espressioni", diff --git a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..2e0a0d42956 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "Colore di sfondo della barra degli strumenti di debug." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..91b52a6addb --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Fare clic per aprire (CMD+clic apre lateralmente)", + "fileLink": "Fare clic per aprire (CTRL+clic apre lateralmente)" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..17c61dfb9bd --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "Controlla il comportamento della console di debug interna." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 0ba55e0fb51..fff7cbcba9e 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "Lo stato dell'oggetto viene acquisito dalla prima valutazione", - "fileLinkMac": "Fare clic per aprire (CMD+clic apre lateralmente)", - "fileLink": "Fare clic per aprire (CTRL+clic apre lateralmente)", "replVariableAriaLabel": "Il valore della variabile {0} è {1}, ciclo Read Eval Print, debug", "replExpressionAriaLabel": "Il valore dell'espressione {0} è {1}, ciclo Read Eval Print, debug", "replValueOutputAriaLabel": "{0}, ciclo Read Eval Print, debug", diff --git a/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 2018bb48066..53d3bcdd1ee 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "Tipo della richiesta di configurazione. Può essere \"launch\" o \"attach\".", "debugServer": "Solo per lo sviluppo dell'estensione di debug: se si specifica una porta, Visual Studio Code prova a connettersi a un adattatore di debug in esecuzione in modalità server", "debugPrelaunchTask": "Attività da eseguire prima dell'avvio della sessione di debug.", - "internalConsoleOptions": "Controlla il comportamento della console di debug interna.", "debugWindowsConfiguration": "Attributi della configurazione di avvio specifici di Windows.", "debugOSXConfiguration": "Attributi della configurazione di avvio specifici di OS X.", "debugLinuxConfiguration": "Attributi della configurazione di avvio specifici di Linux.", diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..22f94f4cf36 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: Saldo (in ingresso)", + "balanceOutward": "Emmet: Saldo (in uscita)" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..1549e77ce27 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: Punto di modifica precedente", + "nextEditPoint": "Emmet: Punto di modifica successivo" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..27d67e79fef --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: Valuta espressione matematica" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..71a96f5f840 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: Espandi abbreviazione" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..ece4609ebc5 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: Aumenta di 0,1", + "incrementNumberByOne": "Emmet: Aumenta di 1", + "incrementNumberByTen": "Emmet: Aumenta di 10", + "decrementNumberByOneTenth": "Emmet: Riduci di 0,1", + "decrementNumberByOne": "Emmet: Riduci di 1", + "decrementNumberByTen": "Emmet: Riduci di 10" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..e7e21455b6b --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: Vai alla coppia corrispondente" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..5dc3268b490 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: Esegui merge delle righe" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..15cd2c912c4 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: Effettua reflection del valore CSS" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..a375d4ca576 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: Rimuovi tag" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..78c6fd0761b --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: Seleziona elemento precedente", + "selectNextItem": "Emmet: Seleziona elemento successivo" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..006ad09b523 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: Dividi/Unisci tag" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..f4338f86f4e --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: Attiva/Disattiva commento" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..49c7306573d --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: Aggiorna dimensioni immagine" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..38caa12dc95 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: Aggiorna tag", + "enterTag": "Immetti tag", + "tag": "Tag" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..f83f8f86716 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: Esegui il wrapping con l'abbreviazione", + "enterAbbreviation": "Immetti abbreviazione", + "abbreviation": "Abbreviazione" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..2b16a19f047 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Se abilitate, le abbreviazioni Emmet vengono espanse quando si preme TAB.", + "emmetPreferences": "Preferenze usate per modificare il comportamento di alcune azioni e i resolver di Emmet.", + "emmetSyntaxProfiles": "Consente di definire il profilo per la sintassi specificata oppure di usare un profilo personalizzato con regole specifiche.", + "emmetExclude": "Matrice di linguaggi in cui le abbreviazioni Emmet non devono essere espanse.", + "emmetExtensionsPath": "Percorso di una cartella contenente snippet, preferenze e profili Emmet" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 0a33d9bea99..8dbebb2e4a7 100644 --- a/i18n/ita/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "Visualizzazione personalizzata per contributes", + "vscode.extension.contributes.view.id": "ID univoco usato per identificare la visualizzazione creata tramite vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Stringa leggibile usata per il rendering della visualizzazione", + "vscode.extension.contributes.view.icon": "Percorso dell'icona della visualizzazione", + "vscode.extension.contributes.views": "Visualizzazioni personalizzate per contributes", "showViewlet": "Mostra {0}", "view": "Visualizza" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 56e75fc5770..f84b219fb4e 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,7 @@ "showRecommendations": "Mostra gli elementi consigliati", "neverShowAgain": "Non visualizzare più questo messaggio", "close": "Chiudi", - "workspaceRecommended": "Per questa area di lavoro sono disponibili estensioni consigliate." + "workspaceRecommended": "Per questa area di lavoro sono disponibili estensioni consigliate.", + "no": "No", + "cancel": "Annulla" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..0a6152b0c7b --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "Sì", + "no": "No", + "uninstall": "Disinstalla", + "later": "In seguito" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index cec14eebc71..a3c0e1da94b 100644 --- a/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "Consente di configurare le associazioni tra file e linguaggi, ad esempio \"*.extension\": \"html\". Queste hanno la precedenza sulle associazioni predefinite dei linguaggi installate.", "encoding": "Codifica del set di caratteri predefinita da usare durante la lettura e la scrittura di file.", "autoGuessEncoding": "Quando questa opzione è abilitata, la codifica del set di caratteri viene ipotizzata all'apertura dei file", - "eol": "Carattere di fine riga predefinito.", "trimTrailingWhitespace": "Se è abilitato, taglierà lo spazio vuoto quando si salva un file.", "insertFinalNewline": "Se è abilitato, inserisce un carattere di nuova riga finale alla fine del file durante il salvataggio.", "files.autoSave.off": "Un file dirty non viene mai salvato automaticamente.", @@ -27,8 +26,6 @@ "autoSaveDelay": "Controlla il ritardo in ms dopo il quale un file dirty viene salvato automaticamente. Si applica solo quando 'files.autoSave' è impostato su '{0}'", "watcherExclude": "Consente di configurare i criteri GLOB dei percorsi file da escludere dal controllo dei file. Se si modifica questa impostazione, è necessario riavviare. Quando si nota che Code consuma troppo tempo della CPU all'avvio, è possibile escludere le cartelle di grandi dimensioni per ridurre il carico iniziale.", "hotExit.off": "Disabilita Hot Exit.", - "hotExit.onExit": "La funzionalità Hot Exit verrà attivata alla chiusura dell'applicazione, ovvero quando si chiude l'ultima finestra in Windows/Linux o quando si attiva il comando workbench.action.quit (riquadro comandi, tasto di scelta rapida, menu). Tutte le finestre con backup verranno ripristinate al successivo avvio.", - "hotExit.onExitAndWindowClose": "La funzionalità Hot Exit verrà attivata alla chiusura dell'applicazione, ovvero quando si chiude l'ultima finestra in Windows/Linux o quando si attiva il comando workbench.action.quit (riquadro comandi, tasto di scelta rapida, menu), nonché per qualsiasi finestra con una cartella aperta indipendentemente dal fatto che sia l'ultima. Tutte le finestre senza cartelle aperte verranno ripristinate al successivo avvio. Per riportare le finestre di cartelle allo stato in cui si trovavano prima dell'arresto, impostare \"window.reopenFolders\" su \"all\".", "hotExit": "Controlla se i file non salvati verranno memorizzati tra una sessione e l'altra, consentendo di ignorare il prompt di salvataggio alla chiusura dell'editor.", "defaultLanguage": "Modalità linguaggio predefinita assegnata ai nuovi file.", "editorConfigurationTitle": "Editor", diff --git a/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 18ae03ff77a..158ed123e7a 100644 --- a/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "È stato rilevato un rallentamento all'avvio", - "slow.detail": "È stato appena rilevato un rallentamento all'avvio. Per consentire a Microsoft di analizzare e risolvere il problema, riavviare '{0}' con la profilatura abilitata e condividere i profili." + "slow.detail": "È stato appena rilevato un rallentamento all'avvio. Per consentire a Microsoft di analizzare e risolvere il problema, riavviare '{0}' con la profilatura abilitata e condividere i profili.", + "prof.message": "I profili sono stati creati.", + "prof.detail": "Creare un problema e allegare manualmente i file seguenti:\n{0}", + "prof.restartAndFileIssue": "Crea problema e riavvia", + "prof.restart": "Riavvia" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index 8fa5a9b9b2a..12a31fb4c16 100644 --- a/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "Apri impostazioni utente", "openGlobalKeybindings": "Apri tasti di scelta rapida", + "openGlobalKeybindingsFile": "Apri file dei tasti di scelta rapida", "openWorkspaceSettings": "Apri impostazioni area di lavoro", "configureLanguageBasedSettings": "Configura impostazioni specifiche del linguaggio...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index 774cffef37d..ef09ca3283a 100644 --- a/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "{0} corrispondenze trovate", "searchMatch": "{0} corrispondenza trovata", - "fileMatchAriaLabel": "{0} corrispondenze nel file {1} della cartella {2}, risultato della ricerca", - "replacePreviewResultAria": "Risultato dell'anteprima sostituzione, {0}", - "searchResultAria": "{0}, risultato della ricerca" + "fileMatchAriaLabel": "{0} corrispondenze nel file {1} della cartella {2}, risultato della ricerca" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index a0b8634361d..cce0f602a0f 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Digitare il nome di un'attività da riavviare", "noTasksMatching": "No tasks matching", "noTasksFound": "Non sono state trovate attività da riavviare" diff --git a/i18n/ita/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 1bf6e6b40b9..ed1ead3e156 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "Digitare il nome di un'attività da eseguire", "noTasksMatching": "No tasks matching", "noTasksFound": "Non sono state trovate attività" diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index fabad77044f..7be3f013ead 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Seleziona strumento di esecuzione attività", "ConfigureTaskRunnerAction.autoDetecting": "Rilevamento automatico delle attività per {0}", "ConfigureTaskRunnerAction.autoDetect": "Il rilevamento automatico del sistema dell'attività non è riuscito. Verrà usato il modello predefinito. Per i dettagli, vedere l'output dell'attività.", + "ConfigureTaskRunnerAction.autoDetectError": "Il rilevamento automatico del sistema dell'attività ha restituito errori. Per i dettagli, vedere l'output dell'attività.", "ConfigureTaskRunnerAction.failed": "Non è possibile creare il file 'tasks.json' all'interno della cartella '.vscode'. Per dettagli, vedere l'output dell'attività.", "ConfigureTaskRunnerAction.label": "Configura esecuzione attività", "ConfigureBuildTaskAction.label": "Configura attività di compilazione", @@ -17,7 +18,6 @@ "problems": "Problemi", "manyMarkers": "Più di 99", "tasks": "Attività", - "TaskSystem.noHotSwap": "Per modificare il motore di esecuzione delle attività, è necessario riavviare VS Code. La modifica verrà ignorata.", "TaskService.noBuildTask": "Non è stata definita alcuna attività di Build. Contrassegnare un'attività con 'isBuildCommand' nel file tasks.json .", "TaskService.noTestTask": "Non è stata definita alcuna attività di test. Contrassegnare un'attività con 'isTestCommand' nel file tasks.json .", "TaskServer.noTask": "Attività {0} richiesta per l'esecuzione non trovata", diff --git a/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index f598673f2ce..cf402ad3802 100644 --- a/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,13 @@ { "selectTheme.label": "Tema colori", "installColorThemes": "Installa temi colori aggiuntivi...", - "problemChangingTheme": "Problema durante l'impostazione del tema: {0}", - "themes.selectTheme": "Seleziona tema colori", "selectIconTheme.label": "Tema icona file", "installIconThemes": "Installa temi dell'icona file aggiuntivi...", "noIconThemeLabel": "Nessuno", "noIconThemeDesc": "Disabilita le icone dei file", "problemChangingIconTheme": "Problema durante l'impostazione del tema dell'icona: {0}", "themes.selectIconTheme": "Seleziona il tema dell'icona file", + "generateColorTheme.label": "Genera tema colore da impostazioni correnti", "preferences": "Preferenze", "developer": "Sviluppatore" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 3a98deaa2c0..aa2a81f6197 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -13,31 +13,25 @@ "welcomePage.recent": "Recenti", "welcomePage.noRecentFolders": "Non ci sono cartelle recenti", "welcomePage.help": "Guida", - "welcomePage.productDocumentation": "Documentazione del prodotto", "welcomePage.introductoryVideos": "Video introduttivi", + "welcomePage.productDocumentation": "Documentazione del prodotto", "welcomePage.gitHubRepository": "Repository GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Mostra la pagina iniziale all'avvio", - "welcomePage.quickLinks": "Collegamenti rapidi", - "welcomePage.interactivePlayground": "Playground interattivo", - "welcomePage.interactivePlaygroundDescription": "Breve panoramica delle funzionalità essenziali dell'editor", - "welcomePage.interfaceOverview": "Panoramica dell'interfaccia", - "welcomePage.interfaceOverviewDescription": "Immagine in sovrimpressione che evidenzia i principali componenti dell'interfaccia utente", + "welcomePage.customize": "Personalizza", + "welcomePage.installKeymapDescription": "Installa i tasti di scelta rapida", + "welcomePage.others": "altri", "welcomePage.colorTheme": "Tema colori", "welcomePage.colorThemeDescription": "Tutto quel che serve per configurare editor e codice nel modo desiderato", - "welcomePage.keybindingsReference": "Riferimento per tasti di scelta rapida", - "welcomePage.keybindingsReferenceDescription": "PDF stampabile con i tasti di scelta rapida più comuni", "welcomePage.showCommands": "Trova ed esegui tutti i comandi", "welcomePage.showCommandsDescription": "Accesso e ricerca rapida di comandi dal pannello di controllo ({0})", + "welcomePage.interfaceOverview": "Panoramica dell'interfaccia", + "welcomePage.interfaceOverviewDescription": "Immagine in sovrimpressione che evidenzia i principali componenti dell'interfaccia utente", + "welcomePage.interactivePlayground": "Playground interattivo", + "welcomePage.interactivePlaygroundDescription": "Breve panoramica delle funzionalità essenziali dell'editor", + "welcomePage.quickLinks": "Collegamenti rapidi", + "welcomePage.keybindingsReference": "Riferimento per tasti di scelta rapida", + "welcomePage.keybindingsReferenceDescription": "PDF stampabile con i tasti di scelta rapida più comuni", "welcomePage.configureSettings": "Configura le impostazioni", - "welcomePage.configureSettingsDescription": "Perfeziona le impostazioni per sfruttare appieno tutta la potenza di Visual Studio Code", - "welcomePage.installKeymapDescription": "Installa i tasti di scelta rapida", - "welcomePage.installKeymap": "Installa i tasti di scelta rapida di {0}, {1}, {2} e {3}", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (corrente)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (corrente)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (corrente)", - "welcomePage.others": "altri" + "welcomePage.configureSettingsDescription": "Perfeziona le impostazioni per sfruttare appieno tutta la potenza di Visual Studio Code" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 6614c86ca0b..01f19048853 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,16 @@ // Do not edit this file. It is machine generated. { "welcomePage": "Benvenuti", - "welcome.title": "Benvenuti", + "welcomePage.typeScript": "TypeScript", + "welcomePage.php": "PHP", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "I tasti di scelta rapida di {0} sono già installati.", "welcomePage.willReloadAfterInstallingKeymap": "La finestra verrà ricaricata dopo l'installazione dei tasti di scelta rapida di {0}.", - "ok": "OK", "welcomePage.installingKeymap": "Installazione dei tasti di scelta rapida di {0}...", "welcomePage.keymapNotFound": "I tasti di scelta rapida di {0} con ID {1} non sono stati trovati.", + "welcome.title": "Benvenuti", + "ok": "OK", "cancel": "Annulla" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 4550587650c..e40df93be8d 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "non associato" + "walkThrough.unboundCommand": "non associato", + "walkThrough.gitNotFound": "Sembra che GIT non sia installato nel sistema." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 3072dac1446..52726bd226c 100644 --- a/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "Apri impostazioni", + "close": "Chiudi", "errorUnknownKey": "Non è possibile scrivere nel file di configurazione. La chiave è sconosciuta", - "errorInvalidTarget": "Non è possibile scrivere nel file di configurazione (destinazione non valida)", - "errorNoWorkspaceOpened": "Non è possibile scrivere le impostazioni perché non è stata aperta alcuna cartella. Aprire prima una cartella e riprovare.", - "errorInvalidConfiguration": "Non è possibile scrivere le impostazioni. Aprire **Impostazioni utente** per correggere errori/avvisi nel file e riprovare.", - "errorInvalidConfigurationWorkspace": "Non è possibile scrivere le impostazioni. Aprire **Impostazioni area di lavoro** per correggere errori/avvisi nel file e riprovare.", - "errorConfigurationFileDirty": "Non è possibile scrivere le impostazioni perché il file è stato modificato ma non salvato. Salvare il file delle **Impostazioni utente** e riprovare.", - "errorConfigurationFileDirtyWorkspace": "Non è possibile scrivere le impostazioni perché il file stato modificato ma non salvato. Salvare il file delle **Impostazioni area di lavoro** e riprovare." + "errorInvalidTarget": "Non è possibile scrivere nel file di configurazione (destinazione non valida)" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/ita/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index d9dd939d22d..95f4dd73cd4 100644 --- a/i18n/ita/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/ita/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Tasto o sequenza di tasti specifica di Windows.", "vscode.extension.contributes.keybindings.when": "Condizione quando il tasto è attivo.", "vscode.extension.contributes.keybindings": "Tasti di scelta rapida per contributes.", - "openDocumentation": "Altre informazioni", - "keybindingMigration.ok": "OK", - "keybindingMigration.prompt": "Alcune scelte rapide da tastiera sono state modificate per il layout di tastiera corrente.", "invalid.keybindings": "Il valore di `contributes.{0}` non è valido: {1}", "unboundCommands": "Altri comandi disponibili: ", "keybindings.json.title": "Configurazione dei tasti di scelta rapida", diff --git a/i18n/ita/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/ita/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index eca6a3b65b4..4d36ef2de5e 100644 --- a/i18n/ita/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/ita/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "Colori per l'evidenziazione della sintassi", "schema.properties.name": "Descrizione della regola", - "schema.fontStyle": "Stile del carattere della regola: uno o combinazione di 'italic', 'bold' e 'underline'" + "schema.fontStyle": "Stile del carattere della regola: uno o combinazione di 'italic', 'bold' e 'underline'", + "schema.tokenColors.path": "Percorso di un file tmTheme (relativo al file corrente)" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/ita/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 25b7b98a369..0aee1a7594d 100644 --- a/i18n/ita/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/ita/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "Problemi durante l'analisi del file di tema di JSON: {0}" + "error.cannotparsejson": "Problemi durante l'analisi del file di tema di JSON: {0}", + "error.invalidformat.colors": "Si è verificato un problema durante l'analisi del file di tema {0}. La proprietà 'colors' non è di tipo 'object'.", + "error.invalidformat.tokenColors": "Si è verificato un problema durante l'analisi del file di tema {0}. La proprietà 'tokenColors' deve essere una matrice che specifica i colori o un percorso di un file di tema TextMate", + "error.plist.invalidformat": "Si è verificato un problema durante l'analisi del file tmTheme {0}. 'settings' non è una matrice.", + "error.cannotparse": "Si sono verificati problemi durante l'analisi del file tmTheme {0}", + "error.cannotload": "Si sono verificati problemi durante il caricamento del file tmTheme {0}: {1}" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/ita/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 13457b15bc1..78a199c933a 100644 --- a/i18n/ita/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/ita/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "Sostituisce i colori del tema colori attualmente selezionato.", + "workbenchColors.deprecated": "L'impostazione non è più sperimentale ed è stata rinominata in 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "In alternativa, usare 'workbench.colorCustomizations'" } \ No newline at end of file diff --git a/i18n/jpn/extensions/git/out/commands.i18n.json b/i18n/jpn/extensions/git/out/commands.i18n.json index 9ff7d6a1f7c..9c6bd23d155 100644 --- a/i18n/jpn/extensions/git/out/commands.i18n.json +++ b/i18n/jpn/extensions/git/out/commands.i18n.json @@ -16,21 +16,30 @@ "confirm discard": "{0} ã®å¤‰æ›´ã‚’破棄ã—ã¾ã™ã‹?", "confirm discard multiple": "{0} 個ã®ãƒ•ァイルã®å¤‰æ›´å†…容を破棄ã—ã¾ã™ã‹?", "discard": "変更を破棄", + "confirm discard all": "ã™ã¹ã¦ã®å¤‰æ›´ã‚’破棄ã—ã¾ã™ã‹? å¤‰æ›´ã¯æˆ»ã‚Šã¾ã›ã‚“!", + "discardAll": "ã™ã¹ã¦ã®å¤‰æ›´ã‚’破棄", + "no staged changes": "コミットã™ã‚‹ã‚¹ãƒ†ãƒ¼ã‚¸ã•れãŸå¤‰æ›´ãŒã‚りã¾ã›ã‚“。\\n\\nã™ã¹ã¦ã®å¤‰æ›´ã‚’自動的ã«ã‚¹ãƒ†ãƒ¼ã‚¸ã—ã¦ã€ç›´æŽ¥ã‚³ãƒŸãƒƒãƒˆã—ã¾ã™ã‹?", + "yes": "ã¯ã„", + "always": "常ã«è¡Œã†", "no changes": "コミットã™ã‚‹å¿…è¦ã®ã‚る変更ã¯ã‚りã¾ã›ã‚“。", "commit message": "コミット メッセージ", "provide commit message": "コミット メッセージを入力ã—ã¦ãã ã•ã„", "branch name": "ブランãƒå", "provide branch name": "ブランãƒåを指定ã—ã¦ãã ã•ã„", + "select branch to delete": "削除ã™ã‚‹ãƒ–ランãƒã®é¸æŠž", + "confirm force delete branch": "ブランム'{0}' ã¯ãƒžãƒ¼ã‚¸ã•れã¦ã„ã¾ã›ã‚“。ãれã§ã‚‚削除ã—ã¾ã™ã‹ï¼Ÿ", + "delete branch": "ブランãƒã®å‰Šé™¤", "no remotes to pull": "リãƒã‚¸ãƒˆãƒªã«ã¯ã€ãƒ—ル元ã¨ã—ã¦æ§‹æˆã•れã¦ã„るリモートãŒã‚りã¾ã›ã‚“。", "no remotes to push": "リãƒã‚¸ãƒˆãƒªã«ã¯ã€ãƒ—ッシュ先ã¨ã—ã¦æ§‹æˆã•れã¦ã„るリモートãŒã‚りã¾ã›ã‚“。", "nobranch": "リモートã«ãƒ—ッシュã™ã‚‹ãƒ–ランãƒã‚’ãƒã‚§ãƒƒã‚¯ã‚¢ã‚¦ãƒˆã—ã¦ãã ã•ã„。", "pick remote": "リモートをé¸ã‚“ã§ã€ãƒ–ランム'{0}' を次ã«å…¬é–‹ã—ã¾ã™:", "sync is unpredictable": "ã“ã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯ã‚³ãƒŸãƒƒãƒˆã‚’ '{0}' ã¨ã®é–“ã§ãƒ—ッシュã—ãŸã‚Šãƒ—ルã—ãŸã‚Šã—ã¾ã™ã€‚", "ok": "OK", - "never again": "了解ã—ã¾ã—ãŸã€‚今後ã¯è¡¨ç¤ºã—ãªã„", + "never again": "OKã€ä»Šå¾Œã¯è¡¨ç¤ºã—ãªã„", "no remotes to publish": "リãƒã‚¸ãƒˆãƒªã«ã¯ã€ç™ºè¡Œå…ˆã¨ã—ã¦æ§‹æˆã•れã¦ã„るリモートãŒã‚りã¾ã›ã‚“。", "disabled": "ã“ã®ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã§ã¯ã€Git ãŒç„¡åйã«ãªã£ã¦ã„ã‚‹ã‹ã€ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“", "clean repo": "ãƒã‚§ãƒƒã‚¯ã‚¢ã‚¦ãƒˆã®å‰ã«ã€ãƒªãƒã‚¸ãƒˆãƒªã®ä½œæ¥­ãƒ„リーを消去ã—ã¦ãã ã•ã„。", + "cant push": "å‚照仕様をリモートã«ãƒ—ッシュã§ãã¾ã›ã‚“。最åˆã« 'Pull' を実行ã—ã¦å¤‰æ›´ã‚’çµ±åˆã—ã¦ãã ã•ã„。", "git error details": "Git: {0}", "git error": "Git エラー", "open git log": "Git ログを開ã" diff --git a/i18n/jpn/extensions/git/out/scmProvider.i18n.json b/i18n/jpn/extensions/git/out/scmProvider.i18n.json index 7fded37328a..fe8b64ab93b 100644 --- a/i18n/jpn/extensions/git/out/scmProvider.i18n.json +++ b/i18n/jpn/extensions/git/out/scmProvider.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "commit": "Commit" + "commit": "コミット" } \ No newline at end of file diff --git a/i18n/jpn/extensions/git/package.i18n.json b/i18n/jpn/extensions/git/package.i18n.json index 86293d87d2b..1c27e31a01c 100644 --- a/i18n/jpn/extensions/git/package.i18n.json +++ b/i18n/jpn/extensions/git/package.i18n.json @@ -26,6 +26,7 @@ "command.undoCommit": "å‰å›žã®ã‚³ãƒŸãƒƒãƒˆã‚’å…ƒã«æˆ»ã™", "command.checkout": "ãƒã‚§ãƒƒã‚¯ã‚¢ã‚¦ãƒˆå…ˆ...", "command.branch": "分å²ã®ä½œæˆ...", + "command.deleteBranch": "ブランãƒã®å‰Šé™¤...", "command.pull": "プル", "command.pullRebase": "プル (リベース)", "command.push": "プッシュ", @@ -39,6 +40,10 @@ "config.autofetch": "自動フェッãƒãŒæœ‰åйã‹ã©ã†ã‹", "config.enableLongCommitWarning": "é•·ã„コミット メッセージã«ã¤ã„ã¦è­¦å‘Šã™ã‚‹ã‹ã©ã†ã‹", "config.confirmSync": "Git リãƒã‚¸ãƒˆãƒªã‚’åŒæœŸã™ã‚‹å‰ã«ç¢ºèªã™ã‚‹", + "config.countBadge": "Git ãƒãƒƒã‚¸ カウンターを制御ã—ã¾ã™ã€‚`all` ã¯ã™ã¹ã¦ã®å¤‰æ›´ã‚’カウントã—ã¾ã™ã€‚ `tracked` ã¯è¿½è·¡ã—ã¦ã„る変更ã®ã¿ã‚«ã‚¦ãƒ³ãƒˆã—ã¾ã™ã€‚ `off` ã¯ã‚«ã‚¦ãƒ³ãƒˆã‚’オフã—ã¾ã™ã€‚", + "config.checkoutType": "`Checkout to...` を実行ã™ã‚‹ã¨ãã«è¡¨ç¤ºã•れるブランãƒã®ç¨®é¡žã‚’制御ã—ã¾ã™ã€‚`all` ã¯ã™ã¹ã¦ã®å‚照を表示ã—ã¾ã™ã€‚`local` ã¯ãƒ­ãƒ¼ã‚«ãƒ« ブランãƒã®ã¿ã€`tags` ã¯ã‚¿ã‚°ã®ã¿ã€`remote` ã¯ãƒªãƒ¢ãƒ¼ãƒˆ ブランãƒã®ã¿ã‚’表示ã—ã¾ã™ã€‚ ", "config.ignoreLegacyWarning": "æ—§ Git ã®è­¦å‘Šã‚’無視ã—ã¾ã™", - "config.ignoreLimitWarning": "リãƒã‚¸ãƒˆãƒªå†…ã«å¤‰æ›´ãŒå¤šã„å ´åˆã¯è­¦å‘Šã‚’無視ã—ã¾ã™" + "config.ignoreLimitWarning": "リãƒã‚¸ãƒˆãƒªå†…ã«å¤‰æ›´ãŒå¤šã„å ´åˆã¯è­¦å‘Šã‚’無視ã—ã¾ã™", + "config.defaultCloneDirectory": "Git リãƒã‚¸ãƒˆãƒªã‚’クローンã™ã‚‹æ—¢å®šã®å ´æ‰€", + "config.enableSmartCommit": "ステージã•れãŸå¤‰æ›´ãŒãªã„å ´åˆã¯ã™ã¹ã¦ã®å¤‰æ›´ã‚’コミットã—ã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/extensions/gulp/package.i18n.json b/i18n/jpn/extensions/gulp/package.i18n.json index 8b6ad71cd4e..1db590a1354 100644 --- a/i18n/jpn/extensions/gulp/package.i18n.json +++ b/i18n/jpn/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Gulp タスクã®è‡ªå‹•検出をオンã«ã™ã‚‹ã‹ã‚ªãƒ•ã«ã™ã‚‹ã‹ã‚’制御ã—ã¾ã™ã€‚既定ã¯ã‚ªãƒ³ã§ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/jake/out/main.i18n.json b/i18n/jpn/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..0f77342ecbc --- /dev/null +++ b/i18n/jpn/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Jake ã®ã‚¨ãƒ©ãƒ¼ã«ã‚ˆã‚‹å¤±æ•—を自動検出: {0}" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/jake/package.i18n.json b/i18n/jpn/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..def0eab1b4c --- /dev/null +++ b/i18n/jpn/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.jake.autoDetect": "Jake タスクã®è‡ªå‹•検出をオンã«ã™ã‚‹ã‹ã‚ªãƒ•ã«ã™ã‚‹ã‹ã‚’制御ã—ã¾ã™ã€‚既定ã¯ã‚ªãƒ³ã§ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/markdown/out/extension.i18n.json b/i18n/jpn/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..fd083fda4b6 --- /dev/null +++ b/i18n/jpn/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "onPreviewStyleLoadError": "'markdown.styles' を読ã¿è¾¼ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“: {0}" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..104396accee --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "compareChanges": "å¤‰æ›´ã®æ¯”較" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..6c318704912 --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +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. +{ + "cursorNotInConflict": "エディターã®ã‚«ãƒ¼ã‚½ãƒ«ãŒãƒžãƒ¼ã‚¸ã®ç«¶åˆã®ç¯„囲内ã«ã‚りã¾ã›ã‚“", + "noConflicts": "ã“ã®ãƒ•ァイルã«ãƒžãƒ¼ã‚¸ã®ç«¶åˆã¯å­˜åœ¨ã—ã¾ã›ã‚“", + "noOtherConflictsInThisFile": "ã“ã®ãƒ•ァイルã«ä»–ã®ãƒžãƒ¼ã‚¸ã®ç«¶åˆã¯å­˜åœ¨ã—ã¾ã›ã‚“" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..9da2446076d --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "(ç¾åœ¨ã®å¤‰æ›´)" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/package.i18n.json b/i18n/jpn/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..178880dd69d --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "command.category": "マージã®ç«¶åˆ", + "command.next": "次ã®ç«¶åˆ", + "command.previous": "å‰ã®ç«¶åˆ", + "command.compare": "ç¾åœ¨ã®ç«¶åˆã‚’比較", + "config.title": "マージã®ç«¶åˆ" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/npm/package.i18n.json b/i18n/jpn/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..6a332075fd0 --- /dev/null +++ b/i18n/jpn/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.npm.autoDetect": "npm スクリプトã®è‡ªå‹•検出をオンã«ã™ã‚‹ã‹ã‚ªãƒ•ã«ã™ã‚‹ã‹ã‚’制御ã—ã¾ã™ã€‚既定ã¯ã‚ªãƒ³ã§ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/jpn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..d6577333f0d --- /dev/null +++ b/i18n/jpn/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +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. +{ + "ts-check": "JavaScript ファイルã®ã‚»ãƒžãƒ³ãƒ†ã‚£ãƒƒã‚¯ ãƒã‚§ãƒƒã‚¯ã‚’有効ã«ã—ã¾ã™ã€‚ ファイルã®å…ˆé ­ã«ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", + "ts-nocheck": "JavaScript ファイルã®ã‚»ãƒžãƒ³ãƒ†ã‚£ãƒƒã‚¯ ãƒã‚§ãƒƒã‚¯ã‚’無効ã«ã—ã¾ã™ã€‚ ファイルã®å…ˆé ­ã«ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", + "ts-ignore": "ãƒ•ã‚¡ã‚¤ãƒ«ã®æ¬¡ã®è¡Œã§ @ts-check エラーを抑制ã—ã¾ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/jpn/extensions/typescript/out/typescriptServiceClient.i18n.json index fd5967f381b..cc6f0e1ea1a 100644 --- a/i18n/jpn/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/jpn/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "パス {0} ã¯ã€æœ‰åŠ¹ãª tsserver インストールを指ã—ã¦ã„ã¾ã›ã‚“。ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹ TypeScript ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ãƒ•ォールãƒãƒƒã‚¯ã—ã¦ã„ã¾ã™ã€‚", "noBundledServerFound": "é©åˆ‡ã«å‹•作ã—ãªã„ウイルス検出ツールãªã©ã®ä»–ã®ã‚¢ãƒ—リケーションã«ã‚ˆã‚Šã€VSCode ã® tsserver ã¯å‰Šé™¤ã•れã¾ã—ãŸã€‚VS Code ã‚’å†ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã—ã¦ãã ã•ã„。", "versionNumber.custom": "カスタム", diff --git a/i18n/jpn/extensions/typescript/out/utils/logger.i18n.json b/i18n/jpn/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/jpn/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json index 3a40c2e29d9..5696b940392 100644 --- a/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "よりé©ã—㟠TypeScript IntelliSense ã«é–¢ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã‚’フェッãƒã—ã¦ã„ã¾ã™", + "typesInstallerInitializationFailed.title": "JavaScript 言語機能ã®ãŸã‚ã®åž‹å®šç¾©ãƒ•ァイルをインストールã§ãã¾ã›ã‚“ã§ã—ãŸã€‚NPM ãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã€PATH ã«ã‚ã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。", "typesInstallerInitializationFailed.moreInformation": "詳細情報", "typesInstallerInitializationFailed.doNotCheckAgain": "今後確èªã—ãªã„", "typesInstallerInitializationFailed.close": "é–‰ã˜ã‚‹" diff --git a/i18n/jpn/extensions/typescript/package.i18n.json b/i18n/jpn/extensions/typescript/package.i18n.json index 35c289eb3d5..1ad434c3205 100644 --- a/i18n/jpn/extensions/typescript/package.i18n.json +++ b/i18n/jpn/extensions/typescript/package.i18n.json @@ -33,11 +33,14 @@ "javascript.validate.enable": "JavaScript ã®æ¤œè¨¼ã‚’有効/無効ã«ã—ã¾ã™ã€‚", "typescript.goToProjectConfig.title": "プロジェクト構æˆã«ç§»å‹•", "javascript.goToProjectConfig.title": "プロジェクト構æˆã«ç§»å‹•", - "typescript.referencesCodeLens.enabled": "CodeLens ã®å‚照を有効/無効ã«ã—ã¾ã™ã€‚TypeScript 2.0.6 以上ãŒå¿…è¦ã§ã™ã€‚", + "javascript.referencesCodeLens.enabled": "JavaScript ファイル内㧠CodeLens ã®å‚照を有効/無効ã«ã—ã¾ã™ã€‚", + "typescript.referencesCodeLens.enabled": "TypeScript ファイル内㧠CodeLens ã®å‚照を有効/無効ã«ã—ã¾ã™ã€‚TypeScript 2.0.6 以上ãŒå¿…è¦ã§ã™ã€‚", "typescript.implementationsCodeLens.enabled": "CodeLens ã®å®Ÿè£…を有効/無効ã«ã—ã¾ã™ã€‚TypeScript 2.2.0 以上ãŒå¿…è¦ã§ã™ã€‚", - "typescript.openTsServerLog.title": "TS サーãƒãƒ¼ã®ãƒ­ã‚° ファイルを開ã", + "typescript.openTsServerLog.title": "TS サーãƒãƒ¼ã®ãƒ­ã‚°ã‚’é–‹ã", + "typescript.restartTsServer": "TS サーãƒãƒ¼ã‚’å†èµ·å‹•ã™ã‚‹", "typescript.selectTypeScriptVersion.title": "TypeScript ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®é¸æŠž", "jsDocCompletion.enabled": " 自動 JSDoc コメントを有効/無効ã«ã—ã¾ã™", - "javascript.implicitProjectConfig.checkJs": "JavaScript ファイルã®ã‚»ãƒžãƒ³ãƒ†ã‚£ãƒƒã‚¯ ãƒã‚§ãƒƒã‚¯ã‚’有効/無効ã«ã—ã¾ã™ã€‚既存㮠jsconfi.json ã‚„ tsconfi.json ファイルã®è¨­å®šã¯ã“れより優先ã•れã¾ã™ã€‚ TypeScript 㯠2.3.1 以上ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", - "typescript.check.npmIsInstalled": "型定義ã®è‡ªå‹•å–å¾—ã« NPM ãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’確èªã™ã‚‹" + "javascript.implicitProjectConfig.checkJs": "JavaScript ファイルã®ã‚»ãƒžãƒ³ãƒ†ã‚£ãƒƒã‚¯ ãƒã‚§ãƒƒã‚¯ã‚’有効/無効ã«ã—ã¾ã™ã€‚既存㮠jsconfi.json ã‚„ tsconfi.json ファイルã®è¨­å®šã¯ã“れより優先ã•れã¾ã™ã€‚TypeScript 㯠2.3.1 以上ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", + "typescript.check.npmIsInstalled": "型定義ã®è‡ªå‹•å–å¾—ã« NPM ãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’確èªã™ã‚‹", + "javascript.nameSuggestions": "JavaScript ã®å€™è£œãƒªã‚¹ãƒˆå†…ã§ãƒ•ァイルã‹ã‚‰ä¸€æ„ã®åå‰ã‚’å«ã‚€ã‹ã©ã†ã‹ã‚’有効/無効ã«ã—ã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index ea2e47d9813..15d556bd644 100644 --- a/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "イメージãŒå¤§ãã™ãŽã¦ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã«è¡¨ç¤ºã§ãã¾ã›ã‚“。", - "resourceOpenExternalButton": "イメージを開ã", - "resourceOpenExternalText": " 外部プログラムを使用ã—ã¦ã„ã¾ã™ã‹?", + "resourceOpenExternalButton": "外部ã®ãƒ—ログラムを使用ã—ã¦ç”»åƒã‚’é–‹ãã¾ã™ã‹?", "nativeBinaryError": "ã“ã®ãƒ•ァイルã¯ãƒã‚¤ãƒŠãƒªã‹ã€éžå¸¸ã«å¤§ãã„ã‹ã€ã¾ãŸã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ãªã„テキスト エンコードを使用ã—ã¦ã„ã‚‹ãŸã‚ã€ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã«è¡¨ç¤ºã•れã¾ã›ã‚“。", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/jpn/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/jpn/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..21cbaadbdbc --- /dev/null +++ b/i18n/jpn/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "シンボルãŒç„¡åйã§ã™", + "error.invalidNumberFormat": "数値表示形å¼ãŒç„¡åйã§ã™", + "error.propertyNameExpected": "プロパティåãŒå¿…è¦ã§ã™", + "error.valueExpected": "値ãŒå¿…è¦ã§ã™", + "error.colonExpected": "コロンãŒå¿…è¦ã§ã™", + "error.commaExpected": "コンマãŒå¿…è¦ã§ã™", + "error.closeBraceExpected": "å³ä¸­ã‹ã£ã“ãŒå¿…è¦ã§ã™", + "error.closeBracketExpected": "å³è§’ã‹ã£ã“ãŒå¿…è¦ã§ã™", + "error.endOfFileExpected": "ファイルã®çµ‚ã‚りãŒå¿…è¦ã§ã™" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/code/electron-main/menus.i18n.json b/i18n/jpn/src/vs/code/electron-main/menus.i18n.json index a1b610411e1..79412979d8d 100644 --- a/i18n/jpn/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/jpn/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "ヘルプ(&&H)", "miNewWindow": "æ–°ã—ã„ウィンドウ(&&W)", "mAbout": "{0} ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ±", + "mServices": "サービス", "mHide": "{0} ã‚’éžè¡¨ç¤ºã«ã™ã‚‹", "mHideOthers": "ãã®ä»–ã‚’éžè¡¨ç¤ºã«ã™ã‚‹", "mShowAll": "ã™ã¹ã¦è¡¨ç¤º", @@ -57,7 +58,7 @@ "miInsertCursorAbove": "ã‚«ãƒ¼ã‚½ãƒ«ã‚’ä¸Šã«æŒ¿å…¥(&&A)", "miInsertCursorBelow": "ã‚«ãƒ¼ã‚½ãƒ«ã‚’ä¸‹ã«æŒ¿å…¥(&&D)", "miInsertCursorAtEndOfEachLineSelected": "ã‚«ãƒ¼ã‚½ãƒ«ã‚’è¡Œæœ«ã«æŒ¿å…¥(&&U)", - "miAddSelectionToNextFindMatch": "次ã®å‡ºç¾å€‹æ‰€ã‚’追加(&&N)", + "miAddSelectionToNextFindMatch": "次ã®å‡ºç¾ç®‡æ‰€ã‚’追加(&&N)", "miAddSelectionToPreviousFindMatch": "å‰ã®å‡ºç¾ç®‡æ‰€ã‚’追加(&&R)", "miSelectHighlights": "ã™ã¹ã¦ã®å‡ºç¾ç®‡æ‰€ã‚’é¸æŠž(&&O)", "miCopyLinesUp": "行を上ã¸ã‚³ãƒ”ー(&&C)", @@ -69,7 +70,7 @@ "miSmartSelectShrink": "é¸æŠžç¯„å›²ã®ç¸®å°(&&S)", "miViewExplorer": "エクスプローラー(&&E)", "miViewSearch": "検索(&&S)", - "miViewGit": "Git(&&G)", + "miViewSCM": "SCM(&&S)", "miViewDebug": "デãƒãƒƒã‚°(&&D)", "miViewExtensions": "拡張機能(&&X)", "miToggleOutput": "出力(&&O)", @@ -114,6 +115,8 @@ "miGotoSymbolInFile": "ファイル内ã®ã‚·ãƒ³ãƒœãƒ«ã¸ç§»å‹•(&&S)...", "miGotoSymbolInWorkspace": "ワークスペース内ã®ã‚·ãƒ³ãƒœãƒ«ã¸ç§»å‹•(&&W)...", "miGotoDefinition": "定義ã«ç§»å‹•(&&D)", + "miGotoTypeDefinition": "型定義ã«ç§»å‹•(&&T)", + "miGotoImplementation": "実装ã«ç§»å‹•(&&I)", "miGotoLine": "指定行ã¸ç§»å‹•(&&L)...", "miStartDebugging": "デãƒãƒƒã‚°ã®é–‹å§‹(&&S)", "miStartWithoutDebugging": "デãƒãƒƒã‚°ãªã—ã§é–‹å§‹(&&W)", @@ -140,6 +143,7 @@ "miAccessibilityOptions": "ユーザー補助オプション(&&O)", "miReportIssues": "å•題ã®å ±å‘Š(&&I)", "miWelcome": "よã†ã“ã(&&W)", + "miInteractivePlayground": "対話型プレイグラウンド(&&I)", "miDocumentation": "å‚照資料(&&D)", "miReleaseNotes": "リリース ノート(&&R)", "miKeyboardShortcuts": "キーボード ショートカットã®å‚ç…§(&&K)", diff --git a/i18n/jpn/src/vs/code/electron-main/windows.i18n.json b/i18n/jpn/src/vs/code/electron-main/windows.i18n.json index 6b0480ce2d2..6631797b5a4 100644 --- a/i18n/jpn/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/jpn/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "OK", "pathNotExistTitle": "パスãŒå­˜åœ¨ã—ã¾ã›ã‚“", "pathNotExistDetail": "パス '{0}' ã¯ãƒ‡ã‚£ã‚¹ã‚¯ã«å­˜åœ¨ã—ãªããªã£ãŸã‚ˆã†ã§ã™ã€‚", - "accessibilityOptionsWindowTitle": "ユーザー補助オプション", "reopen": "ã‚‚ã†ä¸€åº¦é–‹ã", "wait": "待機を続ã‘ã‚‹", "close": "é–‰ã˜ã‚‹", diff --git a/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json index 3086fa1d367..8ce8d297e00 100644 --- a/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "フォントã®å¤ªã•を制御ã—ã¾ã™ã€‚", "fontSize": "フォント サイズをピクセルå˜ä½ã§åˆ¶å¾¡ã—ã¾ã™ã€‚", "lineHeight": "行ã®é«˜ã•を制御ã—ã¾ã™ã€‚fontSize ã«åŸºã¥ã„㦠lineHeight を計算ã™ã‚‹å ´åˆã«ã¯ã€0 を使用ã—ã¾ã™ã€‚", + "letterSpacing": "文字ã®é–“隔をピクセルå˜ä½ã§åˆ¶å¾¡ã—ã¾ã™ã€‚", "lineNumbers": "行番å·ã®è¡¨ç¤ºã‚’制御ã—ã¾ã™ã€‚使用å¯èƒ½ãªå€¤ã¯ã€'on'ã€'off'ã€ãŠã‚ˆã³ 'relative' ã§ã™ã€‚'relative' ã¯ç¾åœ¨ã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã‹ã‚‰ã®è¡Œæ•°ã‚’示ã—ã¾ã™ã€‚", "rulers": "垂直ルーラーを表示ã™ã‚‹åˆ—", "wordSeparators": "å˜èªžã«é–¢é€£ã—ãŸãƒŠãƒ“ゲーションã¾ãŸã¯æ“作を実行ã™ã‚‹ã¨ãã«ã€å˜èªžã®åŒºåˆ‡ã‚Šæ–‡å­—ã¨ã—ã¦ä½¿ç”¨ã•れる文字", @@ -40,7 +41,6 @@ "formatOnType": "エディターã§å…¥åŠ›å¾Œã«è‡ªå‹•çš„ã«è¡Œã®æ›¸å¼è¨­å®šã‚’行ã†ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™", "formatOnPaste": "貼り付ã‘ãŸå†…容ãŒã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã«ã‚ˆã‚Šè‡ªå‹•çš„ã«ãƒ•ォーマットã•れるã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚フォーマッタを使用å¯èƒ½ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ã¾ãŸã€ãƒ•ォーマッタãŒãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆå†…ã®ç¯„囲をフォーマットã§ããªã‘れã°ãªã‚Šã¾ã›ã‚“。", "suggestOnTriggerCharacters": "トリガー文字ã®å…¥åŠ›æ™‚ã«å€™è£œãŒè‡ªå‹•çš„ã«è¡¨ç¤ºã•れるよã†ã«ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™", - "acceptSuggestionOnEnter": "'Tab' キーã«åŠ ãˆã¦ 'Enter' キーã§å€™è£œã‚’å—ã‘入れるã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚æ”¹è¡Œã®æŒ¿å…¥ã‚„候補ã®å映ã®é–“ã§ã‚ã„ã¾ã„ã•を解消ã™ã‚‹ã®ã«å½¹ç«‹ã¡ã¾ã™ã€‚", "acceptSuggestionOnCommitCharacter": "コミット文字ã§å€™è£œã‚’å—ã‘入れるã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚ãŸã¨ãˆã°ã€JavaScript ã§ã¯ã‚»ãƒŸã‚³ãƒ­ãƒ³ (';') をコミット文字ã«ã—ã¦ã€å€™è£œã‚’å—ã‘入れã¦ãã®æ–‡å­—を入力ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", "snippetSuggestions": "ä»–ã®ä¿®æ­£å€™è£œã¨ä¸€ç·’ã«ã‚¹ãƒ‹ãƒšãƒƒãƒˆã‚’表示ã™ã‚‹ã‹ã©ã†ã‹ã€ãŠã‚ˆã³ãã®ä¸¦ã³æ›¿ãˆã®æ–¹æ³•を制御ã—ã¾ã™ã€‚", "emptySelectionClipboard": "é¸æŠžç¯„å›²ã‚’æŒ‡å®šã—ãªã„ã§ã‚³ãƒ”ーã™ã‚‹å ´åˆã«ç¾åœ¨ã®è¡Œã‚’コピーã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", @@ -60,8 +60,9 @@ "renderControlCharacters": "エディターã§åˆ¶å¾¡æ–‡å­—を表示ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™", "renderIndentGuides": "エディターã§ã‚¤ãƒ³ãƒ‡ãƒ³ãƒˆã®ã‚¬ã‚¤ãƒ‰ã‚’表示ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™", "renderLineHighlight": "エディターãŒç¾åœ¨ã®è¡Œã‚’ã©ã®ã‚ˆã†ã«å¼·èª¿è¡¨ç¤ºã™ã‚‹ã‹ã‚’制御ã—ã¾ã™ã€‚考ãˆã‚‰ã‚Œã‚‹å€¤ã¯ 'none'ã€'gutter'ã€'line'ã€'all' ã§ã™ã€‚", - "codeLens": "エディターã§ã‚³ãƒ¼ãƒ‰ レンズを表示ã™ã‚‹ã‹ã‚’ã©ã†ã‹ã‚’制御ã™ã‚‹", + "codeLens": "エディター㧠CodeLens を表示ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã™ã‚‹", "folding": "エディターã§ã‚³ãƒ¼ãƒ‰ã®æŠ˜ã‚ŠãŸãŸã¿ã‚’有効ã«ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™", + "showFoldingControls": "ä½™ç™½ä¸Šã®æŠ˜ã‚ŠãŸãŸã¿ã‚³ãƒ³ãƒˆãƒ­ãƒ¼ãƒ«ã‚’自動的ã«éžè¡¨ç¤ºã«ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ 。", "matchBrackets": "ã‹ã£ã“ã‚’é¸æŠžã™ã‚‹ã¨ã€å¯¾å¿œã™ã‚‹ã‹ã£ã“を強調表示ã—ã¾ã™ã€‚", "glyphMargin": "エディターã§ç¸¦ã®ã‚°ãƒªãƒ•余白ãŒè¡¨ç¤ºã•れるã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚ã»ã¨ã‚“ã©ã®å ´åˆã€ã‚°ãƒªãƒ•余白ã¯ãƒ‡ãƒãƒƒã‚°ã«ä½¿ç”¨ã•れã¾ã™ã€‚", "useTabStops": "ç©ºç™½ã®æŒ¿å…¥ã‚„削除ã¯ã‚¿ãƒ–ä½ç½®ã«å¾“ã£ã¦è¡Œã‚れã¾ã™", diff --git a/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..3fdfb4e461b --- /dev/null +++ b/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "エディターã®ã‚³ãƒ³ãƒ†ãƒ³ãƒ„" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json index 005a4a5743e..b380e645e98 100644 --- a/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,15 @@ "caret": "エディターã®ã‚«ãƒ¼ã‚½ãƒ«ã®è‰²ã€‚", "editorWhitespaces": "エディターã®ã‚¹ãƒšãƒ¼ã‚¹æ–‡å­—ã®è‰²ã€‚", "editorIndentGuides": "エディター インデント ガイドã®è‰²ã€‚", - "editorLineNumbers": "エディターã®è¡Œç•ªå·ã®è‰²ã€‚" + "editorLineNumbers": "エディターã®è¡Œç•ªå·ã®è‰²ã€‚", + "editorRuler": "エディター ルーラーã®è‰²ã€‚", + "editorCodeLensForeground": "CodeLens エディターã®å‰æ™¯è‰²ã€‚", + "editorBracketMatchBackground": "一致ã™ã‚‹ã‹ã£ã“ã®èƒŒæ™¯è‰²", + "editorBracketMatchBorder": "一致ã™ã‚‹ã‹ã£ã“内ã®ãƒœãƒƒã‚¯ã‚¹ã®è‰²", + "editorOverviewRulerBorder": "概è¦ãƒ«ãƒ¼ãƒ©ãƒ¼ã®å¢ƒç•Œè‰²ã€‚", + "editorGutter": "エディターã®ä½™ç™½ã®èƒŒæ™¯è‰²ã€‚余白ã«ã¯ã‚°ãƒªãƒ• マージンã¨è¡Œç•ªå·ãŒå«ã¾ã‚Œã¾ã™ã€‚", + "errorForeground": "エディターã§ã‚¨ãƒ©ãƒ¼ã‚’ç¤ºã™æ³¢ç·šã®å‰æ™¯è‰²ã€‚", + "errorBorder": "エディターã§ã‚¨ãƒ©ãƒ¼ã‚’ç¤ºã™æ³¢ç·šã®å¢ƒç•Œç·šã®è‰²ã€‚", + "warningForeground": "エディターã§è­¦å‘Šã‚’ç¤ºã™æ³¢ç·šã®å‰æ™¯è‰²ã€‚", + "warningBorder": "エディターã§è­¦å‘Šã‚’ç¤ºã™æ³¢ç·šã®å¢ƒç•Œç·šã®è‰²ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..624f9b7af70 --- /dev/null +++ b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "'{0}' ã®å®šç¾©ã¯è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "generic.noResults": "定義ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "meta.title": " – {0} 個ã®å®šç¾©", + "actions.goToDecl.label": "定義ã¸ç§»å‹•", + "actions.goToDeclToSide.label": "定義を横ã«é–‹ã", + "actions.previewDecl.label": "定義をã“ã“ã«è¡¨ç¤º", + "goToImplementation.noResultWord": "'{0}' ã®å®Ÿè£…ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "goToImplementation.generic.noResults": "実装ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "meta.implementations.title": "– {0} 個ã®å®Ÿè£…", + "actions.goToImplementation.label": "実装ã«ç§»å‹•", + "actions.peekImplementation.label": "実装ã®ãƒ—レビュー", + "goToTypeDefinition.noResultWord": "'{0}' ã®åž‹å®šç¾©ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "goToTypeDefinition.generic.noResults": "型定義ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“", + "meta.typeDefinitions.title": " – {0} 個ã®åž‹å®šç¾©", + "actions.goToTypeDefinition.label": "型定義ã¸ç§»å‹•", + "actions.peekTypeDefinition.label": "型定義を表示" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..f918ba9f96d --- /dev/null +++ b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "クリックã—ã¦ã€{0} ã®å®šç¾©ã‚’表示ã—ã¾ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/jpn/src/vs/editor/contrib/hover/browser/hover.i18n.json index 59dfc6718b6..13ad7162719 100644 --- a/i18n/jpn/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "ホãƒãƒ¼ã®è¡¨ç¤º", - "hoverHighlight": "ホãƒãƒ¼ãŒè¡¨ç¤ºã•れã¦ã„るワードã®ä¸‹ã‚’強調表示ã—ã¾ã™ã€‚", - "hoverBackground": "エディター ホãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚", - "hoverBorder": "エディター ホãƒãƒ¼ã®å¢ƒç•Œç·šã®è‰²ã€‚" + "showHover": "ホãƒãƒ¼ã®è¡¨ç¤º" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json index 178a2d932ba..67812ff35d1 100644 --- a/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "command キーを押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã—ã¦ãƒªãƒ³ã‚¯å…ˆã‚’表示", "links.navigate": "Ctrl キーを押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã—ã¦ãƒªãƒ³ã‚¯å…ˆã‚’表示", + "links.navigate.al": "Altl キーを押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã—ã¦ãƒªãƒ³ã‚¯å…ˆã‚’表示", "invalid.url": "申ã—訳ã‚りã¾ã›ã‚“。ã“ã®ãƒªãƒ³ã‚¯ã¯å½¢å¼ãŒæ­£ã—ããªã„ãŸã‚é–‹ãã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸ: {0}", "missing.url": "申ã—訳ã‚りã¾ã›ã‚“。ã“ã®ãƒªãƒ³ã‚¯ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆãŒå­˜åœ¨ã—ãªã„ãŸã‚é–‹ãã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚", "label": "リンクを開ã" diff --git a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 33c314603a1..0e09eb3904d 100644 --- a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "列 {2} ã® {1} 行目㫠{0} ã¤ã®ã‚·ãƒ³ãƒœãƒ«", + "aria.fileReferences.1": "{0} ã« 1 個ã®ã‚·ãƒ³ãƒœãƒ«", + "aria.fileReferences.N": "{1} ã« {0} 個ã®ã‚·ãƒ³ãƒœãƒ«", "aria.result.0": "一致ã™ã‚‹é …ç›®ã¯ã‚りã¾ã›ã‚“", "aria.result.1": "{0} ã« 1 個ã®ã‚·ãƒ³ãƒœãƒ«ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸ", "aria.result.n1": "{1} ã« {0} 個ã®ã‚·ãƒ³ãƒœãƒ«ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸ", diff --git a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index f96e5015ff1..8fedf2e46b0 100644 --- a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,11 +16,12 @@ "peekViewTitleInfoForeground": "ピーク ビューã®ã‚¿ã‚¤ãƒˆãƒ«æƒ…å ±ã®è‰²ã€‚", "peekViewBorder": "ピーク ビューã®å¢ƒç•Œã¨çŸ¢å°ã®è‰²ã€‚", "peekViewResultsBackground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®èƒŒæ™¯è‰²ã€‚", - "peekViewResultsMatchForeground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®ä¸€è‡´ã—ãŸã‚¨ãƒ³ãƒˆãƒªã®å‰æ™¯è‰²ã€‚", - "peekViewResultsFileForeground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®ãƒ•ァイル エントリã®å‰æ™¯è‰²ã€‚", + "peekViewResultsMatchForeground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®ãƒ©ã‚¤ãƒ³ ノードã®å‰æ™¯è‰²ã€‚", + "peekViewResultsFileForeground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®ãƒ•ァイル ノードã®å‰æ™¯è‰²ã€‚", "peekViewResultsSelectionBackground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®é¸æŠžæ¸ˆã¿ã‚¨ãƒ³ãƒˆãƒªã®èƒŒæ™¯è‰²ã€‚", "peekViewResultsSelectionForeground": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®é¸æŠžæ¸ˆã¿ã‚¨ãƒ³ãƒˆãƒªã®å‰æ™¯è‰²ã€‚", "peekViewEditorBackground": "ピーク ビュー エディターã®èƒŒæ™¯è‰²ã€‚", + "peekViewEditorGutterBackground": "ピーク ビュー エディターã®ä½™ç™½ã®èƒŒæ™¯è‰²ã€‚", "peekViewResultsMatchHighlight": "ピーク ãƒ“ãƒ¥ãƒ¼çµæžœãƒªã‚¹ãƒˆã®ä¸€è‡´ã—ãŸå¼·èª¿è¡¨ç¤ºè‰²ã€‚", "peekViewEditorMatchHighlight": "ピーク ビュー エディターã®ä¸€è‡´ã—ãŸå¼·èª¿è¡¨ç¤ºè‰²ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index b1177964ccf..65e2583d291 100644 --- a/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,13 @@ { "editorSuggestWidgetBackground": "候補ã®ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã®èƒŒæ™¯è‰²ã€‚", "editorSuggestWidgetBorder": "候補ウィジェットã®å¢ƒç•Œç·šè‰²ã€‚", + "editorSuggestWidgetForeground": "候補ウィジェットã®å‰æ™¯è‰²ã€‚", + "editorSuggestWidgetSelectedBackground": "候補ウィジェット内ã§é¸æŠžæ¸ˆã¿ã‚¨ãƒ³ãƒˆãƒªã®èƒŒæ™¯è‰²ã€‚", + "editorSuggestWidgetHighlightForeground": "候補ã®ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆå†…ã§ä¸€è‡´ã—ãŸãƒã‚¤ãƒ©ã‚¤ãƒˆã®è‰²ã€‚", "readMore": "詳細を表示...{0}", "suggestionWithDetailsAriaLabel": "{0}ã€å€™è£œã€è©³ç´°ã‚り", "suggestionAriaLabel": "{0}ã€å€™è£œ", - "goback": "戻る", + "readLess": "詳細を隠ã™...{0}", "suggestWidget.loading": "読ã¿è¾¼ã‚“ã§ã„ã¾ã™...", "suggestWidget.noSuggestions": "候補ã¯ã‚りã¾ã›ã‚“。", "suggestionAriaAccepted": "{0}ã€å—ã‘入れ済ã¿", diff --git a/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 918be3ac1a1..7f3e60f73e4 100644 --- a/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "インデントを増減ã™ã‚‹è§’ã‹ã£ã“を定義ã—ã¾ã™ã€‚", "schema.autoClosingPairs": "è§’ã‹ã£ã“ã®ãƒšã‚¢ã‚’定義ã—ã¾ã™ã€‚左角ã‹ã£ã“ãŒå…¥åŠ›ã•れるã¨ã€å³è§’ã‹ã£ã“ãŒè‡ªå‹•çš„ã«æŒ¿å…¥ã•れã¾ã™ã€‚", "schema.autoClosingPairs.notIn": "自動ペアãŒç„¡åйãªã‚¹ã‚³ãƒ¼ãƒ—ã®ä¸€è¦§ã‚’定義ã—ã¾ã™ã€‚", - "schema.surroundingPairs": "é¸æŠžæ–‡å­—åˆ—ã‚’å›²ã‚€ã¨ãã«ä½¿ç”¨ã§ãã‚‹è§’ã‹ã£ã“ã®ãƒšã‚¢ã‚’定義ã—ã¾ã™ã€‚" + "schema.surroundingPairs": "é¸æŠžæ–‡å­—åˆ—ã‚’å›²ã‚€ã¨ãã«ä½¿ç”¨ã§ãã‚‹è§’ã‹ã£ã“ã®ãƒšã‚¢ã‚’定義ã—ã¾ã™ã€‚", + "schema.wordPattern": "言語ã®ãŸã‚ã®å˜èªžã®å®šç¾©ã€‚", + "schema.wordPattern.pattern": "言葉ã®ç…§åˆã«ä½¿ç”¨ã™ã‚‹æ­£è¦è¡¨ç¾ãƒ‘ターン。", + "schema.wordPattern.flags": "言葉ã®ç…§åˆã«ä½¿ç”¨ã™ã‚‹æ­£è¦è¡¨ç¾ãƒ•ラグ。", + "schema.wordPattern.flags.errorMessage": "`/^([gimuy]+)$/` パターンã«ä¸€è‡´ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 5a962ce17d0..5b2270de604 100644 --- a/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "requirearray": "メニュー項目ã¯é…列ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "requirestring": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "optstring": "プロパティ `{0}` ã¯çœç•¥ã™ã‚‹ã‹ã€åž‹ `string` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "requirestring": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "optstring": "`{0}` プロパティã¯çœç•¥ã™ã‚‹ã‹ã€`string` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "vscode.extension.contributes.menuItem.command": "実行ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®è­˜åˆ¥å­ã€‚コマンド㯠'commands' セクションã§å®£è¨€ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "vscode.extension.contributes.menuItem.alt": "実行ã™ã‚‹åˆ¥ã®ã‚³ãƒžãƒ³ãƒ‰ã®è­˜åˆ¥å­ã€‚コマンド㯠'commands' セクションã§å®£è¨€ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "vscode.extension.contributes.menuItem.when": "ã“ã®é …目を表示ã™ã‚‹ãŸã‚ã«æº€ãŸã™å¿…è¦ãŒã‚ã‚‹æ¡ä»¶", @@ -22,9 +22,9 @@ "menus.resourceGroupContext": "ソース管ç†ãƒªã‚½ãƒ¼ã‚¹ グループã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆ メニュー", "menus.resourceStateContext": "ソース管ç†ãƒªã‚½ãƒ¼ã‚¹çŠ¶æ…‹ã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆ メニュー", "nonempty": "空以外ã®å€¤ãŒå¿…è¦ã§ã™ã€‚", - "opticon": "プロパティ `icon` ã¯çœç•¥ã§ãã¾ã™ã€‚指定ã™ã‚‹å ´åˆã«ã¯ã€æ–‡å­—列ã¾ãŸã¯ `{dark, light}` ãªã©ã®ãƒªãƒ†ãƒ©ãƒ«ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "requireStringOrObject": "プロパティ `{0}` ã¯å¿…é ˆã§ã€`string` ã¾ãŸã¯ `object` ã®åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "requirestrings": "プロパティ `{0}` 㨠`{1}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "opticon": "`icon` プロパティã¯çœç•¥ã§ãã¾ã™ã€‚指定ã™ã‚‹å ´åˆã«ã¯ã€æ–‡å­—列ã¾ãŸã¯ `{dark, light}` ãªã©ã®ãƒªãƒ†ãƒ©ãƒ«ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "requireStringOrObject": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` ã¾ãŸã¯ `object` ã®åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "requirestrings": "プロパティ㮠`{0}` 㨠`{1}` ã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", "vscode.extension.contributes.commandType.command": "実行ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®è­˜åˆ¥å­", "vscode.extension.contributes.commandType.title": "コマンド㌠UI ã«è¡¨ç¤ºã•れる際ã®ã‚¿ã‚¤ãƒˆãƒ«", "vscode.extension.contributes.commandType.category": "(çœç•¥å¯èƒ½) コマンド別ã®ã‚«ãƒ†ã‚´ãƒªæ–‡å­—列㌠UI ã§ã‚°ãƒ«ãƒ¼ãƒ—分ã‘ã•れã¾ã™", diff --git a/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json b/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json index b51838a0db5..f63839a1d9b 100644 --- a/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "#NAME?", "installExtension": "拡張機能をインストールã—ã¾ã™ã€‚", "uninstallExtension": "拡張機能をアンインストールã—ã¾ã™ã€‚", + "experimentalApis": "拡張機能ã«å¯¾ã—㦠Proposed API 機能を有効ã«ã—ã¾ã™ã€‚", "disableExtensions": "インストールã•れãŸã™ã¹ã¦ã®æ‹¡å¼µæ©Ÿèƒ½ã‚’無効ã«ã—ã¾ã™ã€‚", "disableGPU": "GPU ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢ アクセラレータを無効ã«ã—ã¾ã™ã€‚", "version": "ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’å°åˆ·ã—ã¾ã™ã€‚", diff --git a/i18n/jpn/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/jpn/src/vs/platform/extensions/node/extensionValidator.i18n.json index d8c385410db..f3a17198670 100644 --- a/i18n/jpn/src/vs/platform/extensions/node/extensionValidator.i18n.json +++ b/i18n/jpn/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -9,15 +9,15 @@ "versionSpecificity2": "`engines.vscode` ({0}) ã§æŒ‡å®šã•れãŸãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒæ˜Žç¢ºã§ã¯ã‚りã¾ã›ã‚“。1.0.0 より後ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® vscode ã®å ´åˆã¯ã€å°‘ãªãã¨ã‚‚ã€æƒ³å®šã•れã¦ã„るメジャー ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’定義ã—ã¦ãã ã•ã„。例 ^1.10.0ã€1.10.xã€1.x.xã€2.x.x ãªã©ã€‚", "versionMismatch": "拡張機能㌠Code {0} ã¨äº’æ›æ€§ãŒã‚りã¾ã›ã‚“。拡張機能ã«å¿…è¦ãªãƒãƒ¼ã‚¸ãƒ§ãƒ³: {1}。", "extensionDescription.empty": "ç©ºã®æ‹¡å¼µæ©Ÿèƒ½ã®èª¬æ˜Žã‚’入手ã—ã¾ã—ãŸ", - "extensionDescription.publisher": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.name": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.version": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.engines": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `object` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.engines.vscode": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.extensionDependencies": "プロパティ `{0}` ã¯çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "extensionDescription.activationEvents1": "プロパティ `{0}` ã¯çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "extensionDescription.publisher": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "extensionDescription.name": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "extensionDescription.version": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "extensionDescription.engines": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "extensionDescription.engines.vscode": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "extensionDescription.extensionDependencies": "`{0}` プロパティã¯çœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "extensionDescription.activationEvents1": "`{0}` プロパティã¯çœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "extensionDescription.activationEvents2": "プロパティ `{0}` 㨠`{1}` ã¯ã€ä¸¡æ–¹ã¨ã‚‚指定ã™ã‚‹ã‹ä¸¡æ–¹ã¨ã‚‚çœç•¥ã—ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "extensionDescription.main1": "プロパティ `{0}` ã¯çœç•¥ã™ã‚‹ã‹ã€åž‹ `string` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "extensionDescription.main1": "`{0}` プロパティã¯çœç•¥ã™ã‚‹ã‹ã€`string` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "extensionDescription.main2": "拡張機能ã®ãƒ•ォルダー ({1}) ã®ä¸­ã« `main` ({0}) ãŒå«ã¾ã‚Œã‚‹ã“ã¨ãŒäºˆæœŸã•れã¾ã™ã€‚ã“れã«ã‚ˆã‚Šæ‹¡å¼µæ©Ÿèƒ½ã‚’ç§»æ¤ã§ããªããªã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚", "extensionDescription.main3": "プロパティ `{0}` 㨠`{1}` ã¯ã€ä¸¡æ–¹ã¨ã‚‚指定ã™ã‚‹ã‹ä¸¡æ–¹ã¨ã‚‚çœç•¥ã—ãªã‘れã°ãªã‚Šã¾ã›ã‚“", "notSemver": "拡張機能ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒ semver ã¨äº’æ›æ€§ãŒã‚りã¾ã›ã‚“。" diff --git a/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json index b656a78c799..df4f3d19acd 100644 --- a/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "エラー: パターン プロパティ {0} ã¯æœ‰åйãªãƒ‘ターン変数åã§ã¯ã‚りã¾ã›ã‚“。", "ProblemMatcherParser.problemPattern.watchingMatcher": "å•題マッãƒãƒ£ãƒ¼ã¯ã€ã‚¦ã‚©ãƒƒãƒå¯¾è±¡ã®é–‹å§‹ãƒ‘ターンã¨çµ‚了パターンã®ä¸¡æ–¹ã‚’定義ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", "ProblemMatcherParser.invalidRegexp": "エラー: 文字列 {0} ã¯ã€æœ‰åŠ¹ãªæ­£è¦è¡¨ç¾ã§ã¯ã‚りã¾ã›ã‚“。\n", - "WatchingPatternSchema.regexp": "ウォッãƒä¸­ã‚¿ã‚¹ã‚¯ã®é–‹å§‹ã¾ãŸã¯çµ‚了を検出ã™ã‚‹æ­£è¦è¡¨ç¾ã€‚", + "WatchingPatternSchema.regexp": "ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ タスクã®é–‹å§‹ã¾ãŸã¯çµ‚了を検出ã™ã‚‹æ­£è¦è¡¨ç¾ã€‚", "WatchingPatternSchema.file": "ファイルåã®ä¸€è‡´ã‚°ãƒ«ãƒ¼ãƒ— インデックス。çœç•¥ã§ãã¾ã™ã€‚", "PatternTypeSchema.name": "æä¾›ã•れãŸã‹äº‹å‰å®šç¾©ã•れãŸå•題パターンã®åå‰", "PatternTypeSchema.description": "A problem pattern or the name of a contributed or predefined problem pattern. Can be omitted if base is specified.", @@ -43,10 +43,15 @@ "ProblemMatcherSchema.severity": "キャプãƒãƒ£ã•れãŸå•é¡Œã®æ—¢å®šã®é‡å¤§åº¦ã€‚パターンãŒé‡è¦åº¦ã®ä¸€è‡´ã‚°ãƒ«ãƒ¼ãƒ—を定義ã—ã¦ã„ãªã„å ´åˆã«ä½¿ç”¨ã•れã¾ã™ã€‚", "ProblemMatcherSchema.applyTo": "テキスト ドキュメントã§å ±å‘Šã•れãŸå•題ãŒã€é–‹ã„ã¦ã„るドキュメントã®ã¿ã€é–‰ã˜ã‚‰ã‚ŒãŸãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã®ã¿ã€ã™ã¹ã¦ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã®ã„ãšã‚Œã«é©ç”¨ã•れるã‹ã‚’制御ã—ã¾ã™ã€‚", "ProblemMatcherSchema.fileLocation": "å•題パターンã§å ±å‘Šã•れãŸãƒ•ァイルåを解釈ã™ã‚‹æ–¹æ³•を定義ã—ã¾ã™ã€‚", + "ProblemMatcherSchema.background": "ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ タスクã§ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªãƒžãƒƒãƒãƒ£ãƒ¼ã®é–‹å§‹ã¨çµ‚了を追跡ã™ã‚‹ãƒ‘ターン。", + "ProblemMatcherSchema.background.activeOnStart": "true ã«è¨­å®šã™ã‚‹ã¨ã€ã‚¿ã‚¹ã‚¯ã®é–‹å§‹æ™‚ã«ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ モニターãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ– モードã«ãªã‚Šã¾ã™ã€‚ã“れ㯠beginPattern ã¨ä¸€è‡´ã™ã‚‹è¡Œã®ç™ºè¡Œã¨åŒç­‰ã§ã™ã€‚", + "ProblemMatcherSchema.background.beginsPattern": "出力内ã§ä¸€è‡´ã™ã‚‹ã¨ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ タスクã®é–‹å§‹ãŒé€šçŸ¥ã•れã¾ã™ã€‚", + "ProblemMatcherSchema.background.endsPattern": "出力内ã§ä¸€è‡´ã™ã‚‹ã¨ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ タスクã®çµ‚了ãŒé€šçŸ¥ã•れã¾ã™ã€‚", + "ProblemMatcherSchema.watching.deprecated": "watching プロパティã¯ä½¿ç”¨ã•れãªããªã‚Šã¾ã—ãŸã€‚代ã‚り㫠background ã‚’ã”使用ãã ã•ã„。", + "ProblemMatcherSchema.watching": "監視パターンã®é–‹å§‹ã¨çµ‚了を追跡ã™ã‚‹ãƒžãƒƒãƒãƒ£ãƒ¼ã€‚", "ProblemMatcherSchema.watching.activeOnStart": "true ã«è¨­å®šã™ã‚‹ã¨ã€ã‚¿ã‚¹ã‚¯ã®é–‹å§‹æ™‚ã«ã‚¦ã‚©ãƒƒãƒãƒ£ãƒ¼ãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ– モードã«ãªã‚Šã¾ã™ã€‚ã“れ㯠beginPattern ã¨ä¸€è‡´ã™ã‚‹è¡Œã®ç™ºè¡Œã¨åŒç­‰ã§ã™ã€‚", "ProblemMatcherSchema.watching.beginsPattern": "出力内ã§ä¸€è‡´ã™ã‚‹ã¨ã€ã‚¦ã‚©ãƒƒãƒä¸­ã®ã‚¿ã‚¹ã‚¯ã®é–‹å§‹ãŒé€šçŸ¥ã•れã¾ã™ã€‚", "ProblemMatcherSchema.watching.endsPattern": "出力内ã§ä¸€è‡´ã™ã‚‹ã¨ã€ã‚¦ã‚©ãƒƒãƒä¸­ã®ã‚¿ã‚¹ã‚¯ã®çµ‚了ãŒé€šçŸ¥ã•れã¾ã™ã€‚", - "ProblemMatcherSchema.watching": "監視パターンã®é–‹å§‹ã¨çµ‚了を追跡ã™ã‚‹ãƒ‘ターン。", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "This property is deprecated. Use the watching property instead.", "LegacyProblemMatcherSchema.watchedBegin": "ファイル ウォッãƒã§ãƒˆãƒªã‚¬ãƒ¼ã•れ㟠ウォッãƒå¯¾è±¡ã‚¿ã‚¹ã‚¯ã®å®Ÿè¡ŒãŒé–‹å§‹ã•れãŸã“ã¨ã‚’ä¼é”ã™ã‚‹æ­£è¦è¡¨ç¾ã€‚", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "This property is deprecated. Use the watching property instead.", diff --git a/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json index a657f353140..9872f49057d 100644 --- a/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,75 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "無効ãªè‰²å½¢å¼ã§ã™ã€‚ #RGBã€#RGBAã€#RRGGBBã€#RRGGBBAA ã®ã„ãšã‚Œã‹ã‚’使用ã—ã¦ãã ã•ã„", "schema.colors": "ワークベンãƒã§ä½¿ç”¨ã™ã‚‹è‰²ã€‚", "foreground": "全体ã®å‰æ™¯è‰²ã€‚ã“ã®è‰²ã¯ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã«ã‚ˆã£ã¦ã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã•れã¦ã„ãªã„å ´åˆã«ã®ã¿ä½¿ç”¨ã•れã¾ã™ã€‚", + "errorForeground": "エラー メッセージ全体ã®å‰æ™¯è‰²ã€‚ã“ã®è‰²ã¯ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã«ã‚ˆã£ã¦ä¸Šæ›¸ãã•れã¦ã„ãªã„å ´åˆã«ã®ã¿ä½¿ç”¨ã•れã¾ã™ã€‚", + "descriptionForeground": "追加情報をæä¾›ã™ã‚‹èª¬æ˜Žæ–‡ã®å‰æ™¯è‰²ã€ä¾‹:ラベル。", + "focusBorder": "フォーカスã•れãŸè¦ç´ ã®å¢ƒç•Œç·šå…¨ä½“ã®è‰²ã€‚ã“ã®è‰²ã¯ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã«ã‚ˆã£ã¦ä¸Šæ›¸ãã•れã¦ã„ãªã„å ´åˆã«ã®ã¿ä½¿ç”¨ã•れã¾ã™ã€‚", + "contrastBorder": "コントラストを強ã‚ã‚‹ãŸã‚ã«ã€ä»–ã®è¦ç´ ã¨éš”ã¦ã‚‹è¿½åŠ ã®å¢ƒç•Œç·šã€‚", + "activeContrastBorder": "コントラストを強ã‚ã‚‹ãŸã‚ã«ã€ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªä»–è¦ç´ ã¨éš”ã¦ã‚‹è¿½åŠ ã®å¢ƒç•Œç·šã€‚", + "selectionBackground": "ワークベンãƒå†…ã®ãƒ†ã‚­ã‚¹ãƒˆé¸æŠžã®èƒŒæ™¯è‰² (例: 入力フィールドやテキストエリア)。エディター内やターミナル内ã®é¸æŠžã«ã¯é©ç”¨ã•れãªã„ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。", + "textSeparatorForeground": "テキストã®åŒºåˆ‡ã‚Šæ–‡å­—ã®è‰²ã€‚", + "textLinkForeground": "テキスト内ã®ãƒªãƒ³ã‚¯ã®å‰æ™¯è‰²ã€‚", + "textLinkActiveForeground": "テキスト内ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªãƒªãƒ³ã‚¯ã®å‰æ™¯è‰²ã€‚", + "textPreformatForeground": "フォーマット済ã¿ãƒ†ã‚­ã‚¹ãƒˆ セグメントã®å‰æ™¯è‰²ã€‚", + "textBlockQuoteBackground": "テキスト内ã®ãƒ–ロック引用ã®èƒŒæ™¯è‰²ã€‚", + "textBlockQuoteBorder": "テキスト内ã®ãƒ–ロック引用ã®å¢ƒç•Œç·šè‰²ã€‚", + "textCodeBlockBackground": "テキスト内ã®ã‚³ãƒ¼ãƒ‰ ブロックã®èƒŒæ™¯è‰²ã€‚", + "widgetShadow": "ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼å†…ã®æ¤œç´¢/ç½®æ›çª“ãªã©ã€ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ ウィジェットã®å½±ã®è‰²ã€‚", "inputBoxBackground": "入力ボックスã®èƒŒæ™¯ã€‚", "inputBoxForeground": "入力ボックスã®å‰æ™¯ã€‚", "inputBoxBorder": "入力ボックスã®å¢ƒç•Œç·šã€‚", "inputBoxActiveOptionBorder": "入力フィールドã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ– オプションã®å¢ƒç•Œç·šã®è‰²ã€‚", + "inputPlaceholderForeground": "入力ボックスã®ãƒ—レースホルダー テキストã®å‰æ™¯è‰²ã€‚", + "inputValidationInfoBackground": "情報ã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®èƒŒæ™¯è‰²ã€‚", + "inputValidationInfoBorder": "情報ã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®å¢ƒç•Œç·šè‰²ã€‚", + "inputValidationWarningBackground": "警告ã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®èƒŒæ™¯è‰²ã€‚", + "inputValidationWarningBorder": "警告ã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®å¢ƒç•Œç·šè‰²ã€‚", + "inputValidationErrorBackground": "エラーã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®èƒŒæ™¯è‰²ã€‚", + "inputValidationErrorBorder": "エラーã®é‡å¤§åº¦ã‚’示ã™å…¥åŠ›æ¤œè¨¼ã®å¢ƒç•Œç·šè‰²ã€‚", "dropdownBackground": "ドロップダウンã®èƒŒæ™¯ã€‚", "dropdownForeground": "ドロップダウンã®å‰æ™¯ã€‚", "dropdownBorder": "ドロップダウンã®å¢ƒç•Œç·šã€‚", + "listFocusBackground": "ツリーリストãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€ãƒ•ォーカスã•れãŸé …ç›®ã®ãƒ„リーリスト背景色。アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listFocusForeground": "ツリーリストãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€ãƒ•ォーカスã•れãŸé …ç›®ã®ãƒ„ãƒªãƒ¼ãƒªã‚¹ãƒˆå‰æ™¯è‰²ã€‚アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listActiveSelectionBackground": "ツリーリストãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€é¸æŠžã•れãŸé …ç›®ã®ãƒ„リーリスト背景色。アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listActiveSelectionForeground": "ツリーリストãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€é¸æŠžã•れãŸé …ç›®ã®ãƒ„ãƒªãƒ¼ãƒªã‚¹ãƒˆå‰æ™¯è‰²ã€‚アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listInactiveSelectionBackground": "ツリーリストãŒéžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€ãƒ•ォーカスã•れãŸé …ç›®ã®ãƒ„リーリスト背景色。アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listInactiveSelectionForeground": "ツリーリストãŒéžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®ã¨ãã€é¸æŠžã•れãŸé …ç›®ã®ãƒ„ãƒªãƒ¼ãƒªã‚¹ãƒˆå‰æ™¯è‰²ã€‚アクティブãªãƒ„リーリストã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ フォーカスãŒã‚りã€éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã¯ã“れãŒã‚りã¾ã›ã‚“。", + "listHoverBackground": "マウスæ“作ã§é …目をホãƒãƒ¼ã™ã‚‹ã¨ãã®ãƒ„リーリスト背景。", + "listHoverForeground": "マウスæ“作ã§é …目をホãƒãƒ¼ã™ã‚‹ã¨ãã®ãƒ„ãƒªãƒ¼ãƒªã‚¹ãƒˆå‰æ™¯ã€‚", + "listDropBackground": "マウスæ“作ã§é …目を移動ã™ã‚‹ã¨ãã®ãƒ„リーリスト ドラッグ アンド ドロップã®èƒŒæ™¯ã€‚", + "highlight": "ツリーリスト内を検索ã—ã¦ã„ã‚‹ã¨ãã€ä¸€è‡´ã—ãŸå¼·èª¿ã®ãƒ„ãƒªãƒ¼ãƒªã‚¹ãƒˆå‰æ™¯è‰²ã€‚", "pickerGroupForeground": "ラベルをグループ化ã™ã‚‹ãŸã‚ã®ã‚¯ãƒªãƒƒã‚¯é¸æŠžã®è‰²ã€‚", "pickerGroupBorder": "境界線をグループ化ã™ã‚‹ãŸã‚ã®ã‚¯ã‚¤ãƒƒã‚¯é¸æŠžã®è‰²ã€‚", + "buttonForeground": "ボタンã®å‰æ™¯è‰²ã€‚", + "buttonBackground": "ボタンã®èƒŒæ™¯è‰²ã€‚", + "buttonHoverBackground": "ホãƒãƒ¼æ™‚ã®ãƒœã‚¿ãƒ³èƒŒæ™¯è‰²ã€‚", + "badgeBackground": "ãƒãƒƒã‚¸ã®èƒŒæ™¯è‰²ã€‚ãƒãƒƒã‚¸ã¨ã¯å°ã•ãªæƒ…報ラベルã®ã“ã¨ã§ã™ã€‚例:æ¤œç´¢çµæžœã®æ•°", + "badgeForeground": "ãƒãƒƒã‚¸ã®å‰æ™¯è‰²ã€‚ãƒãƒƒã‚¸ã¨ã¯å°ã•ãªæƒ…報ラベルã®ã“ã¨ã§ã™ã€‚例:æ¤œç´¢çµæžœã®æ•°", + "scrollbarShadow": "ビューãŒã‚¹ã‚¯ãƒ­ãƒ¼ãƒ«ã•れãŸã“ã¨ã‚’示ã™ã‚¹ã‚¯ãƒ­ãƒ¼ãƒ« ãƒãƒ¼ã®å½±ã€‚", + "scrollbarSliderBackground": "スライダーã®èƒŒæ™¯è‰²ã€‚", + "scrollbarSliderHoverBackground": "ホãƒãƒ¼æ™‚ã®ã‚¹ãƒ©ã‚¤ãƒ€ãƒ¼èƒŒæ™¯è‰²ã€‚", + "scrollbarSliderActiveBackground": "アクティブ時ã®ã‚¹ãƒ©ã‚¤ãƒ€ãƒ¼èƒŒæ™¯è‰²ã€‚", + "progressBarBackground": "時間ã®ã‹ã‹ã‚‹æ“作ã§è¡¨ç¤ºã™ã‚‹ãƒ—ログレス ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚", "editorBackground": "エディターã®èƒŒæ™¯è‰²ã€‚", "editorForeground": "ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®æ—¢å®šã®å‰æ™¯è‰²ã€‚", + "editorWidgetBackground": "検索/ç½®æ›çª“ãªã©ã€ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ ウィジェットã®èƒŒæ™¯è‰²ã€‚", + "editorWidgetBorder": "エディター ウィジェットã®å¢ƒç•Œç·šã®è‰²ã€‚", "editorSelection": "エディターã®é¸æŠžç¯„囲ã®è‰²ã€‚", "editorInactiveSelection": "éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®é¸æŠžç¯„囲ã®è‰²ã€‚", "editorSelectionHighlight": "é¸æŠžç¯„å›²ã¨åŒã˜ã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã®é ˜åŸŸã®è‰²ã€‚", "editorFindMatch": "ç¾åœ¨ã®æ¤œç´¢ä¸€è‡´é …ç›®ã®è‰²ã€‚", "findMatchHighlight": "ä»–ã®æ¤œç´¢ä¸€è‡´é …ç›®ã®è‰²ã€‚", "findRangeHighlight": "検索を制é™ã™ã‚‹ç¯„囲ã®è‰²ã€‚", + "hoverHighlight": "ホãƒãƒ¼ãŒè¡¨ç¤ºã•れã¦ã„るワードã®ä¸‹ã‚’強調表示ã—ã¾ã™ã€‚", + "hoverBackground": "エディター ホãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚", + "hoverBorder": "エディター ホãƒãƒ¼ã®å¢ƒç•Œç·šã®è‰²ã€‚", "activeLinkForeground": "アクティブãªãƒªãƒ³ã‚¯ã®è‰²ã€‚", - "linkForeground": "リンクã®è‰²ã€‚", - "editorWidgetBackground": "検索/ç½®æ›çª“ãªã©ã€ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ ウィジェットã®èƒŒæ™¯è‰²ã€‚" + "diffEditorInserted": "挿入ã•れãŸãƒ†ã‚­ã‚¹ãƒˆã®èƒŒæ™¯è‰²ã€‚", + "diffEditorRemoved": "削除ã•れãŸãƒ†ã‚­ã‚¹ãƒˆã®èƒŒæ™¯è‰²ã€‚", + "diffEditorInsertedOutline": "挿入ã•れãŸãƒ†ã‚­ã‚¹ãƒˆã®è¼ªéƒ­ã®è‰²ã€‚", + "diffEditorRemovedOutline": "削除ã•れãŸãƒ†ã‚­ã‚¹ãƒˆã®è¼ªéƒ­ã®è‰²ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..df697c332c2 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "拡張機能 {0} ã‚’ {1} ã§ä¸Šæ›¸ãã—ã¦ã„ã¾ã™ã€‚", + "extensionUnderDevelopment": "é–‹ç™ºã®æ‹¡å¼µæ©Ÿèƒ½ã‚’ {0} ã«èª­ã¿è¾¼ã‚“ã§ã„ã¾ã™" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..c3df3145deb --- /dev/null +++ b/i18n/jpn/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "é–‰ã˜ã‚‹", + "cancel": "キャンセル", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/jpn/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..6447043d7ee --- /dev/null +++ b/i18n/jpn/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "ID '{0}' ã® TreeExplorerNodeProvider ã¯ç™»éŒ²ã•れã¦ã„ã¾ã›ã‚“。", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider '{0}' ãŒãƒ«ãƒ¼ãƒˆ ãƒŽãƒ¼ãƒ‰ã®æŒ‡å®šã«å¤±æ•—ã—ã¾ã—ãŸã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..74c5f0eabd7 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +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. +{ + "treeView.notRegistered": "ID '{0}' ã®ãƒ„リー ビューã¯ç™»éŒ²ã•れã¦ã„ã¾ã›ã‚“。", + "treeItem.notFound": "ID '{0}' ã®ãƒ„リー項目ã¯è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚", + "treeView.duplicateElement": " {0} è¦ç´ ã¯æ—¢ã«ç™»éŒ²ã•れã¦ã„ã¾ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/jpn/src/vs/workbench/browser/actions/configureLocale.i18n.json index ccad0f32648..21107d326ab 100644 --- a/i18n/jpn/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,7 @@ "configureLocale": "言語を構æˆã™ã‚‹", "displayLanguage": "VSCode ã®è¡¨ç¤ºè¨€èªžã‚’定義ã—ã¾ã™ã€‚", "doc": "サãƒãƒ¼ãƒˆã•れã¦ã„る言語ã®ä¸€è¦§ã«ã¤ã„ã¦ã¯ã€{0} ã‚’ã”覧ãã ã•ã„。", - "restart": "VSCode ã®å†èµ·å‹•ã«å¿…è¦ãªå€¤ã‚’変更ã—ã¾ã™ã€‚", + "restart": "値を変更ã™ã‚‹ã«ã¯ VS Code ã®å†èµ·å‹•ãŒå¿…è¦ã§ã™ã€‚", "fail.createSettings": "'{0}' ({1}) を作æˆã§ãã¾ã›ã‚“。", "JsonSchema.locale": "使用ã™ã‚‹ UI 言語。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/jpn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 5f83155a33c..7af5bc08c38 100644 --- a/i18n/jpn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "ã‚°ãƒ«ãƒ¼ãƒ—å†…ã®æœ€è¿‘使用ã—ãŸã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã†ã¡å‰ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", "openNextRecentlyUsedEditorInGroup": "ã‚°ãƒ«ãƒ¼ãƒ—å†…ã®æœ€è¿‘使用ã—ãŸã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã†ã¡æ¬¡ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", "navigateEditorHistoryByInput": "履歴ã‹ã‚‰ä»¥å‰ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", + "openNextRecentlyUsedEditor": "最近使用ã—ãŸã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã†ã¡æ¬¡ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", + "openPreviousRecentlyUsedEditor": "最近使用ã—ãŸã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã†ã¡å‰ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", "clearEditorHistory": "エディター履歴ã®ã‚¯ãƒªã‚¢", "focusLastEditorInStack": "ã‚°ãƒ«ãƒ¼ãƒ—å†…ã®æœ€å¾Œã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã‚’é–‹ã", "moveEditorLeft": "エディターを左ã¸ç§»å‹•", diff --git a/i18n/jpn/src/vs/workbench/common/theme.i18n.json b/i18n/jpn/src/vs/workbench/common/theme.i18n.json index a7d6ea6e58c..d183c267924 100644 --- a/i18n/jpn/src/vs/workbench/common/theme.i18n.json +++ b/i18n/jpn/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "タブ コンテナーã®èƒŒæ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸå†…ã«ã‚るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚複数ã®ã‚¿ãƒ–ã‚’ 1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚複数ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループãŒã‚ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚", "tabActiveBackground": "アクティブ タブã®èƒŒæ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", "tabInactiveBackground": "éžã‚¢ã‚¯ãƒ†ã‚£ãƒ– タブã®èƒŒæ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", "tabBorder": "タブåŒå£«ã‚’分ã‘ã‚‹ãŸã‚ã®å¢ƒç•Œç·šã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸå†…ã«ã‚るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚複数ã®ã‚¿ãƒ–ã‚’ 1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚複数ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループãŒã‚ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚", "tabActiveEditorGroupActiveForeground": "アクティブ グループ内ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ– タブã®å‰æ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", - "tabActiveEditorGroupInactiveForeground": "éžã‚¢ã‚¯ãƒ†ã‚£ãƒ– グループ内ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ– タブã®å‰æ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", "tabInactiveEditorGroupActiveForeground": "アクティブ グループ内ã®éžã‚¢ã‚¯ãƒ†ã‚£ãƒ– タブã®å‰æ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", - "tabInactiveEditorGroupInactiveForeground": "éžã‚¢ã‚¯ãƒ†ã‚£ãƒ– タブã®å‰æ™¯è‰²ã€‚タブã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã«ãŠã‘るエディターã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚1 ã¤ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループã§è¤‡æ•°ã®ã‚¿ãƒ–ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™ã€‚エディター グループを複数ã«ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚", + "editorGroupBackground": "エディター グループã®èƒŒæ™¯è‰²ã€‚エディター グループã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚背景色ã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループをドラッグã™ã‚‹ã¨è¡¨ç¤ºã•れã¾ã™ã€‚", + "tabsContainerBackground": "ã‚¿ãƒ–ãŒæœ‰åйãªå ´åˆã® エディター グループ タイトル ヘッダーã®èƒŒæ™¯è‰²ã€‚エディター グループã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", + "editorGroupHeaderBackground": "タブãŒç„¡åйãªå ´åˆã® エディター グループ タイトル ヘッダーã®èƒŒæ™¯è‰²ã€‚エディター グループã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", "editorGroupBorder": "複数ã®ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ グループを互ã„ã«åˆ†é›¢ã™ã‚‹ãŸã‚ã®è‰²ã€‚エディター グループã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", - "editorDragAndDropBackground": "エディターã®ãƒ‰ãƒ©ãƒƒã‚°æ™‚ã®èƒŒæ™¯è‰²ã€‚", + "editorDragAndDropBackground": "エディターã®å‘¨å›²ã‚’ドラッグã—ã¦ã„ã‚‹ã¨ãã®èƒŒæ™¯è‰²ã€‚エディターã®ã‚³ãƒ³ãƒ†ãƒ³ãƒ„ãŒæœ€å¾Œã¾ã§è¼ããŸã‚ã«ã€è‰²ã¯é€éŽã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", "panelBackground": "パãƒãƒ«ã®èƒŒæ™¯è‰²ã€‚パãƒãƒ«ã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã®ä¸‹ã«è¡¨ç¤ºã•れã€å‡ºåŠ›ã‚„çµ±åˆã‚¿ãƒ¼ãƒŸãƒŠãƒ«ãªã©ã®ãƒ“ューをå«ã¿ã¾ã™ã€‚", "panelBorder": "エディターã¨ã®åŒºåˆ‡ã‚Šã‚’示ã™ãƒ‘ãƒãƒ«ä¸Šéƒ¨ã®ç½«ç·šã®è‰²ã€‚パãƒãƒ«ã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã®ä¸‹ã«è¡¨ç¤ºã•れã€å‡ºåŠ›ã‚„çµ±åˆã‚¿ãƒ¼ãƒŸãƒŠãƒ«ãªã©ã®ãƒ“ューをå«ã¿ã¾ã™ã€‚", "panelActiveTitleForeground": "アクティブ パãƒãƒ«ã®ã‚¿ã‚¤ãƒˆãƒ«ã®è‰²ã€‚パãƒãƒ«ã¯ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼é ˜åŸŸã®ä¸‹ã«è¡¨ç¤ºã•れã€å‡ºåŠ›ã‚„çµ±åˆã‚¿ãƒ¼ãƒŸãƒŠãƒ«ãªã©ã®ãƒ“ューをå«ã¿ã¾ã™ã€‚", @@ -24,15 +24,21 @@ "statusBarNoFolderBackground": "フォルダーãŒé–‹ã„ã¦ã„ãªã„ã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™ã€‚", "statusBarItemActiveBackground": "クリック時ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®é …ç›®ã®èƒŒæ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™ã€‚", "statusBarItemHoverBackground": "ホãƒãƒ¼ã—ãŸã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®é …ç›®ã®èƒŒæ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™ã€‚", + "statusBarProminentItemBackground": "ステータス ãƒãƒ¼ã®é‡è¦ãªé …ç›®ã®èƒŒæ™¯è‰²ã€‚é‡è¦ãªé …ç›®ã¯ã€é‡è¦æ€§ã‚’示ã™ãŸã‚ã«ä»–ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãƒãƒ¼ã®é …ç›®ã‹ã‚‰éš›ç«‹ã£ã¦ã„ã¾ã™ã€‚ ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™ã€‚", + "statusBarProminentItemHoverBackground": "ホãƒãƒ¼ã—ãŸã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®é‡è¦ãªé …ç›®ã®èƒŒæ™¯è‰²ã€‚é‡è¦ãªé …ç›®ã¯ã€é‡è¦æ€§ã‚’示ã™ãŸã‚ã«ä»–ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãƒãƒ¼ã®é …ç›®ã‹ã‚‰éš›ç«‹ã£ã¦ã„ã¾ã™ã€‚ ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™ã€‚", "activityBarBackground": "アクティビティ ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®ãƒ“ューを切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", "activityBarForeground": "アクティビティ ãƒãƒ¼ã®å‰æ™¯è‰² (例: アイコンã®è‰²)。アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®ãƒ“ューを切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", - "activityBarDragAndDropBackground": "アクティビティ ãƒãƒ¼ã®é …ç›®ã®ãƒ‰ãƒ©ãƒƒã‚° アンド ドロップ フィードãƒãƒƒã‚¯ã®è‰²ã€‚アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®è¡¨ç¤ºã‚’切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", + "activityBarDragAndDropBackground": "アクティビティ ãƒãƒ¼ã®é …ç›®ã®ãƒ‰ãƒ©ãƒƒã‚° アンド ドロップ フィードãƒãƒƒã‚¯ã®è‰²ã€‚アクティビティ ãƒãƒ¼ãŒæœ€å¾Œã¾ã§è¼ããŸã‚ã«ã€è‰²ã¯é€éŽã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®è¡¨ç¤ºã‚’切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", "activityBarBadgeBackground": "アクティビティ通知ãƒãƒƒã‚¸ã®èƒŒæ™¯è‰²ã€‚アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®è¡¨ç¤ºã‚’切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", "activityBarBadgeForeground": "アクティビティ通知ãƒãƒƒã‚¸ã®å‰æ™¯è‰²ã€‚アクティビティ ãƒãƒ¼ã¯å·¦ç«¯ã¾ãŸã¯å³ç«¯ã«è¡¨ç¤ºã•れã€ã‚µã‚¤ãƒ‰ ãƒãƒ¼ã®è¡¨ç¤ºã‚’切り替ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", "sideBarBackground": "サイド ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚サイド ãƒãƒ¼ã¯ã€ã‚¨ã‚¯ã‚¹ãƒ—ローラーや検索ãªã©ã®ãƒ“ューãŒå…¥ã‚‹ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", + "sideBarForeground": "サイド ãƒãƒ¼ã®å‰æ™¯è‰²ã€‚サイド ãƒãƒ¼ã¯ã€ã‚¨ã‚¯ã‚¹ãƒ—ローラーや検索ãªã©ã®ãƒ“ューãŒå…¥ã‚‹ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", "sideBarTitleForeground": "サイド ãƒãƒ¼ã®ã‚¿ã‚¤ãƒˆãƒ«ã®å‰æ™¯è‰²ã€‚サイド ãƒãƒ¼ã¯ã€ã‚¨ã‚¯ã‚¹ãƒ—ローラーや検索ãªã©ã®ãƒ“ューãŒå…¥ã‚‹ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", + "sideBarSectionHeaderBackground": "サイド ãƒãƒ¼ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ ヘッダーã®èƒŒæ™¯è‰²ã€‚サイド ãƒãƒ¼ã¯ã€ã‚¨ã‚¯ã‚¹ãƒ—ローラーや検索ãªã©ã®ãƒ“ューãŒå…¥ã‚‹ã‚³ãƒ³ãƒ†ãƒŠãƒ¼ã§ã™ã€‚", "titleBarActiveForeground": "ウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªå ´åˆã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®å‰æ™¯ã€‚ç¾åœ¨ã€ã“ã®è‰²ã¯ macOS ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã‚‹ã®ã§ã”注æ„ãã ã•ã„。", "titleBarInactiveForeground": "ウィンドウãŒéžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªå ´åˆã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®å‰æ™¯ã€‚ç¾åœ¨ã€ã“ã®è‰²ã¯ macOS ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã‚‹ã®ã§ã”注æ„ãã ã•ã„。", "titleBarActiveBackground": "ウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªå ´åˆã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®èƒŒæ™¯ã€‚ç¾åœ¨ã€ã“ã®è‰²ã¯ macOS ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã‚‹ã®ã§ã”注æ„ãã ã•ã„。", - "titleBarInactiveBackground": "ウィンドウãŒéžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªå ´åˆã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®èƒŒæ™¯ã€‚ç¾åœ¨ã€ã“ã®è‰²ã¯ macOS ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã‚‹ã®ã§ã”注æ„ãã ã•ã„。" + "titleBarInactiveBackground": "ウィンドウãŒéžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ãªå ´åˆã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®èƒŒæ™¯ã€‚ç¾åœ¨ã€ã“ã®è‰²ã¯ macOS ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã‚‹ã®ã§ã”注æ„ãã ã•ã„。", + "notificationsForeground": "通知ã®å‰æ™¯è‰²ã€‚通知ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸Šéƒ¨ã‹ã‚‰ã‚¹ãƒ©ã‚¤ãƒ‰è¡¨ç¤ºã—ã¾ã™ã€‚", + "notificationsBackground": "通知ã®èƒŒæ™¯è‰²ã€‚通知ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸Šéƒ¨ã‹ã‚‰ã‚¹ãƒ©ã‚¤ãƒ‰è¡¨ç¤ºã—ã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json index 5912f182d82..d813d5f6c23 100644 --- a/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "表示", "help": "ヘルプ", "file": "ファイル", + "developer": "開発者", "showEditorTabs": "é–‹ã„ã¦ã„るエディターをタブã«è¡¨ç¤ºã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", "editorTabCloseButton": "エディター タブã®é–‰ã˜ã‚‹ãƒœã‚¿ãƒ³ã®ä½ç½®ã‚’制御ã™ã‚‹ã‹ã€[off] ã«è¨­å®šã—ãŸå ´åˆã«ç„¡åйã«ã—ã¾ã™ã€‚", "showIcons": "é–‹ã„ã¦ã„るエディターをアイコンã§è¡¨ç¤ºã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚ã“れã«ã¯ã€ã‚¢ã‚¤ã‚³ãƒ³ã®ãƒ†ãƒ¼ãƒžã‚’有効ã«ã™ã‚‹å¿…è¦ã‚‚ã‚りã¾ã™ã€‚", @@ -41,12 +42,13 @@ "window.newWindowDimensions.inherit": "æ–°ã—ã„ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’ã€æœ€å¾Œã«ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã ã£ãŸã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¨åŒã˜ã‚µã‚¤ã‚ºã§é–‹ãã¾ã™ã€‚", "window.newWindowDimensions.maximized": "æ–°ã—ã„ウィンドウを最大化ã—ãŸçŠ¶æ…‹ã§é–‹ãã¾ã™ã€‚", "window.newWindowDimensions.fullscreen": "æ–°ã—ã„ウィンドウを全画é¢è¡¨ç¤ºãƒ¢ãƒ¼ãƒ‰ã§é–‹ãã¾ã™ã€‚", - "newWindowDimensions": "æ–°ã—ã„ウィンドウを開ãã¨ãã®ã‚µã‚¤ã‚ºã‚’制御ã—ã¾ã™ã€‚既定ã§ã¯ã€æ–°ã—ã„ウィンドウã¯ç”»é¢ã®ä¸­å¤®ã«å°ã•ã„サイズã§é–‹ãã¾ã™ã€‚'inherit' ã«è¨­å®šã™ã‚‹ã¨ã€æœ€å¾Œã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ– ウィンドウã¨åŒã˜ã‚µã‚¤ã‚ºã§é–‹ãã¾ã™ã€‚'maximized' ã«è¨­å®šã™ã‚‹ã¨ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¯æœ€å¤§ã‚µã‚¤ã‚ºã§é–‹ãã€'fullscreen' ã«è¨­å®šã™ã‚‹ã¨å…¨ç”»é¢ã«ãªã‚Šã¾ã™ã€‚", + "newWindowDimensions": "既㫠1 ã¤ä»¥ä¸Šã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’é–‹ã„ã¦ã„ã‚‹ã¨ãã€æ–°ã—ãé–‹ãウィンドウã®ã‚µã‚¤ã‚ºã‚’制御ã—ã¾ã™ã€‚既定ã§ã¯ã€æ–°ã—ã„ウィンドウを画é¢ä¸­å¤®ã«å°ã•ã„サイズã§é–‹ãã¾ã™ã€‚'inherit' ã«è¨­å®šã™ã‚‹ã¨ã€æœ€å¾Œã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ– ウィンドウã¨åŒã˜ã‚µã‚¤ã‚ºã§é–‹ãã¾ã™ã€‚'maximized' ã«è¨­å®šã™ã‚‹ã¨ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¯æœ€å¤§ã‚µã‚¤ã‚ºã§é–‹ãã€'fullscreen' ã«è¨­å®šã™ã‚‹ã¨å…¨ç”»é¢ã«ãªã‚Šã¾ã™ã€‚ã“ã®è¨­å®šã¯ã€æœ€åˆã«é–‹ã„ãŸã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«é©ç”¨ã•れãªã„ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。最åˆã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¯å¸¸ã«ã€å‰å›žé–‰ã˜ãŸã‚µã‚¤ã‚ºã¨ä½ç½®ã§å¾©å…ƒã—ã¾ã™ã€‚", "window.menuBarVisibility.default": "メニューã¯å…¨ç”»é¢è¡¨ç¤ºãƒ¢ãƒ¼ãƒ‰ã®å ´åˆã«ã®ã¿éžè¡¨ç¤ºã§ã™ã€‚", "window.menuBarVisibility.visible": "全画é¢è¡¨ç¤ºãƒ¢ãƒ¼ãƒ‰ã®å ´åˆã‚‚å«ã‚ã¦ã€å¸¸ã«ãƒ¡ãƒ‹ãƒ¥ãƒ¼ãŒè¡¨ç¤ºã•れã¾ã™ã€‚", "window.menuBarVisibility.toggle": "メニューã¯éžè¡¨ç¤ºã§ã™ãŒã€Alt キーを押ã™ã¨è¡¨ç¤ºã§ãã¾ã™ã€‚", "window.menuBarVisibility.hidden": "メニューã¯å¸¸ã«éžè¡¨ç¤ºã§ã™ã€‚", "menuBarVisibility": "メニュー ãƒãƒ¼ã®è¡¨ç¤º/éžè¡¨ç¤ºã‚’制御ã—ã¾ã™ã€‚'切り替ãˆ' 設定㯠Alt キーを 1 回押ã™ã¨ãƒ¡ãƒ‹ãƒ¥ãƒ¼ ãƒãƒ¼ã®è¡¨ç¤º/éžè¡¨ç¤ºãŒåˆ‡ã‚Šæ›¿ã‚ã‚‹ã“ã¨ã‚’æ„味ã—ã¾ã™ã€‚既定ã§ã¯ã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒå…¨ç”»é¢è¡¨ç¤ºã®å ´åˆã‚’除ãã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ ãƒãƒ¼ã¯è¡¨ç¤ºã•れã¾ã™ã€‚", + "enableMenuBarMnemonics": "有効ã«ã™ã‚‹ã¨ã€Alt キー ショートカットを使用ã—ã¦ãƒ¡ã‚¤ãƒ³ メニューを開ãã“ã¨ãŒã§ãã¾ã™ã€‚ニーモニックを無効ã«ã™ã‚‹ã¨ã€ã“れら㮠Alt キー ショートカットをエディター コマンドã®ä»£ã‚りã«ãƒã‚¤ãƒ³ãƒ‰ã§ãã¾ã™ã€‚", "autoDetectHighContrast": "有効ã«ã™ã‚‹ã¨ã€Windows ã§ãƒã‚¤ コントラスト テーマãŒä½¿ç”¨ã•れã¦ã„ã‚‹å ´åˆã«ã¯ãƒã‚¤ コントラスト テーマã«è‡ªå‹•çš„ã«å¤‰æ›´ã•れã€Windows ã®ãƒã‚¤ コントラスト テーマã‹ã‚‰åˆ‡ã‚Šæ›¿ãˆã‚‰ã‚Œã¦ã„ã‚‹å ´åˆã«ã¯ãƒ€ãƒ¼ã‚¯ テーマã«è‡ªå‹•çš„ã«å¤‰æ›´ã•れã¾ã™ã€‚", "titleBarStyle": "ウィンドウã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ã®å¤–観を調整ã—ã¾ã™ã€‚変更をé©ç”¨ã™ã‚‹ã«ã¯ã€å®Œå…¨ã«å†èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚", "window.nativeTabs": "macOS Sierra ウィンドウ タブを有効ã«ã—ã¾ã™ã€‚ã“ã®å¤‰æ›´ã‚’é©ç”¨ã™ã‚‹ã«ã¯å®Œå…¨ãªå†èµ·å‹•ãŒå¿…è¦ã§ã‚りã€ãƒã‚¤ãƒ†ã‚£ãƒ– タブã§ã‚«ã‚¹ã‚¿ãƒ ã®ã‚¿ã‚¤ãƒˆãƒ« ãƒãƒ¼ ã‚¹ã‚¿ã‚¤ãƒ«ãŒæ§‹æˆã•れã¦ã„ãŸå ´åˆã¯ãれãŒç„¡åйã«ãªã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。", diff --git a/i18n/jpn/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/shell.i18n.json index 298d1518ca4..7edc0e838e8 100644 --- a/i18n/jpn/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/jpn/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "コードを 'root ' ã¨ã—ã¦å®Ÿè¡Œã—ãªã„ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚", - "prof.message": "ãƒ—ãƒ­ãƒ•ã‚¡ã‚¤ãƒ«ãŒæ­£å¸¸ã«ä½œæˆã•れã¾ã—ãŸã€‚", - "prof.detail": "案件を作æˆã—ã€æ‰‹å‹•ã§æ¬¡ã®ãƒ•ァイルを添付ã—ã¦ãã ã•ã„:\n{0}", - "prof.restartAndFileIssue": "案件を作æˆã—å†èµ·å‹•ã™ã‚‹", - "prof.restart": "å†èµ·å‹•" + "runningAsRoot": "コードを 'root ' ã¨ã—ã¦å®Ÿè¡Œã—ãªã„ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/electron-browser/window.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/window.i18n.json index acff2870cf9..472d053bdf6 100644 --- a/i18n/jpn/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/jpn/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "貼り付ã‘", "selectAll": "ã™ã¹ã¦é¸æŠž", "confirmOpen": "{0} 個ã®ãƒ•ォルダーを開ãã¾ã™ã‹?", - "confirmOpenButton": "&&é–‹ã", - "developer": "Developer", - "file": "ファイル" + "confirmOpenButton": "&&é–‹ã" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..d24a34e3065 100644 --- a/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "開発者: キー マッピングを検査ã™ã‚‹" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 2be30d1f34b..7e7505788b6 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "{0} ã‚’é–‹ã", "launchJsonNeedsConfigurtion": "'launch.json' ã‚’æ§‹æˆã¾ãŸã¯ä¿®æ­£ã—ã¦ãã ã•ã„", + "noFolderDebugConfig": "高度ãªãƒ‡ãƒãƒƒã‚°æ§‹æˆã‚’行ã†ã«ã¯ã€æœ€åˆã«ãƒ•ォルダーを開ã„ã¦ãã ã•ã„。", "startDebug": "デãƒãƒƒã‚°ã®é–‹å§‹", "startWithoutDebugging": "デãƒãƒƒã‚°ãªã—ã§é–‹å§‹", "selectAndStartDebugging": "é¸æŠžã—ã¦ãƒ‡ãƒãƒƒã‚°ã‚’é–‹å§‹", @@ -34,6 +35,7 @@ "editConditionalBreakpoint": "ブレークãƒã‚¤ãƒ³ãƒˆã®ç·¨é›†...", "setValue": "値ã®è¨­å®š", "addWatchExpression": "å¼ã®è¿½åŠ ", + "editWatchExpression": "å¼ã®ç·¨é›†", "addToWatchExpressions": "ウォッãƒã«è¿½åŠ ", "removeWatchExpression": "å¼ã®å‰Šé™¤", "removeAllWatchExpressions": "ã™ã¹ã¦ã®å¼ã‚’削除ã™ã‚‹", diff --git a/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..8876044c17e 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "デãƒãƒƒã‚° ツール ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..88f436125ff --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "クリックã—ã¦å¾“ㆠ(Cmd を押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã™ã‚‹ã¨æ¨ªã«é–‹ãã¾ã™)", + "fileLink": "クリックã—ã¦å¾“ㆠ(Ctrl を押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã™ã‚‹ã¨æ¨ªã«é–‹ãã¾ã™)" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..5f4689ab404 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "内部デãƒãƒƒã‚° コンソールã®å‹•作を制御ã—ã¾ã™ã€‚" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..3601388ef3a --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noFolderDebugConfig": "高度ãªãƒ‡ãƒãƒƒã‚°æ§‹æˆã‚’行ã†ã«ã¯ã€æœ€åˆã«ãƒ•ォルダーを開ã„ã¦ãã ã•ã„。" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json index aabd2eeb058..aef11784707 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -32,7 +32,7 @@ "app.launch.json.compounds": "複åˆã®ä¸€è¦§ã€‚å„複åˆã¯ã€åŒæ™‚ã«èµ·å‹•ã•ã‚Œã‚‹è¤‡æ•°ã®æ§‹æˆã‚’å‚ç…§ã—ã¾ã™ã€‚", "app.launch.json.compound.name": "複åˆã®åå‰ã€‚èµ·å‹•æ§‹æˆã®ãƒ‰ãƒ­ãƒƒãƒ—ダウン メニューã«è¡¨ç¤ºã•れã¾ã™ã€‚", "app.launch.json.compounds.configurations": "ã“ã®è¤‡åˆã®ä¸€éƒ¨ã¨ã—ã¦é–‹å§‹ã•れる構æˆã®åå‰ã€‚", - "debugNoType": "デãƒãƒƒã‚° アダプター 'type' ã¯çœç•¥ä¸å¯ã§ã€åž‹ 'string' ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", + "debugNoType": "デãƒãƒƒã‚° アダプター 'type' ã¯çœç•¥ä¸å¯ã§ã€'string' åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。", "DebugConfig.failed": "'launch.json' ファイルを '.vscode' フォルダー ({0}) 内ã«ä½œæˆã§ãã¾ã›ã‚“。", "selectDebug": "環境ã®é¸æŠž" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index e57fd60ee0d..8943a8809bd 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "値ã®ã‚³ãƒ”ー", "copy": "コピー", + "copyAll": "ã™ã¹ã¦ã‚³ãƒ”ー", "copyStackTrace": "呼ã³å‡ºã—履歴ã®ã‚³ãƒ”ー" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 0aaca371445..38c84790727 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "最åˆã®è©•価ã‹ã‚‰ã‚ªãƒ–ジェクトã®çŠ¶æ…‹ãŒã‚­ãƒ£ãƒ—ãƒãƒ£ã•れã¾ã™", - "fileLinkMac": "クリックã—ã¦å¾“ㆠ(Cmd を押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã™ã‚‹ã¨æ¨ªã«é–‹ãã¾ã™)", - "fileLink": "クリックã—ã¦å¾“ㆠ(Ctrl を押ã—ãªãŒã‚‰ã‚¯ãƒªãƒƒã‚¯ã™ã‚‹ã¨æ¨ªã«é–‹ãã¾ã™)", "replVariableAriaLabel": "変数 {0} ã«å€¤ {1} ãŒã‚りã¾ã™ã€Read Eval Print Loopã€ãƒ‡ãƒãƒƒã‚°", "replExpressionAriaLabel": "å¼ {0} ã«å€¤ {1} ãŒã‚りã¾ã™ã€Read Eval Print Loopã€ãƒ‡ãƒãƒƒã‚°", "replValueOutputAriaLabel": "{0}ã€Read Eval Print Loopã€ãƒ‡ãƒãƒƒã‚°", diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index aa4a05fcb72..ccdb00421dc 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "プログラムをデãƒãƒƒã‚°ã—ã¦ã„ã‚‹ã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™" + "statusBarDebuggingBackground": "プログラムをデãƒãƒƒã‚°ã—ã¦ã„ã‚‹ã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®èƒŒæ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™", + "statusBarDebuggingForeground": "プログラムをデãƒãƒƒã‚°ã—ã¦ã„ã‚‹ã¨ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ ãƒãƒ¼ã®å‰æ™¯è‰²ã€‚ステータス ãƒãƒ¼ã¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä¸‹éƒ¨ã«è¡¨ç¤ºã•れã¾ã™" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 75ed35238e1..d63fe387f50 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,12 +7,12 @@ "debugAdapterBinNotFound": "デãƒãƒƒã‚° アダプターã®å®Ÿè¡Œå¯èƒ½ãƒ•ァイル '{0}' ãŒã‚りã¾ã›ã‚“。", "debugAdapterCannotDetermineExecutable": "デãƒãƒƒã‚° アダプター '{0}' ã®å®Ÿè¡Œå¯èƒ½ãƒ•ァイルを判別ã§ãã¾ã›ã‚“。", "debugType": "æ§‹æˆã®ç¨®é¡žã€‚", + "debugTypeNotRecognised": "デãƒãƒƒã‚°ã®ç¨®é¡žã¯èªè­˜ã•れã¾ã›ã‚“ã§ã—ãŸã€‚対応ã™ã‚‹ãƒ‡ãƒãƒƒã‚°ã®æ‹¡å¼µæ©Ÿèƒ½ãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ãŠã‚Šã€æœ‰åйã«ãªã£ã¦ã„ã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。", "node2NotSupported": "\"node2\" ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。代ã‚り㫠\"node\" を使用ã—ã€\"protocol\" 属性を \"inspector\" ã«è¨­å®šã—ã¦ãã ã•ã„。", "debugName": "æ§‹æˆã®åå‰ã€‚èµ·å‹•æ§‹æˆã®ãƒ‰ãƒ­ãƒƒãƒ—ダウン メニューã«è¡¨ç¤ºã•れã¾ã™ã€‚", "debugRequest": "æ§‹æˆã®è¦æ±‚ã®ç¨®é¡žã€‚\"launch\" ã¾ãŸã¯ \"attach\" ã§ã™ã€‚", "debugServer": "デãƒãƒƒã‚°æ‹¡å¼µæ©Ÿèƒ½ã®é–‹ç™ºã®ã¿ã€‚ãƒãƒ¼ãƒˆãŒæŒ‡å®šã® VS Code ã®å ´åˆã€ã‚µãƒ¼ãƒãƒ¼ モードã§å®Ÿè¡Œä¸­ã®ãƒ‡ãƒãƒƒã‚° アダプターã¸ã®æŽ¥ç¶šãŒè©¦è¡Œã•れã¾ã™ã€‚", "debugPrelaunchTask": "デãƒãƒƒã‚° セッションã®é–‹å§‹å‰ã«å®Ÿè¡Œã™ã‚‹ã‚¿ã‚¹ã‚¯ã€‚", - "internalConsoleOptions": "内部デãƒãƒƒã‚° コンソールã®å‹•作を制御ã—ã¾ã™ã€‚", "debugWindowsConfiguration": "Windows 固有ã®èµ·å‹•æ§‹æˆã®å±žæ€§ã€‚", "debugOSXConfiguration": "OS X 固有ã®èµ·å‹•æ§‹æˆã®å±žæ€§ã€‚", "debugLinuxConfiguration": "Linux 固有ã®èµ·å‹•æ§‹æˆã®å±žæ€§ã€‚", diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..13eb719a34f --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: ãƒãƒ©ãƒ³ã‚¹ (内å´)", + "balanceOutward": "Emmet: ãƒãƒ©ãƒ³ã‚¹ (外å´)" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..cf9dccd3bbd --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: å‰ã®ç·¨é›†ç‚¹", + "nextEditPoint": "Emmet: 次ã®ç·¨é›†ç‚¹" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..f6a68a59f42 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: æ•°å¼ã®è©•価" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..23680f558e5 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: 略語ã®å±•é–‹" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..4c2a1db638c --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: 0.1 ãšã¤å¢—加", + "incrementNumberByOne": "Emmet: 1 ãšã¤å¢—加", + "incrementNumberByTen": "Emmet: 10 ãšã¤å¢—加", + "decrementNumberByOneTenth": "Emmet: 0.1 ãšã¤æ¸›å°‘", + "decrementNumberByOne": "Emmet: 1 減少", + "decrementNumberByTen": "Emmet: 10 ãšã¤æ¸›å°‘" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..adcbee4abaf --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: 一致ã™ã‚‹ãƒšã‚¢ã«ç§»å‹•" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..c834e4b5aaa --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: 行ã®ãƒžãƒ¼ã‚¸" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..ab8fd5a62ba --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: CSS 値ã®å転" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..c3bc9dd651f --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: ã‚¿ã‚°ã®å‰Šé™¤" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..350aee6aff9 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: å‰ã®é …ç›®ã®é¸æŠž", + "selectNextItem": "Emmet: 次ã®é …ç›®ã®é¸æŠž" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..4b1dbd8a454 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: ã‚¿ã‚°ã®åˆ†å‰²/çµåˆ" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..942a483bfa3 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: コメントã®è¡¨ç¤º/éžè¡¨ç¤º" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..ba3773dfcdb --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: イメージ ã‚µã‚¤ã‚ºã®æ›´æ–°" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..873d819f37a --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: ã‚¿ã‚°ã®æ›´æ–°", + "enterTag": "ã‚¿ã‚°ã®å…¥åŠ›", + "tag": "ã‚¿ã‚°" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..3f72714a048 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: çœç•¥å½¢ã§ãƒ©ãƒƒãƒ—", + "enterAbbreviation": "çœç•¥å½¢ã®å…¥åŠ›", + "abbreviation": "çœç•¥å½¢" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..f8b16e8c78d --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "ã“れをオンã«ã™ã‚‹ã¨ã€TAB キーを押ã—ãŸã¨ãã« emmet çœç•¥è¨˜æ³•ãŒå±•é–‹ã•れã¾ã™.", + "emmetPreferences": "Emmet ã®ä¸€éƒ¨ã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‚„リゾルãƒãƒ¼ã®å‹•作ã®å¤‰æ›´ã«ä½¿ç”¨ã•れる基本設定。", + "emmetSyntaxProfiles": "指定ã—ãŸæ§‹æ–‡ã«å¯¾ã—ã¦ãƒ—ロファイルを定義ã™ã‚‹ã‹ã€ç‰¹å®šã®è¦å‰‡ãŒã‚る独自ã®ãƒ—ロファイルをã”使用ãã ã•ã„。", + "emmetExclude": "emmet çœç•¥è¨˜æ³•を展開ã™ã¹ãã§ãªã„言語ã®é…列。", + "emmetExtensionsPath": "Emmet ã®ãƒ—ロファイルã€ã‚¹ãƒ‹ãƒšãƒƒãƒˆã€åŸºæœ¬è¨­å®šã‚’å«ã‚€ãƒ•ォルダーã¸ã®ãƒ‘ス" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 9192a65143b..497be6143f7 100644 --- a/i18n/jpn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "カスタム ビューをæä¾›ã—ã¾ã™", + "vscode.extension.contributes.view.id": "vscode.workspace.createTreeView を介ã—ã¦ç”Ÿæˆã—ãŸã€ãƒ“ューをèªè­˜ã™ã‚‹ãŸã‚ã®ä¸€æ„ã® ID", + "vscode.extension.contributes.view.label": "ビューã®è¡¨ç¤ºã«ä½¿ç”¨ã™ã‚‹ã€ä»–人ãŒè§£é‡ˆã§ãる文字列", + "vscode.extension.contributes.view.icon": "ビュー アイコンã¸ã®ãƒ‘ス", + "vscode.extension.contributes.views": "複数ã®ã‚«ã‚¹ã‚¿ãƒ  ビューをæä¾›ã—ã¾ã™", "showViewlet": "{0} を表示", "view": "表示" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 644c72bc995..868785478db 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,8 +22,10 @@ "disableGloballyAction": "常ã«è¡Œã†", "disableAction": "無効ã«ã™ã‚‹", "checkForUpdates": "æ›´æ–°ã®ç¢ºèª", + "enableAutoUpdate": "拡張機能ã®è‡ªå‹•更新を有効ã«ã™ã‚‹", + "disableAutoUpdate": "拡張機能ã®è‡ªå‹•更新を無効ã«ã™ã‚‹", "updateAll": "ã™ã¹ã¦ã®æ‹¡å¼µæ©Ÿèƒ½ã‚’æ›´æ–°ã—ã¾ã™", - "reloadAction": "å†èª­ã¿è¾¼ã‚€", + "reloadAction": "å†èª­ã¿è¾¼ã¿", "postUpdateTooltip": "å†åº¦èª­ã¿è¾¼ã‚“ã§æ›´æ–°ã™ã‚‹", "postUpdateMessage": "ã“ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’å†åº¦èª­ã¿è¾¼ã‚“ã§ã€æ›´æ–°æ¸ˆã¿ã®æ‹¡å¼µæ©Ÿèƒ½ '{0}' をアクティブ化ã—ã¾ã™ã‹?", "postEnableTooltip": "å†åº¦èª­ã¿è¾¼ã‚“ã§ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã«ã™ã‚‹", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "ワークスペースã®ãŠã™ã™ã‚ã®æ‹¡å¼µæ©Ÿèƒ½ã‚’表示", "showRecommendedKeymapExtensions": "推奨ã®ã‚­ãƒ¼ãƒžãƒƒãƒ—を表示ã™ã‚‹", "showRecommendedKeymapExtensionsShort": "キーマップ", + "showLanguageExtensions": "è¨€èªžã®æ‹¡å¼µæ©Ÿèƒ½ã‚’表示", + "showLanguageExtensionsShort": "è¨€èªžã®æ‹¡å¼µæ©Ÿèƒ½", "configureWorkspaceRecommendedExtensions": "ãŠå‹§ã‚ã®æ‹¡å¼µæ©Ÿèƒ½ã®æ§‹æˆ (ワークスペース)", "ConfigureWorkspaceRecommendations.noWorkspace": "推奨事項ã¯ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ フォルダーã§ã®ã¿åˆ©ç”¨å¯èƒ½ã§ã™ã€‚", "OpenExtensionsFile.failed": "'.vscode' ファルダー ({0}) 内㫠'extensions.json' ファイルを作æˆã§ãã¾ã›ã‚“。", diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 0e425d55357..f7a0d5005fc 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -4,9 +4,13 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "reallyRecommended2": "ã“ã®ãƒ•ァイルã®ç¨®é¡žã«ã¯ '{0}' æ‹¡å¼µå­ãŒæŽ¨å¥¨ã•れã¦ã„ã¾ã™ã€‚", + "reallyRecommended2": "ã“ã®ãƒ•ァイルã®ç¨®é¡žã«ã¯æ‹¡å¼µæ©Ÿèƒ½ '{0}' ãŒæŽ¨å¥¨ã•れã¾ã™ã€‚", "showRecommendations": "推奨事項を表示", "neverShowAgain": "今後ã¯è¡¨ç¤ºã—ãªã„", "close": "é–‰ã˜ã‚‹", - "workspaceRecommended": "ã“ã®ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã«ã¯æ‹¡å¼µæ©Ÿèƒ½ã®æŽ¨å¥¨äº‹é …ãŒã‚りã¾ã™ã€‚" + "workspaceRecommended": "ã“ã®ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã«ã¯æ‹¡å¼µæ©Ÿèƒ½ã®æŽ¨å¥¨äº‹é …ãŒã‚りã¾ã™ã€‚", + "ignoreExtensionRecommendations": "ã™ã¹ã¦ã®æ‹¡å¼µæ©Ÿèƒ½ã®æŽ¨å¥¨äº‹é …を無視ã—ã¾ã™ã‹?", + "ignoreAll": "ã¯ã„ã€ã™ã¹ã¦ç„¡è¦–ã—ã¾ã™", + "no": "ã„ã„ãˆ", + "cancel": "キャンセル" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index 1beba30be54..e9f31ea4af6 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "拡張機能", "view": "表示", "extensionsConfigurationTitle": "拡張機能", - "extensionsAutoUpdate": "æ‹¡å¼µæ©Ÿèƒ½ã‚’è‡ªå‹•çš„ã«æ›´æ–°ã—ã¾ã™" + "extensionsAutoUpdate": "æ‹¡å¼µæ©Ÿèƒ½ã‚’è‡ªå‹•çš„ã«æ›´æ–°ã—ã¾ã™", + "extensionsIgnoreRecommendations": "æ‹¡å¼µæ©Ÿèƒ½ã®æŽ¨å¥¨äº‹é …ã‚’ç„¡è¦–ã™ã‚‹" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..6fd33bfb0e0 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "ã¯ã„", + "no": "ã„ã„ãˆ", + "uninstall": "アンインストール", + "later": "後続" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index c77cc35a0f3..a23d7187ba2 100644 --- a/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "言語ã«å¯¾ã™ã‚‹ãƒ•ァイルã®é–¢é€£ä»˜ã‘ (例 \"*.extension\": \"html\") ã‚’æ§‹æˆã—ã¾ã™ã€‚ã“れらã®é–¢é€£ä»˜ã‘ã¯ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã‚‹è¨€èªžã®æ—¢å®šã®é–¢é€£ä»˜ã‘より優先ã•れã¾ã™ã€‚", "encoding": "ファイルã®èª­ã¿å–り/書ãè¾¼ã¿ã§ä½¿ç”¨ã™ã‚‹æ—¢å®šã®æ–‡å­—セット エンコーディング。", "autoGuessEncoding": "有効ãªå ´åˆã€ãƒ•ァイルを開ãã¨ãã«æ–‡å­—セット エンコードを推測ã—ã¾ã™", - "eol": "æ—¢å®šã®æ”¹è¡Œæ–‡å­—。", + "eol": "æ—¢å®šã®æ”¹è¡Œæ–‡å­—。LF ã®å ´åˆã«ã¯ \\n ã‚’ CRLF ã®å ´åˆã«ã¯ \\r\\n を使用ã—ã¦ãã ã•ã„。", "trimTrailingWhitespace": "有効ã«ã™ã‚‹ã¨ã€ãƒ•ァイルã®ä¿å­˜æ™‚ã«æœ«å°¾ã®ç©ºç™½ã‚’トリミングã—ã¾ã™ã€‚", "insertFinalNewline": "有効ã«ã™ã‚‹ã¨ã€ãƒ•ァイルã®ä¿å­˜æ™‚ã«æœ€æ–°ã®è¡Œã‚’æœ«å°¾ã«æŒ¿å…¥ã—ã¾ã™ã€‚", "files.autoSave.off": "ダーティ ファイルを自動的ã«ä¿å­˜ã™ã‚‹ã“ã¨ã¯ã—ã¾ã›ã‚“。", diff --git a/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index a71fcb6fc94..e14e57a90eb 100644 --- a/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "スタートアップã®é…å»¶ãŒæ¤œå‡ºã•れã¾ã—ãŸ", - "slow.detail": "スタートアップãŒé…ã‹ã£ãŸã¨ã®ã“ã¨ã€ç”³ã—訳ã”ã–ã„ã¾ã›ã‚“。プロファイルを有効ã«ã—ã¦ã€'{0}' ã‚’å†èµ·å‹•ã—ã€ãƒ—ロファイルを共有ã—ã¦ãã ã•ã„ã€‚ã‚¹ã‚¿ãƒ¼ãƒˆã‚¢ãƒƒãƒ—ã®æ”¹å–„ã®ãŸã‚ã«å‚考ã«ã•ã›ã¦ã„ãŸã ãã¾ã™ã€‚" + "slow.detail": "スタートアップãŒé…ã‹ã£ãŸã¨ã®ã“ã¨ã€ç”³ã—訳ã”ã–ã„ã¾ã›ã‚“。プロファイルを有効ã«ã—ã¦ã€'{0}' ã‚’å†èµ·å‹•ã—ã€ãƒ—ロファイルを共有ã—ã¦ãã ã•ã„ã€‚ã‚¹ã‚¿ãƒ¼ãƒˆã‚¢ãƒƒãƒ—ã®æ”¹å–„ã®ãŸã‚ã«å‚考ã«ã•ã›ã¦ã„ãŸã ãã¾ã™ã€‚", + "prof.message": "ãƒ—ãƒ­ãƒ•ã‚¡ã‚¤ãƒ«ãŒæ­£å¸¸ã«ä½œæˆã•れã¾ã—ãŸã€‚", + "prof.detail": "案件を作æˆã—ã€æ‰‹å‹•ã§æ¬¡ã®ãƒ•ァイルを添付ã—ã¦ãã ã•ã„:\\n{0}", + "prof.restartAndFileIssue": "å•題を作æˆã—ã¦å†èµ·å‹•", + "prof.restart": "å†èµ·å‹•", + "prof.thanks": "ã”å”力ã„ãŸã ãã€ã‚りãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚", + "prof.detail.restart": "'{0}' を引ãç¶šã使用ã™ã‚‹ã«ã¯ã€æœ€å¾Œã®å†èµ·å‹•ãŒå¿…è¦ã§ã™ã€‚ 改ã‚ã¦ã‚ãªãŸã®è²¢çŒ®ã«æ„Ÿè¬ã—ã¾ã™ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index e8b7110516d..b2c93cd566f 100644 --- a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "ユーザー設定を開ã", "openGlobalKeybindings": "キーボード ショートカットを開ã", + "openGlobalKeybindingsFile": "キーボード ショートカット ファイルを開ã", "openWorkspaceSettings": "ワークスペース設定を開ã", "configureLanguageBasedSettings": "言語固有ã®è¨­å®šã‚’æ§‹æˆã—ã¾ã™...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 0a35cdb1be9..dba4d278b14 100644 --- a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "設定を書ãè¾¼ã‚ã¾ã›ã‚“。ファイル内ã®ã‚¨ãƒ©ãƒ¼/警告を修正ã—ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦ãŠè©¦ã—ãã ã•ã„。", "editTtile": "編集", "replaceDefaultValue": "設定を置æ›", "copyDefaultValue": "設定ã«ã‚³ãƒ”ー", diff --git a/i18n/jpn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/jpn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 6caf000135d..d6cc11eda2e 100644 --- a/i18n/jpn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "ã™ã¹ã¦ã®ã‚³ãƒžãƒ³ãƒ‰ã®è¡¨ç¤º", + "showCommands.label": "コマンド パレット...", "entryAriaLabelWithKey": "{0}ã€{1}ã€ã‚³ãƒžãƒ³ãƒ‰", "entryAriaLabel": "{0}ã€ã‚³ãƒžãƒ³ãƒ‰", "canNotRun": "コマンド '{0}' ã¯ã“ã“ã‹ã‚‰ã¯å®Ÿè¡Œã§ãã¾ã›ã‚“。", diff --git a/i18n/jpn/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json b/i18n/jpn/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json index 10e002dad4b..51d21107be0 100644 --- a/i18n/jpn/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json @@ -7,7 +7,7 @@ "entryAriaLabel": "{0}ã€ãƒ“ューã®é¸æŠž", "views": "ビュー", "panels": "パãƒãƒ«", - "terminals": "端末", + "terminals": "ターミナル", "terminalTitle": "{0}: {1}", "channels": "出力", "openView": "ビューを開ã", diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index b650b0b0eb3..d45b8437459 100644 --- a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Git を表示", + "installAdditionalSCMProviders": "ãã®ä»–ã® SCM プロãƒã‚¤ãƒ€ãƒ¼ã‚’インストール...", "source control": "ソース管ç†", "toggleSCMViewlet": "SCM を表示", "view": "表示" diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index d53de2c62b0..d93c7d2fb84 100644 --- a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "ãã®ä»–ã® SCM プロãƒã‚¤ãƒ€ãƒ¼ã‚’インストール...", "switch provider": "SCM プロãƒã‚¤ãƒ€ãƒ¼ã®åˆ‡ã‚Šæ›¿ãˆ..." } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/jpn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index e7c97d566fc..ae61bd9d4c9 100644 --- a/i18n/jpn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -7,6 +7,6 @@ "searchMatches": "一致ã™ã‚‹é …目㌠{0} 件見ã¤ã‹ã‚Šã¾ã—ãŸ", "searchMatch": "一致ã™ã‚‹é …目㌠{0} 件見ã¤ã‹ã‚Šã¾ã—ãŸ", "fileMatchAriaLabel": "フォルダー {2} ã®ãƒ•ァイル {1} 内㧠{0} ä»¶ã®ä¸€è‡´ã€æ¤œç´¢çµæžœ", - "replacePreviewResultAria": "ãƒ—ãƒ¬ãƒ“ãƒ¥ãƒ¼çµæžœã®ç½®æ›ã€{0}", - "searchResultAria": "{0}ã€æ¤œç´¢çµæžœ" + "replacePreviewResultAria": "テキスト {3} ã® {2} 列目㮠{0} ã‚’ {1} ã«ç½®æ›ã—ã¾ã™", + "searchResultAria": "テキスト {2} ã® {1} 列目㫠{0} ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 54fb4cd8f93..98112fb1164 100644 --- a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "スニペット ファイルã®ãƒ‘ス。拡張機能フォルダーã®ç›¸å¯¾ãƒ‘スã§ã‚りã€é€šå¸¸ './snippets/' ã§å§‹ã¾ã‚Šã¾ã™ã€‚", "invalid.language": "`contributes.{0}.language` ã§ä¸æ˜Žãªè¨€èªžã§ã™ã€‚æä¾›ã•れãŸå€¤: {1}", "invalid.path.0": "`contributes.{0}.path` ã«æ–‡å­—列ãŒå¿…è¦ã§ã™ã€‚æä¾›ã•れãŸå€¤: {1}", - "invalid.path.1": "拡張機能ã®ãƒ•ォルダー ({2}) ã®ä¸­ã« `contributes.{0}.path` ({1}) ãŒå«ã¾ã‚Œã¦ã„ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ã“れã«ã‚ˆã‚Šæ‹¡å¼µã‚’ç§»æ¤ã§ããªããªã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚" + "invalid.path.1": "拡張機能ã®ãƒ•ォルダー ({2}) ã®ä¸­ã« `contributes.{0}.path` ({1}) ãŒå«ã¾ã‚Œã¦ã„ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ã“れã«ã‚ˆã‚Šæ‹¡å¼µã‚’ç§»æ¤ã§ããªããªã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚", + "badVariableUse": "スニペット \"{0}\" ã¯ã€ã‚¹ãƒ‹ãƒšãƒƒãƒˆå¤‰æ•°ã¨ã‚¹ãƒ‹ãƒšãƒƒãƒˆ プレースホルダーを混乱ã•ã›ã‚‹å¯èƒ½æ€§ãŒéžå¸¸ã«ã‚りã¾ã™ã€‚詳細ã«ã¤ã„ã¦ã¯ https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax ã‚’ã”覧ãã ã•ã„。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index c0432625724..f7db07a2e2d 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks" + "entryAriaLabel": "{0}, tasks", + "workspace": "ワークスペースã‹ã‚‰", + "extension": "拡張機能ã‹ã‚‰" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 52ca786c8e4..1e77cbdffdf 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,8 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "å†é–‹ã™ã‚‹ã‚¿ã‚¹ã‚¯ã®åå‰ã‚’入力ã—ã¾ã™", - "noTasksMatching": "No tasks matching", + "noTasksMatching": "一致ã™ã‚‹ã‚¿ã‚¹ã‚¯ãŒã‚りã¾ã›ã‚“", "noTasksFound": "å†é–‹ã™ã‚‹ã‚¿ã‚¹ã‚¯ã¯ã‚りã¾ã›ã‚“" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 17dcb80868e..5a397f34e03 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,8 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks", "tasksAriaLabel": "実行ã™ã‚‹ã‚¿ã‚¹ã‚¯ã®åå‰ã‚’入力ã—ã¾ã™", - "noTasksMatching": "No tasks matching", + "noTasksMatching": "一致ã™ã‚‹ã‚¿ã‚¹ã‚¯ãŒã‚りã¾ã›ã‚“", "noTasksFound": "タスクãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 4605e28e85a..c7b8031b6e5 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "ConfigurationParser.invalidCWD": "警告: options.cwd ã¯ã€åž‹ string ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。値 {0} を無視ã—ã¾ã™\n", + "ConfigurationParser.invalidCWD": "警告: options.cwd ã¯ã€string åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。値 {0} を無視ã—ã¾ã™", "ConfigurationParser.noShell": "警告: シェル構æˆãŒã‚µãƒãƒ¼ãƒˆã•れるã®ã¯ã€ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã§ã‚¿ã‚¹ã‚¯ã‚’実行ã—ã¦ã„ã‚‹å ´åˆã®ã¿ã§ã™ã€‚", "ConfigurationParser.noargs": "エラー: ã‚³ãƒžãƒ³ãƒ‰å¼•æ•°ã¯æ–‡å­—列ã®é…列ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。指定ã•れãŸå€¤:\n{0}", "ConfigurationParser.noName": "エラー: 宣言スコープ内ã®å•題マッãƒãƒ£ãƒ¼ã«æ¬¡ã®åå‰ãŒãªã‘れã°ãªã‚Šã¾ã›ã‚“:\n{0}\n", diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 66c1ae4f80a..81375f18706 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,11 +9,12 @@ "ConfigureTaskRunnerAction.quickPick.template": "タスク ãƒ©ãƒ³ãƒŠãƒ¼ã‚’é¸æŠž", "ConfigureTaskRunnerAction.autoDetecting": "{0} ã®ã‚¿ã‚¹ã‚¯ã‚’自動検出", "ConfigureTaskRunnerAction.autoDetect": "タスク システムã®è‡ªå‹•検出ãŒå¤±æ•—ã—ã¾ã—ãŸã€‚既定ã®ãƒ†ãƒ³ãƒ—レートを使用ã—ã¦ã„ã¾ã™ã€‚詳細ã«ã¤ã„ã¦ã¯ã€ã‚¿ã‚¹ã‚¯å‡ºåŠ›ã‚’å‚ç…§ã—ã¦ãã ã•ã„", + "ConfigureTaskRunnerAction.autoDetectError": "タスク システムã®è‡ªå‹•検出ã§ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚詳細ã«ã¤ã„ã¦ã¯ã€ã‚¿ã‚¹ã‚¯å‡ºåŠ›ã‚’å‚ç…§ã—ã¦ãã ã•ã„。", "ConfigureTaskRunnerAction.failed": "'.vscode' フォルダー内㫠'tasks.json' ファイルを作æˆã§ãã¾ã›ã‚“。詳細ã«ã¤ã„ã¦ã¯ã€ã‚¿ã‚¹ã‚¯å‡ºåŠ›ã‚’å‚ç…§ã—ã¦ãã ã•ã„。", "ConfigureTaskRunnerAction.label": "タスク ãƒ©ãƒ³ãƒŠãƒ¼ã®æ§‹æˆ", "ConfigureBuildTaskAction.label": "ビルド タスクを構æˆã—ã¾ã™", "CloseMessageAction.label": "é–‰ã˜ã‚‹", - "ShowTerminalAction.label": "端末ã®è¡¨ç¤º", + "ShowTerminalAction.label": "ターミナルã®è¡¨ç¤º", "problems": "å•題", "manyMarkers": "99+", "tasks": "タスク", diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 12b9c699bf2..440b92fd91d 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,6 @@ { "TerminalTaskSystem.unknownError": "タスクã®å®Ÿè¡Œä¸­ã«ä¸æ˜Žãªã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚詳細ã«ã¤ã„ã¦ã¯ã€ã‚¿ã‚¹ã‚¯å‡ºåŠ›ãƒ­ã‚°ã‚’å‚ç…§ã—ã¦ãã ã•ã„。", "TerminalTaskSystem.terminalName": "タスク - {0}", - "TerminalTaskSystem": "UNC ドライブã§ã‚·ã‚§ãƒ« コマンドを実行ã§ãã¾ã›ã‚“。" + "TerminalTaskSystem": "UNC ドライブã§ã‚·ã‚§ãƒ« コマンドを実行ã§ãã¾ã›ã‚“。", + "unkownProblemMatcher": "å•題マッãƒãƒ£ãƒ¼ {0} ã¯è§£æ±ºã§ãã¾ã›ã‚“ã§ã—ãŸã€‚マッãƒãƒ£ãƒ¼ã¯ç„¡è¦–ã•れã¾ã™" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 6f9be6076a6..0cc1f921982 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "タスクã®å®Ÿè¡Œä¸­ã«ä¸æ˜Žãªã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚詳細ã«ã¤ã„ã¦ã¯ã€ã‚¿ã‚¹ã‚¯å‡ºåŠ›ãƒ­ã‚°ã‚’å‚ç…§ã—ã¦ãã ã•ã„。", "TaskRunnerSystem.watchingBuildTaskFinished": "\nビルド タスクã®ã‚¦ã‚©ãƒƒãƒãŒçµ‚了ã—ã¾ã—ãŸã€‚", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nãƒ¦ãƒ¼ã‚¶ãƒ¼è¦æ±‚ã”ã¨ã«ã‚¿ã‚¹ã‚¯ '{0}' ãŒçµ‚了ã—ã¾ã—ãŸã€‚" + "TaskRunnerSystem.cancelRequested": "\nãƒ¦ãƒ¼ã‚¶ãƒ¼è¦æ±‚ã”ã¨ã«ã‚¿ã‚¹ã‚¯ '{0}' ãŒçµ‚了ã—ã¾ã—ãŸã€‚", + "unkownProblemMatcher": "å•題マッãƒãƒ£ãƒ¼ {0} ã¯è§£æ±ºã§ãã¾ã›ã‚“ã§ã—ãŸã€‚マッãƒãƒ£ãƒ¼ã¯ç„¡è¦–ã•れã¾ã™" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json index 0465847b150..11afc0e1f72 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -5,22 +5,22 @@ // Do not edit this file. It is machine generated. { "terminalIntegratedConfigurationTitle": "çµ±åˆç«¯æœ«", - "terminal.integrated.shell.linux": "端末㌠Linux ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。", - "terminal.integrated.shellArgs.linux": "Linux 端末ã§ä½¿ç”¨ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ ライン引数。", - "terminal.integrated.shell.osx": "端末㌠OS X ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。", + "terminal.integrated.shell.linux": "ターミナル㌠Linux ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。", + "terminal.integrated.shellArgs.linux": "Linux ã®ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã§ä½¿ç”¨ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ ライン引数。", + "terminal.integrated.shell.osx": "ターミナル㌠OS X ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。", "terminal.integrated.shellArgs.osx": "OS X 端末ã§ä½¿ç”¨ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ ライン引数。", - "terminal.integrated.shell.windows": "端末㌠Windows ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。Windows ã«ä»˜å±žã®ã‚·ã‚§ãƒ« (cmdã€PowerShellã€ã¾ãŸã¯ Bash on Ubuntu) を使用ã™ã‚‹å ´åˆã€64 ビット ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’使用ã™ã‚‹ã«ã¯ã€C:\\Windows\\System32 ã§ã¯ãªãã€C:\\Windows\\sysnative ã‚’é¸ã³ã¾ã™ã€‚", + "terminal.integrated.shell.windows": "ターミナル㌠Windows ã§ä½¿ç”¨ã™ã‚‹ã‚·ã‚§ãƒ«ã®ãƒ‘ス。Windows ã«ä»˜å±žã®ã‚·ã‚§ãƒ« (cmdã€PowerShellã€ã¾ãŸã¯ Bash on Ubuntu) を使用ã™ã‚‹å ´åˆã€64 ビット ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’使用ã™ã‚‹ã«ã¯ã€C:\\Windows\\System32 ã§ã¯ãªãã€C:\\Windows\\sysnative ã‚’é¸ã³ã¾ã™ã€‚", "terminal.integrated.shellArgs.windows": "Windows ターミナル上ã®å ´åˆã«ä½¿ç”¨ã•れるコマンド ライン引数。", - "terminal.integrated.rightClickCopyPaste": "設定ã—ã¦ã„ã‚‹å ´åˆã€ç«¯æœ«å†…ã§å³ã‚¯ãƒªãƒƒã‚¯ã—ãŸã¨ãã«ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆ メニューを表示ã•ã›ãšã€é¸æŠžç¯„囲ãŒã‚ã‚‹å ´åˆã¯ã‚³ãƒ”ーã€é¸æŠžç¯„囲ãŒãªã„å ´åˆã¯è²¼ã‚Šä»˜ã‘ã®æ“作を行ã„ã¾ã™ã€‚", + "terminal.integrated.rightClickCopyPaste": "設定ã—ã¦ã„ã‚‹å ´åˆã€ã‚¿ãƒ¼ãƒŸãƒŠãƒ«å†…ã§å³ã‚¯ãƒªãƒƒã‚¯ã—ãŸã¨ãã«ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆ メニューを表示ã•ã›ãšã€é¸æŠžç¯„囲ãŒã‚ã‚‹å ´åˆã¯ã‚³ãƒ”ーã€é¸æŠžç¯„囲ãŒãªã„å ´åˆã¯è²¼ã‚Šä»˜ã‘ã®æ“作を行ã„ã¾ã™ã€‚", "terminal.integrated.fontFamily": "端末ã®ãƒ•ォント ファミリを制御ã—ã¾ã™ã€‚既定値㯠editor.fontFamily ã«ãªã‚Šã¾ã™ã€‚", - "terminal.integrated.fontLigatures": "端末ã§ãƒ•ォントã®åˆå­—ãŒæœ‰åйã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", - "terminal.integrated.fontSize": "端末ã®ãƒ•ォント サイズをピクセルå˜ä½ã§åˆ¶å¾¡ã—ã¾ã™ã€‚", - "terminal.integrated.lineHeight": "端末ã®è¡Œã®é«˜ã•を制御ã—ã¾ã™ã€‚ã“ã®æ•°å€¤ã«ç«¯æœ«ã®ãƒ•ォント サイズを乗算ã™ã‚‹ã¨ã€å®Ÿéš›ã®è¡Œã®é«˜ã• (ピクセルå˜ä½) ã«ãªã‚Šã¾ã™ã€‚", + "terminal.integrated.fontLigatures": "ターミナルã§ãƒ•ォントã®åˆå­—ãŒæœ‰åйã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", + "terminal.integrated.fontSize": "ターミナルã®ãƒ•ォント サイズをピクセルå˜ä½ã§åˆ¶å¾¡ã—ã¾ã™ã€‚", + "terminal.integrated.lineHeight": "ターミナルã®è¡Œã®é«˜ã•を制御ã—ã¾ã™ã€‚ã“ã®æ•°å€¤ã«ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã®ãƒ•ォント サイズを乗算ã™ã‚‹ã¨ã€å®Ÿéš›ã®è¡Œã®é«˜ã• (ピクセルå˜ä½) ã«ãªã‚Šã¾ã™ã€‚", "terminal.integrated.enableBold": "ターミナル内ã§å¤ªå­—を有効ã«ã™ã‚‹ã‹ã©ã†ã‹ã€‚ã“れã«ã¯ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã‚·ã‚§ãƒ«ã‹ã‚‰ã®ã‚µãƒãƒ¼ãƒˆãŒã²ã¤ã‚ˆã†ã§ã™ã€‚", - "terminal.integrated.cursorBlinking": "端末ã®ã‚«ãƒ¼ã‚½ãƒ«ã‚’点滅ã•ã›ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", + "terminal.integrated.cursorBlinking": "ターミナルã®ã‚«ãƒ¼ã‚½ãƒ«ã‚’点滅ã•ã›ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚", "terminal.integrated.cursorStyle": "端末ã®ã‚«ãƒ¼ã‚½ãƒ«ã®ã‚¹ã‚¿ã‚¤ãƒ«ã‚’制御ã—ã¾ã™ã€‚", "terminal.integrated.scrollback": "端末ãŒãã®ãƒãƒƒãƒ•ァーã«ä¿æŒã§ãる最大行数を制御ã—ã¾ã™ã€‚", - "terminal.integrated.setLocaleVariables": "端末ã®é–‹å§‹æ™‚ã«ãƒ­ã‚±ãƒ¼ãƒ«å¤‰æ•°ã‚’設定ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚OS X ã§ã¯æ—¢å®šã§ true ã«ãªã‚Šã€ãã®ä»–ã®ãƒ—ラットフォームã§ã¯ false ã§ã™ã€‚", + "terminal.integrated.setLocaleVariables": "ターミナルã®é–‹å§‹æ™‚ã«ãƒ­ã‚±ãƒ¼ãƒ«å¤‰æ•°ã‚’設定ã™ã‚‹ã‹ã©ã†ã‹ã‚’制御ã—ã¾ã™ã€‚OS X ã§ã¯æ—¢å®šã§ true ã«ãªã‚Šã€ãã®ä»–ã®ãƒ—ラットフォームã§ã¯ false ã§ã™ã€‚", "terminal.integrated.cwd": "端末を起動ã™ã‚‹æ˜Žç¤ºçš„ãªé–‹å§‹ãƒ‘スã§ã™ã€‚ã“れã¯ã‚·ã‚§ãƒ« プロセスã®ç¾åœ¨ã®ä½œæ¥­ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª (cwd) ã¨ã—ã¦ä½¿ç”¨ã•れã¾ã™ã€‚特ã«ãƒ«ãƒ¼ãƒˆ ディレクトリ㌠cwd ã«é©ã—ã¦ã„ãªã„å ´åˆã«ã€ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã®è¨­å®šã§å½¹ç«‹ã¡ã¾ã™ã€‚", "terminal.integrated.confirmOnExit": "アクティブãªã‚¿ãƒ¼ãƒŸãƒŠãƒ« セッションãŒã‚ã‚‹å ´åˆã«çµ‚了ã®ç¢ºèªã‚’ã™ã‚‹ã‹ã©ã†ã‹ã€‚", "terminal.integrated.commandsToSkipShell": "キーãƒã‚¤ãƒ³ãƒ‰ãŒã‚·ã‚§ãƒ«ã«é€ä¿¡ã•れãšã€ä»£ã‚りã«å¸¸ã« Code ã§å‡¦ç†ã•れるコマンド ID ã®ã‚»ãƒƒãƒˆã€‚ã“れã«ã‚ˆã‚Šã€ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ãŒãƒ•ォーカスã•れã¦ã„ãªã„å ´åˆã¨åŒã˜å‹•作をã™ã‚‹ã‚·ã‚§ãƒ«ã«ã‚ˆã£ã¦é€šå¸¸ä½¿ç”¨ã•れるキーãƒã‚¤ãƒ³ãƒ‰ã‚’使用ã§ãるよã†ã«ãªã‚Šã¾ã™ã€‚例: Ctrl+p ã§ Quick Open ã‚’èµ·å‹•ã—ã¾ã™ã€‚", diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 1ed0e372072..e7930c9cd7a 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbench.action.terminal.toggleTerminal": "çµ±åˆç«¯æœ«ã®åˆ‡ã‚Šæ›¿ãˆ", + "workbench.action.terminal.toggleTerminal": "çµ±åˆã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã®åˆ‡ã‚Šæ›¿ãˆ", "workbench.action.terminal.kill": "アクティブãªç«¯æœ«ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’強制終了", "workbench.action.terminal.kill.short": "端末ã®å¼·åˆ¶çµ‚了", "workbench.action.terminal.copySelection": "é¸æŠžå†…å®¹ã®ã‚³ãƒ”ー", "workbench.action.terminal.new": "æ–°ã—ã„çµ±åˆç«¯æœ«ã®ä½œæˆ", - "workbench.action.terminal.new.short": "æ–°ã—ã„端末", + "workbench.action.terminal.new.short": "æ–°ã—ã„ターミナル", "workbench.action.terminal.focus": "端末ã«ãƒ•ォーカス", "workbench.action.terminal.focusNext": "次ã®ç«¯æœ«ã«ãƒ•ォーカス", "workbench.action.terminal.focusAtIndex": "ターミナル {0} ã«ãƒ•ォーカス", - "workbench.action.terminal.focusPrevious": "å‰ã®ç«¯æœ«ã«ãƒ•ォーカス", - "workbench.action.terminal.paste": "アクティブãªç«¯æœ«ã«è²¼ã‚Šä»˜ã‘", + "workbench.action.terminal.focusPrevious": "å‰ã®ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã«ãƒ•ォーカス", + "workbench.action.terminal.paste": "アクティブãªã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã«è²¼ã‚Šä»˜ã‘", "workbench.action.terminal.DefaultShell": "既定ã®ã‚·ã‚§ãƒ«ã®é¸æŠž", - "workbench.action.terminal.runSelectedText": "アクティブãªç«¯æœ«ã§é¸æŠžã—ãŸãƒ†ã‚­ã‚¹ãƒˆã‚’実行", + "workbench.action.terminal.runSelectedText": "アクティブãªã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã§é¸æŠžã—ãŸãƒ†ã‚­ã‚¹ãƒˆã‚’実行", "workbench.action.terminal.runActiveFile": "アクティブãªãƒ•ァイルをアクティブãªã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã§å®Ÿè¡Œ", "workbench.action.terminal.runActiveFile.noFile": "ターミナルã§å®Ÿè¡Œã§ãã‚‹ã®ã¯ã€ãƒ‡ã‚£ã‚¹ã‚¯ä¸Šã®ãƒ•ァイルã®ã¿ã§ã™", "workbench.action.terminal.switchTerminalInstance": "端末インスタンスをスイッãƒ", @@ -26,5 +26,7 @@ "workbench.action.terminal.scrollUp": "上ã«ã‚¹ã‚¯ãƒ­ãƒ¼ãƒ« (行)", "workbench.action.terminal.scrollUpPage": "スクロール アップ (ページ)", "workbench.action.terminal.scrollToTop": "一番上ã«ã‚¹ã‚¯ãƒ­ãƒ¼ãƒ«", - "workbench.action.terminal.clear": "クリア" + "workbench.action.terminal.clear": "クリア", + "workbench.action.terminal.allowWorkspaceShell": "ワークスペースã§ã‚·ã‚§ãƒ«ã‚’æ§‹æˆã™ã‚‹ã“ã¨ã‚’許å¯ã™ã‚‹", + "workbench.action.terminal.disallowWorkspaceShell": "ワークスペースã§ã‚·ã‚§ãƒ«ã‚’æ§‹æˆã™ã‚‹ã“ã¨ã‚’許å¯ã—ãªã„" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index 7880bacd288..50f3054a326 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "ターミナルã®èƒŒæ™¯è‰²ã€‚パãƒãƒ«ã”ã¨ã«ç•°ãªã‚‹è‰²ã‚’指定ã§ãã¾ã™ã€‚", + "terminal.foreground": "ターミナルã®å‰æ™¯è‰²ã€‚", "terminal.ansiColor": "ターミナル㮠'{0}' ANSI カラー。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index ab5a0deee5d..a898f37da7b 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "terminal.integrated.copySelection.noSelection": "ターミナルã«ãƒ•ォーカスãŒãªã„å ´åˆã¯ã€ã‚¿ãƒ¼ãƒŸãƒŠãƒ«ã®é¸æŠžã‚’コピーã§ãã¾ã›ã‚“", - "terminal.integrated.exitedWithCode": "端末処ç†ãŒçµ‚了ã—ã¾ã—㟠(終了コード: {0})", + "terminal.integrated.exitedWithCode": "ターミナルã®å‡¦ç†ãŒçµ‚了ã—ã¾ã—㟠(終了コード: {0})", "terminal.integrated.waitOnExit": "ä»»æ„ã®ã‚­ãƒ¼ã‚’押ã—ã¦ç«¯æœ«ã‚’終了ã—ã¾ã™", - "terminal.integrated.launchFailed": "端末プロセス コマンド `{0}{1}` ã‚’èµ·å‹•ã§ãã¾ã›ã‚“ã§ã—㟠(終了コード: {2})" + "terminal.integrated.launchFailed": "ターミナル プロセス コマンド `{0}{1}` ã‚’èµ·å‹•ã§ãã¾ã›ã‚“ã§ã—㟠(終了コード: {2})" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index e2d25e3da15..7592dde26b5 100644 --- a/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -5,15 +5,15 @@ // Do not edit this file. It is machine generated. { "selectTheme.label": "é…色テーマ", - "installColorThemes": "ãã®ä»–ã®è‰²ã®ãƒ†ãƒ¼ãƒžã‚’インストール...", - "problemChangingTheme": "テーマã®è¨­å®šã§å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}", - "themes.selectTheme": "é…色テーマã®é¸æŠž", + "installColorThemes": "ãã®ä»–ã®é…色テーマをインストール...", + "themes.selectTheme": "é…色テーマã®é¸æŠž (上/下キーã§ãƒ—レビューå¯èƒ½)", "selectIconTheme.label": "ファイル アイコンã®ãƒ†ãƒ¼ãƒž", "installIconThemes": "ãã®ä»–ã®ãƒ•ァイル アイコンã®ãƒ†ãƒ¼ãƒžã‚’インストール...", "noIconThemeLabel": "ãªã—", "noIconThemeDesc": "ファイル アイコンを無効ã«ã™ã‚‹", "problemChangingIconTheme": "アイコン テーマã®è¨­å®šã§å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}", "themes.selectIconTheme": "ファイル アイコンã®ãƒ†ãƒ¼ãƒžã‚’é¸æŠžã—ã¾ã™", + "generateColorTheme.label": "ç¾åœ¨ã®è¨­å®šã‹ã‚‰é…色テーマを生æˆã™ã‚‹", "preferences": "基本設定", "developer": "Developer" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/jpn/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json index e2eae85639c..33d502728a1 100644 --- a/i18n/jpn/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -11,7 +11,7 @@ "watermark.openFileFolder": "ファイルã¾ãŸã¯ãƒ•ォルダーを開ã", "watermark.openRecent": "最近開ã„ãŸé …ç›®", "watermark.newUntitledFile": "ç„¡é¡Œã®æ–°è¦ãƒ•ァイル", - "watermark.toggleTerminal": "端末ã®åˆ‡ã‚Šæ›¿ãˆ", + "watermark.toggleTerminal": "ターミナルã®åˆ‡ã‚Šæ›¿ãˆ", "watermark.findInFiles": "フォルダーを指定ã—ã¦æ¤œç´¢", "watermark.startDebugging": "デãƒãƒƒã‚°ã®é–‹å§‹", "watermark.selectTheme": "テーマã®å¤‰æ›´", diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index d4254f6ae36..950f340d9ae 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,33 +11,34 @@ "welcomePage.openFolder": "フォルダーを開ã...", "welcomePage.cloneGitRepository": "Git リãƒã‚¸ãƒˆãƒªã‚’複製...", "welcomePage.recent": "最近", + "welcomePage.moreRecent": "ãã®ä»–", "welcomePage.noRecentFolders": "最近使用ã—ãŸãƒ•ォルダーãªã—", "welcomePage.help": "ヘルプ", - "welcomePage.productDocumentation": "製å“ドキュメント", + "welcomePage.keybindingsCheatsheet": "å°åˆ·å¯èƒ½ãªã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ã®ãƒãƒ¼ãƒˆã‚·ãƒ¼ãƒˆ", "welcomePage.introductoryVideos": "紹介ビデオ", + "welcomePage.productDocumentation": "製å“ドキュメント", "welcomePage.gitHubRepository": "GitHub リãƒã‚¸ãƒˆãƒª", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "起動時ã«ã‚¦ã‚§ãƒ«ã‚«ãƒ  ページを表示", - "welcomePage.quickLinks": "クイック リンク", - "welcomePage.interactivePlayground": "対話型プレイグラウンド", - "welcomePage.interactivePlaygroundDescription": "エディターã®åŸºæœ¬æ©Ÿèƒ½ã‚’ç°¡æ½”ãªãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã§ä½“験ã—ã¾ã™", - "welcomePage.interfaceOverview": "ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ã‚¤ã‚¹ã®æ¦‚è¦", - "welcomePage.interfaceOverviewDescription": "UI ã®ä¸»è¦ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’解説ã—ãŸè¦–覚オーãƒãƒ¼ãƒ¬ã‚¤ã‚’表示ã—ã¾ã™", + "welcomePage.customize": "カスタマイズã™ã‚‹", + "welcomePage.installExtensionPacks": "ツールã¨è¨€èªž", + "welcomePage.installExtensionPacksDescription": "{0} 㨠{1} ã®ã‚µãƒãƒ¼ãƒˆã‚’インストールã™ã‚‹ ", + "welcomePage.moreExtensions": "ãã®ä»–", + "welcomePage.installKeymapDescription": "キーボード ショートカットをインストールã—ã¾ã™", + "welcomePage.installKeymapExtension": "{0} 㨠{1} ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットをインストール", + "welcomePage.others": "ãã®ä»–", "welcomePage.colorTheme": "é…色テーマ", "welcomePage.colorThemeDescription": "エディターã¨ã‚³ãƒ¼ãƒ‰ã®å¤–観を自由ã«è¨­å®šã—ã¾ã™", - "welcomePage.keybindingsReference": "キーボード ショートカットã®å‚照資料", - "welcomePage.keybindingsReferenceDescription": "最も一般的ãªã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットを掲載ã—ãŸå°åˆ·å¯èƒ½ãª PDF ã§ã™", + "welcomePage.learn": "å­¦ã¶", "welcomePage.showCommands": "ã™ã¹ã¦ã®ã‚³ãƒžãƒ³ãƒ‰ã®æ¤œç´¢ã¨å®Ÿè¡Œ", "welcomePage.showCommandsDescription": "コントロール パãƒãƒ«ã‹ã‚‰ã‚³ãƒžãƒ³ãƒ‰ã‚’検索ã—ã¦ã™ã°ã‚„ãアクセスã—ã¾ã™ ({0})", + "welcomePage.interfaceOverview": "ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ã‚¤ã‚¹ã®æ¦‚è¦", + "welcomePage.interfaceOverviewDescription": "UI ã®ä¸»è¦ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’解説ã—ãŸè¦–覚オーãƒãƒ¼ãƒ¬ã‚¤ã‚’表示ã—ã¾ã™", + "welcomePage.interactivePlayground": "対話型プレイグラウンド", + "welcomePage.interactivePlaygroundDescription": "エディターã®åŸºæœ¬æ©Ÿèƒ½ã‚’ç°¡æ½”ãªãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã§ä½“験ã—ã¾ã™", + "welcomePage.quickLinks": "クイック リンク", + "welcomePage.keybindingsReference": "キーボード ショートカットã®å‚照資料", + "welcomePage.keybindingsReferenceDescription": "最も一般的ãªã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットを掲載ã—ãŸå°åˆ·å¯èƒ½ãª PDF ã§ã™", "welcomePage.configureSettings": "設定を構æˆã™ã‚‹", - "welcomePage.configureSettingsDescription": "VS Code ã®å…¨æ©Ÿèƒ½ã‚’活用ã™ã‚‹ãŸã‚ã«è¨­å®šã‚’微調整ã—ã¾ã™", - "welcomePage.installKeymapDescription": "キーボード ショートカットをインストールã—ã¾ã™", - "welcomePage.installKeymap": "{0}ã€{1}ã€{2}ã€{3} ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットをインストール", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (最新)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (最新)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (最新)", - "welcomePage.others": "ãã®ä»–" + "welcomePage.configureSettingsDescription": "VS Code ã®å…¨æ©Ÿèƒ½ã‚’活用ã™ã‚‹ãŸã‚ã«è¨­å®šã‚’微調整ã—ã¾ã™" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 57e82748c8e..09458a86c49 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -5,6 +5,6 @@ // Do not edit this file. It is machine generated. { "workbenchConfigurationTitle": "ワークベンãƒ", - "welcomePage.enabled": "有効ã«ã™ã‚‹ã¨ã€ã‚¹ã‚¿ãƒ¼ãƒˆã‚¢ãƒƒãƒ—時ã«ã€ã‚ˆã†ã“ãページãŒè¡¨ç¤ºã•れã¾ã™ã€‚", + "welcomePage.enabled": "有効ã«ã™ã‚‹ã¨ã€èµ·å‹•時ã«ã‚¦ã‚§ãƒ«ã‚«ãƒ  ページを表示ã—ã¾ã™ã€‚", "help": "ヘルプ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index e669bacef12..eba406025bb 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,27 @@ // Do not edit this file. It is machine generated. { "welcomePage": "よã†ã“ã", - "welcome.title": "よã†ã“ã", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "{0} ã®ã‚µãƒãƒ¼ãƒˆã¯æ—¢ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã¾ã™ã€‚", + "welcomePage.willReloadAfterInstallingExtensionPack": "{0} ã®ã‚µãƒãƒ¼ãƒˆã‚’インストールã—ãŸå¾Œã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒå†åº¦èª­ã¿è¾¼ã¾ã‚Œã¾ã™ã€‚", + "welcomePage.installingExtensionPack": "{0} ã®ã‚µãƒãƒ¼ãƒˆã‚’インストール...", + "welcomePage.extensionPackNotFound": "ID {1} ã®ã‚µãƒãƒ¼ãƒˆ {0} ã¯è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚", "welcomePage.keymapAlreadyInstalled": "キーボード ショートカット {0} ã¯æ—¢ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã¾ã™ã€‚", "welcomePage.willReloadAfterInstallingKeymap": "キーボード ショートカット {0} をインストールã—ãŸå¾Œã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒå†åº¦èª­ã¿è¾¼ã¾ã‚Œã¾ã™ã€‚", - "ok": "OK", "welcomePage.installingKeymap": "{0} ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットをインストールã—ã¦ã„ã¾ã™...", "welcomePage.keymapNotFound": "ID {1} ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカット {0} ã¯è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚", - "cancel": "キャンセル" + "welcome.title": "よã†ã“ã", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installedExtension": "{0} (インストール済ã¿) ", + "ok": "OK", + "cancel": "キャンセル", + "welcomePage.quickLinkBackground": "ウェルカム ページã®ã‚¯ã‚¤ãƒƒã‚¯ リンクã®èƒŒæ™¯è‰²ã€‚", + "welcomePage.quickLinkHoverBackground": "ウェルカム ページã®ã‚¯ã‚¤ãƒƒã‚¯ リンクã®ãƒ›ãƒãƒ¼èƒŒæ™¯è‰²ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index e4999a3c4e8..f2d0c06274d 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "ãƒã‚¤ãƒ³ãƒ‰ãªã—" + "walkThrough.unboundCommand": "ãƒã‚¤ãƒ³ãƒ‰ãªã—", + "walkThrough.gitNotFound": "システム㫠Git ãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ãªã„å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚", + "walkThrough.embeddedEditorBackground": "対話型プレイグラウンドã®åŸ‹ã‚è¾¼ã¿ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã®èƒŒæ™¯è‰²ã€‚" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 05b5cdcae7b..81d7a645e32 100644 --- a/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "設定を開ã", + "close": "é–‰ã˜ã‚‹", + "saveAndRetry": "設定をä¿å­˜ã—ã¦å†è©¦è¡Œ", "errorUnknownKey": "æ§‹æˆãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ãè¾¼ã‚ã¾ã›ã‚“ (䏿˜Žãªã‚­ãƒ¼)", "errorInvalidTarget": "æ§‹æˆãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ãè¾¼ã‚ã¾ã›ã‚“ (無効ãªã‚¿ãƒ¼ã‚²ãƒƒãƒˆ)", "errorNoWorkspaceOpened": "é–‹ã„ã¦ã„るフォルダーãŒãªã„ãŸã‚ã€è¨­å®šã‚’書ãè¾¼ã‚ã¾ã›ã‚“。最åˆã«ãƒ•ォルダーを開ã„ã¦ã‹ã‚‰ã€ã‚‚ã†ä¸€åº¦ãŠè©¦ã—ãã ã•ã„。", diff --git a/i18n/jpn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/jpn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 7cace13d285..3920f3ceeb5 100644 --- a/i18n/jpn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "nonempty": "空以外ã®å€¤ãŒå¿…è¦ã§ã™ã€‚", - "requirestring": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "optstring": "プロパティ `{0}` ã¯çœç•¥ã™ã‚‹ã‹ã€åž‹ `string` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "requirestring": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "optstring": "`{0}` プロパティã¯çœç•¥ã™ã‚‹ã‹ã€`string` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", "vscode.extension.contributes.keybindings.command": "キー ãƒã‚¤ãƒ³ãƒ‰ã®ãƒˆãƒªã‚¬ãƒ¼æ™‚ã«å®Ÿè¡Œã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®è­˜åˆ¥å­ã€‚", "vscode.extension.contributes.keybindings.key": "キーã¾ãŸã¯ã‚­ãƒ¼ シーケンス (キー㯠+ ã§åŒºåˆ‡ã‚Šã€ã‚·ãƒ¼ã‚±ãƒ³ã‚¹ã¯ã‚¹ãƒšãƒ¼ã‚¹ã§åŒºåˆ‡ã‚‹ã€‚例: Ctrl+Oã€Ctrl+L L ã§åŒæ™‚ã«æŠ¼ã™", "vscode.extension.contributes.keybindings.mac": "Mac 固有ã®ã‚­ãƒ¼ã¾ãŸã¯ã‚­ãƒ¼ シーケンス。", @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Windows 固有ã®ã‚­ãƒ¼ã¾ãŸã¯ã‚­ãƒ¼ シーケンス。", "vscode.extension.contributes.keybindings.when": "キーãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆã®æ¡ä»¶ã€‚", "vscode.extension.contributes.keybindings": "キー ãƒã‚¤ãƒ³ãƒ‰ã‚’æä¾›ã—ã¾ã™ã€‚", - "openDocumentation": "詳細情報", - "keybindingMigration.ok": "OK", - "keybindingMigration.prompt": "使用中ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ レイアウトã«åˆã‚ã›ã¦ä¸€éƒ¨ã®ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ ショートカットãŒå¤‰æ›´ã•れã¾ã—ãŸã€‚", "invalid.keybindings": "æ­£ã—ããªã„ `contributes.{0}`: {1}", "unboundCommands": "ä»–ã«ä½¿ç”¨ã§ãã‚‹ã‚³ãƒžãƒ³ãƒ‰ã¯æ¬¡ã®ã¨ãŠã‚Šã§ã™: ", "keybindings.json.title": "キー ãƒã‚¤ãƒ³ãƒ‰ã®æ§‹æˆ", diff --git a/i18n/jpn/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/jpn/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json index 03cdc9aeaad..22d698c1407 100644 --- a/i18n/jpn/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -6,11 +6,11 @@ { "invalid": "`contributes.{0}` ãŒç„¡åйã§ã™ã€‚é…列ãŒå¿…è¦ã§ã™ã€‚", "invalid.empty": "`contributes.{0}` ã«å¯¾ã™ã‚‹ç©ºã®å€¤", - "require.id": "プロパティ `{0}` ã¯å¿…é ˆã§ã€åž‹ `string` ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", - "opt.extensions": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "opt.filenames": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "opt.firstLine": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "opt.configuration": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "opt.aliases": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", - "opt.mimetypes": "プロパティ `{0}` ã‚’çœç•¥ã™ã‚‹ã‹ã€åž‹ `string[]` ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™" + "require.id": "`{0}` プロパティã¯å¿…é ˆã§ã€`string` åž‹ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "opt.extensions": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "opt.filenames": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "opt.firstLine": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "opt.configuration": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "opt.aliases": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™", + "opt.mimetypes": "`{0}` プロパティをçœç•¥ã™ã‚‹ã‹ã€`string[]` åž‹ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/jpn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index f0fb6370546..978edc39141 100644 --- a/i18n/jpn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "æ§‹æ–‡ã®å¼·èª¿è¡¨ç¤ºã‚’ã™ã‚‹è‰²", "schema.properties.name": "ルールã®èª¬æ˜Ž", - "schema.fontStyle": "ルールã®ãƒ•ォント スタイル: '斜体'ã€'太字'ã€'下線' ã®ã„ãšã‚Œã‹ã¾ãŸã¯ã“れらã®çµ„ã¿åˆã‚ã›" + "schema.fontStyle": "ルールã®ãƒ•ォント スタイル: '斜体'ã€'太字'ã€'下線' ã®ã„ãšã‚Œã‹ã¾ãŸã¯ã“れらã®çµ„ã¿åˆã‚ã›", + "schema.tokenColors.path": "tmTheme ファイルã¸ã®ãƒ‘ス (ç¾åœ¨ã®ãƒ•ァイルã¨ã®ç›¸å¯¾ãƒ‘ス)" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/jpn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 83a24dfd0e0..782cc7b29de 100644 --- a/i18n/jpn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "JSON テーマ ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}" + "error.cannotparsejson": "JSON テーマ ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}", + "error.invalidformat.colors": "é…色テーマ ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}。'colors' プロパティ㯠'object' åž‹ã§ã¯ã‚りã¾ã›ã‚“。", + "error.invalidformat.tokenColors": "é…色テーマ ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}。'tokenColors' プロパティã¯ã€é…色を指定ã™ã‚‹é…列ã‹ã€TextMate テーマファイルã¸ã®ãƒ‘スã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“", + "error.plist.invalidformat": "tmTheme ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}。'settings' ã¯é…列ã§ã¯ã‚りã¾ã›ã‚“。", + "error.cannotparse": "tmTheme ファイルã®è§£æžä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {0}", + "error.cannotload": "tmTheme ファイル {0} ã®èª­ã¿è¾¼ã¿ä¸­ã«å•題ãŒç™ºç”Ÿã—ã¾ã—ãŸ: {1}" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/jpn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index a22528984cb..eb295ac74b0 100644 --- a/i18n/jpn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "ç¾åœ¨é¸æŠžã—ã¦ã„ã‚‹é…色テーマã§é…色を上書ãã—ã¾ã™ã€‚", + "workbenchColors.deprecated": "ã“ã®è¨­å®šã¯ã‚‚ã†è©¦é¨“çš„ãªã‚‚ã®ã§ã¯ãªãã€åå‰ãŒ 'workbench.colorCustomizations' ã«å¤‰æ›´ã•れã¦ã„ã¾ã™", + "workbenchColors.deprecatedDescription": "代ã‚り㫠'workbench.colorCustomizations' を使用ã—ã¦ãã ã•ã„" } \ No newline at end of file diff --git a/i18n/kor/extensions/git/out/commands.i18n.json b/i18n/kor/extensions/git/out/commands.i18n.json index 4a4101b4207..9798aa482fa 100644 --- a/i18n/kor/extensions/git/out/commands.i18n.json +++ b/i18n/kor/extensions/git/out/commands.i18n.json @@ -16,6 +16,10 @@ "confirm discard": "{0}ì˜ ë³€ê²½ ë‚´ìš©ì„ ì·¨ì†Œí•˜ì‹œê² ìŠµë‹ˆê¹Œ?", "confirm discard multiple": "{0}ê°œ 파ì¼ì˜ 변경 ë‚´ìš©ì„ ì·¨ì†Œí•˜ì‹œê² ìŠµë‹ˆê¹Œ?", "discard": "변경 ë‚´ìš© 취소", + "confirm discard all": "모든 변경 ë‚´ìš©ì„ ì·¨ì†Œí•˜ì‹œê² ìŠµë‹ˆê¹Œ? ì´ ìž‘ì—…ì€ ë˜ëŒë¦´ 수 없습니다.", + "discardAll": "모든 변경 ë‚´ìš© 취소", + "yes": "예", + "always": "í•­ìƒ", "no changes": "커밋할 변경 ë‚´ìš©ì´ ì—†ìŠµë‹ˆë‹¤.", "commit message": "커밋 메시지", "provide commit message": "커밋 메시지를 제공하세요.", @@ -31,6 +35,7 @@ "no remotes to publish": "리í¬ì§€í† ë¦¬ì— 게시하ë„ë¡ êµ¬ì„±ëœ ì›ê²©ì´ 없습니다.", "disabled": "Gitì€ ì´ ìž‘ì—… ì˜ì—­ì—서 사용하지 않ë„ë¡ ì„¤ì •ë˜ì–´ 있거나 ì§€ì›ë˜ì§€ 않습니다.", "clean repo": "ì²´í¬ ì•„ì›ƒí•˜ê¸° ì „ì— ë¦¬í¬ì§€í† ë¦¬ 작업 트리를 정리하세요.", + "cant push": "참조를 ì›ê²©ì— 푸시할 수 없습니다. 먼저 'í’€'ì„ ì‹¤í–‰í•˜ì—¬ 변경 ë‚´ìš©ì„ í†µí•©í•˜ì„¸ìš”.", "git error details": "Git: {0}", "git error": "Git 오류", "open git log": "Git 로그 열기" diff --git a/i18n/kor/extensions/git/out/scmProvider.i18n.json b/i18n/kor/extensions/git/out/scmProvider.i18n.json index 7fded37328a..69250749f77 100644 --- a/i18n/kor/extensions/git/out/scmProvider.i18n.json +++ b/i18n/kor/extensions/git/out/scmProvider.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "commit": "Commit" + "commit": "커밋" } \ No newline at end of file diff --git a/i18n/kor/extensions/git/package.i18n.json b/i18n/kor/extensions/git/package.i18n.json index 0aeb4b64014..aed0ca69317 100644 --- a/i18n/kor/extensions/git/package.i18n.json +++ b/i18n/kor/extensions/git/package.i18n.json @@ -39,6 +39,8 @@ "config.autofetch": "ìžë™ 가져오기 사용 여부", "config.enableLongCommitWarning": "긴 커밋 ë©”ì‹œì§€ì— ëŒ€í•´ 경고할지 여부입니다.", "config.confirmSync": "Git 리í¬ì§€í† ë¦¬ë¥¼ ë™ê¸°í™”하기 ì „ì— í™•ì¸í•©ë‹ˆë‹¤.", + "config.countBadge": "Git ë°°ì§€ 카운터를 제어합니다. `all`ì´ë©´ 변경 ë‚´ìš©ì„ ëª¨ë‘ ê³„ì‚°í•˜ê³ , `tracked`ì´ë©´ ì¶”ì ëœ 변경 내용만 계산하고, `off`ì´ë©´ 해제합니다.", + "config.checkoutType": "`다ìŒìœ¼ë¡œ ì²´í¬ ì•„ì›ƒ...`ì„ ì‹¤í–‰í•  때 나열ë˜ëŠ” 분기 ìœ í˜•ì„ ì œì–´í•©ë‹ˆë‹¤. `all`ì´ë©´ 모든 참조를 표시하고, `local`ì´ë©´ 로컬 분기만 표시하고, `tags`ì´ë©´ 태그만 표시하고, `remote`ì´ë©´ ì›ê²© 분기만 표시합니다.", "config.ignoreLegacyWarning": "레거시 Git 경고를 무시합니다.", "config.ignoreLimitWarning": "리í¬ì§€í† ë¦¬ì— 변경 ë‚´ìš©ì´ ë„ˆë¬´ 많으면 경고를 무시합니다." } \ No newline at end of file diff --git a/i18n/kor/extensions/gulp/package.i18n.json b/i18n/kor/extensions/gulp/package.i18n.json index 8b6ad71cd4e..9dc5dc5daa6 100644 --- a/i18n/kor/extensions/gulp/package.i18n.json +++ b/i18n/kor/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Gulp ìž‘ì—…ì˜ ìžë™ ê²€ìƒ‰ì„ ì‚¬ìš©í• ì§€ 여부를 제어합니다. ê¸°ë³¸ê°’ì€ [켜기]입니다." +} \ No newline at end of file diff --git a/i18n/kor/extensions/jake/out/main.i18n.json b/i18n/kor/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/jake/package.i18n.json b/i18n/kor/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/markdown/out/extension.i18n.json b/i18n/kor/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/package.i18n.json b/i18n/kor/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/npm/package.i18n.json b/i18n/kor/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/npm/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/kor/extensions/typescript/out/typescriptServiceClient.i18n.json index 5ce4069a9b5..50cd48bc2e2 100644 --- a/i18n/kor/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/kor/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "경로 {0}ì´(ê°€) 올바른 tsserver 설치를 가리키지 않습니다. í¬í•¨ëœ TypeScript ë²„ì „ì„ ëŒ€ì‹  사용합니다.", "noBundledServerFound": "잘못 ë™ìž‘하는 ë°”ì´ëŸ¬ìФ ê°ì§€ ë„구와 ê°™ì€ ë‹¤ë¥¸ ì‘ìš© 프로그램ì—서 VSCodeì˜ tsserverê°€ ì‚­ì œë˜ì—ˆìŠµë‹ˆë‹¤. VS Code를 다시 설치하세요.", "versionNumber.custom": "ì‚¬ìš©ìž ì§€ì •", diff --git a/i18n/kor/extensions/typescript/out/utils/logger.i18n.json b/i18n/kor/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/kor/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json index bba27308a23..07c376496cf 100644 --- a/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "TypeScript IntelliSense를 í–¥ìƒí•˜ê¸° 위해 ë°ì´í„°ë¥¼ 페치하는 중", + "typesInstallerInitializationFailed.title": "JavaScript 언어 ê¸°ëŠ¥ì— ëŒ€í•´ ìž…ë ¥ 파ì¼ì„ 설치할 수 없습니다. NPMì´ ì„¤ì¹˜ë˜ì–´ 있고 PATHì— ìžˆëŠ”ì§€ 확ì¸í•˜ì„¸ìš”.", "typesInstallerInitializationFailed.moreInformation": "추가 ì •ë³´", "typesInstallerInitializationFailed.doNotCheckAgain": "다시 í™•ì¸ ì•ˆ 함", "typesInstallerInitializationFailed.close": "닫기" diff --git a/i18n/kor/extensions/typescript/package.i18n.json b/i18n/kor/extensions/typescript/package.i18n.json index 032e92f8c4d..4e1ce76b213 100644 --- a/i18n/kor/extensions/typescript/package.i18n.json +++ b/i18n/kor/extensions/typescript/package.i18n.json @@ -33,9 +33,7 @@ "javascript.validate.enable": "JavaScript 유효성 검사를 사용하거나 사용하지 않습니다.", "typescript.goToProjectConfig.title": "프로ì íЏ 구성으로 ì´ë™", "javascript.goToProjectConfig.title": "프로ì íЏ 구성으로 ì´ë™", - "typescript.referencesCodeLens.enabled": "참조 CodeLens 사용하거나 사용하지 않ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤. TypeScript >= 2.0.6ì´ í•„ìš”í•©ë‹ˆë‹¤.", "typescript.implementationsCodeLens.enabled": "구현 CodeLens를 사용하거나 사용하지 않ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤. TypeScript >= 2.2.0ì´ í•„ìš”í•©ë‹ˆë‹¤.", - "typescript.openTsServerLog.title": "TS 서버 로그 íŒŒì¼ ì—´ê¸°", "typescript.selectTypeScriptVersion.title": "TypeScript 버전 ì„ íƒ", "jsDocCompletion.enabled": "ìžë™ JSDoc ì£¼ì„ ì‚¬ìš©/사용 안 함", "javascript.implicitProjectConfig.checkJs": "JavaScript 파ì¼ì˜ ì˜ë¯¸ 체계 검사를 사용/사용하지 않습니다. 기존 jsconfig.json ë˜ëŠ” tsconfig.json 파ì¼ì€ ì´ ì„¤ì •ì„ ìž¬ì •ì˜í•©ë‹ˆë‹¤. TypeScript >=2.3.1ì´ í•„ìš”í•©ë‹ˆë‹¤. ", diff --git a/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index def2cd28d67..4266985efc9 100644 --- a/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "ì´ë¯¸ì§€ê°€ 너무 커서 íŽ¸ì§‘ê¸°ì— í‘œì‹œí•  수 없습니다. ", - "resourceOpenExternalButton": "ì´ë¯¸ì§€ 열기", - "resourceOpenExternalText": " 외부 í”„ë¡œê·¸ëž¨ì„ ì‚¬ìš©í• ê¹Œìš”?", "nativeBinaryError": "파ì¼ì´ ì´ì§„ì´ê±°ë‚˜ 매우 í¬ê±°ë‚˜ ì§€ì›ë˜ì§€ 않는 í…스트 ì¸ì½”ë”©ì„ ì‚¬ìš©í•˜ê¸° ë•Œë¬¸ì— íŽ¸ì§‘ê¸°ì—서 표시ë˜ì§€ 않습니다.", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/kor/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/kor/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..ac05a5533ca --- /dev/null +++ b/i18n/kor/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "ìž˜ëª»ëœ ê¸°í˜¸", + "error.invalidNumberFormat": "ìž˜ëª»ëœ ìˆ«ìž í˜•ì‹", + "error.propertyNameExpected": "ì†ì„± ì´ë¦„ í•„ìš”", + "error.valueExpected": "ê°’ í•„ìš”", + "error.colonExpected": "ì½œë¡ ì´ í•„ìš”í•©ë‹ˆë‹¤.", + "error.commaExpected": "쉼표가 필요합니다.", + "error.closeBraceExpected": "닫는 괄호 í•„ìš”", + "error.closeBracketExpected": "닫는 대괄호 í•„ìš”", + "error.endOfFileExpected": "íŒŒì¼ ë í•„ìš”" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/code/electron-main/menus.i18n.json b/i18n/kor/src/vs/code/electron-main/menus.i18n.json index 76675a56471..a8faf00b858 100644 --- a/i18n/kor/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/kor/src/vs/code/electron-main/menus.i18n.json @@ -69,7 +69,6 @@ "miSmartSelectShrink": "ì„ íƒ ì˜ì—­ 축소(&&S)", "miViewExplorer": "íƒìƒ‰ê¸°(&&E)", "miViewSearch": "검색(&&S)", - "miViewGit": "Git(&&G)", "miViewDebug": "디버그(&&D)", "miViewExtensions": "확장(&&X)", "miToggleOutput": "출력(&&O)", diff --git a/i18n/kor/src/vs/code/electron-main/windows.i18n.json b/i18n/kor/src/vs/code/electron-main/windows.i18n.json index 0756d51cd46..474475abdb1 100644 --- a/i18n/kor/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/kor/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "확ì¸", "pathNotExistTitle": "경로가 없습니다.", "pathNotExistDetail": "'{0}' 경로가 디스í¬ì— ë” ì´ìƒ 없는 것 같습니다.", - "accessibilityOptionsWindowTitle": "접근성 옵션", "reopen": "다시 열기", "wait": "ê³„ì† ëŒ€ê¸°", "close": "닫기", diff --git a/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json index 18538323353..18aff6704be 100644 --- a/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -40,7 +40,6 @@ "formatOnType": "ìž…ë ¥ 후 편집기ì—서 ìžë™ìœ¼ë¡œ ì¤„ì˜ ì„œì‹ì„ 지정할지 여부를 제어합니다.", "formatOnPaste": "ë¶™ì—¬ë„£ì€ ì½˜í…ì¸ ì˜ ì„œì‹ì„ 편집기ì—서 ìžë™ìœ¼ë¡œ 지정할지 여부를 제어합니다. í¬ë§·í„°ëŠ” 반드시 사용할 수 있어야 하며 문서ì—서 ë²”ìœ„ì˜ ì„œì‹ì„ 지정할 수 있어야 합니다.", "suggestOnTriggerCharacters": "트리거 문ìžë¥¼ 입력할 때 ì œì•ˆì„ ìžë™ìœ¼ë¡œ 표시할지 여부를 제어합니다.", - "acceptSuggestionOnEnter": "'Tab' 키 ì™¸ì— 'Enter' í‚¤ì— ëŒ€í•œ ì œì•ˆë„ í—ˆìš©í• ì§€ë¥¼ 제어합니다. 새 ì¤„ì„ ì‚½ìž…í•˜ëŠ” ë™ìž‘ê³¼ ì œì•ˆì„ í—ˆìš©í•˜ëŠ” ë™ìž‘ ê°„ì˜ ëª¨í˜¸í•¨ì„ ì—†ì•¨ 수 있습니다.", "acceptSuggestionOnCommitCharacter": "커밋 문ìžì— 대한 ì œì•ˆì„ í—ˆìš©í• ì§€ë¥¼ 제어합니다. 예를 들어 JavaScriptì—서는 세미콜론(';')ì´ ì œì•ˆì„ í—ˆìš©í•˜ê³  해당 문ìžë¥¼ 입력하는 커밋 문ìžì¼ 수 있습니다.", "snippetSuggestions": "코드 ì¡°ê°ì´ 다른 추천과 함께 표시ë˜ëŠ”ì§€ 여부 ë° ì •ë ¬ ë°©ë²•ì„ ì œì–´í•©ë‹ˆë‹¤.", "emptySelectionClipboard": "ì„ íƒ ì˜ì—­ ì—†ì´ í˜„ìž¬ 줄 복사 여부를 제어합니다.", diff --git a/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..4118aae2aa7 --- /dev/null +++ b/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "편집기 콘í…츠" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..eb7148607bd --- /dev/null +++ b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "'{0}'ì— ëŒ€í•œ ì •ì˜ë¥¼ ì°¾ì„ ìˆ˜ 없습니다.", + "generic.noResults": "ì •ì˜ë¥¼ ì°¾ì„ ìˆ˜ ì—†ìŒ", + "meta.title": "– {0} ì •ì˜", + "actions.goToDecl.label": "ì •ì˜ë¡œ ì´ë™", + "actions.goToDeclToSide.label": "측면ì—서 ì •ì˜ ì—´ê¸°", + "actions.previewDecl.label": "ì •ì˜ í”¼í‚¹(Peeking)", + "goToImplementation.noResultWord": "'{0}'ì— ëŒ€í•œ êµ¬í˜„ì„ ì°¾ì„ ìˆ˜ 없습니다.", + "goToImplementation.generic.noResults": "êµ¬í˜„ì„ ì°¾ì„ ìˆ˜ 없습니다.", + "meta.implementations.title": " – {0} ê°œ 구현", + "actions.goToImplementation.label": "구현으로 ì´ë™", + "actions.peekImplementation.label": "구현 미리 보기", + "goToTypeDefinition.noResultWord": "'{0}'ì— ëŒ€í•œ í˜•ì‹ ì •ì˜ë¥¼ ì°¾ì„ ìˆ˜ 없습니다.", + "goToTypeDefinition.generic.noResults": "í˜•ì‹ ì •ì˜ë¥¼ ì°¾ì„ ìˆ˜ 없습니다.", + "meta.typeDefinitions.title": "– {0} í˜•ì‹ ì •ì˜", + "actions.goToTypeDefinition.label": "í˜•ì‹ ì •ì˜ë¡œ ì´ë™", + "actions.peekTypeDefinition.label": "í˜•ì‹ ì •ì˜ ë¯¸ë¦¬ 보기" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..57b4929798f --- /dev/null +++ b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "{0}ê°œ ì •ì˜ë¥¼ 표시하려면 í´ë¦­í•˜ì„¸ìš”." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/kor/src/vs/editor/contrib/hover/browser/hover.i18n.json index f2f8c2fde82..af972da445a 100644 --- a/i18n/kor/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "가리키기 표시", - "hoverHighlight": "호버가 í‘œì‹œëœ ë‹¨ì–´ 아래를 ê°•ì¡° 표시합니다.", - "hoverBackground": "편집기 í˜¸ë²„ì˜ ë°°ê²½ìƒ‰.", - "hoverBorder": "편집기 í˜¸ë²„ì˜ í…Œë‘리 색입니다." + "showHover": "가리키기 표시" } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index a6baba2d6b1..2aeba994a61 100644 --- a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -4,6 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "aria.oneReference": "{2}ì—´, {1}줄, {0}ì˜ ê¸°í˜¸", + "aria.fileReferences.1": "{0}ì˜ ê¸°í˜¸ 1ê°œ", + "aria.fileReferences.N": "{1}ì˜ ê¸°í˜¸ {0}ê°œ", "aria.result.0": "ê²°ê³¼ ì—†ìŒ", "aria.result.1": "{0}ì—서 기호 1개를 찾았습니다.", "aria.result.n1": "{1}ì—서 기호 {0}개를 찾았습니다.", diff --git a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index 502c4b44ac9..d5cc24a60e7 100644 --- a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,8 +16,6 @@ "peekViewTitleInfoForeground": "Peek ë·° 제목 ì •ë³´ 색입니다.", "peekViewBorder": "Peek ë·° í…Œë‘리 ë° í™”ì‚´í‘œ 색입니다.", "peekViewResultsBackground": "Peek ë·° ê²°ê³¼ 목ë¡ì˜ 배경색입니다.", - "peekViewResultsMatchForeground": "Peek ë·° ê²°ê³¼ 목ë¡ì˜ ì¼ì¹˜ 항목 전경입니다.", - "peekViewResultsFileForeground": "Peek ë·° ê²°ê³¼ 목ë¡ì˜ íŒŒì¼ í•­ëª© 전경입니다.", "peekViewResultsSelectionBackground": "Peek ë·° ê²°ê³¼ 목ë¡ì—서 ì„ íƒëœ í•­ëª©ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", "peekViewResultsSelectionForeground": "Peek ë·° ê²°ê³¼ 목ë¡ì—서 ì„ íƒëœ í•­ëª©ì˜ ì „ê²½ìƒ‰ìž…ë‹ˆë‹¤.", "peekViewEditorBackground": "Peek ë·° íŽ¸ì§‘ê¸°ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", diff --git a/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 569bfddeb58..8f85109ab67 100644 --- a/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -6,10 +6,12 @@ { "editorSuggestWidgetBackground": "제안 ìœ„ì ¯ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", "editorSuggestWidgetBorder": "제안 ìœ„ì ¯ì˜ í…Œë‘리 색입니다.", + "editorSuggestWidgetForeground": "제안 ìœ„ì ¯ì˜ ì „ê²½ìƒ‰ìž…ë‹ˆë‹¤.", + "editorSuggestWidgetSelectedBackground": "제한 위젯ì—서 ì„ íƒëœ í•­ëª©ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", + "editorSuggestWidgetHighlightForeground": "제안 ìœ„ì ¯ì˜ ì¼ì¹˜ 항목 ê°•ì¡° 표시 색입니다.", "readMore": "ìžì„¸ížˆ 알아보기...{0}", "suggestionWithDetailsAriaLabel": "{0}, 제안, 세부 ì •ë³´ 있ìŒ", "suggestionAriaLabel": "{0}, 제안", - "goback": "뒤로 ì´ë™", "suggestWidget.loading": "로드 중...", "suggestWidget.noSuggestions": "제안 í•­ëª©ì´ ì—†ìŠµë‹ˆë‹¤.", "suggestionAriaAccepted": "{0}, 수ë½ë¨", diff --git a/i18n/kor/src/vs/platform/environment/node/argv.i18n.json b/i18n/kor/src/vs/platform/environment/node/argv.i18n.json index 5596f41cdd4..95f21567a73 100644 --- a/i18n/kor/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/kor/src/vs/platform/environment/node/argv.i18n.json @@ -20,6 +20,7 @@ "showVersions": "#NAME?", "installExtension": "í™•ìž¥ì„ ì„¤ì¹˜í•©ë‹ˆë‹¤.", "uninstallExtension": "í™•ìž¥ì„ ì œê±°í•©ë‹ˆë‹¤.", + "experimentalApis": "í™•ìž¥ì— ëŒ€í•´ ì œì•ˆëœ API ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤.", "disableExtensions": "ì„¤ì¹˜ëœ ëª¨ë“  í™•ìž¥ì„ ì‚¬ìš©í•˜ì§€ 않ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤.", "disableGPU": "GPU 하드웨어 ê°€ì†ì„ 사용하지 않ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤.", "version": "ë²„ì „ì„ ì¶œë ¥í•©ë‹ˆë‹¤.", diff --git a/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json index e2cb0557fbc..ff679b577b2 100644 --- a/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,6 @@ "ProblemMatcherParser.noValidIdentifier": "오류: 패턴 ì†ì„± {0}ì´(ê°€) 유효한 패턴 변수 ì´ë¦„ì´ ì•„ë‹™ë‹ˆë‹¤.", "ProblemMatcherParser.problemPattern.watchingMatcher": "문제 검사기ì—서 ê°ì‹œ 시작 패턴과 종료 íŒ¨í„´ì„ ëª¨ë‘ ì •ì˜í•´ì•¼ 합니다.", "ProblemMatcherParser.invalidRegexp": "오류: {0} 문ìžì—´ì€ 유효한 ì •ê·œì‹ì´ 아닙니다.\n", - "WatchingPatternSchema.regexp": "조사 ìž‘ì—…ì˜ ì‹œìž‘ ë˜ëŠ” ëì„ ê²€ìƒ‰í•˜ëŠ” ì •ê·œì‹ìž…니다.", "WatchingPatternSchema.file": "íŒŒì¼ ì´ë¦„ì˜ ì¼ì¹˜ 그룹 ì¸ë±ìФì´ë©° ìƒëžµí•  수 있습니다.", "PatternTypeSchema.name": "제공ë˜ê±°ë‚˜ 미리 ì •ì˜ëœ íŒ¨í„´ì˜ ì´ë¦„", "PatternTypeSchema.description": "문제 패턴 ë˜ëŠ” 제공ë˜ê±°ë‚˜ 미리 ì •ì˜ëœ 문제 íŒ¨í„´ì˜ ì´ë¦„입니다. ê¸°ë³¸ì´ ì§€ì •ëœ ê²½ìš° ìƒëžµí•  수 있습니다.", @@ -46,7 +45,6 @@ "ProblemMatcherSchema.watching.activeOnStart": "true로 설정한 경우 ìž‘ì—…ì´ ì‹œìž‘ë˜ë©´ ì„ íƒê¸°ê°€ 활성 모드로 전환ë©ë‹ˆë‹¤. ì´ëŠ” beginPatternê³¼ ì¼ì¹˜í•˜ëŠ” ì¤„ì„ ì‹¤í–‰í•˜ëŠ” 것과 같습니다.", "ProblemMatcherSchema.watching.beginsPattern": "ì¶œë ¥ì´ ì¼ì¹˜í•˜ëŠ” 경우 조사 ìž‘ì—…ì„ ì‹œìž‘í•  때 신호를 받습니다.", "ProblemMatcherSchema.watching.endsPattern": "ì¶œë ¥ì´ ì¼ì¹˜í•˜ëŠ” 경우 조사 ìž‘ì—…ì„ ëë‚  때 신호를 받습니다.", - "ProblemMatcherSchema.watching": "ê°ì‹œ íŒ¨í„´ì˜ ì‹œìž‘ê³¼ ëì„ ì¶”ì í•˜ëŠ” 패턴입니다.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "ì´ ì†ì„±ì€ 사용ë˜ì§€ 않습니다. 대신 ê°ì‹œ ì†ì„±ì„ 사용하세요.", "LegacyProblemMatcherSchema.watchedBegin": "íŒŒì¼ ê°ì‹œë¥¼ 통해 트리거ë˜ëŠ” ê°ì‹œë˜ëŠ” ìž‘ì—…ì´ ì‹œìž‘ë¨ì„ 나타내는 ì •ê·œì‹ìž…니다.", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "ì´ ì†ì„±ì€ 사용ë˜ì§€ 않습니다. 대신 ê°ì‹œ ì†ì„±ì„ 사용하세요.", diff --git a/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json index 20e43b0f760..4ff5446bc03 100644 --- a/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -4,26 +4,57 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "invalid.color": "ìž˜ëª»ëœ ìƒ‰ 형ì‹ìž…니다. #RGB, #RGBA, #RRGGBB ë˜ëŠ” #RRGGBBAA를 사용하세요.", "schema.colors": "워í¬ë²¤ì¹˜ì—서 사용ë˜ëŠ” 색입니다.", "foreground": "ì „ì²´ 전경색입니다. ì´ ìƒ‰ì€ êµ¬ì„± 요소ì—서 재정ì˜í•˜ì§€ ì•Šì€ ê²½ìš°ì—ë§Œ 사용ë©ë‹ˆë‹¤.", + "focusBorder": "í¬ì»¤ìŠ¤ê°€ 있는 ìš”ì†Œì˜ ì „ì²´ í…Œë‘리 색입니다. ì´ ìƒ‰ì€ êµ¬ì„± 요소ì—서 재정ì˜í•˜ì§€ ì•Šì€ ê²½ìš°ì—ë§Œ 사용ë©ë‹ˆë‹¤.", + "contrastBorder": "ë” ëšœë ·ì´ ëŒ€ë¹„ë˜ë„ë¡ ìš”ì†Œë¥¼ 다른 요소와 구분하는 요소 ì£¼ìœ„ì˜ ì¶”ê°€ í…Œë‘리입니다.", + "activeContrastBorder": "ë” ëšœë ·ì´ ëŒ€ë¹„ë˜ë„ë¡ ìš”ì†Œë¥¼ 다른 요소와 구분하는 활성 요소 ì£¼ìœ„ì˜ ì¶”ê°€ í…Œë‘리입니다.", + "widgetShadow": "편집기 ë‚´ì—서 찾기/바꾸기 ê°™ì€ ìœ„ì ¯ì˜ ê·¸ë¦¼ìž ìƒ‰ìž…ë‹ˆë‹¤.", "inputBoxBackground": "ìž…ë ¥ ìƒìž 배경입니다.", "inputBoxForeground": "ìž…ë ¥ ìƒìž 전경입니다.", "inputBoxBorder": "ìž…ë ¥ ìƒìž í…Œë‘리입니다.", "inputBoxActiveOptionBorder": "ìž…ë ¥ 필드ì—서 í™œì„±í™”ëœ ì˜µì…˜ì˜ í…Œë‘리 색입니다.", + "inputValidationInfoBackground": "ì •ë³´ 심ê°ë„ì˜ ìž…ë ¥ 유효성 검사 배경색입니다.", + "inputValidationInfoBorder": "ì •ë³´ 심ê°ë„ì˜ ìž…ë ¥ 유효성 검사 í…Œë‘리 색입니다.", + "inputValidationWarningBackground": "ì •ë³´ ê²½ê³ ì˜ ìž…ë ¥ 유효성 검사 배경색입니다.", + "inputValidationWarningBorder": "경고 심ê°ë„ì˜ ìž…ë ¥ 유효성 검사 í…Œë‘리 색입니다.", + "inputValidationErrorBackground": "오류 심ê°ë„ì˜ ìž…ë ¥ 유효성 검사 배경색입니다.", + "inputValidationErrorBorder": "오류 심ê°ë„ì˜ ìž…ë ¥ 유효성 검사 í…Œë‘리 색입니다.", "dropdownBackground": "드롭다운 배경입니다.", "dropdownForeground": "드롭다운 전경입니다.", "dropdownBorder": "드롭다운 í…Œë‘리입니다.", + "listFocusBackground": "목ë¡/트리가 활성 ìƒíƒœì¸ 경우 í¬ì»¤ìŠ¤ê°€ 있는 í•­ëª©ì˜ ëª©ë¡/트리 배경색입니다. 목ë¡/트리가 활성 ìƒíƒœì´ë©´ 키보드 í¬ì»¤ìŠ¤ë¥¼ 가지며, 비활성 ìƒíƒœì´ë©´ í¬ì»¤ìŠ¤ê°€ 없습니다.", + "listActiveSelectionBackground": "목ë¡/트리가 활성 ìƒíƒœì¸ 경우 ì„ íƒí•œ í•­ëª©ì˜ ëª©ë¡/트리 배경색입니다. 목ë¡/트리가 활성 ìƒíƒœì´ë©´ 키보드 í¬ì»¤ìŠ¤ë¥¼ 가지며, 비활성 ìƒíƒœì´ë©´ í¬ì»¤ìŠ¤ê°€ 없습니다.", + "listActiveSelectionForeground": "목ë¡/트리가 활성 ìƒíƒœì¸ 경우 ì„ íƒí•œ í•­ëª©ì˜ ëª©ë¡/트리 전경색입니다. 목ë¡/트리가 활성 ìƒíƒœì´ë©´ 키보드 í¬ì»¤ìŠ¤ë¥¼ 가지며, 비활성 ìƒíƒœì´ë©´ í¬ì»¤ìŠ¤ê°€ 없습니다.", + "listInactiveSelectionBackground": "목ë¡/트리가 비활성 ìƒíƒœì¸ 경우 ì„ íƒí•œ í•­ëª©ì˜ ëª©ë¡/트리 배경색입니다. 목ë¡/트리가 활성 ìƒíƒœì´ë©´ 키보드 í¬ì»¤ìŠ¤ë¥¼ 가지며, 비활성 ìƒíƒœì´ë©´ í¬ì»¤ìŠ¤ê°€ 없습니다.", + "listHoverBackground": "마우스로 í•­ëª©ì„ ê°€ë¦¬í‚¬ 때 목ë¡/트리 배경입니다.", + "listDropBackground": "마우스로 í•­ëª©ì„ ì´ë™í•  때 목ë¡/트리 ëŒì–´ì„œ 놓기 배경입니다.", + "highlight": "목ë¡/트리 ë‚´ì—서 검색할 때 ì¼ì¹˜ 항목 ê°•ì¡° í‘œì‹œì˜ ëª©ë¡/트리 전경색입니다.", "pickerGroupForeground": "그룹화 ë ˆì´ë¸”ì— ëŒ€í•œ 빠른 ì„ íƒê¸° 색입니다.", "pickerGroupBorder": "그룹화 í…Œë‘ë¦¬ì— ëŒ€í•œ 빠른 ì„ íƒê¸° 색입니다.", + "buttonForeground": "단추 기본 전경색입니다.", + "buttonBackground": "단추 배경색입니다.", + "buttonHoverBackground": "마우스로 가리킬 때 단추 배경색입니다.", + "scrollbarShadow": "스í¬ë¡¤ë˜ëŠ” 보기를 나타내는 스í¬ë¡¤ 막대 그림ìžìž…니다.", + "scrollbarSliderBackground": "슬ë¼ì´ë” 배경색입니다.", + "scrollbarSliderHoverBackground": "마우스로 가리킬 때 슬ë¼ì´ë” 배경색입니다.", + "scrollbarSliderActiveBackground": "활성 ìƒíƒœì¸ 경우 슬ë¼ì´ë” 배경색입니다.", "editorBackground": "편집기 배경색입니다.", "editorForeground": "편집기 기본 전경색입니다.", + "editorWidgetBackground": "찾기/바꾸기 ê°™ì€ íŽ¸ì§‘ê¸° ìœ„ì ¯ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", "editorSelection": "편집기 ì„ íƒ ì˜ì—­ì˜ 색입니다.", "editorInactiveSelection": "비활성 편집기 ì„ íƒ ì˜ì—­ì˜ 색입니다.", "editorSelectionHighlight": "ì„ íƒ ì˜ì—­ê³¼ ë™ì¼í•œ 콘í…츠가 있는 ì˜ì—­ì˜ 색입니다.", "editorFindMatch": "현재 검색 ì¼ì¹˜ í•­ëª©ì˜ ìƒ‰ìž…ë‹ˆë‹¤.", "findMatchHighlight": "기타 검색 ì¼ì¹˜ í•­ëª©ì˜ ìƒ‰ìž…ë‹ˆë‹¤.", "findRangeHighlight": "ê²€ìƒ‰ì„ ì œí•œí•˜ëŠ” ì˜ì—­ì˜ ìƒ‰ì„ ì§€ì •í•©ë‹ˆë‹¤.", + "hoverHighlight": "호버가 í‘œì‹œëœ ë‹¨ì–´ 아래를 ê°•ì¡° 표시합니다.", + "hoverBackground": "편집기 í˜¸ë²„ì˜ ë°°ê²½ìƒ‰.", + "hoverBorder": "편집기 í˜¸ë²„ì˜ í…Œë‘리 색입니다.", "activeLinkForeground": "활성 ë§í¬ì˜ 색입니다.", - "linkForeground": "ë§í¬ 색입니다.", - "editorWidgetBackground": "찾기/바꾸기 ê°™ì€ íŽ¸ì§‘ê¸° ìœ„ì ¯ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤." + "diffEditorInserted": "ì‚½ìž…ëœ í…ìŠ¤íŠ¸ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", + "diffEditorRemoved": "ì œê±°ëœ í…ìŠ¤íŠ¸ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", + "diffEditorInsertedOutline": "ì‚½ìž…ëœ í…ìŠ¤íŠ¸ì˜ ìœ¤ê³½ì„  색입니다.", + "diffEditorRemovedOutline": "ì œê±°ëœ í…ìŠ¤íŠ¸ì˜ ìœ¤ê³½ì„  색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..a0a766dacfd --- /dev/null +++ b/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "확장 {0}ì„(를) {1}(으)로 ë®ì–´ì“°ëŠ” 중입니다.", + "extensionUnderDevelopment": "{0}ì—서 개발 확장 로드 중" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..68f2beaa1e0 --- /dev/null +++ b/i18n/kor/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "닫기", + "cancel": "취소", + "ok": "확ì¸" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/node/extHostExplorerView.i18n.json b/i18n/kor/src/vs/workbench/api/node/extHostExplorerView.i18n.json new file mode 100644 index 00000000000..b5a93203559 --- /dev/null +++ b/i18n/kor/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.notRegistered": "IDê°€ '{0}'ì¸ ë“±ë¡ëœ TreeExplorerNodeProviderê°€ 없습니다.", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider '{0}'ì—서 루트 노드를 제공하지 못했습니다." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json index 46230055683..72443813473 100644 --- a/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,6 @@ "configureLocale": "언어 구성", "displayLanguage": "VSCodeì˜ í‘œì‹œ 언어를 ì •ì˜í•©ë‹ˆë‹¤.", "doc": "ì§€ì›ë˜ëŠ” 언어 목ë¡ì€ {0} ì„(를) 참조하세요.", - "restart": "ê°’ì„ ë³€ê²½í•˜ë ¤ë©´ VSCode를 다시 시작해야 합니다.", "fail.createSettings": "'{0}'({1})ì„(를) 만들 수 없습니다.", "JsonSchema.locale": "사용할 UI 언어입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/kor/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 92d7d86820f..66ca4a6169b 100644 --- a/i18n/kor/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "그룹ì—서 ìµœê·¼ì— ì‚¬ìš©í•œ ì´ì „ 편집기 열기", "openNextRecentlyUsedEditorInGroup": "그룹ì—서 ìµœê·¼ì— ì‚¬ìš©í•œ ë‹¤ìŒ íŽ¸ì§‘ê¸° 열기", "navigateEditorHistoryByInput": "기ë¡ì—서 ì´ì „ 편집기 열기", + "openNextRecentlyUsedEditor": "ìµœê·¼ì— ì‚¬ìš©í•œ ë‹¤ìŒ íŽ¸ì§‘ê¸° 열기", + "openPreviousRecentlyUsedEditor": "ìµœê·¼ì— ì‚¬ìš©í•œ ì´ì „ 편집기 열기", "clearEditorHistory": "편집기 ê¸°ë¡ ì§€ìš°ê¸°", "focusLastEditorInStack": "ê·¸ë£¹ì˜ ë§ˆì§€ë§‰ 편집기 열기", "moveEditorLeft": "왼쪽으로 편집기 ì´ë™", diff --git a/i18n/kor/src/vs/workbench/common/theme.i18n.json b/i18n/kor/src/vs/workbench/common/theme.i18n.json index 56bd399b45f..ca6f547f854 100644 --- a/i18n/kor/src/vs/workbench/common/theme.i18n.json +++ b/i18n/kor/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "탭 컨테ì´ë„ˆì˜ 배경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 ê·¸ë£¹ì— ì—¬ëŸ¬ íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", "tabActiveBackground": "활성 탭 배경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", "tabInactiveBackground": "비활성 탭 배경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", "tabBorder": "íƒ­ì„ ì„œë¡œ 구분하기 위한 í…Œë‘리입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 ê·¸ë£¹ì— ì—¬ëŸ¬ íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", "tabActiveEditorGroupActiveForeground": "활성 ê·¸ë£¹ì˜ í™œì„± 탭 전경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", - "tabActiveEditorGroupInactiveForeground": "비활성 ê·¸ë£¹ì˜ í™œì„± 탭 전경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", "tabInactiveEditorGroupActiveForeground": "활성 ê·¸ë£¹ì˜ ë¹„í™œì„± 탭 전경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", - "tabInactiveEditorGroupInactiveForeground": "비활성 ê·¸ë£¹ì˜ ë¹„í™œì„± 탭 전경색입니다. íƒ­ì€ íŽ¸ì§‘ê¸° ì˜ì—­ì—서 íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. 한 편집기 그룹ì—서 여러 íƒ­ì„ ì—´ 수 있습니다. 여러 편집기 ê·¸ë£¹ì´ ìžˆì„ ìˆ˜ 있습니다.", + "editorGroupBackground": "편집기 ê·¸ë£¹ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤. 편집기 ê·¸ë£¹ì€ íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다. ë°°ê²½ìƒ‰ì€ íŽ¸ì§‘ê¸° ê·¸ë£¹ì„ ëŒ ë•Œ 표시ë©ë‹ˆë‹¤.", + "editorGroupHeaderBackground": "íƒ­ì„ ì‚¬ìš©í•˜ì§€ 않ë„ë¡ ì„¤ì •í•œ 경우 편집기 그룹 제목 ë¨¸ë¦¬ê¸€ì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤. 편집기 ê·¸ë£¹ì€ íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다.", "editorGroupBorder": "여러 편집기 ê·¸ë£¹ì„ ì„œë¡œ 구분하기 위한 색입니다. 편집기 ê·¸ë£¹ì€ íŽ¸ì§‘ê¸°ì˜ ì»¨í…Œì´ë„ˆìž…니다.", - "editorDragAndDropBackground": "편집기를 ëŒì–´ì˜¬ ë•Œì˜ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤.", "panelBackground": "íŒ¨ë„ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤. 패ë„ì€ íŽ¸ì§‘ê¸° ì˜ì—­ ì•„ëž˜ì— í‘œì‹œë˜ë©° 출력 ë° í†µí•© í„°ë¯¸ë„ ê°™ì€ ë³´ê¸°ê°€ í¬í•¨ë©ë‹ˆë‹¤.", "panelBorder": "편집기와 구분ë˜ëŠ” 맨 ìœ„ì˜ íŒ¨ë„ í…Œë‘리 색입니다. 패ë„ì€ íŽ¸ì§‘ê¸° ì˜ì—­ ì•„ëž˜ì— í‘œì‹œë˜ë©° 출력 ë° í†µí•© í„°ë¯¸ë„ ê°™ì€ ë³´ê¸°ê°€ í¬í•¨ë©ë‹ˆë‹¤.", "panelActiveTitleForeground": "활성 패ë„ì˜ ì œëª© 색입니다. 패ë„ì€ íŽ¸ì§‘ê¸° ì˜ì—­ ì•„ëž˜ì— í‘œì‹œë˜ë©° 출력 ë° í†µí•© í„°ë¯¸ë„ ê°™ì€ ë³´ê¸°ê°€ í¬í•¨ë©ë‹ˆë‹¤.", @@ -24,15 +22,19 @@ "statusBarNoFolderBackground": "í´ë”ê°€ 열리지 ì•Šì•˜ì„ ë•Œì˜ ìƒíƒœ 표시줄 배경색입니다. ìƒíƒœ í‘œì‹œì¤„ì€ ì°½ì˜ ë§¨ ì•„ëž˜ì— í‘œì‹œë©ë‹ˆë‹¤.", "statusBarItemActiveBackground": "í´ë¦­í•  ë•Œì˜ ìƒíƒœ 표시줄 항목 배경색입니다. ìƒíƒœ í‘œì‹œì¤„ì€ ì°½ì˜ ë§¨ ì•„ëž˜ì— í‘œì‹œë©ë‹ˆë‹¤.", "statusBarItemHoverBackground": "마우스로 가리킬 ë•Œì˜ ìƒíƒœ 표시줄 항목 배경색입니다. ìƒíƒœ í‘œì‹œì¤„ì€ ì°½ì˜ ë§¨ ì•„ëž˜ì— í‘œì‹œë©ë‹ˆë‹¤.", + "statusBarProminentItemBackground": "ìƒíƒœ 표시줄 주요 항목 배경색입니다. 주요 í•­ëª©ì€ ì¤‘ìš”ë„를 나타내는 다른 ìƒíƒœ 표시줄 항목보다 ëˆˆì— ìž˜ ë•니다. ìƒíƒœ í‘œì‹œì¤„ì€ ì°½ì˜ ë§¨ ì•„ëž˜ì— í‘œì‹œë©ë‹ˆë‹¤.", + "statusBarProminentItemHoverBackground": "마우스로 가리킬 ë•Œì˜ ìƒíƒœ 표시줄 주요 항목 배경색입니다. 주요 í•­ëª©ì€ ì¤‘ìš”ë„를를 나타내는 다른 ìƒíƒœ 표시줄 항목보다 ëˆˆì— ìž˜ ë•니다. ìƒíƒœ í‘œì‹œì¤„ì€ ì°½ì˜ ë§¨ ì•„ëž˜ì— í‘œì‹œë©ë‹ˆë‹¤.", "activityBarBackground": "작업 막대 배경색입니다. 작업 막대는 맨 왼쪽ì´ë‚˜ ì˜¤ë¥¸ìª½ì— í‘œì‹œë˜ë©° 사ì´ë“œë°”ì˜ ë·° ê°„ì„ ì „í™˜í•˜ëŠ” ë° ì‚¬ìš©í•  수 있습니다.", "activityBarForeground": "작업 막대 ì „ê²½ 색(예: ì•„ì´ì½˜ì— 사용ë¨)입니다. 작업 막대는 오른쪽ì´ë‚˜ 왼쪽 ëì— í‘œì‹œë˜ë©° 사ì´ë“œë°”ì˜ ë³´ê¸° ê°„ì„ ì „í™˜í•  수 있습니다.", - "activityBarDragAndDropBackground": "작업 막대 í•­ëª©ì˜ ëŒì–´ì„œ 놓기 피드백 색입니다. 작업 막대는 왼쪽ì´ë‚˜ 오른쪽 ëì— í‘œì‹œë˜ë©° 사ì´ë“œë°”ì˜ ë³´ê¸°ë¥¼ 전환할 수 있습니다.", "activityBarBadgeBackground": "í™œë™ ì•Œë¦¼ ë°°ì§€ 배경색입니다. 작업 막대는 왼쪽ì´ë‚˜ 오른쪽 ëì— í‘œì‹œë˜ë©° 사ì´ë“œë°”ì˜ ë³´ê¸°ë¥¼ 전환할 수 있습니다.", "activityBarBadgeForeground": "í™œë™ ì•Œë¦¼ ë°°ì§€ 전경색입니다. 작업 막대는 왼쪽ì´ë‚˜ 오른쪽 ëì— í‘œì‹œë˜ë©° 사ì´ë“œë°”ì˜ ë³´ê¸°ë¥¼ 전환할 수 있습니다.", "sideBarBackground": "사ì´ë“œë°” 배경색입니다. 사ì´ë“œë°”는 íƒìƒ‰ê¸° ë° ê²€ìƒ‰ê³¼ ê°™ì€ ë·°ì˜ ì»¨í…Œì´ë„ˆìž…니다.", "sideBarTitleForeground": "사ì´ë“œë°” 제목 전경색입니다. 사ì´ë“œë°”는 íƒìƒ‰ê¸° ë° ê²€ìƒ‰ê³¼ ê°™ì€ ë·°ì˜ ì»¨í…Œì´ë„ˆìž…니다.", + "sideBarSectionHeaderBackground": "사ì´ë“œë°” 섹션 í—¤ë” ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤. 사ì´ë“œë°”는 íƒìƒ‰ê¸° ë° ê²€ìƒ‰ê³¼ ê°™ì€ ë·°ì˜ ì»¨í…Œì´ë„ˆìž…니다.", "titleBarActiveForeground": "ì°½ì´ í™œì„±í™”ëœ ê²½ìš°ì˜ ì œëª© 표시줄 전경입니다. ì´ ìƒ‰ì€ í˜„ìž¬ macOSì—서만 ì§€ì›ë©ë‹ˆë‹¤.", "titleBarInactiveForeground": "ì°½ì´ ë¹„í™œì„±í™”ëœ ê²½ìš°ì˜ ì œëª© 표시줄 전경입니다. ì´ ìƒ‰ì€ í˜„ìž¬ macOSì—서만 ì§€ì›ë©ë‹ˆë‹¤.", "titleBarActiveBackground": "ì°½ì„ í™œì„±í™”í•  ë•Œì˜ ì œëª© 표시줄 전경입니다. ì´ ìƒ‰ì€ í˜„ìž¬ macOSì—서만 ì§€ì›ë©ë‹ˆë‹¤.", - "titleBarInactiveBackground": "ì°½ì´ ë¹„í™œì„±í™”ëœ ê²½ìš°ì˜ ì œëª© 표시줄 배경입니다. ì´ ìƒ‰ì€ í˜„ìž¬ macOSì—서만 ì§€ì›ë©ë‹ˆë‹¤." + "titleBarInactiveBackground": "ì°½ì´ ë¹„í™œì„±í™”ëœ ê²½ìš°ì˜ ì œëª© 표시줄 배경입니다. ì´ ìƒ‰ì€ í˜„ìž¬ macOSì—서만 ì§€ì›ë©ë‹ˆë‹¤.", + "notificationsForeground": "알림 전경색입니다. ì•Œë¦¼ì€ ì°½ì˜ ìœ„ìª½ì— í‘œì‹œë©ë‹ˆë‹¤.", + "notificationsBackground": "알림 배경색입니다. ì•Œë¦¼ì€ ì°½ì˜ ìœ„ìª½ì— í‘œì‹œë©ë‹ˆë‹¤." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json index ca403839f42..4c30f4bc75c 100644 --- a/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "보기", "help": "ë„움ë§", "file": "파ì¼", + "developer": "개발ìž", "showEditorTabs": "ì—´ë ¤ 있는 편집기를 탭ì—서 표시할지 여부를 제어합니다.", "editorTabCloseButton": "íŽ¸ì§‘ê¸°ì˜ íƒ­ 닫기 ë‹¨ì¶”ì˜ ìœ„ì¹˜ë¥¼ 제어하거나 'off'로 ì„¤ì •ëœ ê²½ìš° ì´ ë‹¨ì¶”ë¥¼ 사용하지 않ë„ë¡ ì„¤ì •í•©ë‹ˆë‹¤.", "showIcons": "열린 편집기를 ì•„ì´ì½˜ê³¼ 함께 표시할지 여부를 제어합니다. ì´ë¥¼ 위해서는 ì•„ì´ì½˜ í…Œë§ˆë„ ì‚¬ìš©í•˜ë„ë¡ ì„¤ì •í•´ì•¼ 합니다.", @@ -41,7 +42,6 @@ "window.newWindowDimensions.inherit": "마지막 활성 창과 ë™ì¼í•œ í¬ê¸°ë¡œ 새 ì°½ì„ ì—½ë‹ˆë‹¤.", "window.newWindowDimensions.maximized": "ìµœëŒ€í™”ëœ ìƒˆ ì°½ì„ ì—½ë‹ˆë‹¤.", "window.newWindowDimensions.fullscreen": "ì „ì²´ 화면 모드ì—서 새 ì°½ì„ ì—½ë‹ˆë‹¤.", - "newWindowDimensions": "새 ì°½ì„ ì—´ 때 í¬ê¸°ë¥¼ 제어합니다. 기본ì ìœ¼ë¡œ 새 ì°½ì€ í™”ë©´ 가운ë°ì— ìž‘ì€ í¬ê¸°ë¡œ 열립니다. 'inherit'으로 설정할 경우 마지막 활성 창과 ë™ì¼í•œ í¬ê¸°ë¡œ ì°½ì´ ì—´ë¦½ë‹ˆë‹¤. 'maximized'로 설정할 경우 ì°½ì´ ìµœëŒ€í™”ë˜ì–´ 열리고 'fullscreen'으로 구성할 경우 ì „ì²´ 화면으로 열립니다.", "window.menuBarVisibility.default": "메뉴가 ì „ì²´ 화면 모드ì—서만 숨겨집니다.", "window.menuBarVisibility.visible": "메뉴가 ì „ì²´ 화면 모드ì—ì„œë„ í•­ìƒ í‘œì‹œë©ë‹ˆë‹¤.", "window.menuBarVisibility.toggle": "메뉴가 숨겨져 있지만 키를 통해 메뉴를 표시할 수 있습니다.", diff --git a/i18n/kor/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/shell.i18n.json index 1233e0b9ff8..79ac1b1fdaa 100644 --- a/i18n/kor/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/kor/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "Code를 '루트'로 실행하지 않는 ê²ƒì´ ì¢‹ìŠµë‹ˆë‹¤.", - "prof.message": "í”„ë¡œí•„ì„ ë§Œë“¤ì—ˆìŠµë‹ˆë‹¤.", - "prof.detail": "문제를 ë°œìƒì‹œí‚¤ê³  ë‹¤ìŒ íŒŒì¼ì„ 수ë™ìœ¼ë¡œ 첨부하세요.\n{0}", - "prof.restartAndFileIssue": "문제 만들기 ë° ë‹¤ì‹œ 시작", - "prof.restart": "다시 시작" + "runningAsRoot": "Code를 '루트'로 실행하지 않는 ê²ƒì´ ì¢‹ìŠµë‹ˆë‹¤." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/electron-browser/window.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/window.i18n.json index 05bb1370294..a185383bf4c 100644 --- a/i18n/kor/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/kor/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "붙여넣기", "selectAll": "ëª¨ë‘ ì„ íƒ", "confirmOpen": "{0}ê°œì˜ í´ë”를 여시겠습니까?", - "confirmOpenButton": "열기(&&O)", - "developer": "개발ìž", - "file": "파ì¼" + "confirmOpenButton": "열기(&&O)" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..e7e7cdc921d 100644 --- a/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "개발ìž: 키 매핑 검사" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index c3b7509d8a4..60f3a207808 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "ì¤‘ë‹¨ì  íŽ¸ì§‘...", "setValue": "ê°’ 설정", "addWatchExpression": "ì‹ ì¶”ê°€", + "editWatchExpression": "ì‹ íŽ¸ì§‘", "addToWatchExpressions": "조사ì‹ì— 추가", "removeWatchExpression": "ì‹ ì œê±°", "removeAllWatchExpressions": "모든 ì‹ ì œê±°", diff --git a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..e3166a31b49 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "디버그 ë„구 ëª¨ìŒ ë°°ê²½ìƒ‰ìž…ë‹ˆë‹¤." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..f69056da38c --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "í´ë¦­í•˜ì—¬ ì´ë™(측면ì—서 열려면 Cmd 키를 누르고 í´ë¦­)", + "fileLink": "í´ë¦­í•˜ì—¬ ì´ë™(측면ì—서 열려면 Ctrl 키를 누르고 í´ë¦­)" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..1fd1591aa39 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "ë‚´ë¶€ 디버그 ì½˜ì†”ì˜ ë™ìž‘ì„ ì œì–´í•©ë‹ˆë‹¤." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 8145efa9749..9c417b8c7dd 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "개체 ìƒíƒœëŠ” 첫 번재 í‰ê°€ì—서 캡처ë©ë‹ˆë‹¤.", - "fileLinkMac": "í´ë¦­í•˜ì—¬ ì´ë™(측면ì—서 열려면 Cmd 키를 누르고 í´ë¦­)", - "fileLink": "í´ë¦­í•˜ì—¬ ì´ë™(측면ì—서 열려면 Ctrl 키를 누르고 í´ë¦­)", "replVariableAriaLabel": "{0} ë³€ìˆ˜ì— {1} ê°’ì´ ìžˆìŠµë‹ˆë‹¤. ì½ê¸° í‰ê°€ ì¸ì‡„ 루프, 디버그", "replExpressionAriaLabel": "{0} ì‹ì— {1} ê°’ì´ ìžˆìŠµë‹ˆë‹¤. ì½ê¸° í‰ê°€ ì¸ì‡„ 루프, 디버그", "replValueOutputAriaLabel": "{0}, ì½ê¸° í‰ê°€ ì¸ì‡„ 루프, 디버그", diff --git a/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index cdf01baf557..fb59d091ab9 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "구성 형ì‹ì„ 요청합니다. \"시작\" ë˜ëŠ” \"ì—°ê²°\"ì¼ ìˆ˜ 있습니다.", "debugServer": "디버그 확장 ë°°í¬ ì „ìš©ìž…ë‹ˆë‹¤. í¬íŠ¸ê°€ ì§€ì •ëœ ê²½ìš° VS Codeì—서는 서버 모드로 실행하는 디버그 ì–´ëŒ‘í„°ì— ì—°ê²°ì„ ì‹œë„합니다.", "debugPrelaunchTask": "디버그 ì„¸ì…˜ì´ ì‹œìž‘ë˜ê¸° ì´ì „ì— ì‹¤í–‰í•  작업입니다.", - "internalConsoleOptions": "ë‚´ë¶€ 디버그 ì½˜ì†”ì˜ ë™ìž‘ì„ ì œì–´í•©ë‹ˆë‹¤.", "debugWindowsConfiguration": "Windows 특정 시작 구성 특성입니다.", "debugOSXConfiguration": "OS X 특정 시작 구성 특성입니다.", "debugLinuxConfiguration": "Linux 특정 시작 구성 특성입니다.", diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..82d5698f1e0 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: 균형있게(안쪽으로)", + "balanceOutward": "Emmet: 균형있게(바깥쪽으로)" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..739aa4ea537 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: ì´ì „ 편집 ì ", + "nextEditPoint": "Emmet: ë‹¤ìŒ íŽ¸ì§‘ ì " +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..5323baf8c08 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: 수학 ì‹ í‰ê°€" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..15be0c84d97 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: 약어 확장" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..2255914bed5 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: 0.1 ì¦ê°€", + "incrementNumberByOne": "Emmet: 1 ì¦ê°€", + "incrementNumberByTen": "Emmet: 10 ì¦ê°€", + "decrementNumberByOneTenth": "Emmet: 0.1 ê°ì†Œ", + "decrementNumberByOne": "Emmet: 1 ê°ì†Œ", + "decrementNumberByTen": "Emmet: 10 ê°ì†Œ" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..83a77e69884 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: ì¼ì¹˜í•˜ëŠ” ìŒìœ¼ë¡œ ì´ë™" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..161537077b5 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: 줄 병합" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..9de599d6dbe --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: CSS ê°’ ë°˜ì˜" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..d694fdaa5d8 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: 태그 제거" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..ce90cf1c917 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: ì´ì „ 항목 ì„ íƒ", + "selectNextItem": "Emmet: ë‹¤ìŒ í•­ëª© ì„ íƒ" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..d700fca47b3 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: 태그 ë¶„í• /ì¡°ì¸" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..47d9fb34230 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: ì£¼ì„ ì„¤ì •/í•´ì œ" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..4cf87429ced --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: ì´ë¯¸ì§€ í¬ê¸° ì—…ë°ì´íЏ" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..00369305a07 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: 태그 ì—…ë°ì´íЏ", + "enterTag": "태그 ìž…ë ¥", + "tag": "태그" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..d86b2ec66c0 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: 약어로 래핑", + "enterAbbreviation": "약어 ìž…ë ¥", + "abbreviation": "약어" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..b4ba4df288c --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "사용하ë„ë¡ ì„¤ì •í•˜ë©´ emmet 약어는 키를 ëˆŒë €ì„ ë•Œ 확장ë©ë‹ˆë‹¤.", + "emmetPreferences": "Emmetì˜ ì¼ë¶€ 작업 ë° í•´ê²° í”„ë¡œê·¸ëž¨ì˜ ë™ìž‘ì„ ìˆ˜ì •í•˜ëŠ” ë° ì‚¬ìš©ë˜ëŠ” 기본 설정입니다.", + "emmetSyntaxProfiles": "ì§€ì •ëœ êµ¬ë¬¸ì— ëŒ€í•œ í”„ë¡œí•„ì„ ì •ì˜í•˜ê±°ë‚˜ 특정 ê·œì¹™ì´ í¬í•¨ëœ 고유한 í”„ë¡œí•„ì„ ì‚¬ìš©í•˜ì„¸ìš”.", + "emmetExclude": "Emmet 약어를 확장하면 안 ë˜ëŠ” ì–¸ì–´ì˜ ë°°ì—´ìž…ë‹ˆë‹¤.", + "emmetExtensionsPath": "Emmet 프로필, 코드 ì¡°ê° ë° ê¸°ë³¸ ì„¤ì •ì´ í¬í•¨ëœ í´ë”ì˜ ê²½ë¡œ" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index f4bb6b4c431..1d9370c72b0 100644 --- a/i18n/kor/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "ì‚¬ìš©ìž ì§€ì • 뷰를 ì ìš©í•©ë‹ˆë‹¤.", + "vscode.extension.contributes.view.id": "vscode.workspace.createTreeView를 통해 만든 뷰를 ì‹ë³„하는 ë° ì‚¬ìš©ëœ ê³ ìœ  ID", + "vscode.extension.contributes.view.label": "뷰를 ë Œë”ë§í•˜ëŠ” ë° ì‚¬ìš©ë˜ëŠ” ì‚¬ëžŒì´ ì½ì„ 수 있는 문ìžì—´", + "vscode.extension.contributes.view.icon": "ë·° ì•„ì´ì½˜ì˜ 경로", + "vscode.extension.contributes.views": "ì‚¬ìš©ìž ì§€ì • 뷰를 ì ìš©í•©ë‹ˆë‹¤.", "showViewlet": "{0} 표시", "view": "보기" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 76bb8574a7e..84dc72bd8eb 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -8,5 +8,7 @@ "showRecommendations": "권장 사항 표시", "neverShowAgain": "다시 표시 안 함", "close": "닫기", - "workspaceRecommended": "ì´ ìž‘ì—… ì˜ì—­ì— 확장 권장 ì‚¬í•­ì´ ìžˆìŠµë‹ˆë‹¤." + "workspaceRecommended": "ì´ ìž‘ì—… ì˜ì—­ì— 확장 권장 ì‚¬í•­ì´ ìžˆìŠµë‹ˆë‹¤.", + "no": "아니요", + "cancel": "취소" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..77a77543915 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "예", + "no": "아니요", + "uninstall": "제거", + "later": "나중ì—" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index aafef40ec7e..fe8ef9500ce 100644 --- a/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "파ì¼ê³¼ ì–¸ì–´ì˜ ì—°ê²°ì„ êµ¬ì„±í•˜ì„¸ìš”(예: \"*.extension\": \"html\"). ì´ëŸ¬í•œ êµ¬ì„±ì€ ì„¤ì¹˜ëœ ì–¸ì–´ì˜ ê¸°ë³¸ 연결보다 ìš°ì„  순위가 높습니다.", "encoding": "파ì¼ì„ ì½ê³  쓸 때 사용할 기본 ë¬¸ìž ì§‘í•© ì¸ì½”딩입니다.", "autoGuessEncoding": "사용하ë„ë¡ ì„¤ì •í•˜ëŠ” 경우 파ì¼ì„ ì—´ 때 ë¬¸ìž ì§‘í•© ì¸ì½”ë”©ì„ ì¶”ì¸¡í•©ë‹ˆë‹¤.", - "eol": "줄 바꿈 문ìžì˜ 기본 ë입니다.", "trimTrailingWhitespace": "사용하ë„ë¡ ì„¤ì •ë˜ë©´ 파ì¼ì„ 저장할 때 후행 ê³µë°±ì´ ìž˜ë¦½ë‹ˆë‹¤.", "insertFinalNewline": "사용하ë„ë¡ ì„¤ì •ë˜ë©´ 저장할 때 íŒŒì¼ ëì— ë§ˆì§€ë§‰ ì¤„ë°”ê¿ˆì„ ì‚½ìž…í•©ë‹ˆë‹¤.", "files.autoSave.off": "ë”í‹° 파ì¼ì´ ìžë™ìœ¼ë¡œ 저장ë˜ì§€ 않습니다.", @@ -27,8 +26,6 @@ "autoSaveDelay": "ë”í‹° 파ì¼ì„ ìžë™ìœ¼ë¡œ 저장할 ë•Œê¹Œì§€ì˜ ì§€ì—°(밀리초)ì„ ì œì–´í•©ë‹ˆë‹¤. 'files.autoSave'를 '{0}'(으)로 설정한 경우ì—ë§Œ ì ìš©ë©ë‹ˆë‹¤.", "watcherExclude": "íŒŒì¼ ê°ì‹œì—서 제외할 íŒŒì¼ ê²½ë¡œì˜ GLOB íŒ¨í„´ì„ êµ¬ì„±í•˜ì„¸ìš”. ì´ ì„¤ì •ì„ ë³€ê²½í•˜ë ¤ë©´ 다시 시작해야 합니다. 시작 시 Codeì—서 CPU ì‹œê°„ì„ ë§Žì´ ì°¨ì§€í•˜ë©´ 대용량 í´ë”를 제외하여 초기 로드를 ì¤„ì¼ ìˆ˜ 있습니다.", "hotExit.off": "í•« 종료를 사용하지 않습니다.", - "hotExit.onExit": "í•« 종료는 ì‘ìš© í”„ë¡œê·¸ëž¨ì„ ë‹«ì„ ë•Œ 트리거ë©ë‹ˆë‹¤. 즉 Windows/Linuxì—서 마지막 ì°½ì„ ë‹«ì„ ë•Œë‚˜ workbench.action.quit ëª…ë ¹ì´ íŠ¸ë¦¬ê±°ë  ë•Œ(명령 팔레트, 키 ë°”ì¸ë”©, 메뉴)입니다. ë‹¤ìŒ ì‹¤í–‰ 시 ë°±ì—…ì„ í¬í•¨í•œ 모든 ì°½ì´ ë³µì›ë©ë‹ˆë‹¤.", - "hotExit.onExitAndWindowClose": "í•« 종료는 ì‘ìš© í”„ë¡œê·¸ëž¨ì„ ë‹«ì„ ë•Œ 트리거ë©ë‹ˆë‹¤. 즉 Windows/Linuxì—서 마지막 ì°½ì„ ë‹«ì„ ë•Œë‚˜ workbench.action.quit ëª…ë ¹ì´ íŠ¸ë¦¬ê±°ë  ë•Œ(명령 팔레트, 키 ë°”ì¸ë”©, 메뉴), ë˜í•œ 마지막 ì°½ì¸ì§€ ì—¬ë¶€ì— ìƒê´€ì—†ì´ í´ë”ê°€ 열린 모든 ì°½ì˜ ê²½ìš°ìž…ë‹ˆë‹¤. 열린 í´ë”ê°€ 없는 모든 ì°½ì€ ë‹¤ìŒ ì‹¤í–‰ 시 ë³µì›ë©ë‹ˆë‹¤. 종료ë˜ê¸° ì „ì— í´ë” ì°½ì„ ë³µì›í•˜ë ¤ë©´ \"window.reopenFolders\"를 \"all\"로 설정합니다.", "hotExit": "저장하지 ì•Šì€ íŒŒì¼ì„ 세션 ê°„ì— ê¸°ì–µí•˜ì—¬, 편집기를 종료할 때 저장할지 묻는 메시지를 건너뛸지 여부를 제어합니다.", "defaultLanguage": "새 파ì¼ì— 할당ë˜ëŠ” 기본 언어 모드입니다.", "editorConfigurationTitle": "편집기", diff --git a/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 4b931297269..ef1cdc9bc09 100644 --- a/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "ëŠë¦° 시작 ê°ì§€ë¨", - "slow.detail": "방금 ëŠë¦¬ê²Œ 시작ë˜ì—ˆìŠµë‹ˆë‹¤. 프로파ì¼ë§ì„ 사용하ë„ë¡ ì„¤ì •í•œ ìƒíƒœë¡œ '{0}'ì„(를) 다시 시작하세요. í”„ë¡œí•„ì„ ê³µìœ í•´ 주시면 다시 빠르게 ì‹œìž‘ë  ìˆ˜ 있ë„ë¡ ìµœì„ ì„ ë‹¤í•˜ê² ìŠµë‹ˆë‹¤." + "slow.detail": "방금 ëŠë¦¬ê²Œ 시작ë˜ì—ˆìŠµë‹ˆë‹¤. 프로파ì¼ë§ì„ 사용하ë„ë¡ ì„¤ì •í•œ ìƒíƒœë¡œ '{0}'ì„(를) 다시 시작하세요. í”„ë¡œí•„ì„ ê³µìœ í•´ 주시면 다시 빠르게 ì‹œìž‘ë  ìˆ˜ 있ë„ë¡ ìµœì„ ì„ ë‹¤í•˜ê² ìŠµë‹ˆë‹¤.", + "prof.message": "í”„ë¡œí•„ì„ ë§Œë“¤ì—ˆìŠµë‹ˆë‹¤.", + "prof.detail": "문제를 ë°œìƒì‹œí‚¤ê³  ë‹¤ìŒ íŒŒì¼ì„ 수ë™ìœ¼ë¡œ 첨부하세요.\n{0}", + "prof.restartAndFileIssue": "문제 만들기 ë° ë‹¤ì‹œ 시작", + "prof.restart": "다시 시작" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index d8fa05234c4..474bdeb6edf 100644 --- a/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "ì‚¬ìš©ìž ì„¤ì • 열기", "openGlobalKeybindings": "바로 가기 키 열기", + "openGlobalKeybindingsFile": "바로 가기 키 íŒŒì¼ ì—´ê¸°", "openWorkspaceSettings": "작업 ì˜ì—­ 설정 열기", "configureLanguageBasedSettings": "언어별 설정 구성...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index 50e19120bf9..5346ff5c5cf 100644 --- a/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "ì¼ì¹˜í•˜ëŠ” {0}ê°œ í•­ëª©ì„ ì°¾ìŒ", "searchMatch": "ì¼ì¹˜í•˜ëŠ” {0}ê°œ í•­ëª©ì„ ì°¾ìŒ", - "fileMatchAriaLabel": "{2} í´ë”ì˜ {1} 파ì¼ì— {0}ê°œì˜ ì¼ì¹˜ í•­ëª©ì´ ìžˆìŒ, 검색 ê²°ê³¼", - "replacePreviewResultAria": "미리 보기 바꾸기 ê²°ê³¼, {0}", - "searchResultAria": "{0}, 검색 ê²°ê³¼" + "fileMatchAriaLabel": "{2} í´ë”ì˜ {1} 파ì¼ì— {0}ê°œì˜ ì¼ì¹˜ í•­ëª©ì´ ìžˆìŒ, 검색 ê²°ê³¼" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 61ec0a4e8b1..0417fe610ad 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, 작업", "tasksAriaLabel": "다시 시작할 작업 ì´ë¦„ ìž…ë ¥", "noTasksMatching": "ì¼ì¹˜í•˜ëŠ” 작업 ì—†ìŒ", "noTasksFound": "다시 시작할 ìž‘ì—…ì´ ì—†ìŠµë‹ˆë‹¤." diff --git a/i18n/kor/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 63feb95524e..e3f31c9106d 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, 작업", "tasksAriaLabel": "실행할 ìž‘ì—…ì˜ ì´ë¦„ ìž…ë ¥", "noTasksMatching": "ì¼ì¹˜í•˜ëŠ” 작업 ì—†ìŒ", "noTasksFound": "ìž‘ì—…ì„ ì°¾ì„ ìˆ˜ ì—†ìŒ" diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 660da9b820c..4e1c891e83f 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Task Runner ì„ íƒ", "ConfigureTaskRunnerAction.autoDetecting": "{0} ìž‘ì—…ì„ ìžë™ 검색 중", "ConfigureTaskRunnerAction.autoDetect": "작업 ì‹œìŠ¤í…œì„ ìžë™ìœ¼ë¡œ ê°ì§€í•˜ì§€ 못했습니다. 기본 í…œí”Œë¦¿ì„ ì‚¬ìš©í•˜ëŠ” 중입니다. ìžì„¸í•œ ë‚´ìš©ì€ ìž‘ì—… ì¶œë ¥ì„ ì°¸ì¡°í•˜ì„¸ìš”.", + "ConfigureTaskRunnerAction.autoDetectError": "작업 ì‹œìŠ¤í…œì„ ìžë™ìœ¼ë¡œ ê°ì§€í•˜ëŠ” 중 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. ìžì„¸í•œ ë‚´ìš©ì€ ìž‘ì—… ì¶œë ¥ì„ ì°¸ì¡°í•˜ì„¸ìš”.", "ConfigureTaskRunnerAction.failed": "'.vscode' í´ë” ë‚´ì— 'tasks.json' 파ì¼ì„ 만들 수 없습니다. ìžì„¸í•œ ë‚´ìš©ì€ ìž‘ì—… ì¶œë ¥ì„ ì°¸ì¡°í•˜ì„¸ìš”.", "ConfigureTaskRunnerAction.label": "Task Runner 구성", "ConfigureBuildTaskAction.label": "빌드 작업 구성", @@ -17,7 +18,6 @@ "problems": "문제", "manyMarkers": "99+", "tasks": "작업", - "TaskSystem.noHotSwap": "작업 실행 ì—”ì§„ì„ ë³€ê²½í•˜ë©´ VS Code를 다시 시작해야 합니다. ë³€ê²½ì´ ë¬´ì‹œë©ë‹ˆë‹¤.", "TaskService.noBuildTask": "ì •ì˜ëœ 빌드 ìž‘ì—…ì´ ì—†ìŠµë‹ˆë‹¤. tasks.json 파ì¼ì—서 ìž‘ì—…ì„ 'isBuildCommand'로 표시하세요.", "TaskService.noTestTask": "ì •ì˜ëœ 테스트 ìž‘ì—…ì´ ì—†ìŠµë‹ˆë‹¤. tasks.json 파ì¼ì—서 ìž‘ì—…ì„ 'isTestCommand'로 표시하세요.", "TaskServer.noTask": "실행하ë„ë¡ ìš”ì²­í•œ 작업 {0}ì„(를) ì°¾ì„ ìˆ˜ 없습니다.", diff --git a/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index e9cc7e8122e..25cf1e96203 100644 --- a/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,13 @@ { "selectTheme.label": "색 테마", "installColorThemes": "추가 색 테마 설치...", - "problemChangingTheme": "테마를 설정하는 ë™ì•ˆ 문제 ë°œìƒ: {0}", - "themes.selectTheme": "색 테마 ì„ íƒ", "selectIconTheme.label": "íŒŒì¼ ì•„ì´ì½˜ 테마", "installIconThemes": "추가 íŒŒì¼ ì•„ì´ì½˜ 테마 설치...", "noIconThemeLabel": "ì—†ìŒ", "noIconThemeDesc": "íŒŒì¼ ì•„ì´ì½˜ 사용 안 함", "problemChangingIconTheme": "ì•„ì´ì½˜ 테마를 설정하는 ë™ì•ˆ 문제 ë°œìƒ: {0}", "themes.selectIconTheme": "íŒŒì¼ ì•„ì´ì½˜ 테마 ì„ íƒ", + "generateColorTheme.label": "현재 설정ì—서 색 테마 ìƒì„±", "preferences": "기본 설정", "developer": "개발ìž" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index c7b22dc29a4..3b4766bb5d9 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -13,31 +13,25 @@ "welcomePage.recent": "최근 항목", "welcomePage.noRecentFolders": "최근 í´ë” ì—†ìŒ", "welcomePage.help": "ë„움ë§", - "welcomePage.productDocumentation": "제품 설명서", "welcomePage.introductoryVideos": "소개 비디오", + "welcomePage.productDocumentation": "제품 설명서", "welcomePage.gitHubRepository": "GitHub 리í¬ì§€í† ë¦¬", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "시작 시 시작 페ì´ì§€ 표시", - "welcomePage.quickLinks": "빠른 ë§í¬", - "welcomePage.interactivePlayground": "대화형 실습", - "welcomePage.interactivePlaygroundDescription": "ì§§ì€ ì—°ìŠµì—서 기본 편집기 기능 사용해 보기", - "welcomePage.interfaceOverview": "ì¸í„°íŽ˜ì´ìФ 개요", - "welcomePage.interfaceOverviewDescription": "UIì˜ ì£¼ìš” 구성 요소를 ê°•ì¡° 표시하는 시ê°ì  ì˜¤ë²„ë ˆì´ ê°€ì ¸ì˜¤ê¸°", + "welcomePage.customize": "ì‚¬ìš©ìž ì§€ì •", + "welcomePage.installKeymapDescription": "바로 가기 키 설치", + "welcomePage.others": "기타", "welcomePage.colorTheme": "색 테마", "welcomePage.colorThemeDescription": "편집기 ë° ì½”ë“œê°€ 좋아하는 ë°©ì‹ìœ¼ë¡œ 표시ë˜ê²Œ 만들기", - "welcomePage.keybindingsReference": "바로 가기 키 참조", - "welcomePage.keybindingsReferenceDescription": "가장 ì¼ë°˜ì ì¸ 바로 가기 키가 í¬í•¨ëœ ì¸ì‡„ 가능한 PDF", "welcomePage.showCommands": "모든 명령 찾기 ë° ì‹¤í–‰", "welcomePage.showCommandsDescription": "제어íŒì—서 ëª…ë ¹ì„ ë¹ ë¥´ê²Œ 검색 ë° ì•¡ì„¸ìŠ¤({0})", + "welcomePage.interfaceOverview": "ì¸í„°íŽ˜ì´ìФ 개요", + "welcomePage.interfaceOverviewDescription": "UIì˜ ì£¼ìš” 구성 요소를 ê°•ì¡° 표시하는 시ê°ì  ì˜¤ë²„ë ˆì´ ê°€ì ¸ì˜¤ê¸°", + "welcomePage.interactivePlayground": "대화형 실습", + "welcomePage.interactivePlaygroundDescription": "ì§§ì€ ì—°ìŠµì—서 기본 편집기 기능 사용해 보기", + "welcomePage.quickLinks": "빠른 ë§í¬", + "welcomePage.keybindingsReference": "바로 가기 키 참조", + "welcomePage.keybindingsReferenceDescription": "가장 ì¼ë°˜ì ì¸ 바로 가기 키가 í¬í•¨ëœ ì¸ì‡„ 가능한 PDF", "welcomePage.configureSettings": "설정 구성", - "welcomePage.configureSettingsDescription": "ì„¤ì •ì„ ì¡°ì •í•˜ì—¬ VS Code ì˜ ì „ì²´ 기능 잠금 í•´ì œ", - "welcomePage.installKeymapDescription": "바로 가기 키 설치", - "welcomePage.installKeymap": "{0}, {1}, {2} ë° {3}ì˜ ë°”ë¡œ 가기 키 설치", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim(현재)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime(현재)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom(현재)", - "welcomePage.others": "기타" + "welcomePage.configureSettingsDescription": "ì„¤ì •ì„ ì¡°ì •í•˜ì—¬ VS Code ì˜ ì „ì²´ 기능 잠금 í•´ì œ" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index f4fb40d0799..a436e5a707b 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,16 @@ // Do not edit this file. It is machine generated. { "welcomePage": "시작", - "welcome.title": "시작", + "welcomePage.typeScript": "TypeScript", + "welcomePage.php": "PHP", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "{0} 바로 가기 키가 ì´ë¯¸ 설치ë˜ì–´ 있습니다.", "welcomePage.willReloadAfterInstallingKeymap": "{0} 바로 가기 키를 설치한 후 ì°½ì´ ë‹¤ì‹œ 로드ë©ë‹ˆë‹¤.", - "ok": "확ì¸", "welcomePage.installingKeymap": "{0} 바로 가기 키를 설치하는 중...", "welcomePage.keymapNotFound": "IDê°€ {1}ì¸ {0} 바로 가기 키를 ì°¾ì„ ìˆ˜ 없습니다.", + "welcome.title": "시작", + "ok": "확ì¸", "cancel": "취소" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index e579f606de7..7f6ec89a740 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "ë°”ì¸ë”© 안 ë¨" + "walkThrough.unboundCommand": "ë°”ì¸ë”© 안 ë¨", + "walkThrough.gitNotFound": "Gitê°€ ì‹œìŠ¤í…œì— ì„¤ì¹˜ë˜ì§€ ì•Šì€ ê²ƒ 같습니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index a897bbf9abe..131b473a69b 100644 --- a/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "설정 열기", + "close": "닫기", "errorUnknownKey": "구성 파ì¼ì— 쓸 수 없습니다(알 수 없는 키).", - "errorInvalidTarget": "구성 파ì¼ì— 쓸 수 없습니다(ìž˜ëª»ëœ ëŒ€ìƒ).", - "errorNoWorkspaceOpened": "í´ë”ê°€ ì—´ë ¤ 있지 않으므로 ì„¤ì •ì„ ì“¸ 수 없습니다. 먼저 í´ë”를 ì—´ê³  다시 시ë„하세요.", - "errorInvalidConfiguration": "ì„¤ì •ì„ ì“¸ 수 없습니다. **ì‚¬ìš©ìž ì„¤ì •**ì„ ì—´ì–´ 파ì¼ì—서 오류/경고를 해결하고 다시 시ë„하세요.", - "errorInvalidConfigurationWorkspace": "ì„¤ì •ì„ ì“¸ 수 없습니다. **작업 ì˜ì—­ 설정**ì„ ì—´ì–´ 파ì¼ì—서 오류/경고를 해결하고 다시 시ë„하세요.", - "errorConfigurationFileDirty": "파ì¼ì´ 변경ë˜ì–´ ì„¤ì •ì„ ì“¸ 수 없습니다. **ì‚¬ìš©ìž ì„¤ì •** 파ì¼ì„ 저장하고 다시 시ë„하세요.", - "errorConfigurationFileDirtyWorkspace": "파ì¼ì´ 변경ë˜ì–´ ì„¤ì •ì„ ì“¸ 수 없습니다. **작업 ì˜ì—­ 설정** 파ì¼ì„ 저장하고 다시 시ë„하세요." + "errorInvalidTarget": "구성 파ì¼ì— 쓸 수 없습니다(ìž˜ëª»ëœ ëŒ€ìƒ)." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/kor/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 86a6dfd7761..1d3e36aa30f 100644 --- a/i18n/kor/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/kor/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Windows 특정 키 ë˜ëŠ” 키 시퀀스", "vscode.extension.contributes.keybindings.when": "키가 활성화ë˜ëŠ” 조건입니다.", "vscode.extension.contributes.keybindings": "키 ë°”ì¸ë”©ì„ ì ìš©í•©ë‹ˆë‹¤.", - "openDocumentation": "ìžì„¸í•œ ì •ë³´", - "keybindingMigration.ok": "확ì¸", - "keybindingMigration.prompt": "키보드 ë ˆì´ì•„ì›ƒì— ëŒ€í•´ ì¼ë¶€ 바로 가기 키가 변경ë˜ì—ˆìŠµë‹ˆë‹¤.", "invalid.keybindings": "ìž˜ëª»ëœ `contributes.{0}`입니다. {1}", "unboundCommands": "사용 가능한 다른 명령:", "keybindings.json.title": "키 ë°”ì¸ë”© 구성", diff --git a/i18n/kor/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/kor/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index ef85a3ba9f6..67d59d097a5 100644 --- a/i18n/kor/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/kor/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "구문 ê°•ì¡° 표시를 위한 색", "schema.properties.name": "ê·œì¹™ì— ëŒ€í•œ 설명", - "schema.fontStyle": "ê·œì¹™ì˜ ê¸€ê¼´ 스타ì¼: '기울임꼴, '굵게' ë° '밑줄' 중 하나 ë˜ëŠ” ì´ë“¤ì˜ ì¡°í•©" + "schema.fontStyle": "ê·œì¹™ì˜ ê¸€ê¼´ 스타ì¼: '기울임꼴, '굵게' ë° '밑줄' 중 하나 ë˜ëŠ” ì´ë“¤ì˜ ì¡°í•©", + "schema.tokenColors.path": "tmTheme 파ì¼ì˜ 경로(현재 파ì¼ì˜ ìƒëŒ€ 경로)" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/kor/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 622950f98f8..1acfa7a4ff4 100644 --- a/i18n/kor/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/kor/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "JSON 테마 파ì¼ì„ 구문 ë¶„ì„하는 중 문제 ë°œìƒ: {0}" + "error.cannotparsejson": "JSON 테마 파ì¼ì„ 구문 ë¶„ì„하는 중 문제 ë°œìƒ: {0}", + "error.invalidformat.colors": "색 테마 íŒŒì¼ {0}ì„(를) 구문 ë¶„ì„하는 중 문제가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. 'colors' ì†ì„±ì´ 'object' 형ì‹ì´ 아닙니다.", + "error.invalidformat.tokenColors": "색 테마 íŒŒì¼ {0}ì„(를) 구문 ë¶„ì„하는 중 문제가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. 'tokenColors' ì†ì„±ì´ 'object' 형ì‹ì´ 아닙니다. 'tokenColors' ì†ì„±ì€ ìƒ‰ì„ ì§€ì •í•˜ëŠ” ë°°ì—´ ë˜ëŠ” í…스트 ì§ í…Œë§ˆ 파ì¼ì˜ 경로여야 합니다.", + "error.plist.invalidformat": "tmTheme íŒŒì¼ {0}ì„(를) 구문 ë¶„ì„하는 중 문제가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. 'settings'ê°€ ë°°ì—´ì´ ì•„ë‹™ë‹ˆë‹¤.", + "error.cannotparse": "tmTheme íŒŒì¼ {0}ì„(를) 구문 ë¶„ì„하는 중 문제가 ë°œìƒí–ˆìŠµë‹ˆë‹¤.", + "error.cannotload": "tmTheme íŒŒì¼ {0}ì„(를) 로드하는 중 문제가 ë°œìƒí–ˆìŠµë‹ˆë‹¤. {1}" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/kor/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index b9570259fd2..dc5e319d6e7 100644 --- a/i18n/kor/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/kor/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "현재 ì„ íƒí•œ 색 테마ì—서 ìƒ‰ì„ ìž¬ì •ì˜í•©ë‹ˆë‹¤.", + "workbenchColors.deprecated": "ì´ ì„¤ì •ì€ ë” ì´ìƒ ì‹¤í—˜ì  ì„¤ì •ì´ ì•„ë‹ˆë©° ì´ë¦„ì´\n 'workbench.colorCustomizations'로 변경ë˜ì—ˆìŠµë‹ˆë‹¤.", + "workbenchColors.deprecatedDescription": "대신 'workbench.colorCustomizations'를 사용합니다." } \ No newline at end of file diff --git a/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json new file mode 100644 index 00000000000..74a80b4280d --- /dev/null +++ b/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "activeEditorShort": "e.g. meuArquivo.txt", + "activeEditorMedium": "e.g. minhaPasta/meuArquivo.txt", + "activeEditorLong": "e.g. /Usuarios/Desenvolvimento/meuProjeto/minhaPasta/meuArquivo.txt", + "rootName": "e.g. meuProjeto", + "rootPath": "e.g. /Usuarios/Desenvolvimento/meuProjeto", + "appName": "e.g. VS Code", + "dirty": "Um indicador de alteração se o editor ativo foi alterado", + "separator": "um separador condicional (' - ') que somente é mostrado quando envolvido por variáveis com valores", + "assocLabelFile": "Arquivos com Extensão", + "assocDescriptionFile": "Mapear todos arquivos que correspondem ao padrão global no seu nome de arquivo à linguagem com o identificador dado", + "assocLabelPath": "Arquivos com Caminho", + "assocDescriptionPath": "Mapear todos os arquivos que correspondem ao caminho absoluto global no seu caminho à linguagem com o identificador dado", + "fileLabel": "Arquivos por Extensão", + "fileDescription": "Combina todos os arquivos de uma extensão de arquivo específica.", + "filesLabel": "Arquivos com Várias Extensões", + "filesDescription": "Combina todos os arquivos com qualquer uma das extensões de arquivo.", + "derivedLabel": "Arquivos com Irmãos por Nome", + "derivedDescription": "Combina arquivos que têm irmãos com o mesmo nome, mas uma extensão diferente.", + "topFolderLabel": "Pasta por Nome (Nível Superior)", + "topFolderDescription": "Combina uma pasta de nível superior com um nome específico.", + "topFoldersLabel": "Pastas com Vários Nomes (Nível Superior)", + "topFoldersDescription": "Combina várias pastas de nível superior.", + "folderLabel": "Pasta por Nome (Qualquer Local)", + "folderDescription": "Combina uma pasta com um nome específico em qualquer local.", + "falseDescription": "Desabilita o padrão.", + "trueDescription": "Habilita o padrão.", + "siblingsDescription": "Combina arquivos que têm irmãos com o mesmo nome, mas uma extensão diferente.", + "languageSpecificEditorSettings": "Configurações do editor especificas para a linguagem", + "languageSpecificEditorSettingsDescription": "Sobrescrever as configurações do editor para a linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/css/client/out/cssMain.i18n.json b/i18n/ptb/extensions/css/client/out/cssMain.i18n.json new file mode 100644 index 00000000000..a649796227b --- /dev/null +++ b/i18n/ptb/extensions/css/client/out/cssMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Servidor de linguagem CSS" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/css/package.i18n.json b/i18n/ptb/extensions/css/package.i18n.json new file mode 100644 index 00000000000..de011d44dce --- /dev/null +++ b/i18n/ptb/extensions/css/package.i18n.json @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "css.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "css.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "css.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "css.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "css.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "css.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "css.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "css.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "css.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "css.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "css.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "css.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "css.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "css.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "css.lint.unknownProperties.desc": "Propriedade desconhecida.", + "css.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "css.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "css.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "css.validate.desc": "Habilita ou desabilita todas as validações", + "less.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "less.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "less.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "less.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "less.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "less.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "less.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "less.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "less.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "less.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "less.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "less.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "less.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "less.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "less.lint.unknownProperties.desc": "Propriedade desconhecida.", + "less.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "less.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "less.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "less.validate.desc": "Habilita ou desabilita todas as validações", + "scss.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "scss.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "scss.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "scss.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "scss.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "scss.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "scss.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "scss.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "scss.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "scss.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "scss.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "scss.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "scss.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "scss.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "scss.lint.unknownProperties.desc": "Propriedade desconhecida.", + "scss.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "scss.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "scss.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "scss.validate.desc": "Habilita ou desabilita todas as validações", + "less.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores", + "scss.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores", + "css.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json b/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json new file mode 100644 index 00000000000..8505afd6d4a --- /dev/null +++ b/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "languageSpecificEditorSettings": "Configurações do editor especificas para a linguagem", + "languageSpecificEditorSettingsDescription": "Sobrescrever as configurações do editor para a linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/askpass-main.i18n.json b/i18n/ptb/extensions/git/out/askpass-main.i18n.json new file mode 100644 index 00000000000..280b14bd0d7 --- /dev/null +++ b/i18n/ptb/extensions/git/out/askpass-main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Credenciais ausentes ou inválidas." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/commands.i18n.json b/i18n/ptb/extensions/git/out/commands.i18n.json new file mode 100644 index 00000000000..6744be04c88 --- /dev/null +++ b/i18n/ptb/extensions/git/out/commands.i18n.json @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Etiqueta em {0}", + "remote branch at": "Ramo remoto em {0}", + "repourl": "URL do repositório", + "parent": "Diretório pai", + "cloning": "Clonando repositório do Git...", + "openrepo": "Abrir Repositório", + "proposeopen": "Gostaria de abrir o repositório clonado?", + "confirm revert": "Tem certeza que deseja reverter as alterações selecionadas em {0}?", + "revert": "Reverter as alterações", + "confirm discard": "Tem certeza que deseja descartar as alterações em {0}?", + "confirm discard multiple": "Tem certeza que deseja descartar as alterações em {0} arquivos?", + "discard": "Descartar alterações", + "confirm discard all": "Tem certeza que deseja descartar TODAS as alterações? Isso é IRREVERSÃVEL!", + "discardAll": "Descartar TODAS as alterações", + "no staged changes": "Não há nenhuma modificação escalonada para confirmar.\n\nGostaria de escalonar automaticamente todas as suas alterações e confirmá-las diretamente?", + "yes": "Sim", + "always": "Sempre", + "no changes": "Não há mudanças para confirmar.", + "commit message": "Confirmar mensagem", + "provide commit message": "Por favor, forneça uma mensagem de commit", + "branch name": "Nome do Ramo", + "provide branch name": "Por favor, forneça um nome de ramo", + "select branch to delete": "Selecione uma ramificação para excluir", + "confirm force delete branch": "A ramificação '{0}' não foi totalmente mesclada. Excluir mesmo assim?", + "delete branch": "Excluir ramificação", + "no remotes to pull": "O seu repositório não possui remotos configurados para efetuar pull.", + "no remotes to push": "O seu repositório não possui remotos configurados para efetuar push.", + "nobranch": "Por favor, faça checkout em um ramo para fazer push em um remoto.", + "pick remote": "Pegue um remoto para publicar o ramo '{0}':", + "sync is unpredictable": "Esta ação vai fazer push e pull nos commits de e para '{0}'.", + "ok": "OK", + "never again": "Ok, Nunca Mostrar Novamente", + "no remotes to publish": "Seu repositório não possui remotos configurados para publicação.", + "disabled": "Git está desativado ou não é suportado neste espaço de trabalho", + "clean repo": "Por favor, limpe sua árvore de trabalho do repositório antes de fazer check-out.", + "cant push": "Não pode empurrar referências para remoto. Execute 'Pull' primeiro para integrar suas alterações.", + "git error details": "Git: {0}", + "git error": "Erro de Git", + "open git log": "Abrir Histórico do Git" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/main.i18n.json b/i18n/ptb/extensions/git/out/main.i18n.json new file mode 100644 index 00000000000..ae1dee26032 --- /dev/null +++ b/i18n/ptb/extensions/git/out/main.i18n.json @@ -0,0 +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. +{ + "using git": "Usando git {0} de {1}", + "updateGit": "Atualizar o Git", + "neverShowAgain": "Não mostrar novamente", + "git20": "Você parece ter o git {0} instalado. Code funciona melhor com git > = 2" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/model.i18n.json b/i18n/ptb/extensions/git/out/model.i18n.json new file mode 100644 index 00000000000..717d2b4364a --- /dev/null +++ b/i18n/ptb/extensions/git/out/model.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Abrir", + "merge changes": "Mesclar Alterações", + "staged changes": "Alterações em Etapas", + "changes": "Alterações", + "ok": "OK", + "neveragain": "Nunca Mostrar Novamente", + "huge": "O repositório git em '{0}' tem muitas atualizações ativas, somente um subconjunto de funcionalidades do Git será habilitado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/scmProvider.i18n.json b/i18n/ptb/extensions/git/out/scmProvider.i18n.json new file mode 100644 index 00000000000..490dda3603e --- /dev/null +++ b/i18n/ptb/extensions/git/out/scmProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "commit": "Confirmar" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/statusbar.i18n.json b/i18n/ptb/extensions/git/out/statusbar.i18n.json new file mode 100644 index 00000000000..0b6ee800ffa --- /dev/null +++ b/i18n/ptb/extensions/git/out/statusbar.i18n.json @@ -0,0 +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. +{ + "checkout": "Checkout...", + "sync changes": "Sincronizar alterações", + "publish changes": "Publicar alterações", + "syncing changes": "Sincronizando alterações..." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/package.i18n.json b/i18n/ptb/extensions/git/package.i18n.json new file mode 100644 index 00000000000..e3eec31c008 --- /dev/null +++ b/i18n/ptb/extensions/git/package.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "command.clone": "Clonar", + "command.init": "Inicializar Repositório", + "command.refresh": "Atualizar", + "command.openChange": "Abrir alterações", + "command.openFile": "Abrir Arquivo", + "command.stage": "Estagiar Alterações", + "command.stageAll": "Estagiar Todas Alterações", + "command.stageSelectedRanges": "Estagiar Faixas Selecionadas", + "command.revertSelectedRanges": "Reverter Faixas Selecionadas", + "command.unstage": "Desestagiar Alterações", + "command.unstageAll": "Desestagiar Todas Alterações", + "command.unstageSelectedRanges": "Desestagiar Faixas Selecionadas", + "command.clean": "Descartar Alterações", + "command.cleanAll": "Descartar Todas as Alterações", + "command.commit": "Confirmar", + "command.commitStaged": "Confirmar os preparados", + "command.commitStagedSigned": "Confirmar Estagiados (Desconectado)", + "command.commitAll": "Confirmar tudo", + "command.commitAllSigned": "Confirmar Tudo (Desconectado)", + "command.undoCommit": "Desfazer Ultima Confirmação", + "command.checkout": "Fazer checkout para...", + "command.branch": "Criar Ramificação...", + "command.deleteBranch": "Excluir Ramificação...", + "command.pull": "Efetuar pull", + "command.pullRebase": "Efetuar pull (Rebase)", + "command.push": "Enviar por push", + "command.pushTo": "Enviar por push para...", + "command.sync": "Sincronizar", + "command.publish": "Publicar", + "command.showOutput": "Mostrar Saída do Git", + "config.enabled": "Se o git estiver habilitado", + "config.path": "Caminho para o executável do git", + "config.autorefresh": "Se a atualização automática estiver habilitada", + "config.autofetch": "Se a recuperação automática estiver habilitada", + "config.enableLongCommitWarning": "Se mensagens longas de confirmação devem ter aviso", + "config.confirmSync": "Confirmar antes de sincronizar repositórios git", + "config.countBadge": "Controla o contador de distintivos do git. 'todos' considera todas as alterações. 'rastreado' considera apenas as alterações controladas. 'desligado' desliga o contador.", + "config.checkoutType": "Controla quais tipos de ramos são listados quando executando `Checkout para... `. `todos` mostra todas as referências, `local` mostra apenas os ramos locais, `etiqueta` mostra apenas etiquetas e `remoto` mostra apenas os ramos remotos.", + "config.ignoreLegacyWarning": "Ignora o aviso de Git legado", + "config.ignoreLimitWarning": "Ignora o aviso quando houver muitas alterações em um repositório", + "config.defaultCloneDirectory": "O local padrão onde clonar um repositório git", + "config.enableSmartCommit": "Confirme todas as alterações quando não há modificações escalonadas." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/grunt/out/main.i18n.json b/i18n/ptb/extensions/grunt/out/main.i18n.json new file mode 100644 index 00000000000..909b68937c6 --- /dev/null +++ b/i18n/ptb/extensions/grunt/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Auto detecção de Grunt falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/grunt/package.i18n.json b/i18n/ptb/extensions/grunt/package.i18n.json new file mode 100644 index 00000000000..d79ce76907e --- /dev/null +++ b/i18n/ptb/extensions/grunt/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.grunt.autoDetect": "Controla se a deteção automática de tarefas do Grunt está ligado ou desligado. Padrão é ligado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/gulp/out/main.i18n.json b/i18n/ptb/extensions/gulp/out/main.i18n.json new file mode 100644 index 00000000000..51b05e4013e --- /dev/null +++ b/i18n/ptb/extensions/gulp/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Auto detecção de gulp falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/gulp/package.i18n.json b/i18n/ptb/extensions/gulp/package.i18n.json new file mode 100644 index 00000000000..fae292414c2 --- /dev/null +++ b/i18n/ptb/extensions/gulp/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.gulp.autoDetect": "Controla se a detecção automática de tarefas Gulp está ativada ou desativada. Por padrão, é ativado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json b/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json new file mode 100644 index 00000000000..314d1e5c58a --- /dev/null +++ b/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Servidor de Linguagem HTML" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/html/package.i18n.json b/i18n/ptb/extensions/html/package.i18n.json new file mode 100644 index 00000000000..2f255a02e7f --- /dev/null +++ b/i18n/ptb/extensions/html/package.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "html.format.enable.desc": "Ativa/desativa o formatador HTML padrão (requer reinicialização)", + "html.format.wrapLineLength.desc": "Quantidade máxima de caracteres por linha (0 = desativar).", + "html.format.unformatted.desc": "Lista de tags, separados por vírgula, que não deveria ser reformatada. o padrão é 'nulo' para todas as tags listadas em https://www.w3.org/TR/html5/dom.html#phrasing-content.", + "html.format.contentUnformatted.desc": "Lista de tags, separada por vírgula, onde o conteúdo não deve ser reformatado. o padrão é 'nulo' para a tag 'pré'.", + "html.format.indentInnerHtml.desc": "Indentar secões e .", + "html.format.preserveNewLines.desc": "Se quebras de linha existentes antes de elementos deveriam ser preservadas. Só funciona antes de elementos, não dentro de rótulos ou para texto.", + "html.format.maxPreserveNewLines.desc": "Número máximo de quebras de linha a serem preservadas em um bloco. Use 'null' para ilimitado.", + "html.format.indentHandlebars.desc": "Formatar e indentar {{#foo}} e {{/ foo}}.", + "html.format.endWithNewline.desc": "Finalizar com uma nova linha.", + "html.format.extraLiners.desc": "Lista de rótulos, separados por vírgulas, que deveriam ter uma quebra de linha extra antes deles. 'null' admite o padrão \"head, body, /html\".", + "html.format.wrapAttributes.desc": "Agrupar atributos.", + "html.format.wrapAttributes.auto": "Agrupar atributos somente quando o tamanho da linha é excedido.", + "html.format.wrapAttributes.force": "Agrupar cada atributo exceto o primeiro.", + "html.format.wrapAttributes.forcealign": "Agrupar cada atributo, exceto o primeiro e manter alinhado.", + "html.format.wrapAttributes.forcemultiline": "Agrupar cada atributo.", + "html.suggest.angular1.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos e propriedades do Angular V1.", + "html.suggest.ionic.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos, propriedades e valores Ionic.", + "html.suggest.html5.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos, propriedades e valores HTML5.", + "html.validate.scripts": "Configura se o suporte da linguagem HTML interna valida scripts embutidos.", + "html.validate.styles": "Configura se o suporte da linguagem HTML interna valida estilos embutidos." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/jake/out/main.i18n.json b/i18n/ptb/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..4cfc54e5fef --- /dev/null +++ b/i18n/ptb/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Auto detecção de Jake falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/jake/package.i18n.json b/i18n/ptb/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..94c08817c8d --- /dev/null +++ b/i18n/ptb/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.jake.autoDetect": "Controla se a detecção automática de tarefas Jake está ativada ou desativada. Por padrão, é ativado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json b/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json new file mode 100644 index 00000000000..84b277202e8 --- /dev/null +++ b/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json @@ -0,0 +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. +{ + "json.bower.default": "Bower.json padrão", + "json.bower.error.repoaccess": "Falha na solicitação ao repositório bower: {0}", + "json.bower.latest.version": "último" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json b/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json new file mode 100644 index 00000000000..9917fa36b2e --- /dev/null +++ b/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json @@ -0,0 +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. +{ + "json.package.default": "Package.json padrão", + "json.npm.error.repoaccess": "Falha na solicitação ao repositório NPM: {0}", + "json.npm.latestversion": "A versão do pacote mais recente no momento", + "json.npm.majorversion": "Combina com a versão principal mais recente (1.x.x)", + "json.npm.minorversion": "Combina a versão secundária mais recente (1.2.x)", + "json.npm.version.hover": "Última versão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json b/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json new file mode 100644 index 00000000000..4391c95a2ba --- /dev/null +++ b/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Servidor de linguagem JSON" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/json/package.i18n.json b/i18n/ptb/extensions/json/package.i18n.json new file mode 100644 index 00000000000..9d812f5b253 --- /dev/null +++ b/i18n/ptb/extensions/json/package.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "json.schemas.desc": "Esquemas associadas a arquivos de JSON no projeto atual", + "json.schemas.url.desc": "Um URL para um esquema ou um caminho relativo a um esquema no diretório atual", + "json.schemas.fileMatch.desc": "Uma matriz de padrões de arquivos para correspondência ao resolver arquivos JSON para esquemas.", + "json.schemas.fileMatch.item.desc": "Um padrão de arquivos que pode conter '*' para fazer a correspondência ao resolver arquivos JSON para esquemas.", + "json.schemas.schema.desc": "A definição de esquema para o URL dado. O esquema precisa ser fornecido apenas para evitar acessos ao URL do esquema.", + "json.format.enable.desc": "Habilitar/desabilitar o formatador JSON padrão (requer reinicialização)", + "json.tracing.desc": "Loga a comunicação entre o VS Code e o servidor de linguagem JSON.", + "json.colorDecorators.enable.desc": "Habilita ou desabilita os decoradores de cor" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/extension.i18n.json b/i18n/ptb/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..0f4d1689d7f --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "onPreviewStyleLoadError": "Não foi possível carregar o 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json b/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json new file mode 100644 index 00000000000..f4e956aa5eb --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json @@ -0,0 +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. +{ + "preview.securityMessage.text": "Scripts foram desabilitados neste documento", + "preview.securityMessage.title": "Scripts são desabilitados na pré-visualização de markdown. Altere a configuração de segurança de pré-visualização do Markdown para habilitar scripts", + "preview.securityMessage.label": "Aviso de segurança de scripts desabilitados" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/security.i18n.json b/i18n/ptb/extensions/markdown/out/security.i18n.json new file mode 100644 index 00000000000..6b83ed6faed --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/security.i18n.json @@ -0,0 +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. +{ + "preview.showPreviewSecuritySelector.disallowScriptsForWorkspaceTitle": "Desabilitar a execução de scripts em pré-visualização de markdown para este espaço de trabalho", + "preview.showPreviewSecuritySelector.currentSelection": "Configuração atual", + "preview.showPreviewSecuritySelector.allowScriptsForWorkspaceTitle": "Habilitar a execução de scripts em pré-visualizações de markdown para este espaço de trabalho", + "preview.showPreviewSecuritySelector.title": "Alterar configurações de segurança para a pré-visualização do Markdown" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/package.i18n.json b/i18n/ptb/extensions/markdown/package.i18n.json new file mode 100644 index 00000000000..83c2f99b160 --- /dev/null +++ b/i18n/ptb/extensions/markdown/package.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "markdown.preview.doubleClickToSwitchToEditor.desc": "Duplo clique na pré-visualização markdown para alternar para o editor.", + "markdown.preview.fontFamily.desc": "Controla a família de fonte usada na pré-visualização de markdown.", + "markdown.preview.fontSize.desc": "Controla o tamanho da fonte em pixels usado na pré-visualização de markdown.", + "markdown.preview.lineHeight.desc": "Controla a altura de linha usada na pré-visualização de markdown. Este número é relativo ao tamanho de fonte.", + "markdown.preview.markEditorSelection.desc": "Marca a seleção atual do editor na pré-visualização de markdown.", + "markdown.preview.scrollEditorWithPreview.desc": "Quando a pré-visualização de markdown é rolada, atualiza a exibição do editor.", + "markdown.preview.scrollPreviewWithEditorSelection.desc": "Rola a pré-visualização do markdown para revelar a linha atualmente selecionada do editor.", + "markdown.preview.title": "Abrir a visualização", + "markdown.previewFrontMatter.dec": "Configura como o frontispicio YAML frente questão devem ser processado na pré-visualização de markdown. 'hide' remove o frontispicio. Caso contrário, o frontispicio é tratado como conteúdo de markdown.", + "markdown.previewSide.title": "Abre pré-visualização ao lado", + "markdown.showSource.title": "Exibir Código-Fonte", + "markdown.styles.dec": "Uma lista de URLs ou caminhos locais para folhas de estilo CSS para usar na pré-visualização do markdown. Caminhos relativos são interpretados em relação à pasta aberta no explorer. Se não houver nenhuma pasta aberta, eles são interpretados em relação ao local do arquivo markdown. Todos os ' \\' precisam ser escritos como ' \\ \\ '.", + "markdown.showPreviewSecuritySelector.title": "Alterar as configurações de segurança de pré-visualização do Markdown", + "markdown.preview.enableExperimentalExtensionApi.desc": "[Experimental] Permitir extensões para ampliar a pré-visualização do markdown.", + "markdown.trace.desc": "Habilitar log de depuração para a extensão do markdown." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..dd5a316f1a1 --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +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. +{ + "acceptCurrentChange": "Aceitar a mudança atual", + "acceptIncomingChange": "Aceitar a mudança de entrada", + "acceptBothChanges": "Aceitar ambas alterações", + "compareChanges": "Comparar alteracões" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..ee80b2e1905 --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Cursor do editor não está dentro de um conflito de mesclagem", + "compareChangesTitle": "{0}: Mudanças atuais \\u2194 alterações de entrada ", + "cursorOnSplitterRange": "Cursor do editor está dentro do separador de conflitos de mesclagem, por favor mova-o para o bloco \"atual\" ou \"entrada\"", + "noConflicts": "Nenhum conflito de mesclagem encontrado neste arquivo", + "noOtherConflictsInThisFile": "Não há outros conflitos de mesclagem dentro desse arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..a3da6d4660e --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "(Mudança atual)", + "incomingChange": "(Mudança de entrada)" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/package.i18n.json b/i18n/ptb/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..b290f272513 --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Conflito de Mesclagem", + "command.accept.all-incoming": "Aceitar todas as novas entradas", + "command.accept.all-both": "Aceitar Ambos", + "command.accept.current": "Aceitar a atual", + "command.accept.incoming": "Aceitar as novas entradas", + "command.accept.selection": "Aceitar a seleção", + "command.accept.both": "Aceitar Ambos", + "command.next": "Próximo conflito", + "command.previous": "Conflito anterior", + "command.compare": "Comparar o conflito atual", + "config.title": "Mesclar conflitos", + "config.codeLensEnabled": "Habilitar/Desabilitar o conflito de mesclagem no bloco CodeLens dentro do editor", + "config.decoratorsEnabled": "Habilitar/Desabilitar decoradores de mesclagem de conflitos dentro do editor" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/npm/package.i18n.json b/i18n/ptb/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8d33aa31e7f --- /dev/null +++ b/i18n/ptb/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "config.npm.autoDetect": "Controla se a deteção automática de scripts npm está ligado ou desligado. O padrão é ligado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json b/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json new file mode 100644 index 00000000000..9e0ce64f472 --- /dev/null +++ b/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json @@ -0,0 +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. +{ + "php.useExecutablePath": "Você permite {0} (definido como uma configuração do espaço de trabalho) a ser executado para lint de arquivos PHP?", + "php.yes": "Permitir", + "php.no": "Não permitir", + "wrongExecutable": "Não é possível validar {0} pois não é um executável php válido. Use a configuração 'php.validate.executablePath' para configurar o executável do PHP.", + "noExecutable": "Não é possível validar porque nenhum executável PHP está definido. Use a configuração 'php.validate.executablePath' para configurar o executável do PHP.", + "unknownReason": "Falha ao executar o php usando o caminho: {0}. O motivo é desconhecido." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/php/package.i18n.json b/i18n/ptb/extensions/php/package.i18n.json new file mode 100644 index 00000000000..7ec916f5dd8 --- /dev/null +++ b/i18n/ptb/extensions/php/package.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "configuration.suggest.basic": "Configura se as sugestões intrínsecas da linguagem PHP estão habilitadas. O suporte sugere globais e variáveis do PHP.", + "configuration.validate.enable": "Habilita/desabilita a validação interna do PHP.", + "configuration.validate.executablePath": "Aponta para o executável do PHP.", + "configuration.validate.run": "Se o linter é executado ao salvar ou ao digitar.", + "configuration.title": "PHP", + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "Desabilita a validação de executável do PHP (definida como configuração do espaço de trabalho)" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json new file mode 100644 index 00000000000..1cef0c6e94a --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "versionMismatch": "Incompatibilidade de versão! global tsc ({0})! = serviço de linguagem do VS Code ({1}). Erros de compilação inconsistentes podem ocorrer", + "moreInformation": "Mais informações", + "doNotCheckAgain": "Não verificar novamente", + "close": "Fechar", + "updateTscCheck": "Atualizada configuração de usuário 'typescript.check.tscVersion' para false " +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json new file mode 100644 index 00000000000..58097d90545 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "acquiringTypingsLabel": "Adquirindo digitações...", + "acquiringTypingsDetail": "Adquirindo definições de digitações para o Intellisense." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..99716f32145 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +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. +{ + "ts-check": "Habilita verificação semântica em um arquivo JavaScript. Deve estar no topo de um arquivo.", + "ts-nocheck": "Desabilita verificação semântica em um arquivo JavaScript. Deve estar no topo de um arquivo.", + "ts-ignore": "Suprime erros de @ts-check na próxima linha de um arquivo." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json new file mode 100644 index 00000000000..ef8dd6423d6 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json @@ -0,0 +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. +{ + "oneImplementationLabel": "1 implementação", + "manyImplementationLabel": "{0} implementações", + "implementationsErrorLabel": "Não foi possível determinar implementações" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json new file mode 100644 index 00000000000..20b08d7679b --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "typescript.jsDocCompletionItem.documentation": "Comentário JSDoc" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json new file mode 100644 index 00000000000..1838c3c1621 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json @@ -0,0 +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. +{ + "oneReferenceLabel": "1 referência", + "manyReferenceLabel": "{0} referências", + "referenceErrorLabel": "Não foi possível determinar as referências" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json b/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json new file mode 100644 index 00000000000..82e6c288fb1 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "typescript.projectConfigNoWorkspace": "Favor abrir uma pasta no VS Code para usar um projeto TypeScript ou JavaScript", + "typescript.projectConfigUnsupportedFile": "Não foi possível determinar o projeto TypeScript ou JavaScript. Tipo de arquivo não suportado", + "typescript.projectConfigCouldNotGetInfo": "Não foi possível determinar o projeto TypeScript ou JavaScript", + "typescript.noTypeScriptProjectConfig": "Arquivo não é parte de um projeto TypeScript", + "typescript.noJavaScriptProjectConfig": "Arquivo não é parte de um projeto JavaScript", + "typescript.configureTsconfigQuickPick": "Configurar tsconfig.json", + "typescript.configureJsconfigQuickPick": "Configurar jsconfig.json", + "typescript.projectConfigLearnMore": "Saber Mais" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json new file mode 100644 index 00000000000..37527e507b0 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noServerFound": "O caminho {0} não aponta para uma instalação de tsserver válida. Voltando para a versão do TypeScript empacotada.", + "noBundledServerFound": "O tsserver do VS Code foi excluído por outra aplicação, como por exemplo uma ferramenta de detecção de virus mal-comportada. Favor reinstalar o VS Code.", + "versionNumber.custom": "personalizado", + "serverCouldNotBeStarted": "Servidor de linguagem TypeScript não pôde ser iniciado. Mensagem de erro é: {0}", + "useVSCodeVersionOption": "Usar a Versão do VS Code", + "activeVersion": "Atualmente ativo", + "useWorkspaceVersionOption": "Use a versão de área de trabalho", + "learnMore": "Saiba Mais", + "selectTsVersion": "Selecione a versão do TypeScript usada para os recursos de linguagem JavaScript e TypeScript", + "typescript.openTsServerLog.notSupported": "Logging de TS Server requer TS TS 2.2.2+", + "typescript.openTsServerLog.loggingNotEnabled": "Logging de TS Server está desligado. Por favor configure 'typescript.tsserver.log' e reinicie o TS Server para habilitar o log", + "typescript.openTsServerLog.enableAndReloadOption": "Habilitar logging e reniciar TS server", + "typescript.openTsServerLog.noLogFile": "O TS Server não iniciou o logging.", + "openTsServerLog.openFileFailedFailed": "Não foi possível abrir o arquivo de log do TS Server", + "serverDiedAfterStart": "O serviço de linguagem TypeScript morreu 5 vezes depois que começou. O serviço não será reiniciado.", + "serverDiedReportIssue": "Reportar Problema", + "serverDied": "O serviço TypeScript morreu inesperadamente 5 vezes nos últimos 5 minutos." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json b/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json new file mode 100644 index 00000000000..5cb18373637 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "hintExclude": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas com muitos arquivos, como: {0}", + "hintExclude.generic": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas grandes com arquivos em que você não trabalha.", + "open": "Configurar exclusões", + "large.label": "Configurar exclusões", + "hintExclude.tooltip": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas grandes com arquivos em que você não trabalha." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json new file mode 100644 index 00000000000..ce050eb3d8e --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "installingPackages": "Buscando dados para melhor IntelliSense do TypeScript", + "typesInstallerInitializationFailed.title": "Não foi possível instalar arquivos de digitação para recursos da linguagem JavaScript. Certifique-se que NPM está instalado e está em seu caminho", + "typesInstallerInitializationFailed.moreInformation": "Mais informações", + "typesInstallerInitializationFailed.doNotCheckAgain": "Não verificar novamente", + "typesInstallerInitializationFailed.close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/package.i18n.json b/i18n/ptb/extensions/typescript/package.i18n.json new file mode 100644 index 00000000000..74b4568f8b9 --- /dev/null +++ b/i18n/ptb/extensions/typescript/package.i18n.json @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "typescript.reloadProjects.title": "Recarregar Projeto", + "javascript.reloadProjects.title": "Recarregar Projeto", + "configuration.typescript": "TypeScript", + "typescript.useCodeSnippetsOnMethodSuggest.dec": "Funções completas com a assinatura do parâmetro.", + "typescript.tsdk.desc": "Especifica o caminho da pasta que contém os arquivos tsserver e lib*.d.ts para usar.", + "typescript.disableAutomaticTypeAcquisition": "Desabilita a aquisição automática de tipo. Requer TypeScript > = 2.0.6 e um reinício depois da alteração.", + "typescript.check.tscVersion": "Verifica se um ima instalação global do compilador TypeScript (por exemplo, tsc) difere do serviço de linguagem TypeScript usado.", + "typescript.tsserver.log": "Habilita o log do servidor TS para um arquivo. Este log pode ser usado para diagnosticar problemas do servidor de TS. O log pode conter caminhos de arquivo, código-fonte e outras informações potencialmente confidenciais do seu projeto.", + "typescript.tsserver.trace": "Habilita o rastreamento de mensagens enviadas para o servidor de TS. Este rastreamento pode ser usado para diagnosticar problemas do servidor de TS. O rastreamento pode conter caminhos de arquivo, código-fonte e outras informações potencialmente confidenciais do seu projeto.", + "typescript.tsserver.experimentalAutoBuild": "Habilita auto build experimental. Requer a versão 1.9 dev ou 2.x do tsserver e o reinício do VS Code depois da alteração.", + "typescript.validate.enable": "Habilita/Desabilita a validação TypeScript.", + "typescript.format.enable": "Habilita/Desabilita o formatador padrão TypeScript.", + "javascript.format.enable": "Habilita/Desabilita o formatador padrão JavaScript.", + "format.insertSpaceAfterCommaDelimiter": "Define o tratamento de espaços após um delimitador vírgula.", + "format.insertSpaceAfterSemicolonInForStatements": "Define o tratamento de espaços após um ponto e vírgula para um comando.", + "format.insertSpaceBeforeAndAfterBinaryOperators": "Define o tratamento de espaços após um operador binário.", + "format.insertSpaceAfterKeywordsInControlFlowStatements": "Define o tratamento de espaços após palavras-chave em um comando de controle de fluxo.", + "format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": "Define o tratamento de espaços após uma palavra-chave de função para funções anônimas.", + "format.insertSpaceBeforeFunctionParenthesis": "Define a manipulação de espaços antes de parênteses do argumento de função. Requer TypeScript > = 2.1.5.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "Define a manipulação de espaços após abrir e antes de fechar parênteses não vazios.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "Define a manipulação de espaços após abrir e antes de fechar colchetes não vazios.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves não vazias. Requer TypeScript >= 2.3.0.", + "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves de cadeias de caracteres de modelos. Requer TypeScript >= 2.0.6.", + "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves de expressões JSX. Requer TypeScript >= 2.0.6.", + "format.placeOpenBraceOnNewLineForFunctions": "Define-se uma chave de abertura é colocada em uma nova linha para funções ou não.", + "format.placeOpenBraceOnNewLineForControlBlocks": "Define-se uma chave de abertura é colocada em uma nova linha para blocos de controle ou não.", + "javascript.validate.enable": "Habilitar/Desabilitar validação JavaScript.", + "typescript.goToProjectConfig.title": "Ir para a Configuração do Projeto", + "javascript.goToProjectConfig.title": "Ir para a Configuração do Projeto", + "javascript.referencesCodeLens.enabled": "Habilitar/desabilitar referências CodeLens em arquivos JavaScript.", + "typescript.referencesCodeLens.enabled": "Habilitar/desabilitar referências CodeLens em arquivos TypeScript. Requer TypeScript > = 2.0.6.", + "typescript.implementationsCodeLens.enabled": "Habilitar/desabilitar implementações CodeLens. Requer TypeScript > = 2.0.6.", + "typescript.openTsServerLog.title": "Abrir arquivo de log do servidor TS", + "typescript.restartTsServer": "Reiniciar o servidor TS", + "typescript.selectTypeScriptVersion.title": "Selecionar a versão do JavaScript", + "jsDocCompletion.enabled": "Habilitar/Desabilitar comentários JSDoc automáticos.", + "javascript.implicitProjectConfig.checkJs": "Habilitar/desabilitar verificação semântica de arquivos JavaScript. Os arquivos existentes jsconfig.json ou tsconfig.json substituem essa configuração. Requer TypeScript > = 2.3.1.", + "typescript.check.npmIsInstalled": "Verificar se NPM está instalado para aquisição automática de digitação", + "javascript.nameSuggestions": "Habilitar/desabilitar incluindo nomes exclusivos do arquivo nas listas de sugestão de JavaScript." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json b/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json new file mode 100644 index 00000000000..4ecb2c803f4 --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "titleLabel": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json b/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json new file mode 100644 index 00000000000..e558eb6187a --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "repeated": "{0} (ocorreu novamente)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json b/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json new file mode 100644 index 00000000000..524ba7bb4a7 --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "defaultLabel": "entrada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json b/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json new file mode 100644 index 00000000000..1a477ef1e6d --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json @@ -0,0 +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. +{ + "caseDescription": "Diferenciar Maiúsculas de Minúsculas", + "wordsDescription": "Coincidir Palavra Inteira", + "regexDescription": "Usar Expressão Regular" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json b/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json new file mode 100644 index 00000000000..0b282bdee8a --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json @@ -0,0 +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. +{ + "alertErrorMessage": "Erro: {0}", + "alertWarningMessage": "Aviso: {0}", + "alertInfoMessage": "Informações: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json new file mode 100644 index 00000000000..ff9f2c98cbb --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "imgMeta": "{0}x{1} {2}", + "largeImageError": "A imagem é muito grande para ser exibida no editor.", + "resourceOpenExternalButton": "Abrir imagem usando um programa externo?", + "nativeBinaryError": "O arquivo não pode ser exibido no editor porque é binário, muito grande ou usa uma codificação de texto sem suporte.", + "sizeB": "{0}B", + "sizeKB": "{0}KB", + "sizeMB": "{0}MB", + "sizeGB": "{0}GB", + "sizeTB": "{0}TB" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json b/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json new file mode 100644 index 00000000000..4a046b57296 --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "more": "Mais" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/errorMessage.i18n.json b/i18n/ptb/src/vs/base/common/errorMessage.i18n.json new file mode 100644 index 00000000000..257ffd9e14c --- /dev/null +++ b/i18n/ptb/src/vs/base/common/errorMessage.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "message": "{0}. Código de erro: {1}", + "error.permission.verbose": "Permissão Negada (HTTP {0})", + "error.permission": "Permissão Negada", + "error.http.verbose": "{0} (HTTP {1}: {2})", + "error.http": "{0} (HTTP {1})", + "error.connection.unknown.verbose": "Erro de Conexão Desconhecido ({0})", + "error.connection.unknown": "Ocorreu um erro de conexão desconhecido. Você não está mais conectado à Internet ou o servidor que você está conectado está offline.", + "stackTrace.format": "{0}: {1}", + "error.defaultMessage": "Ocorreu um erro desconhecido. Consulte o log para obter mais detalhes.", + "nodeExceptionMessage": "Ocorreu um erro de sistema ({0})", + "error.moreErrors": "{0} ({1} erros no total)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..d6108586df8 --- /dev/null +++ b/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "Símbolo inválido", + "error.invalidNumberFormat": "Formato de número inválido", + "error.propertyNameExpected": "Nome de propriedade esperado", + "error.valueExpected": "Valor esperado", + "error.colonExpected": "Dois-pontos esperados", + "error.commaExpected": "Vírgula esperada", + "error.closeBraceExpected": "Chave de fechamento esperada", + "error.closeBracketExpected": "Colchete de fechamento esperado", + "error.endOfFileExpected": "Fim do arquivo esperado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/processes.i18n.json b/i18n/ptb/src/vs/base/common/processes.i18n.json new file mode 100644 index 00000000000..165322e5952 --- /dev/null +++ b/i18n/ptb/src/vs/base/common/processes.i18n.json @@ -0,0 +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. +{ + "ExecutableParser.commandMissing": "Erro: informações de executável devem definir um comando do tipo string", + "ExecutableParser.isShellCommand": "Aviso: IsShellCommand deve ser to tipo booleano. Ignorando valor {0}", + "ExecutableParser.args": "Aviso: args deve ser do tipo string[]. Ignorando valor {0}.", + "ExecutableParser.invalidCWD": "Aviso: options.cwd deve ser do tipo string. Ignorando valor {0}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/severity.i18n.json b/i18n/ptb/src/vs/base/common/severity.i18n.json new file mode 100644 index 00000000000..7aff8041180 --- /dev/null +++ b/i18n/ptb/src/vs/base/common/severity.i18n.json @@ -0,0 +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. +{ + "sev.error": "Erro", + "sev.warning": "Aviso", + "sev.info": "Informações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/node/processes.i18n.json b/i18n/ptb/src/vs/base/node/processes.i18n.json new file mode 100644 index 00000000000..3584dc9b15e --- /dev/null +++ b/i18n/ptb/src/vs/base/node/processes.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "TaskRunner.UNC": "Não é possível executar um comando shell em uma unidade UNC." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/node/zip.i18n.json b/i18n/ptb/src/vs/base/node/zip.i18n.json new file mode 100644 index 00000000000..a577f90ea2e --- /dev/null +++ b/i18n/ptb/src/vs/base/node/zip.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "notFound": "{0} não encontrado dentro do zip." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json new file mode 100644 index 00000000000..1d0f7ebd47a --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "quickOpenAriaLabelEntry": "{0}, seletor", + "quickOpenAriaLabel": "seletor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json new file mode 100644 index 00000000000..ca3d8a5266a --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "quickOpenAriaLabel": "Seletor rápido. Digite para filtrar resultados.", + "treeAriaLabel": "Seletor rápido" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json b/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json new file mode 100644 index 00000000000..5e72c45050c --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "collapse": "Recolher" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/menus.i18n.json b/i18n/ptb/src/vs/code/electron-main/menus.i18n.json new file mode 100644 index 00000000000..85312962c12 --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/menus.i18n.json @@ -0,0 +1,164 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mFile": "&&Arquivo", + "mEdit": "&&Editar", + "mSelection": "&&Seleção", + "mView": "&&Visualizar", + "mGoto": "&&Ir", + "mDebug": "&&Depurar", + "mWindow": "Janela", + "mHelp": "&&Ajuda", + "miNewWindow": "Nova &&Janela", + "mAbout": "Sobre {0}", + "mServices": "Serviços", + "mHide": "Ocultar {0}", + "mHideOthers": "Ocultar Outros", + "mShowAll": "Mostrar Tudo", + "miQuit": "Sair de {0}", + "miNewFile": "&&Novo Arquivo", + "miOpen": "&&Abrir", + "miOpenFolder": "Abrir &&Pasta", + "miOpenFile": "&&Abrir Arquivo", + "miOpenRecent": "Abrir &&Recente", + "miSave": "&&Salvar", + "miSaveAs": "Salvar &&Como...", + "miSaveAll": "Salvar &&Tudo", + "miAutoSave": "Salvar Automaticamente", + "miRevert": "Re&&verter Arquivo", + "miCloseWindow": "Fe&&char Janela", + "miCloseFolder": "Fechar &&Pasta", + "miCloseEditor": "Fechar &&Editor", + "miExit": "Sai&&r", + "miOpenSettings": "&&Configurações", + "miOpenKeymap": "Atalhos de &&Teclado", + "miOpenKeymapExtensions": "Extensões de &&Mapeamento de Teclado", + "miOpenSnippets": "Trechos de Có&&digo do Usuário", + "miSelectColorTheme": "Cor do T&&ema", + "miSelectIconTheme": "&&Ãcone de Arquivo do Tema", + "miPreferences": "&&Preferências", + "miReopenClosedEditor": "&&Reabrir Editor Fechado", + "miClearRecentOpen": "&&Limpar Arquivos Recentes", + "miUndo": "&&Desfazer", + "miRedo": "&&Refazer", + "miCut": "Cor&&tar", + "miCopy": "&&Copiar", + "miPaste": "Co&&lar", + "miFind": "&&Localizar", + "miReplace": "&&Substituir", + "miFindInFiles": "Localizar &&nos Arquivos", + "miReplaceInFiles": "Substituir &&nos Arquivos", + "miEmmetExpandAbbreviation": "Emmet: E&&xpandir Abreviação", + "miShowEmmetCommands": "E&&mmet...", + "miToggleLineComment": "&&Alternar Comentário de Linha", + "miToggleBlockComment": "Alternar Comentário de &&Bloco", + "miInsertCursorAbove": "&&Inserir cursor acima", + "miInsertCursorBelow": "Inserir cursor a&&baixo", + "miInsertCursorAtEndOfEachLineSelected": "Adicionar C&&ursores ao Final das Linhas", + "miAddSelectionToNextFindMatch": "Adicionar &&próxima ocorrência", + "miAddSelectionToPreviousFindMatch": "Adicionar ocorrência a&&nterior ", + "miSelectHighlights": "Selecionar todas as &&ocorrências", + "miCopyLinesUp": "&&Copiar linha acima", + "miCopyLinesDown": "C&&opiar linha abaixo", + "miMoveLinesUp": "Mo&&ver linha para cima", + "miMoveLinesDown": "Mover &&linha para baixo", + "miSelectAll": "&&Selecionar Tudo", + "miSmartSelectGrow": "&&Expandir seleção", + "miSmartSelectShrink": "&&Reduzir seleção", + "miViewExplorer": "&&Explorador", + "miViewSearch": "&&Pesquisar", + "miViewSCM": "S&&CM", + "miViewDebug": "&&Depurar", + "miViewExtensions": "E&&xtensões", + "miToggleOutput": "&&Saída", + "miToggleDebugConsole": "Con&&sole de Depuração", + "miToggleIntegratedTerminal": "Terminal &&Integrado", + "miMarker": "&&Problemas", + "miAdditionalViews": "&&Visualizações Adicionais", + "miCommandPalette": "&&Paleta de comando", + "miToggleFullScreen": "Alternar &&Tela Inteira", + "miToggleZenMode": "Alternar modo Zen", + "miToggleMenuBar": "Alternar &&Barra de Menus", + "miSplitEditor": "Dividir &&editor", + "miToggleEditorLayout": "Alternar &&Layout do Grupo de Editor", + "miToggleSidebar": "&&Alternar Barra Lateral", + "miMoveSidebarRight": "&&Mover a barra lateral para a direita", + "miMoveSidebarLeft": "&&Mover a barra lateral para a esquerda", + "miTogglePanel": "Alternar &&Painel", + "miHideStatusbar": "&&Ocultar Barra de Status", + "miShowStatusbar": "&&Mostrar Barra de Status", + "miHideActivityBar": "Ocultar Barra de &&Atividades", + "miShowActivityBar": "Mostrar Barra de &&Atividades", + "miToggleWordWrap": "Alternar &&Quebra de Linha", + "miToggleRenderWhitespace": "Alternar &&Renderização de Espaços em Branco", + "miToggleRenderControlCharacters": "Alternar &&Caracteres de Controle", + "miZoomIn": "&&Ampliar", + "miZoomOut": "Red&&uzir", + "miZoomReset": "&&Reinicializar Zoom", + "miBack": "&&Voltar", + "miForward": "&&Avançar", + "miNextEditor": "&&Próximo Editor", + "miPreviousEditor": "&&Editor Anterior", + "miNextEditorInGroup": "&&Próximo Editor Usado no Grupo", + "miPreviousEditorInGroup": "&&Editor Anterior Usado no Grupo", + "miSwitchEditor": "Trocar &&Editor", + "miFocusFirstGroup": "&&Primeiro Grupo", + "miFocusSecondGroup": "&&Segundo Grupo", + "miFocusThirdGroup": "&&Terceiro Grupo", + "miNextGroup": "&&Próximo Grupo", + "miPreviousGroup": "&&Grupo Anterior", + "miSwitchGroup": "Trocar &&Grupo", + "miGotoFile": "Ir para &&Arquivo...", + "miGotoSymbolInFile": "Ir para o &&Símbolo no Arquivo...", + "miGotoSymbolInWorkspace": "Ir para o Símbolo em &&Ãrea de Trabalho", + "miGotoDefinition": "Ir para &&Definição", + "miGotoTypeDefinition": "Ir para a &&definição de tipo", + "miGotoImplementation": "Ir para a &&implementação", + "miGotoLine": "Ir para &&Linha...", + "miStartDebugging": "Iniciar Depuração", + "miStartWithoutDebugging": "Iniciar &&Sem Depuração", + "miStopDebugging": "&&Parar Depuração", + "miRestart Debugging": "&&Reiniciar Depuração", + "miOpenConfigurations": "Abrir &&Configurações", + "miAddConfiguration": "Adicionar Configuração...", + "miStepOver": "Pular &&Sobre", + "miStepInto": "Pular &&Dentro", + "miStepOut": "Pular &&Fora", + "miContinue": "&&Continuar", + "miToggleBreakpoint": "Alternar &&Ponto de Parada", + "miConditionalBreakpoint": "Ponto de Parada &&Condicional...", + "miColumnBreakpoint": "Ponto de Parada de C&&oluna", + "miFunctionBreakpoint": "Ponto de Parada de &&Função...", + "miNewBreakpoint": "&&Novo Ponto de Parada", + "miDisableAllBreakpoints": "Desabilitar T&&odos os Pontos de Parada", + "miRemoveAllBreakpoints": "Remover &&Todos os Pontos de Parada", + "miInstallAdditionalDebuggers": "&&Instalar Depuradores Adicionais...", + "mMinimize": "Minimizar", + "mClose": "Fechar", + "mBringToFront": "Trazer Tudo para a Frente", + "miToggleDevTools": "&&Alternar Ferramentas do Desenvolvedor", + "miAccessibilityOptions": "&&Opções de Acessibilidade", + "miReportIssues": "Relatar &&Problemas", + "miWelcome": "&&Bem-vindo", + "miInteractivePlayground": "Playground &&Interativo", + "miDocumentation": "&&Documentação", + "miReleaseNotes": "&&Notas de Versão", + "miKeyboardShortcuts": "Referência de &&Atalhos de Teclado", + "miIntroductoryVideos": "&&Vídeos Introdutórios", + "miTwitter": "&&Junte-se a nós no Twitter", + "miUserVoice": "&&Pesquisar Solicitações de Recursos", + "miLicense": "&&Exibir Licença", + "miPrivacyStatement": "&&Política de Privacidade", + "miAbout": "&&Sobre", + "miRestartToUpdate": "Reinicie para Atualizar...", + "miCheckingForUpdates": "Verificando Atualizações...", + "miDownloadUpdate": "Baixar Atualização Disponível", + "miDownloadingUpdate": "Baixando Atualização...", + "miInstallingUpdate": "Instalando Atualização...", + "miCheckForUpdates": "Verificar Atualizações...", + "aboutDetail": "\\\\nVersão {0}\\\\nConfirmação {1}\\\\nData {2}\\\\nShell {3}\\\\nRenderizador {4}\\\\nNó {5}", + "okButton": "OK" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/window.i18n.json b/i18n/ptb/src/vs/code/electron-main/window.i18n.json new file mode 100644 index 00000000000..abee584a9c1 --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/window.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "hiddenMenuBar": "Você ainda pode acessar a barra de menu pressionando a tecla * * Alt * *." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/windows.i18n.json b/i18n/ptb/src/vs/code/electron-main/windows.i18n.json new file mode 100644 index 00000000000..abf3a42e2eb --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/windows.i18n.json @@ -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. +{ + "ok": "OK", + "pathNotExistTitle": "O caminho não existe", + "pathNotExistDetail": "O caminho '{0}' não parece mais existir no disco.", + "reopen": "Reabrir", + "wait": "Continuar Esperando", + "close": "Fechar", + "appStalled": "A janela não está mais respondendo", + "appStalledDetail": "Você pode reabrir, fechar a janela ou continuar esperando.", + "appCrashed": "A janela foi fechada inesperadamente", + "appCrashedDetail": "Pedimos desculpas pelo inconveniente! Você pode reabrir a janela para continuar de onde parou.", + "newWindow": "Nova Janela", + "newWindowDesc": "Abrir uma nova janela", + "recentFolders": "Pastas Recentes", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json b/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json new file mode 100644 index 00000000000..ee0b74f6e41 --- /dev/null +++ b/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json @@ -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. +{ + "notFound": "Extensão '{0}' não encontrada.", + "notInstalled": "Extensão '{0}' não está instalada.", + "useId": "Certifique-se de usar a ID de extensão completa, incluindo o editor, por exemplo: {0}", + "successVsixInstall": "Extensão '{0}' foi instalada com sucesso!", + "alreadyInstalled": "Extensão '{0}' já está instalada.", + "foundExtension": "Encontrado '{0}' na loja VS Code.", + "installing": "Instalando...", + "successInstall": "Extensão '{0}' v {1} foi instalada com sucesso!", + "uninstalling": "Desinstalando {0}...", + "successUninstall": "Extensão '{0}' foi desinstalada com sucesso!" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json new file mode 100644 index 00000000000..32deba05d12 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorConfigurationTitle": "Editor", + "fontFamily": "Controla a família de fontes.", + "fontWeight": "Controla o peso da fonte.", + "fontSize": "Controla o tamanho da fonte em pixels.", + "lineHeight": "Controla a altura da linha. Use 0 para computar a altura da linha a partir do tamanho da fonte.", + "letterSpacing": "Controla o espaçamento da letra em pixels.", + "lineNumbers": "Controla a exibição de números de linha. Valores possíveis são 'on', 'off' e 'relative'. 'relative' mostra a contagem de linhas a partir da posição atual do cursor.", + "rulers": "Colunas nas quais mostrar réguas verticais", + "wordSeparators": "Caracteres que serão usados como separadores de palavras ao fazer navegação relacionada a palavras ou operações", + "tabSize": "O número de espaços equivalentes a uma tabulação. Esta configuração é sobreposta no conteúdo do arquivo quando `editor.detectIndentation` está ligado.", + "tabSize.errorMessage": "Esperado 'número'. Note que o valor \"auto\" foi alterado pela configuração 'editor.detectIndentation'.", + "insertSpaces": "Insere espaços quanto pressionado Tab. Esta configuração é sobrescrita com base no conteúdo do arquivo quando 'editor.detectIndentation' está habilitado.", + "insertSpaces.errorMessage": "Esperado 'booleano'. Note que o valor \"auto\" foi alterado pela configuração 'editor.detectIndentation'.", + "detectIndentation": "Quando um arquivo está sendo aberto, 'editor.tabSize' e 'editor.insertSpace' será detectado com base no conteúdo do arquivo.", + "roundedSelection": "Controla se as seleções têm cantos arredondados", + "scrollBeyondLastLine": "Controla se o editor rolará além da última linha", + "minimap.enabled": "Controla se o mini mapa é exibido", + "minimap.renderCharacters": "Renderizar os caracteres em uma linha (em oposição a blocos de caracteres)", + "minimap.maxColumn": "Limitar o tamanho de um mini-mapa para renderizar no máximo um número determinado de colunas", + "find.seedSearchStringFromSelection": "Controla se nós inicializamos a string de pesquisa na Ferramenta de Pesquisa a partir da seleção do editor", + "find.autoFindInSelection": "Controla se a configuração Find in Selection deve estar ativada quando vários caracteres ou linhas de texto estão selecionados no editor", + "wordWrap.off": "As linhas nunca serão quebradas.", + "wordWrap.on": "As linhas serão quebradas na largura de visualização", + "wordWrap.wordWrapColumn": "As linhas serão quebradas em `editor.wordWrapColumn`.", + "wordWrap.bounded": "As linhas serão quebradas no mínimo entre a largura de visualização e `editor.wordWrapColumn`.", + "wordWrap": "Controla como as linhas devem ser quebradas automaticamente. Pode ser:\n- 'off' (quebra automática de linha desabilitada)\n- 'on' (quebra automática de linha na largura da janela)\n- 'wordWrapColumn' (quebra automática no numero de colunas definido em `editor.wordWrapColumn`) ou\n- 'bounded' (quebra automática em uma dimensão minima da janela e na largura configurada)", + "wordWrapColumn": "Controla a coluna de quebra de linha do editor quando editor.wordWrap` é 'wordWrapColumn' ou 'bounded'.", + "wrappingIndent": "Controla o recuo de linhas quebradas. Pode ser \"none\", \"same\" ou \"indent\".", + "mouseWheelScrollSensitivity": "Um multiplicador a ser usado em \"deltaX\" e \"deltaY\" dos eventos de rolagem do botão de rolagem do mouse", + "multicursorModifier": "O modificador a ser utilizado para adicionar vários cursores com o mouse.", + "quickSuggestions.strings": "Habilitar sugestões rápidas dentro de strings.", + "quickSuggestions.comments": "Habilitar sugestões rápidas dentro de comentários.", + "quickSuggestions.other": "Habilitar sugestões rápidas fora de strings e comentários.", + "quickSuggestions": "Controlar se sugestões devem aparecer automaticamente ao digitar", + "quickSuggestionsDelay": "Controla o atraso em ms após o qual sugestões rápidas serão exibidas", + "parameterHints": "Habilita dicas de parâmetros", + "autoClosingBrackets": "Controla se o editor deve fechar colchetes automaticamente depois de abri-los", + "formatOnType": "Controla se o editor deve formatar automaticamente a linha após a digitação", + "formatOnPaste": "Controla se o editor deve formatar automaticamente o conteúdo colado. Um formatador deve estar disponível e o formatador deve ser capaz de formatar apenas uma parte do documento.", + "suggestOnTriggerCharacters": "Controla se as sugestões devem aparecer automaticamente ao digitar caracteres de gatilho", + "acceptSuggestionOnEnter": "Controla se as sugestões devem ser aceitas com 'Enter' - em adição a 'Tab'. Ajuda a evitar a ambiguidade entre a inserção de novas linhas ou aceitar sugestões. O valor 'smart' significa apenas aceitar uma sugestão com Enter quando ela fizer uma mudança textual", + "acceptSuggestionOnCommitCharacter": "Controla se as sugestões devem ser aceitas em caracteres de confirmação. Por exemplo, em JavaScript, o ponto-e-vírgula (';') pode ser um caractere de confirmação que aceita uma sugestão e digita esse caractere.", + "snippetSuggestions": "Controla se os snippets são exibidos juntamente com as outras sugestões e como eles são ordenados.", + "emptySelectionClipboard": "Controla se a cópia sem nenhuma seleção copia a linha atual.", + "wordBasedSuggestions": "Controla se o auto-completar deve ser calculado baseado nas palavras no documento.", + "suggestFontSize": "Tamanho da fonte para a ferramenta de sugestão", + "suggestLineHeight": "Altura de linha para a ferramenta de sugestão", + "selectionHighlight": "Controla se o editor deve realçar correspondências semelhantes à seleção", + "occurrencesHighlight": "Controla se o editor deve realçar ocorrências de símbolos semânticos.", + "overviewRulerLanes": "Controla o número de decorações que podem ser exibidas na mesma posição na régua de visão geral", + "overviewRulerBorder": "Controla se deve desenhar uma borda ao redor da régua de visão geral.", + "cursorBlinking": "Controla o estilo de animação do cursor, os valores possíveis são 'blink', 'smooth', 'phase', 'expand' e 'solid'", + "mouseWheelZoom": "Alterar o zoom da fonte editor quando utilizada a roda do mouse e pressionando Ctrl", + "cursorStyle": "Controla o estilo do cursor, os valores aceitos são 'block', 'block-outline', 'line', 'line-thin', 'underline' e 'underline-thin'", + "fontLigatures": "Habilita ligaduras de fontes", + "hideCursorInOverviewRuler": "Controla se o cursor deve ficar oculto na régua de visão geral.", + "renderWhitespace": "Controla como o editor deve rendenizar caracteres de espaços em branco, possibilidades são 'none', 'boundary' e 'all'. A opção 'boundary' não rendeniza espaços simples entre palavras.", + "renderControlCharacters": "Controla se o editor deve renderizar caracteres de controle", + "renderIndentGuides": "Controla se o editor deve renderizar guias de identação", + "renderLineHighlight": "Controla como o editor deve renderizar a linha atual, as possibilidades são 'none', 'gutter', 'line' e 'all'.", + "codeLens": "Controla se o editor exibirá a lente de códigos.", + "folding": "Controla se o editor tem codigo colapsível hablitado", + "showFoldingControls": "Controla se os controles de desdobramento na divisão são ocultas automaticamente.", + "matchBrackets": "Realça colchetes correspondente quando um deles estiver selecionado.", + "glyphMargin": "Controla se o editor deve renderizar a margem vertical de ícones. A margem vertical de ícones é usada primordialmente na depuração", + "useTabStops": "Inserção e deleção de espaço em branco seguem a tabulação", + "trimAutoWhitespace": "Remove espaços em branco inseridos automaticamente no fim da linha", + "stablePeek": "Mantém os editores de visualização abertos mesmo quando clicando seu conteúdo ou teclando Escape.", + "dragAndDrop": "Controla se o editor deve permitir mover seleções via arrastar e soltar.", + "sideBySide": "Controla se o editor de diff mostra as diff lado a lado ou inline.", + "ignoreTrimWhitespace": "Controla se o editor de diff mostra alterações nos espaços iniciais ou finais como diferenças", + "renderIndicators": "Controla se o editor de diff mostra indicadores +/- para alterações adicionadas/removidas", + "selectionClipboard": "Controla se a área primária de transferência Linux deve ser suportada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..40fed0886cc --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Conteúdo do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json b/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json new file mode 100644 index 00000000000..60bcb5f5b5a --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "corrupt.commands": "Exceção inesperada ao executar o comando." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json b/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json new file mode 100644 index 00000000000..fc3574b7fde --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mode.tokenizationSupportFailed": "O modo falhou ao gerar token da entrada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json b/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json new file mode 100644 index 00000000000..509203220c8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "plainText.alias": "Texto sem formatação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json b/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json new file mode 100644 index 00000000000..3fada6ebf53 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json @@ -0,0 +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. +{ + "conflict": "Estes arquivos foram alterados nesse meio tempo: {0}", + "summary.0": "Não foram feitas edições", + "summary.nm": "Feitas {0} edições de texto em {1} arquivos", + "summary.n0": "Feitas {0} edições de texto em um arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json b/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json new file mode 100644 index 00000000000..85f2d2943f6 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.contributes.languages": "Contribui às declarações de linguagem.", + "vscode.extension.contributes.languages.id": "ID da linguagem", + "vscode.extension.contributes.languages.aliases": "Aliases de nome para esta linguagem.", + "vscode.extension.contributes.languages.extensions": "Extensões de arquivos associadas a esta linguagem", + "vscode.extension.contributes.languages.filenames": "Nome dos arquivos associados a esta linguagem", + "vscode.extension.contributes.languages.filenamePatterns": "Padrão glob de nomes de arquivos associados a linguagem.", + "vscode.extension.contributes.languages.mimetypes": "Tipos Mime associados à linguagem.", + "vscode.extension.contributes.languages.firstLine": "Uma expressão regular que coincide com a primeira linha de um arquivo da linguaguem.", + "vscode.extension.contributes.languages.configuration": "Um caminho relativo para um arquivo contendo opções de configuração para a linguagem." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json b/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json new file mode 100644 index 00000000000..b6c528c5a25 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "diagAndSourceMultiline": "[{0}] {1}", + "diagAndSource": "[{0}] {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json new file mode 100644 index 00000000000..a1bf17d6ec8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "lineHighlight": "Cor de fundo para a posição do cursor na seleção de linhas.", + "lineHighlightBorderBox": "Cor de fundo para a borda em volta da linha na posição do cursor", + "rangeHighlight": "Cor de fundo dos ranges selecionados, assim como abertura instantânea e descoberta de recursos ", + "caret": "Cor do cursor no editor.", + "editorWhitespaces": "Cor dos caracteres em branco no editor", + "editorIndentGuides": "Cor das guias de indentação do editor.", + "editorLineNumbers": "Cor dos números de linha do editor.", + "editorRuler": "Cor das réguas do editor.", + "editorCodeLensForeground": "Cor do primeiro plano das lentes de código do editor", + "editorBracketMatchBackground": "Cor de fundo atrás do colchetes correspondentes", + "editorBracketMatchBorder": "Cor para as caixas de colchetes correspondentes", + "editorOverviewRulerBorder": "Cor da borda da régua de visão geral.", + "editorGutter": "Cor de fundo da separação do editor.O separador contém os glifos das margens e os números de linha.", + "errorForeground": "Cor do primeiro plano das linhas onduladas de erro no editor.", + "errorBorder": "Cor da borda das linhas onduladas de erro no editor.", + "warningForeground": "Cor do primeiro plano de linhas onduladas de aviso no editor.", + "warningBorder": "Cor da borda das linhas onduladas de aviso no editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json b/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json new file mode 100644 index 00000000000..e045839f7c6 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "introMsg": "Obrigado por testar a opção de acessibilidade do VS Code.", + "status": "Status", + "tabFocusModeOnMsg": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. Mude este comportamento ao pressionar {0}.", + "tabFocusModeOnMsgNoKb": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. O comando {0} não pode ser ativado atualmente por uma tecla.", + "tabFocusModeOffMsg": "Pressionando Tab no editor atual irá inserir um caractere Tab. Mude este comportamente ao pressionar {0}.", + "tabFocusModeOffMsgNoKb": "Pressionando Tab no editor atual irá inserir um caractere Tab. O comando {0} não pode ser ativado atualmente por uma tecla.", + "outroMsg": "Você pode ignorar essa dica e retornar ao editor apertando a tecla ESC", + "ShowAccessibilityHelpAction": "Mostrar ajuda de acessibilidade" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json b/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json new file mode 100644 index 00000000000..4af1753636d --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "smartSelect.jumpBracket": "Ir para colchete" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json new file mode 100644 index 00000000000..157105c4a35 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "caret.moveLeft": "Mover cursor para a esquerda", + "caret.moveRight": "Mover cursor para a direita" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json new file mode 100644 index 00000000000..c1d3083b198 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "transposeLetters.label": "Transport letras" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json b/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json new file mode 100644 index 00000000000..903f9fc1086 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json @@ -0,0 +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. +{ + "actions.clipboard.cutLabel": "Recortar", + "actions.clipboard.copyLabel": "Copiar", + "actions.clipboard.pasteLabel": "Colar", + "actions.clipboard.copyWithSyntaxHighlightingLabel": "Copiar com realce de sintaxe" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json b/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json new file mode 100644 index 00000000000..ff1ba569c0c --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json @@ -0,0 +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. +{ + "comment.line": "Alternar Comentário de Linha", + "comment.line.add": "Adicionar Comentário de Linha", + "comment.line.remove": "Remover Comentário de Linha", + "comment.block": "Alternar Comentário de Bloco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json b/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json new file mode 100644 index 00000000000..e2b1d946bee --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "action.showContextMenu.label": "Mostrar o menu de contexto do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json new file mode 100644 index 00000000000..473543c0850 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json @@ -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. +{ + "label.find": "Localizar", + "placeholder.find": "Localizar", + "label.previousMatchButton": "Correspondência anterior", + "label.nextMatchButton": "Próxima correspondência", + "label.toggleSelectionFind": "Localizar na seleção", + "label.closeButton": "Fechar", + "label.replace": "Substituir", + "placeholder.replace": "Substituir", + "label.replaceButton": "Substituir", + "label.replaceAllButton": "Substituir Tudo", + "label.toggleReplaceButton": "Ativar/desativar modo Substituir", + "title.matchesCountLimit": "Somente os primeiros 999 resultados são realçados, mas todas as operações de pesquisa funcionam em todo o texto.", + "label.matchesLocation": "{0} de {1}", + "label.noResults": "Nenhum resultado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json new file mode 100644 index 00000000000..07397efa5fe --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "startFindAction": "Localizar", + "findNextMatchAction": "Localizar Próximo", + "findPreviousMatchAction": "Localizar anterior", + "nextSelectionMatchFindAction": "Localizar Próxima Seleção", + "previousSelectionMatchFindAction": "Localizar Seleção Anterior", + "startReplace": "Substituir", + "addSelectionToNextFindMatch": "Adicionar Seleção ao Próximo Localizar Correspondência", + "addSelectionToPreviousFindMatch": "Adicionar Seleção à Correspondência de Localização Anterior", + "moveSelectionToNextFindMatch": "Mover Última Seleção para Próximo Localizar Correspondência", + "moveSelectionToPreviousFindMatch": "Mover Última Seleção para Correspondência de Localização Anterior", + "selectAllOccurencesOfFindMatch": "Selecionar Todas as Ocorrências de Localizar Correspondência", + "changeAll.label": "Alterar todas as ocorrências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json b/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json new file mode 100644 index 00000000000..c9d6b88a852 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "unfoldAction.label": "Abrir", + "unFoldRecursivelyAction.label": "Abrir recursivamente", + "foldAction.label": "Colapsar", + "foldRecursivelyAction.label": "Colapsar recursivamente", + "foldAllAction.label": "Colapsar tudo", + "unfoldAllAction.label": "Abrir tudo", + "foldLevelAction.label": "Nível de colapsamento {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json new file mode 100644 index 00000000000..4327e5f6744 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -0,0 +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. +{ + "hint11": "1 edição de formatação feita na linha {0}", + "hintn1": "{0} edições de formatação feitas na linha {1}", + "hint1n": "Feita 1 edição de formatação entre as linhas {0} e {1}", + "hintnn": "Feitas {0} edições de formatação entre as linhas {1} e {2}", + "formatDocument.label": "Formatar Documento", + "formatSelection.label": "Formatar Seleção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..01753366bca --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "Não foi encontrada definição para '{0}'", + "generic.noResults": "Nenhuma definição encontrada", + "meta.title": "- {0} definições", + "actions.goToDecl.label": "Ir para Definição", + "actions.goToDeclToSide.label": "Abrir definição ao lado", + "actions.previewDecl.label": "Inspecionar definição", + "goToImplementation.noResultWord": "Nenhuma implementação encontrada para '{0}'", + "goToImplementation.generic.noResults": "Nenhuma implementação encontrada", + "meta.implementations.title": "– {0} implementações", + "actions.goToImplementation.label": "Ir para a implementação", + "actions.peekImplementation.label": "Inspecionar implementação", + "goToTypeDefinition.noResultWord": "Nenhuma definição encontrada para '{0}'", + "goToTypeDefinition.generic.noResults": "Nenhuma definição de tipo encontrada", + "meta.typeDefinitions.title": "– {0} definições de tipos", + "actions.goToTypeDefinition.label": "Ir para a definição de tipo", + "actions.peekTypeDefinition.label": "Inspecionar definição de tipo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..675cbe29ae1 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Clique para mostrar {0} definições." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json b/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json new file mode 100644 index 00000000000..0ad65de8863 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json @@ -0,0 +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. +{ + "title.wo_source": "({0}/{1})", + "markerAction.next.label": "Ir para o Próximo Erro ou Aviso", + "markerAction.previous.label": "Ir para o Erro ou Aviso Anterior", + "editorMarkerNavigationError": "Ferramenta de marcação de edição apresentando error na cor ", + "editorMarkerNavigationWarning": "Ferramenta de marcação de edição apresentando adventência na cor", + "editorMarkerNavigationBackground": "Cor de fundo da ferramenta de marcação de navegação do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json new file mode 100644 index 00000000000..196a8fb2bb0 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "showHover": "Mostrar Item Flutuante" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json b/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json new file mode 100644 index 00000000000..2c74cf6f1ec --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "modesContentHover.loading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json b/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json new file mode 100644 index 00000000000..fbbfbd02161 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "InPlaceReplaceAction.previous.label": "Substituir pelo valor anterior", + "InPlaceReplaceAction.next.label": "Substituir pelo próximo valor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json new file mode 100644 index 00000000000..8edeaaf8104 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "indentationToSpaces": "Converter indentação em espaços.", + "indentationToTabs": "Coverter Indentação a Tabulações.", + "configuredTabSize": "Tamanho de Tabulação Configurado", + "selectTabWidth": "Selecione o Tamanho de Tabulação para o Arquivo Atual", + "indentUsingTabs": "Indentar Usando Tabulações", + "indentUsingSpaces": "Indentar Usando Espaços", + "detectIndentation": "Detectar Indentação a Partir do Conteúdo", + "editor.reindentlines": "Reindentar Linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json b/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 00000000000..e715c4d667f --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "inspectTMScopes": "Desenvolvedor: Inspecionar escopos TM", + "inspectTMScopesWidget.loading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json b/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json new file mode 100644 index 00000000000..8a368ab368d --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "lines.copyUp": "Copiar linha acima", + "lines.copyDown": "Copiar linha abaixo", + "lines.moveUp": "Mover linha para cima", + "lines.moveDown": "Mover linha para baixo", + "lines.sortAscending": "Classificar Linhas Ascendentemente", + "lines.sortDescending": "Classificar Linhas Descendentemente", + "lines.trimTrailingWhitespace": "Cortar Espaço em Branco à Direita", + "lines.delete": "Excluir linha", + "lines.indent": "Recuar linha", + "lines.outdent": "Recuar linha para a esquerda", + "lines.insertBefore": "Inserir linha acima", + "lines.insertAfter": "Inserir linha abaixo", + "lines.deleteAllLeft": "Excluir tudo à Esquerda", + "lines.deleteAllRight": "Excluir Tudo à Direita", + "lines.joinLines": "Unir Linhas", + "editor.transpose": "Transpor caracteres ao redor do cursor", + "editor.transformToUppercase": "Transformar para maiúsculas", + "editor.transformToLowercase": "Transformar para minúsculas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json new file mode 100644 index 00000000000..32cd9d3212a --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json @@ -0,0 +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. +{ + "links.navigate.mac": "Cmd + clique para seguir o link", + "links.navigate": "Ctrl + clique para seguir o link", + "links.navigate.al": "Alt + clique para seguir o link", + "invalid.url": "Desculpe, falha ao abrir este link porque ele não está bem formatado: {0}", + "missing.url": "Desculpe, falha ao abrir este link porque seu destino está faltando.", + "label": "Abrir link" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json b/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json new file mode 100644 index 00000000000..583be5b3e5c --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json @@ -0,0 +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. +{ + "mutlicursor.insertAbove": "Inserir cursor acima", + "mutlicursor.insertBelow": "Inserir cursor abaixo", + "mutlicursor.insertAtEndOfEachLineSelected": "Adicionar Cursores ao Final das Linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json new file mode 100644 index 00000000000..f0450d3f4de --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "parameterHints.trigger.label": "Dicas de parâmetro de gatilho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json new file mode 100644 index 00000000000..0f8237adbb3 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "hint": "{0}, dica" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json b/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json new file mode 100644 index 00000000000..01ae8d7aff8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json @@ -0,0 +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. +{ + "quickFixWithKb": "Mostrar correções ({0})", + "quickFix": "Mostrar correções", + "quickfix.trigger.label": "Correção Rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json new file mode 100644 index 00000000000..9d557535df6 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "meta.titleReference": "- {0} referências", + "references.action.label": "Localizar Todas as Referências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json new file mode 100644 index 00000000000..65217d2ace8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "labelLoading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json new file mode 100644 index 00000000000..47c3685850e --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "aria.oneReference": "símbolo em {0} na linha {1} e coluna {2}", + "aria.fileReferences.1": "1 símbolo em {0}", + "aria.fileReferences.N": "{0} símbolos em {1}", + "aria.result.0": "Nenhum resultado encontrado", + "aria.result.1": "Encontrado 1 símbolo em {0}", + "aria.result.n1": "Encontrados {0} símbolos em {1}", + "aria.result.nm": "Encontrados {0} símbolos em {1} arquivos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json new file mode 100644 index 00000000000..72f61eeaf83 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "referencesFailre": "Falha ao resolver arquivo.", + "referencesCount": "{0} referências", + "referenceCount": "{0} referência", + "missingPreviewMessage": "nenhuma visualização disponível", + "treeAriaLabel": "Referências", + "noResults": "Nenhum resultado", + "peekView.alternateTitle": "Referências", + "peekViewTitleBackground": "Cor de fundo da área de visualização do título.", + "peekViewTitleForeground": "Cor de visualização do título.", + "peekViewTitleInfoForeground": "Cor da visualização de informações do título.", + "peekViewBorder": "Cor das bordas e seta da área de visualização", + "peekViewResultsBackground": "Cor de fundo da área de visualização da lista de resultados.", + "peekViewResultsMatchForeground": "Cor de primeiro plano para nós de linha na lista de resultados visualizados.", + "peekViewResultsFileForeground": "Cor de primeiro plano para nós de arquivos na lista de resultados visualizados.", + "peekViewResultsSelectionBackground": "Cor de fundo da entrada selecionada na visualização da lista de resultados.", + "peekViewResultsSelectionForeground": "Cor da entrada selecionada na visualização da lista de resultados.", + "peekViewEditorBackground": "Cor de fundo da visualização do editor.", + "peekViewEditorGutterBackground": "Cor de fundo da separação na visualização rápida do editor.", + "peekViewResultsMatchHighlight": "Corresponder cor de realce com visualização da lista de resultados.", + "peekViewEditorMatchHighlight": "Corresponder cor de realce com visualização do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json b/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json new file mode 100644 index 00000000000..a56535f6241 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json @@ -0,0 +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. +{ + "no result": "Nenhum resultado.", + "aria": "Renomeado '{0}' para '{1}'com sucesso. Resumo: {2}", + "rename.failed": "Desculpe, falha na execução de renomear.", + "rename.label": "Renomear Símbolo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json b/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json new file mode 100644 index 00000000000..49eba92fa44 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "renameAriaLabel": "Renomear entrada. Digite o novo nome e tecle Enter para gravar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json b/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json new file mode 100644 index 00000000000..89319f9a266 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "smartSelect.grow": "Expandir seleção", + "smartSelect.shrink": "Reduzir seleção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json new file mode 100644 index 00000000000..b064152c8be --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "arai.alert.snippet": "Ao aceitar '{0}' foi inserido o seguinte texto: {1}", + "suggest.trigger.label": "Sugestão de gatilho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json new file mode 100644 index 00000000000..c9da4793d67 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -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. +{ + "editorSuggestWidgetBackground": "Cor de fundo para a ferramenta de sugestão.", + "editorSuggestWidgetBorder": "Cor da borda para a ferramenta de sugestão.", + "editorSuggestWidgetForeground": "Cor de primeiro plano para a ferramenta de sugestão.", + "editorSuggestWidgetSelectedBackground": "Cor de fundo da entrada selecionada da ferramenta de sugestões.", + "editorSuggestWidgetHighlightForeground": "Cor de realce da correspondência na ferramenta de sugestão.", + "readMore": "Ler Mais...{0}", + "suggestionWithDetailsAriaLabel": "{0}, sugestão, tem detalhes", + "suggestionAriaLabel": "{0}, sugestão", + "readLess": "Ler menos... {0}", + "suggestWidget.loading": "Carregando...", + "suggestWidget.noSuggestions": "Nenhuma sugestão.", + "suggestionAriaAccepted": "{0}, aceito", + "ariaCurrentSuggestionWithDetails": "{0}, sugestão, tem detalhes", + "ariaCurrentSuggestion": "{0}, sugestão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json b/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json new file mode 100644 index 00000000000..0f3dd068095 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggle.tabMovesFocus": "Alterne o uso da tecla Tab para mover o foco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json b/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json new file mode 100644 index 00000000000..e8556cb38a8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "wordHighlight": "Cor de fundo de um símbolo durante acesso de leitura, como ao ler uma variável.", + "wordHighlightStrong": "Cor de fundo de um símbolo durante acesso de escrita, como ao escrever uma variável." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json new file mode 100644 index 00000000000..41ad7313b7d --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "label.close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json b/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json new file mode 100644 index 00000000000..dfef3cc47a5 --- /dev/null +++ b/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "invalid.language": "Linguagem desconhecida em `contributes.{0}.language`. Valor fornecido: {1}", + "invalid.scopeName": "Esperada uma string em 'contributes.{0}.scopeName'. Valor informado: {1}", + "invalid.path.0": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.injectTo": "Valor inválido em `contributes.{0}.injectTo`. Deve ser uma matriz de nomes de escopo de idioma. Valor fornecido: {1}", + "invalid.embeddedLanguages": "Valor inválido em `contributes.{0}.embeddedLanguages`. Deve ser um objeto de mapeamento do nome do escopo para a linguagem. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "no-tm-grammar": "Nenhuma gramática TM registrada para este idioma." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json new file mode 100644 index 00000000000..04aa2bc703f --- /dev/null +++ b/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "parseErrors": "Erros parseando {0}: {1}", + "schema.openBracket": "O colchete de abertura de caractere ou sequência de caracteres.", + "schema.closeBracket": "O colchete de fechamento de caractere ou sequência de caracteres.", + "schema.comments": "Define o símbolo dos comentários", + "schema.blockComments": "Define como comentários em bloco são marcados.", + "schema.blockComment.begin": "A sequência de caracteres que inicia um comentário em bloco.", + "schema.blockComment.end": "A sequência de caracteres que termina um comentário de bloco.", + "schema.lineComment": "A sequência de caracteres que inicia um comentário de linha.", + "schema.brackets": "Define os símbolos de colchetes que aumentam ou diminuem a indentação.", + "schema.autoClosingPairs": "Define os pares de colchetes. Quando é introduzido um colchete de abertura, o colchete de fechamento é inserido automaticamente.", + "schema.autoClosingPairs.notIn": "Define uma lista de escopos onde os auto pares são desativados.", + "schema.surroundingPairs": "Define os pares de colchetes que podem ser usados para cercar uma seqüência selecionada.", + "schema.wordPattern": "A definição da palavra para a linguagem.", + "schema.wordPattern.pattern": "O padrão RegExp usado para coincidir com as palavras.", + "schema.wordPattern.flags": "Os sinalizadores RegExp usados para coincidir com as palavras.", + "schema.wordPattern.flags.errorMessage": "Deve corresponder ao padrão `/^([gimuy]+)$/`." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json b/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json new file mode 100644 index 00000000000..7707ea3401f --- /dev/null +++ b/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json @@ -0,0 +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. +{ + "vscode.extension.contributes.grammars": "Contibui aos toquenizadores textmate", + "vscode.extension.contributes.grammars.language": "Identificador da linguagem para qual a sintaxe contribui.", + "vscode.extension.contributes.grammars.scopeName": "Nome do escopo Textmate usado pelo arquivo tmLanguage.", + "vscode.extension.contributes.grammars.path": "Caminho para o arquivo tmLanguage. O caminho é relativo a pasta da extensão e geralmente começa com './syntaxes/'.", + "vscode.extension.contributes.grammars.embeddedLanguages": "Um mapeamento no nome do escopo para o Id da linguagem se esta gramática contenha linguagens embutidas.", + "vscode.extension.contributes.grammars.injectTo": "Lista de nomes de escopos de linguagem aos quais esta gramática é injetada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json b/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json new file mode 100644 index 00000000000..e64a7d0ed09 --- /dev/null +++ b/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "titleAndKb": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json new file mode 100644 index 00000000000..a8ef6175a09 --- /dev/null +++ b/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "requirearray": "os itens de menu devem ser um array", + "requirestring": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "optstring": "a propriedade `{0}` é opcional ou deve ser do tipo `string`", + "vscode.extension.contributes.menuItem.command": "Identificador do comando para ser executado. O comando deve ser declarado na seção de 'Comandos'", + "vscode.extension.contributes.menuItem.alt": "O identificador de um comando alternativo para executar. O comando deve ser declarado na sessão 'Comandos'", + "vscode.extension.contributes.menuItem.when": "Condição, que deve ser verdadeira, para mostrar esse item", + "vscode.extension.contributes.menuItem.group": "Grupo ao qual pertence este comando", + "vscode.extension.contributes.menus": "Contribui itens de menu ao editor", + "menus.commandPalette": "Paleta de comandos", + "menus.editorTitle": "Meno do título editor", + "menus.editorContext": "Mostrar o menu de contexto do editor", + "menus.explorerContext": "Menu no contexto de explorador de arquivos", + "menus.editorTabContext": "Mostrar o menu de contexto do editor", + "menus.debugCallstackContext": "O menu de contexto de pilha de chamadas de depuração", + "menus.scmTitle": "O menu de título do controle de fonte", + "menus.resourceGroupContext": "O menu de contexto do grupo de recursos de controle de fonte", + "menus.resourceStateContext": "O menu de contexto de estado de recursos do controle de fonte", + "nonempty": "Esperado um valor não vazio", + "opticon": "a propriedade '{0}' é opcional ou pode ser do tipo 'string'", + "requireStringOrObject": "a propriedade '{0}' é obrigatória e deve ser do tipo 'string'", + "requirestrings": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "vscode.extension.contributes.commandType.command": "Indentificador de comando para executar", + "vscode.extension.contributes.commandType.title": "Título para o qual o comando é representado na UI", + "vscode.extension.contributes.commandType.category": "(Opcional) Sequência de categoria será agrupada na interface de usuário", + "vscode.extension.contributes.commandType.icon": "(Opcional) Icone utilizado para representar o comando na interface de usuário. Um arquivo ou configuração do tema.", + "vscode.extension.contributes.commandType.icon.light": "Caminho do Ãcone quando o tema light for utilizado", + "vscode.extension.contributes.commandType.icon.dark": "Caminho do ícone quando o tema dark for utilizado", + "vscode.extension.contributes.commands": "Contribui comandos à paleta de comandos", + "dup": "Comando '{0}' aparece multiplas vezes na sessão 'comandos'\n", + "menuId.invalid": "'{0}' nao é um identificador de menu válido ", + "missing.command": "Identificador do comando para ser executado. O comando deve ser declarado na seção de 'Comandos'", + "missing.altCommand": "Referências ao item de menu no alt-command '{0}' qual nao é definido na sessão 'comandos'", + "dupe.command": "Itens de referencias do mesmo comando como padrão e alt-command", + "nosupport.altCommand": "Desculpe, mas atualmente somente o groupo 'navegação' do menu 'editor/título' suporta alt-commands" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json new file mode 100644 index 00000000000..928f36b2ee4 --- /dev/null +++ b/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "defaultConfigurations.title": "Sobreposições da Configuração Padrão", + "overrideSettings.description": "Definir que configurações do editor sejam substituídas para idioma {0}.", + "overrideSettings.defaultDescription": "Definir que configurações do editor sejam substituídas para um idioma.", + "vscode.extension.contributes.configuration": "Contribui às definições de configuração.", + "vscode.extension.contributes.configuration.title": "Um resumo das configurações. Este rótulo será usado no arquivo de configurações como um comentário de separação.", + "vscode.extension.contributes.configuration.properties": "Descrição das propriedades de configuração.", + "config.property.languageDefault": "Não é possível registrar '{0}'. Isto corresponde a propriedade padrão '\\\\[.*\\\\]$' para descrever configurações do editor específico de linguagem. Use a contribuição 'configurationDefaults'.", + "config.property.duplicate": "Não é possível registrar '{0}'. Esta propriedade já está registrada.", + "invalid.properties": "'configuration.properties' deve ser um objeto", + "invalid.type": "Se definido, 'configuration.type' deve ser do tipo 'object'", + "invalid.title": "'configuration.title' deve ser um string", + "vscode.extension.contributes.defaultConfiguration": "Contribui às definições de configuração padrão do editor por linguagem." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json b/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json new file mode 100644 index 00000000000..4cec19113d2 --- /dev/null +++ b/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "gotoValidation": "Argumentos no modo '--goto' deve ser no formato de 'Arquivo(:LINHA(:CARACTERE))'.", + "diff": "Abrir um editor de diff. Requer passar dois caminhos de arquivo como argumentos.", + "goto": "Abra o arquivo no caminho, na linha e caractere (addcionar:linha[:caractere] para o caminho).", + "locale": "Para localização utilize (ex. en-US ou zh-TW).", + "newWindow": "Força uma nova instância do Código.", + "performance": "Comece com o 'Desenvolvedor: Desempenho de inicialização' comando habilitado.", + "prof-startup": "Rodar o CPU profiler durante a inicialização", + "reuseWindow": "Forçar a abertura de um arquivo ou pasta na última janela ativa", + "userDataDir": "Especifica o diretório que os dados do usuário serão mantidos, útil quando estiver rodando como root.", + "verbose": "Imprimir a saída detalhada (Implica -- esperar).", + "wait": "Aguarde a janela ser fechada antes de retornar.", + "extensionHomePath": "Defina o caminho raíz para as extensões.", + "listExtensions": "Lista de extensões instaladas", + "showVersions": "Exibir versões de extensões instaladas, quando estiver usando --list-extension", + "installExtension": "Instala uma extensão.", + "uninstallExtension": "Desinstala uma extensão.", + "experimentalApis": "Permite recursos de api propostos para uma extensão.", + "disableExtensions": "Desabilita todas as extensões instaladas.", + "disableGPU": "Desabilita aceleração de hardware da GPU.", + "version": "Versão de impressão", + "help": "Uso de impressão.", + "usage": "Uso", + "options": "opções", + "paths": "caminhos", + "optionsUpperCase": "Opções" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json new file mode 100644 index 00000000000..52f37b66ccd --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noWorkspace": "Não há espaço de trabalho." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json new file mode 100644 index 00000000000..33ea8261326 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "extensions": "Extensões", + "preferences": "Preferências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json new file mode 100644 index 00000000000..76dc4cf48f3 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "notFound": "Extensão não encontrada", + "noCompatible": "Não foi possível econtrar uma versão de {0} com esta versão do Code." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json new file mode 100644 index 00000000000..a6c5a37ab05 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "invalidManifest": "Extensão inválida: pacote.json nao é um arquivo JSON válido", + "restartCode": "Por favor reinicie Code antes de reinstalar {0}.", + "installDependeciesConfirmation": "A instalação de '{0}' também inclui suas dependências. Gostaria de continuar?", + "install": "Sim", + "doNotInstall": "Não", + "uninstallDependeciesConfirmation": "Gostaria de desinstalar '{0}' somente, ou suas dependências também?", + "uninstallOnly": "Apenas", + "uninstallAll": "Todos", + "cancel": "Cancelar", + "uninstallConfirmation": "Tem certeza que deseja desinstalar '{0}'?", + "ok": "OK", + "singleDependentError": "Não foi possível desinstalar a extensão '{0}'. A extensão '{1}' depende dela.", + "twoDependentsError": "Não foi possível desinstalar a extensão '{0}'. As extensões '{1}' e '{2}' dependem dela.", + "multipleDependentsError": "Não foi possível desinstalar a extensão '{0}'. As extensões '{1}' e '{2}' e outras dependem dela.", + "notExists": "Não foi possível encontrar a extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json b/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json new file mode 100644 index 00000000000..d521fce97ff --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json @@ -0,0 +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. +{ + "unknownDep": "Extensão '{1}' falhou ao ativar. Motivo: dependência desconhecida '{0}'.", + "failedDep1": "Extensão '{1}' falhou ao ativar. Motivo: a dependência '{0}' falhou ao ativar.", + "failedDep2": "Extensão '{0}' falhou ao ativar. Motivo: mais de 10 níveis de dependências (provavelmente um laço de dependência).", + "activationError": "Ativação da extensão `{0}` falhou: {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json new file mode 100644 index 00000000000..649e13b03b1 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.engines.vscode": "Para extensões do VS Code, especifica a versão do VS Code que a extensão é compatível. Não pode ser *. Por exemplo: ^0.10.5 indica compatibilidade com uma versão mínima de 0.10.5 para o VS Code.", + "vscode.extension.publisher": "O editor da extensão do VS Code.", + "vscode.extension.displayName": "O nome de exibição para a extensão do VS Code.", + "vscode.extension.categories": "As categorias usadas pela galeria do VS Code para categorizar a extensão.", + "vscode.extension.galleryBanner": "Banner usado na loja VS Code.", + "vscode.extension.galleryBanner.color": "A cor do banner usado no cabeçalho de página da loja VS Code.", + "vscode.extension.galleryBanner.theme": "A cor do tema usada para o fonte usado no banner.", + "vscode.extension.contributes": "Todas as contribuições da extensão VS Code representadas por este pacote.", + "vscode.extension.preview": "Configura a extensão para ser marcada como pré-visualização na Loja.", + "vscode.extension.activationEvents": "Eventos de ativação para a extensão VS Code.", + "vscode.extension.badges": "Matriz de emblemas a mostrar na barra lateral da página da extensão na Loja.", + "vscode.extension.badges.url": "URL da imagem do emblema.", + "vscode.extension.badges.href": "Link do emblema.", + "vscode.extension.badges.description": "Descrição do emblema.", + "vscode.extension.extensionDependencies": "Dependências para outras extensões. O identificador de uma extensão sempre é ${publisher}. ${nome}. Por exemplo: vscode.csharp.", + "vscode.extension.scripts.prepublish": "Script a ser executado antes do pacote ser publicado como uma extensão VS Code.", + "vscode.extension.icon": "O caminho para um ícone de 128x128 pixels." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json new file mode 100644 index 00000000000..fe37dd1820f --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "versionSyntax": "Não foi possível analisar o valor de 'engines.vscode' {0}. Por favor, utilize, por exemplo: ^ 0.10.0, ^ 1.2.3, ^ 0.11.0, ^ 0.10.x, etc.", + "versionSpecificity1": "Versão especificada em 'engines.vscode' ({0}) não é específica o suficiente. Para versões do vscode anteriores a 1.0.0, por favor defina no mínimo a versão principal e secundária desejada. Por exemplo, ^ 0.10.0, 0.10.x, 0.11.0, etc.", + "versionSpecificity2": "Versão especificada em 'engines.vscode' ({0}) não é específica o suficiente. Para as versões do vscode posteriores a 1.0.0, por favor defina no mínimo a versão principal do desejado. Por exemplo, ^ 1.10.0, 1.10.x 1. XX, 2.x.x, etc.", + "versionMismatch": "Extensão não é compatível com Code {0}. A extensão requer: {1}.", + "extensionDescription.empty": "Descrição de extensão vazia obtida", + "extensionDescription.publisher": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.name": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.version": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.engines": "a propriedade `{0}` é obrigatória e deve ser do tipo `object`", + "extensionDescription.engines.vscode": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.extensionDependencies": "a propriedade `{0}` pode ser omitida ou deve ser do tipo `string[]`", + "extensionDescription.activationEvents1": "a propriedade `{0}` pode ser omitida ou deve ser do tipo `string[]`", + "extensionDescription.activationEvents2": "Propriedades '{0}' e '{1}' devem ser especificadas ou devem ambas ser omitidas", + "extensionDescription.main1": "a propriedade `{0}` é opcional ou pode ser do tipo `string`", + "extensionDescription.main2": "Esperado 'main' ({0}) ser incluído dentro da pasta da extensão ({1}). Isto pode fazer a extensão não-portável.", + "extensionDescription.main3": "propriedades '{0}' e '{1}' devem ser especificadas ou devem ambas ser omitidas", + "notSemver": "Versão da extensão não é compatível a semver" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json b/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json new file mode 100644 index 00000000000..d252527ac15 --- /dev/null +++ b/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json @@ -0,0 +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. +{ + "integrity.ok": "OK", + "integrity.dontShowAgain": "Não mostrar novamente", + "integrity.moreInfo": "Mais informações", + "integrity.prompt": "Sua instalação de {0} parece estar corrompida. Favor reinstalar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json b/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json new file mode 100644 index 00000000000..47ff1ba6bad --- /dev/null +++ b/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "contributes.jsonValidation": "Contribui à configuração do schema json.", + "contributes.jsonValidation.fileMatch": "O padrão de arquivo a corresponder, por exemplo \"package.json\" ou \"*.launch\".", + "contributes.jsonValidation.url": "Um esquema de URL ('http:', 'https:') ou caminho relativo à pasta de extensão('./').", + "invalid.jsonValidation": "'configuration.jsonValidation' deve ser uma matriz", + "invalid.fileMatch": "'configuration.jsonValidation.fileMatch' deve ser definido", + "invalid.url": "'configuration.jsonValidation.url' deve ser uma URL ou caminho relativo", + "invalid.url.fileschema": "'configuration.jsonValidation.url' é uma URL relativa inválida: {0}", + "invalid.url.schema": "'configuration.jsonValidation.url' deve começar com ' http:', ' https: 'ou'. /' para os esquemas de referência localizados na extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json b/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json new file mode 100644 index 00000000000..59961c4476a --- /dev/null +++ b/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "first.chord": "({0}) foi pressionado. Aguardando segunda tecla de pressionamento simultâneo...", + "missing.chord": "A combinação de chave ({0}, {1}) não é um comando." +} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/notroot/notrootView.css b/i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json similarity index 56% rename from src/vs/workbench/parts/git/browser/views/notroot/notrootView.css rename to i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json index 85665d2e346..bf2baf83906 100644 --- a/src/vs/workbench/parts/git/browser/views/notroot/notrootView.css +++ b/i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json @@ -2,22 +2,15 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -.git-viewlet > .notroot-view { - padding: 0 20px 0 20px; -} - -.git-viewlet > .notroot-view > p { - line-height: 1.5em; -} - -.git-viewlet > .notroot-view .code { - display: inline; -} - -.git-viewlet > .notroot-view a +// Do not edit this file. It is machine generated. { - color: inherit; - font-weight: bold; - text-decoration: underline; -} + "ctrlKey": "Ctrl", + "shiftKey": "Shift", + "altKey": "Alt", + "windowsKey": "Windows", + "ctrlKey.long": "Controle", + "shiftKey.long": "Shift", + "altKey.long": "Alt", + "cmdKey.long": "Comando", + "windowsKey.long": "Windows" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json new file mode 100644 index 00000000000..29df9e58b2b --- /dev/null +++ b/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "ProblemPatternParser.loopProperty.notLast": "A propriedade loop só é suportada na última linha correspondente.", + "ProblemPatternParser.problemPattern.missingRegExp": "Está faltando uma expressão regular a problema padrão.", + "ProblemPatternParser.problemPattern.missingProperty": "O problema padrão é inválido. Ele deve ter ao menos um arquivo, mensagem e linha ou local de grupo de correspondência.", + "ProblemPatternParser.invalidRegexp": "Erro: a cadeia de caracteres {0} não é uma expressão regular válida.\n", + "ProblemPatternSchema.regexp": "A expressão regular para procurar um erro, aviso ou informação na saída.", + "ProblemPatternSchema.file": "O índice do grupo de correspondência do arquivo. Se omitido, será usado 1.", + "ProblemPatternSchema.location": "O índice de grupo de correspondência da localização do problema. Padrões de localização válidos são: (linha), (linha, coluna) e (startLine, startColumn, endLine, endColumn). Se omitido (linha, coluna) é assumido.", + "ProblemPatternSchema.line": "O índice de grupo de correspondência da linha do problema. O padrão é 2", + "ProblemPatternSchema.column": "O índice de grupo de correspondência de caractere da linha do problema. O padrão é 3", + "ProblemPatternSchema.endLine": "O índice de grupo de correspondência de linha final do problema. O padrão é indefinido", + "ProblemPatternSchema.endColumn": "O índice de grupo de correspondência de caráter final de linha do problema. O padrão é indefinido", + "ProblemPatternSchema.severity": "O índice de grupo de correspondência da gravidade do problema. O padrão é indefinido", + "ProblemPatternSchema.code": "O índice de grupo de correspondência do código do problema. O padrão é indefinido", + "ProblemPatternSchema.message": "O índice de grupo de correspondência da mensagem. Se omitido o padrão é 4 se o local for especificado. Caso contrário o padrão é 5.", + "ProblemPatternSchema.loop": "Em um loop de correspondência multi linha indica se este padrão é executado em um loop enquanto houver correspondências. Somente pode ser especificado no último padrão em um padrão de linha múltiplas.", + "NamedProblemPatternSchema.name": "O nome do modelo de problema.", + "NamedMultiLineProblemPatternSchema.name": "O nome do modelo de problema multi-linhas.", + "NamedMultiLineProblemPatternSchema.patterns": "Os padrões atuais.", + "ProblemPatternExtPoint": "Contribui aos modelos de problema", + "ProblemPatternRegistry.error": "Modelo de problema inválido. O modelo será ignorado.", + "ProblemMatcherParser.noProblemMatcher": "Erro: a descrição não pode ser convertida em uma correspondência de problema:\n{0}\n\n", + "ProblemMatcherParser.noProblemPattern": "Erro: a descrição nao define um padrão de problema válido: {0}\n", + "ProblemMatcherParser.noOwner": "Erro: a descriçao não define um proprietário:\n{0}\n", + "ProblemMatcherParser.noFileLocation": "Erro: a descrição não define uma localização de arquivo:\n{0}\n", + "ProblemMatcherParser.unknownSeverity": "Info: severidade {0} desconhecida. Valores válidos são erro, aviso e info.\n", + "ProblemMatcherParser.noDefinedPatter": "Erro: o padrão com o identificador {0} não existe.", + "ProblemMatcherParser.noIdentifier": "Erro: a propriedade padrão se refere a um identificador vazio.", + "ProblemMatcherParser.noValidIdentifier": "Erro: a propriedade padrão {0} não é uma variável de padrões válida.", + "ProblemMatcherParser.problemPattern.watchingMatcher": "Um problema de correspondência deve obrigatoriamente definir padrão inicial e um padrão final para monitoramento.", + "ProblemMatcherParser.invalidRegexp": "Erro: a cadeia de caracteres {0} não é uma expressão regular válida.\n", + "WatchingPatternSchema.regexp": "A expressão regular para detectar o início ou o fim de uma tarefa em segundo plano.", + "WatchingPatternSchema.file": "O índice do grupo de correspondência do arquivo. Pode ser omitido.", + "PatternTypeSchema.name": "O nome de um padrão pré-definido ou contribuído.", + "PatternTypeSchema.description": "Um padrão de problema ou o nome de um padrão de problema pré-definido ou contribuído. Pode ser omitido se base for especificada.", + "ProblemMatcherSchema.base": "O nome de uma correspondência de problema base a ser utilizado.", + "ProblemMatcherSchema.owner": "O proprietário de um problema dentro do código. Pode ser omitido se base for especificada. Default para 'externo' se omitido e base não for especificada.", + "ProblemMatcherSchema.severity": "A severidade padrão para captura de problemas. É utilizada se o padrão não definir um grupo correspondente para severidade.", + "ProblemMatcherSchema.applyTo": "Controla se um problema reportado em um documento de texto é aplicado somente para aberto, fechado ou todos os documentos.", + "ProblemMatcherSchema.fileLocation": "Define como os nomes de arquivos reportados em um padrão de problema devem ser interpretados.", + "ProblemMatcherSchema.background": "Padrões para monitorar o início e o término de um pesquisador ativo em uma tarefa em segundo plano.", + "ProblemMatcherSchema.background.activeOnStart": "Se configurado para verdadeiro, o monitor em segundo plano está em modo ativo quando a tarefa inicia. Isto é igual a emissão de uma linha que corresponde ao beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Se houver correspondência na saída o início de uma tarefa em segundo plano é sinalizada.", + "ProblemMatcherSchema.background.endsPattern": "Se houver correspondência na saída o final de uma tarefa em segundo plano é sinalizada.", + "ProblemMatcherSchema.watching.deprecated": "A propriedade watching foi descontinuada. Use background no lugar dela.", + "ProblemMatcherSchema.watching": "Padrões para monitorar o início e o término de um pesquisador observando.", + "ProblemMatcherSchema.watching.activeOnStart": "Se configurado para verdadeiro, o monitoramento está em modo ativo quando a tarefa inicia. Isto é igual a emissão de uma linha que corresponde ao beginPattern", + "ProblemMatcherSchema.watching.beginsPattern": "Se houver correspondência na saída o início de uma tarefa observada é sinalizada.", + "ProblemMatcherSchema.watching.endsPattern": "Se houver correspondência na saída o final de uma tarefa observada é sinalizada.", + "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Esta propriedade está descontinuada. Ao invés, use a propriedade de observação.", + "LegacyProblemMatcherSchema.watchedBegin": "Uma expressão regular sinalizando que uma tarefa observada é ativada através da observação.", + "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Esta propriedade está descontinuada. Ao invés, use a propriedade de observação.", + "LegacyProblemMatcherSchema.watchedEnd": "Uma expressão regular sinalizando que uma tarefa observada terminou a execução.", + "NamedProblemMatcherSchema.name": "O nome do correspondente do problema.", + "ProblemMatcherExtPoint": "Contribui aos correspondentes de problema" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/message/common/message.i18n.json b/i18n/ptb/src/vs/platform/message/common/message.i18n.json new file mode 100644 index 00000000000..620c63edd07 --- /dev/null +++ b/i18n/ptb/src/vs/platform/message/common/message.i18n.json @@ -0,0 +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. +{ + "close": "Fechar", + "later": "Mais tarde", + "cancel": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/request/node/request.i18n.json b/i18n/ptb/src/vs/platform/request/node/request.i18n.json new file mode 100644 index 00000000000..1f7fd75e5aa --- /dev/null +++ b/i18n/ptb/src/vs/platform/request/node/request.i18n.json @@ -0,0 +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. +{ + "httpConfigurationTitle": "HTTP", + "proxy": "As configurações de proxy a usar. Se não forem configuradas, serão obtidas das variáveis de ambiente http_proxy e https_proxy", + "strictSSL": "Se o certificado do servidor de proxy deve ser verificado contra a lista de autoridades de certificação fornecida.", + "proxyAuthorization": "O valor para enviar como o cabeçalho de 'autorização Proxy' para cada solicitação de rede." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json b/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json new file mode 100644 index 00000000000..a1d67b82fb7 --- /dev/null +++ b/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableTelemetry": "Permitir que os dados de uso e erros sejam enviados à Microsoft." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json new file mode 100644 index 00000000000..64d68304f98 --- /dev/null +++ b/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "invalid.color": "Formato inválido de cor. Use #RGB, #RGBA, #RRGGBB ou #RRGGBBAA", + "schema.colors": "Cores usadas no workbench.", + "foreground": "Cor de primeiro plano geral. Essa cor é só usada se não for substituída por um componente.", + "errorForeground": "Cor de primeiro plano geral para mensagens de erro. Essa cor é só usada se não for substituída por um componente.", + "descriptionForeground": "Cor de primeiro plano para a descrição do texto provendo informação adicional, por exemplo para uma etiqueta.", + "focusBorder": "Cor geral da borda para elementos focalizados. Essa cor é usada somente se não for substituída por um componente.", + "contrastBorder": "Uma borda extra em torno de elementos para separá-los dos outros de maior contraste.", + "activeContrastBorder": "Uma borda extra em torno de elementos ativos para separá-los dos outros de maior contraste.", + "selectionBackground": "A cor de fundo das seleções de texto na bancada de trabalho (por exemplo, para campos de entrada ou áreas de texto). Note que isto não se aplica a seleções dentro do editor e do terminal.", + "textSeparatorForeground": "Cor para separadores de texto.", + "textLinkForeground": "Cor de primeiro plano para links no texto.", + "textLinkActiveForeground": "Cor de primeiro plano para links ativos no texto.", + "textPreformatForeground": "Cor de primeiro plano para segmentos de texto pré-formatados.", + "textBlockQuoteBackground": "Cor de fundo para blocos de citações no texto.", + "textBlockQuoteBorder": "Cor da borda para blocos de citações no texto.", + "textCodeBlockBackground": "Cor de fundo para blocos de código no texto.", + "widgetShadow": "Cor de sombra ferramentas como localizar/substituir dentro do editor.", + "inputBoxBackground": "Cor de fundo da caixa de entrada.", + "inputBoxForeground": "Cor de primeiro plano da caixa de entrada.", + "inputBoxBorder": "Borda da caixa de entrada.", + "inputBoxActiveOptionBorder": "Cor da borda das opções ativas em campos de entrada.", + "inputPlaceholderForeground": "Cor de primeiro plano da caixa de entrada para o texto de espaço reservado.", + "inputValidationInfoBackground": "Cor de fundo de validação de entrada para a severidade de informações.", + "inputValidationInfoBorder": "Cor da borda de validação de entrada para a severidade de informações.", + "inputValidationWarningBackground": "Cor de fundo de validação de entrada para avisos.", + "inputValidationWarningBorder": "Cor da borda de validação para a severidade de avisos.", + "inputValidationErrorBackground": "Cor de fundo de validação de entrada para a severidade do erro.", + "inputValidationErrorBorder": "Cor da borda de validação de entrada para a severidade do erro.", + "dropdownBackground": "Cor de fundo do menu suspenso.", + "dropdownForeground": "Cor de primeiro plano do menu suspenso.", + "dropdownBorder": "Borda do menu suspenso.", + "listFocusBackground": "Cor de fundo para o item focalizado de Lista/árvore quando a lista/árvore está ativa. Uma árvore/lista de ativa tem o foco do teclado, uma inativa não.", + "listFocusForeground": "Cor de fundo da Lista/árvore para o item focalizado quando a lista/árvore está ativa. Uma árvore/lista ativa tem o foco do teclado, uma inativa não.", + "listActiveSelectionBackground": "Cor de fundo para o item selecionado de Lista/árvore quando a lista/árvore está ativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listActiveSelectionForeground": "Cor de primeiro plano para o item selecionado de Lista/árvore quando a lista/árvore está ativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listInactiveSelectionBackground": "Cor de fundo para o item selecionado de Lista/árvore quando a lista/árvore está inativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listInactiveSelectionForeground": "Cor de primeiro plano para Lista/árvore para o item selecionado quando a lista/árvore está inativa. Uma árvore/lista ativa tem o foco do teclado, um inativo não.", + "listHoverBackground": "Cor de fundo de Lista/árvore quando pairando sobre itens usando o mouse.", + "listHoverForeground": "Primeiro plano da Lista/Ãrvoce quando passar sobre itens usando o mouse.", + "listDropBackground": "Cor de fundo ao arrastar e soltar de Lista/árvore quando movendo itens usando o mouse.", + "highlight": "Cor de primeiro plano de Lista/árvore de destaques de correspondências ao pesquisar na árvore/lista.", + "pickerGroupForeground": "Seletor rápido de cor para rótulos de agrupamento.", + "pickerGroupBorder": "Seletor rápido de cor para bordas de agrupamentos.", + "buttonForeground": "Cor de primeiro plano do botão.", + "buttonBackground": "Cor de fundo do botão.", + "buttonHoverBackground": "Cor de fundo de botão quando flutuar sobre ele.", + "badgeBackground": "Cor de fundo do distintivo. Distintivos são rótulos de pequenas informações, por exemplo, para a contagem de resultados de pesquisa.", + "badgeForeground": "Cor de primeiro plano do distintivo. Distintivos são rótulos de pequenas informações, por exemplo, para a contagem de resultados de pesquisa.", + "scrollbarShadow": "Sombra da barra de rolagem para indicar que a visualização está sendo rolada.", + "scrollbarSliderBackground": "Cor de fundo do controle deslizante.", + "scrollbarSliderHoverBackground": "Cor de fundo de controle deslizante quando estiver flutuando sobre ele.", + "scrollbarSliderActiveBackground": "Cor de fundo de controle deslizante quando ativo.", + "progressBarBackground": "Cor de fundo da barra de progresso que pode ser mostrada em operações de execução demorada.", + "editorBackground": "Cor de plano de fundo do editor.", + "editorForeground": "Cor de primeiro plano padrão do editor.", + "editorWidgetBackground": "Cor de plano de fundo das ferramentas de edição, como pesquisar/substituir.", + "editorWidgetBorder": "Cor da borda da ferramenta editor.", + "editorSelection": "Cor de seleção do editor.", + "editorInactiveSelection": "Cor de seleção em um editor inativo.", + "editorSelectionHighlight": "Cor de regiões com o mesmo conteúdo da seleção.", + "editorFindMatch": "Cor da correspondência de pesquisa atual.", + "findMatchHighlight": "Cor dos outros resultados de pesquisa.", + "findRangeHighlight": "Cor da faixa que limita a pesquisa.", + "hoverHighlight": "Realçar abaixo da palavra onde é mostrado item flutuante", + "hoverBackground": "Cor de fundo para o item flutuante do editor", + "hoverBorder": "Cor da borda para o item flutuante do editor.", + "activeLinkForeground": "Cor dos links ativos.", + "diffEditorInserted": "Cor de fundo para texto que foi inserido.", + "diffEditorRemoved": "Cor de fundo para texto que foi removido.", + "diffEditorInsertedOutline": "Cor de contorno para o texto que foi inserido.", + "diffEditorRemovedOutline": "Cor de contorno para o texto que foi removido." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..d45294dd317 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "Sobrescrevendo extensão {0} por {1}.", + "extensionUnderDevelopment": "Carregando extensão de desenvolvimento em {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..0feb87677bb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Fechar", + "cancel": "Cancelar", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json b/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json new file mode 100644 index 00000000000..867922ab8d2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "limitHit": "Não apresentando {0} erros e avisos a mais." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..d5ca67a9353 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +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. +{ + "treeView.notRegistered": "Nenhuma visualização de árvore com id '{0}' registrado.", + "treeItem.notFound": "Nenhum item de árvore com id '{0}' encontrado.", + "treeView.duplicateElement": "Elemento {0} já está registrado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json new file mode 100644 index 00000000000..80686b2c898 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -0,0 +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. +{ + "configureLocale": "Configurar Idioma", + "displayLanguage": "Define o idioma de exibição do VSCode.", + "doc": "Veja {0} para obter uma lista dos idiomas suportados.", + "restart": "Modificar o valor requer reinicialização do VSCode.", + "fail.createSettings": "Não foi possível criar '{0}' ({1}).", + "JsonSchema.locale": "O idioma da interface do usuário a ser usada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json new file mode 100644 index 00000000000..9da2e4e11c7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "openFolder": "Abrir Pasta...", + "openFileFolder": "Abrir..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json new file mode 100644 index 00000000000..02e74f2918f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleActivityBar": "Alternar Visibilidade da Barra de Atividades", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json new file mode 100644 index 00000000000..4cdb847aaca --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json @@ -0,0 +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. +{ + "toggleEditorGroupLayout": "Alternar Layout Vertical/Horizontal do Grupo de Editor", + "horizontalLayout": "Layout do Grupo de Editor Horizontal", + "verticalLayout": "Layout do Grupo de Editor Vertical", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json new file mode 100644 index 00000000000..ee4fc530361 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleLocation": "Alternar Localização da Barra Lateral", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json new file mode 100644 index 00000000000..5143e35479c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleSidebar": "Alternar Localização da Barra Lateral", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json new file mode 100644 index 00000000000..5376fb36c3a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleStatusbar": "Alternar Visibilidade da Barra de Status", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json new file mode 100644 index 00000000000..b0a635982f2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleZenMode": "Alternar Modo Zen", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json new file mode 100644 index 00000000000..8dab311a65f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeFromActivityBar": "Remover da Barra de Atividades", + "keepInActivityBar": "Manter na Barra de Atividades", + "titleKeybinding": "{0} ({1})", + "additionalViews": "Visualizações Adicionais", + "numberBadge": "{0} ({1})", + "manageExtension": "Gerenciar Extensão", + "toggle": "Alternar Visualização Fixa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json new file mode 100644 index 00000000000..5f8a7bb47de --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "hideActivitBar": "Ocultar a Barra de Atividades", + "activityBarAriaLabel": "Chave do Modo de exibição Ativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json new file mode 100644 index 00000000000..e12e6d4b90e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "ariaCompositeToolbarLabel": "{0} ações ", + "titleTooltip": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json new file mode 100644 index 00000000000..a38af02d663 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "metadataDiff": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json new file mode 100644 index 00000000000..53321246ac7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "binaryEditor": "Visualizador binário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json new file mode 100644 index 00000000000..dbfae18a9bf --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "textEditor": "Editor de texto", + "textDiffEditor": "Editor de Diferentes Textos", + "binaryDiffEditor": "Editor de Diferença Binária", + "sideBySideEditor": "Editor Lado a lado", + "groupOnePicker": "Mostrar editores no primeiro grupo", + "groupTwoPicker": "Mostrar editores no segundo grupo", + "groupThreePicker": "Mostrar editores no terceiro grupo", + "allEditorsPicker": "Mostrar todos editores abertos", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json new file mode 100644 index 00000000000..ae6f9ae84b7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitEditor": "Dividir editor", + "joinTwoGroups": "Juntar editores de dois grupos", + "navigateEditorGroups": "Navegar entre grupos de editores", + "focusActiveEditorGroup": "Focalizar grupo de editores ativo", + "focusFirstEditorGroup": "Focalizar o primeiro grupo de editores", + "focusSecondEditorGroup": "Focalizar o segundo grupo de editores", + "focusThirdEditorGroup": "Focalizar o terceiro grupo de editores", + "focusPreviousGroup": "Focalizar grupo anterior", + "focusNextGroup": "Focalizar próximo grupo", + "openToSide": "Aberto para o lado", + "closeEditor": "Fechar editor", + "revertAndCloseActiveEditor": "Reverter e fechar editor", + "closeEditorsToTheLeft": "Fechar editores à esquerda ", + "closeEditorsToTheRight": "Fechar editores à direita", + "closeAllEditors": "Fechar todos editores", + "closeEditorsInOtherGroups": "Fechar editores nos outros grupos", + "closeOtherEditorsInGroup": "Fechar outros editores", + "closeEditorsInGroup": "Fechar todos editores no grupo", + "moveActiveGroupLeft": "Mover grupo de editores para esquerda", + "moveActiveGroupRight": "Mover grupo de editores para direita", + "minimizeOtherEditorGroups": "Minimizar outros grupos de editores", + "evenEditorGroups": "Igualar larguras de grupos de editores", + "maximizeEditor": "Maximizar grupo de editor e ocultar barra lateral", + "keepEditor": "Manter editor", + "openNextEditor": "Abrir próximo editor", + "openPreviousEditor": "Abrir editor anterior", + "nextEditorInGroup": "Abrir próximo editor no grupo", + "openPreviousEditorInGroup": "Abrir editor anterior no grupo", + "navigateNext": "Avançar", + "navigatePrevious": "Voltar", + "reopenClosedEditor": "Reabrir Editor Fechado", + "clearRecentFiles": "Limpar arquivos recentes", + "showEditorsInFirstGroup": "Mostrar editores no primeiro grupo", + "showEditorsInSecondGroup": "Mostrar editores no segundo grupo", + "showEditorsInThirdGroup": "Mostrar editores no terceiro grupo", + "showEditorsInGroup": "Mostrar editores no grupo", + "showAllEditors": "Mostrar todos editores", + "openPreviousRecentlyUsedEditorInGroup": "Abrir o Editor Anterior Recentemente Usado no Grupo", + "openNextRecentlyUsedEditorInGroup": "Abrir o Próximo Editor Recentemente Usado no Grupo", + "navigateEditorHistoryByInput": "Abrir o Editor Anterior do Histórico", + "openNextRecentlyUsedEditor": "Abrir o Próximo Editor Recentemente Utilizado", + "openPreviousRecentlyUsedEditor": "Abrir o Editor Anterior Recentemente Utilizado", + "clearEditorHistory": "Limpar Histórico do Editor", + "focusLastEditorInStack": "Abrir Último Editor do Grupo", + "moveEditorLeft": "Mover Editor para Esquerda", + "moveEditorRight": "Mover Editor para Direita", + "moveEditorToPreviousGroup": "Mover Editor para o Grupo Anterior", + "moveEditorToNextGroup": "Mover o Editor para o Próximo Grupo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json new file mode 100644 index 00000000000..f42c45c02f5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorCommand.activeEditorMove.description": "Mover o editor ativo por guias ou grupos", + "editorCommand.activeEditorMove.arg.name": "Argumento de movimento do editor ativo", + "editorCommand.activeEditorMove.arg.description": "Propriedades do argumento: \n\t\t\t\t\t\t- 'para': sequência de valor fornecendo para onde mover.\n\t\t\t\t\t\t- 'por': sequência de valor, fornecendo a unidade para o movimento. Por guia ou por grupo.\n\t\t\t\t\t\t- 'valor': valor numérico, fornecendo quantas posições ou uma posição absoluta para mover.\n\t\t\t\t\t", + "commandDeprecated": "Comando **{0}** foi removido. Você pode usar **{1}** em vez disso", + "openKeybindings": "Configurar os atalhos de teclado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json new file mode 100644 index 00000000000..c6a90d88542 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "groupOneVertical": "Esquerda", + "groupTwoVertical": "Centro", + "groupThreeVertical": "Direita", + "groupOneHorizontal": "Topo", + "groupTwoHorizontal": "Centro", + "groupThreeHorizontal": "Baixo", + "editorOpenError": "Não foi possível abrir '{0}': {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json new file mode 100644 index 00000000000..e17bc940565 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json @@ -0,0 +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. +{ + "entryAriaLabel": "{0}, seletor de grupo editor", + "groupLabel": "Grupo: {0}", + "noResultsFoundInGroup": "Não foi encontrado nennhum editor aberto no grupo", + "noOpenedEditors": "Lista de editores abertos está atualmente vazia no grupo", + "noResultsFound": "Não foi encontrado editor correspondente aberto", + "noOpenedEditorsAllGroups": "A lista de editores abertos está atualmente vazia" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json new file mode 100644 index 00000000000..ff6a038e701 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "singleSelectionRange": "Ln {0}, {1} Col ({2} selecionado)", + "singleSelection": "Ln {0}, {1} Col", + "multiSelectionRange": "{0} seleções ({1} caracteres selecionados)", + "multiSelection": "{0} seleções", + "endOfLineLineFeed": "LF", + "endOfLineCarriageReturnLineFeed": "CRLF", + "tabFocusModeEnabled": "Tabulação move o foco", + "screenReaderDetected": "Leitor de tela detectado", + "disableTabMode": "Desativar o modo de acessibilidade", + "gotoLine": "Ir para linha", + "indentation": "Indentação", + "selectEncoding": "Selecionar a codificação", + "selectEOL": "Selecionar a sequência de fim de linha", + "selectLanguageMode": "Selecionar modo de idioma", + "fileInfo": "Informações do arquivo", + "spacesSize": "Espaços: {0}", + "tabSize": "Tamanho de Tabulação: {0}", + "showLanguageExtensions": "Pesquisar extensões na loja para '{0}'...", + "changeMode": "Alterar o modo de linguagem", + "noEditor": "Nenhum editor de texto ativo neste momento", + "languageDescription": "({0}) - linguagem configurada", + "languageDescriptionConfigured": "({0})", + "languagesPicks": "linguagens (identificador)", + "configureModeSettings": "Configurar '{0}' configurações baseadas em linguagem...", + "configureAssociationsExt": "Configurar a associação de arquivo para '{0}'...", + "autoDetect": "Detecção automática", + "pickLanguage": "Selecionar o modo do idioma", + "currentAssociation": "Associação atual", + "pickLanguageToConfigure": "Selecionar o modo de linguagem para associar a '{0}'", + "changeIndentation": "Alterar a indentação", + "noWritableCodeEditor": "O editor de código ativo é somente leitura.", + "indentView": "alterar visualização", + "indentConvert": "converter arquivo", + "pickAction": "Selecionar ação", + "changeEndOfLine": "Alterar sequência de final de linha", + "pickEndOfLine": "Selecionar sequência de final de linha", + "changeEncoding": "Alterar a codificação do arquivo", + "noFileEditor": "Nenhum arquivo ativo neste momento", + "saveWithEncoding": "Salvar com codificação", + "reopenWithEncoding": "Reabrir com codificação", + "guessedEncoding": "Adivinhado a partir do conteúdo", + "pickEncodingForReopen": "Selecione a codificaçãodo arquivo para reabrir o arquivo.", + "pickEncodingForSave": "Selecione a codificação do arquivo para Salvar Com" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json new file mode 100644 index 00000000000..9001e58fa99 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "araLabelTabActions": "Ações de tablulação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json new file mode 100644 index 00000000000..8af2aff62d5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "textDiffEditor": "Editor de Diferentes Textos", + "readonlyEditorWithInputAriaLabel": "{0}. Editor de comparação de texto somente leitura.", + "readonlyEditorAriaLabel": "Editor de comparação de texto somente leitura.", + "editableEditorWithInputAriaLabel": "{0}. Editor de comparação de arquivos texto.", + "editableEditorAriaLabel": "Editor de comparação de arquivos texto.", + "navigate.next.label": "Próxima Alteração", + "navigate.prev.label": "Alteração Anterior", + "inlineDiffLabel": "Alternar para exibição embutida", + "sideBySideDiffLabel": "Alternar para exibição lado a lado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json new file mode 100644 index 00000000000..eb58230b854 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorLabelWithGroup": "{0}, Grupo {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json new file mode 100644 index 00000000000..77f89efba5f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "textEditor": "Editor de texto", + "readonlyEditorWithInputAriaLabel": "{0}. Editor de texto somente leitura.", + "readonlyEditorAriaLabel": "Editor de texto somente leitura.", + "untitledFileEditorWithInputAriaLabel": "{0}. Editor de texto de arquivo sem nome.", + "untitledFileEditorAriaLabel": "Editor de texto de arquivo sem nome." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json new file mode 100644 index 00000000000..bf8307cd384 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "close": "Fechar", + "closeOthers": "Fechar Outros", + "closeRight": "Fechar à direita", + "closeAll": "Fechar todos", + "keepOpen": "Manter aberto", + "showOpenedEditors": "Mostrar editores abertos", + "araLabelEditorActions": "Ações de editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json new file mode 100644 index 00000000000..1f98f38c47e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "panelActionTooltip": "{0} ({1})", + "closePanel": "Fechar Painel", + "togglePanel": "Alternar Painel", + "focusPanel": "Foco no Painel", + "toggleMaximizedPanel": "Alternar Painel Maximizado", + "maximizePanel": "Maximizar Tamanho do Painel", + "minimizePanel": "Restaurar tamanho do Painel", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json new file mode 100644 index 00000000000..48a7b1b2f76 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "panelSwitcherBarAriaLabel": "Chave do Painel Ativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json new file mode 100644 index 00000000000..c98dd22d95d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json @@ -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. +{ + "inputModeEntryDescription": "{0} (Pressione 'Enter' para confirmar ou 'Esc' para cancelar)", + "inputModeEntry": "Pressione 'Enter' para confirmar o texto digitado ou 'Esc' para cancelar", + "emptyPicks": "Não há entradas a serem escolhidas", + "quickOpenInput": "Digite '?' para obter ajuda sobre as ações que você pode realizar a partir daqui", + "historyMatches": "aberto recentemente", + "noResultsFound1": "Nenhum resultado encontrado", + "canNotRunPlaceholder": "Esse manipulador de abertura rápida não pode ser usado no contexto atual", + "entryAriaLabel": "{0}, recentemente aberto", + "removeFromEditorHistory": "Remover do Histórico", + "pickHistory": "Selecionar uma entrada do editor para remover do histórico" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json new file mode 100644 index 00000000000..57f5524e1be --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "quickOpen": "Ir para o Arquivo...", + "quickNavigateNext": "Navegar ao próximo em modo de abertura rápida", + "quickNavigatePrevious": "Navegar ao anterior em modo de abertura rápida", + "quickSelectNext": "Selecionar próximo em modo de abertura rápida", + "quickSelectPrevious": "Selecionar anterior em modo de abertura rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json new file mode 100644 index 00000000000..89806e051ea --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "focusSideBar": "Foco na Barra Lateral", + "viewCategory": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json new file mode 100644 index 00000000000..4a2adabf5a6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "canNotRun": "O comando '{0}' não está habilitado e não pode ser executado.", + "manageExtension": "Gerenciar Extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json new file mode 100644 index 00000000000..1c3db4d572b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "patchedWindowTitle": "[Sem Suporte]", + "devExtensionWindowTitlePrefix": "[Host de Desenvolvimento de Extensão]" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json b/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json new file mode 100644 index 00000000000..26c5e14f367 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json @@ -0,0 +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. +{ + "noResultsMatching": "Nenhum resultado encontrado", + "noResultsFound2": "Nenhum resultado encontrado", + "entryAriaLabel": "{0}, comando", + "noCommands": "Não há comandos correspondentes" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json b/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json new file mode 100644 index 00000000000..34655b736ba --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "collapse": "Recolher tudo", + "viewToolbarAriaLabel": "{0} ações " +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/common/theme.i18n.json b/i18n/ptb/src/vs/workbench/common/theme.i18n.json new file mode 100644 index 00000000000..635ace8d708 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/common/theme.i18n.json @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "tabActiveBackground": "Cor de fundo da guia ativa. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabInactiveBackground": "Cor de fundo da guia inativa. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabBorder": "Borda para separar uma guia das outras. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabActiveEditorGroupActiveForeground": "Cor de primeiro plano da guia ativa em um grupo ativo. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabInactiveEditorGroupActiveForeground": "Cor de primeiro plano da guia inativa em um grupo ativo. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "editorGroupBackground": "Cor de fundo de um grupo de editor. Grupos de editor são os recipientes dos editores. A cor de fundo é mostrada ao arrastar o editor de grupos ao redor.", + "tabsContainerBackground": "Cor de fundo do cabeçalho do título do grupo de editor quando as guias são habilitadas. Grupos de editor são os recipientes dos editores.", + "tabsContainerBorder": "Cor da borda do cabeçalho do título do grupo de editor quando as guias estão habilitadas. Grupos de editor são os recipientes dos editores.", + "editorGroupHeaderBackground": "Cor de fundo do título do cabeçalho do grupo de editor quando as guias são desabilitadas. Grupos de editor são os recipientes dos editores.", + "editorGroupBorder": "Cor para separar múltiplos grupos de editor de outro. Grupos de editor são os recipientes dos editores.", + "editorDragAndDropBackground": "Cor de fundo ao arrastar editores. A cor deve ter transparência para que o conteúdo do editor ainda possa ser visto.", + "panelBackground": "Cor de fundo do painel. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelBorder": "Cor da borda do painel no topo separando do editor. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelActiveTitleForeground": "Cor do título para o painel ativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelInactiveTitleForeground": "Cor do título para o painel inativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelActiveTitleBorder": "Cor da borda para o título do painel ativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "statusBarForeground": "Cor do primeiro plano da barra de status. A barra de status é mostrada na parte inferior da janela.", + "statusBarBackground": "Cor de fundo da barra de status padrão. A barra de status é mostrada na parte inferior da janela.", + "statusBarBorder": "Cor da borda da barra de status que separa a barra lateral e o editor.A barra de status é mostrada na parte inferior da janela.", + "statusBarNoFolderBackground": "Cor de fundo da barra de status quando nenhuma pasta está aberta. A barra de status é mostrada na parte inferior da janela.", + "statusBarNoFolderForeground": "Cor do primeiro plano da barra de status quando nenhuma pasta está aberta. A barra de status é mostrada na parte inferior da janela.", + "statusBarItemActiveBackground": "Cor de fundo do item da barra de status quando você clicado. A barra de status é mostrada na parte inferior da janela.", + "statusBarItemHoverBackground": "Cor de fundo do item da barra de status quando estiver passando sobre ele. A barra de status é mostrada na parte inferior da janela.", + "statusBarProminentItemBackground": "Cor de fundo de itens proeminentes da barra de status. Itens proeminentes destacam-se outras entradas da barra de status para indicar a importância. A barra de status é mostrada na parte inferior da janela.", + "statusBarProminentItemHoverBackground": "Cor de fundo dos itens proeminentes de barra de status quando estiver passando sobre eles. Itens proeminentes destacam-se outras entradas de barra de status para indicar a importância. A barra de status é mostrada na parte inferior da janela.", + "activityBarBackground": "Cor de fundo da barra de atividades. Barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarForeground": "Cor de primeiro plano da barra de atividades (por exemplo, usada para os ícones). A barra de atividades está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarBorder": "Cor da borda da barra de atividades separando a barra lateral. A barra de atividade é mostrada à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarDragAndDropBackground": "Cor de feedback de arrastar e soltar para os itens da barra de atividades. A cor deve ter transparência para que as entradas de bar de atividade ainda possam brilhar. A barra de atividade está visível à esquerda ou à direita e permite para alternar entre as visualizações da barra lateral.", + "activityBarBadgeBackground": "Cor de fundo da notificação de atividade. A barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarBadgeForeground": "Cor de primeiro plano da notificação de atividade. A barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "sideBarBackground": "Cor de fundo da barra lateral. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarForeground": "Cor de primeiro plano da barra lateral. A barra lateral é o recipiente para visualizações como o explorador e a busca.", + "sideBarBorder": "Cor da borda da barra lateral separando o editor. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarTitleForeground": "Cor de primeiro plano do título da barra lateral. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarSectionHeaderBackground": "Cor de fundo do cabeçalho de seção lateral. A barra lateral é o recipiente para visões como explorador e pesquisa.", + "sideBarSectionHeaderForeground": "Cor de primeiro plano do cabeçalho de seção da barra lateral. A barra lateral é o recipiente para visualizações como o explorador e pesquisa.", + "titleBarActiveForeground": "Cor da barra de título do primeiro plano quando a janela está ativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarInactiveForeground": "Cor de primeiro plano da barra de título quando a janela está inativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarActiveBackground": "Cor de fundo da barra de título quando a janela está ativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarInactiveBackground": "Cor de fundo de barra de título quando a janela está inativa. Observe que essa cor é atualmente somente suportada no macOS.", + "notificationsForeground": "Cor do primeiro plano de notificações. Notificações deslizam na parte superior da janela.", + "notificationsBackground": "Cor de fundo de notificações. Notificações deslizam na parte superior da janela." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json new file mode 100644 index 00000000000..d829a3c8cad --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "closeActiveEditor": "Fechar Editor", + "closeWindow": "Fechar Janela", + "switchWindow": "Alternar Janela", + "switchWindowPlaceHolder": "Selecionar uma janela", + "current": "Janela Atual", + "closeFolder": "Fechar Pasta", + "noFolderOpened": "Não há nenhuma pasta aberta nesta instância para ser fechada.", + "newWindow": "Nova Janela", + "toggleFullScreen": "Alternar Tela Inteira", + "toggleMenuBar": "Alternar Barra de Menus", + "toggleDevTools": "Alternar Ferramentas do Desenvolvedor", + "zoomIn": "Ampliar", + "zoomOut": "Reduzir", + "zoomReset": "Reinicializar Zoom", + "appPerf": "Desempenho de inicialização", + "reloadWindow": "Recarregar Janela", + "openRecent": "Abrir Recente", + "folders": "pastas", + "files": "arquivos", + "openRecentPlaceHolderMac": "Selecionar um caminho (Pressione a tecla Cmd para abrir em uma nova janela)", + "openRecentPlaceHolder": "Selecionar um caminho para abrir (Pressione a tecla Cmd para abrir em uma nova janela)", + "closeMessages": "Fechar mensagens de notificação", + "reportIssues": "Reportar Problemas", + "reportPerformanceIssue": "Reportar Problema de Desempenho", + "keybindingsReference": "Referência de Atalhos de Teclado", + "openDocumentationUrl": "Documentação", + "openIntroductoryVideosUrl": "Vídeos Introdutórios", + "toggleSharedProcess": "Alternar processo compartilhado", + "navigateLeft": "Mover para a Visualizção à Esquerda", + "navigateRight": "Mover para a Visualização à Direita", + "navigateUp": "Mover para a Visualização Acima", + "navigateDown": "Mover para a Visualização Abaixo", + "increaseViewSize": "Aumentar o Tamanho da Visualização Atual", + "decreaseViewSize": "Diminuir o Tamanho da Visualização Atual" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json new file mode 100644 index 00000000000..3a1051dcfda --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "diffLeftRightLabel": "{0} ⟷ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json new file mode 100644 index 00000000000..10b7a7ff108 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableCrashReporting": "Ativar o envio de relatórios de incidentes à Microsoft.\nEsta opção requer reinicialização para ser efetivada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json new file mode 100644 index 00000000000..e5a7ab81686 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json @@ -0,0 +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. +{ + "extensionHostProcess.startupFailDebug": "O host de extensão não iniciou em 10 segundos, ele pode ser interrompido na primeira linha e precisa de um depurador para continuar.", + "extensionHostProcess.startupFail": "Host de extensão não começou em 10 segundos, isso pode ser um problema.", + "extensionHostProcess.error": "Erro do host de extensão: {0}", + "extensionHostProcess.crash": "Host de extensão foi encerrado inesperadamente. Por favor recarregar a janela para recuperar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json new file mode 100644 index 00000000000..3b9050de1af --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "view": "Exibir", + "help": "Ajuda", + "file": "Arquivo", + "developer": "Desenvolvedor", + "showEditorTabs": "Controla se os editores abertos devem ou não serem exibidos em abas.", + "editorTabCloseButton": "Controla a posição dos botões de fechar das abas do editor ou os desabilita quando configurados para 'desligado'.", + "showIcons": "Controla se os editores abertos devem ou não ser exibidos com um ícone. Requer um tema de ícone para ser habilitado. ", + "enablePreview": "Controla se os editores abertos são exibidos como visualização. Editores de visualização são reutilizados até que eles sejam preservados (por exemplo, através de um duplo clique ou edição).", + "enablePreviewFromQuickOpen": "Controla se os editores abertos da Abertura Rápida são exibidos como visualização. Os editores de visualização são reutilizados até serem preservados (por exemplo, através de um duplo clique ou edição).", + "editorOpenPositioning": "Controla onde os editores serão abertos. Escolha 'esquerda' ou 'direita' para abrir os editores à esquerda ou à direita do \neditor ativo. Selecione 'primeiro' ou 'último' para abrir os editores independentemente do atual.", + "revealIfOpen": "Controla se um editor é exibido em qualquer um dos grupos, se aberto. Se desabilitado, um editor será aberto preferencialmente no grupo de editores ativo. Se habilitado, um editor já aberto será exibido no grupo de editores ativo, ao invés de ser aberto novamente. Note que há alguns casos onde esta configuração é ignorada, por exemplo, quando for forçada a abertura de um editor em um grupo específico ou ao lado do grupo atualmente ativo.", + "closeOnFocusLost": "Controla se Abertura Rápida deve fechar automaticamente caso perca o foco.", + "openDefaultSettings": "Controla se a abertura de configurações também abre um editor mostrando todas as configurações padrão.", + "sideBarLocation": "Controla a localização da barra lateral. Ele pode ser exibido à esquerda ou à direita da área de trabalho.", + "statusBarVisibility": "Controla a visibilidade da barra de status na parte inferior da área de trabalho.", + "activityBarVisibility": "Controla a visibilidade da barra de atividades na área de trabalho.", + "closeOnFileDelete": "Controla se os editores que mostram um arquivo devem fechar automaticamente quanto o arquivo é apagado ou renomeado por algum outro processo. Desativar isso manterá o editor aberto como sujo neste evento. Note que apagar do aplicativo sempre fechará o editor e os arquivos sujos nunca fecharão para preservar seus dados.", + "swipeToNavigate": "Navegue entre arquivos abertos usando o deslizamento horizontal de três dedos.", + "workbenchConfigurationTitle": "Ãrea de Trabalho", + "window.openFilesInNewWindow.on": "Arquivos serão abertos em uma nova janela", + "window.openFilesInNewWindow.off": "Arquivos serão abertos em uma nova janela com a pasta de arquivos aberta ou com a última janela ativa.", + "window.openFilesInNewWindow.default": "Os arquivos serão abertos na janela com a pasta de arquivos aberta ou a última janela ativa, a menos que seja aberto através do dock ou do finder (somente macOS)", + "openFilesInNewWindow": "Controla se os arquivos devem ser abertos em uma nova janela\n- padrão: os arquivos serão abertos em uma nova janela com a pasta de arquivos aberta ou na última janela ativa, a menos que seja aberta através do dock ou do finder (apenas macOS)\n- ligado: os arquivos serão abertos em uma nova janela\n- desligado: os arquivos serão abertos em uma janela com a pasta de arquivos aberta ou a última janela ativa\nNota que ainda podem haver casos em que esta configuração será ignorada (por exemplo, quando estiver usando as opções de linha de comando -new-window ou -reuse-window).", + "window.openFoldersInNewWindow.on": "As pastas serão abertas em uma nova janela", + "window.openFoldersInNewWindow.off": "As pastas substituirão a última janela ativa", + "window.openFoldersInNewWindow.default": "As pastas serão abertas em uma nova janela, a menos que uma pasta seja selecionada dentro do aplicativo (por exemplo, através do menu Arquivo)", + "openFoldersInNewWindow": "Controla se as pastas devem ser abertas em uma nova janela ou substituir a última janela ativa\n- padrão: as pastas serão abertas em uma nova janela, a menos que seja selecionada dentro do aplicativo (por exemplo, através do menu Arquivo)\n- ligado: as pastas serão abertas em uma nova janela\n- desligado: as pastas substituirão a última janela ativa\nNote que ainda podem haver casos em que esta configuração será ignorada (por exemplo, quando estiver usando as opções de linha de comando -new-window ou -reuse-window).", + "window.reopenFolders.none": "Nunca reabra uma pasta.", + "window.reopenFolders.one": "Reabrir a última pasta ativa.", + "window.reopenFolders.all": "Reabrir todas as pastas da última sessão.", + "reopenFolders": "Controla como as pastas são reabertas depois de um reinício. Escolha 'nenhum' para nunca reabrir uma pasta, 'uma' para reabrir a última pasta que você trabalhou ou 'todas' para reabrir todas as pastas da sua última sessão.", + "restoreFullscreen": "Controla se uma janela deve ser restaurada em modo de tela cheia se ela foi finalizada em modo de tela cheia.", + "zoomLevel": "Ajusta o nível de zoom da janela. O tamanho original é 0 e cada aumento (por exemplo, 1) ou redução (por exemplo, -1) representa um zoom 20% maior ou menor. Você também pode digitar decimais para ajustar o nível de zoom com uma granularidade mais fina.", + "title": "Controla o título da janela com base no editor ativo. As variáveis são substituídas com base no contexto:\n$ {ActiveEditorShort}: por exemplo, meuArquivo.txt\n$ {ActiveEditorMedium}: por exemplo, minhaPasta / meuArquivo.txt\n$ {ActiveEditorLong}: por exemplo, /Usuários/Desenvolvimento/meuProjeto/minhaPasta/meuArquivo.txt\n$ {RootName}: por exemplo, meuProjeto\n$ {RootPath}: por exemplo, /Usuários/Desenvolvimento/meuProjeto\n$ {AppName}: por exemplo, VS Code\n$ {Dirty}: um indicador sujo se o editor ativo for sujo\n$ {Separator}: um separador condicional (\"-\") que só aparece quando for rodeado por variáveis com valores", + "window.newWindowDimensions.default": "Abrir novas janelas no centro da tela.", + "window.newWindowDimensions.inherit": "Abrir novas janelas com a mesma dimensão da última janela ativa.", + "window.newWindowDimensions.maximized": "Abrir novas janelas maximizadas.", + "window.newWindowDimensions.fullscreen": "Abrir novas janelas em modo de tela cheia.", + "newWindowDimensions": "Controla as dimensões ao abrir uma nova janela quando pelo menos uma janela já está aberta. Por padrão, uma nova janela será aberta no centro da tela com pequena dimensão. Quando definido como 'inherit', a janela vai ter as mesmas dimensões que a última janela que estava ativa. Quando definido como 'maximized', a janela abrirá maximizada e em tela cheia se configurado para 'fullscreen'. Observe que essa configuração não tem um impacto sobre a primeira janela que é aberta. A primeira janela sempre irá restaurar o tamanho e a localização como você deixou antes de fechar.", + "window.menuBarVisibility.default": "O menu está oculto apenas em modo de tela cheia.", + "window.menuBarVisibility.visible": "O menu está sempre visivel mesmo quando em modo de tela cheia.", + "window.menuBarVisibility.toggle": "O menu está oculto, mas pode ser mostrado através da tecla Alt.", + "window.menuBarVisibility.hidden": "O menu está sempre oculto.", + "menuBarVisibility": "Controla a visibilidade da barra de menu. Uma configuração 'alternar' significa que a barra de menus está oculta e pressionar a tecla Alt irá mostrá-la. Por padrão, a barra de menu será visível, a menos que a janela esteja em modo de tela cheia.", + "enableMenuBarMnemonics": "Se habilitado, os menus principais podem ser abertos através de atalhos de tecla Alt. Desativar mnemônicos permite vincular esses atalhos de tecla Alt para comandos do editor.", + "autoDetectHighContrast": "Se habilitado, irá mudar automaticamente para o tema de alto contraste se o Windows estiver utilizando um tema de alto contraste, e para o tema escuro ao mudar de um tema de alto contraste do Windows.", + "titleBarStyle": "Ajusta a aparência da barra de título da janela. As alterações exigem um reinício completo.", + "window.nativeTabs": "Habilita as abas da janela do macOS Sierra. Note que as alterações exigem um reinício completo e que as abas nativas desabilitarão um estilo de barra de título customizado, se configurado.", + "windowConfigurationTitle": "Janela", + "zenModeConfigurationTitle": "Modo Zen", + "zenMode.fullScreen": "Controla se a ativação do modo Zen também coloca o espaço de trabalho em modo de tela cheia.", + "zenMode.hideTabs": "Controla se a ativação do modo Zen também oculta as abas do espaço de trabalho.", + "zenMode.hideStatusBar": "Controla se a ativação do modo Zen também oculta a barra de status no rodapé do espaço de trabalho.", + "zenMode.hideActivityBar": "Controla se a ativação do modo Zen também oculta a barra de atividades à esquerda do espaço de trabalho.", + "zenMode.restore": "Controla se uma janela deve ser restaurada para o modo zen se ela foi finalizada no modo zen." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json new file mode 100644 index 00000000000..056d426d27d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "loaderError": "Falha ao carregar o arquivo necessário. Você não está mais conectado à Internet ou o servidor que você está conectado está offline. Atualize o navegador e tente novamente.", + "loaderErrorNative": "Falha ao carregar um arquivo necessário. Reinicie o aplicativo para tentar novamente. Detalhes: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json new file mode 100644 index 00000000000..951a140a2ea --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "runningAsRoot": "Não é recomendado executar Code como 'root'." +} \ No newline at end of file diff --git a/src/vs/platform/theme/common/themes.ts b/i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json similarity index 55% rename from src/vs/platform/theme/common/themes.ts rename to i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json index 072779016a3..50118b77afe 100644 --- a/src/vs/platform/theme/common/themes.ts +++ b/i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json @@ -2,16 +2,14 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -export function isLightTheme(themeId: string) { - return /vs($| )/.test(themeId); -} - -export function isDarkTheme(themeId: string) { - return /vs-dark($| )/.test(themeId); -} - -export function isHighContrastTheme(themeId: string) { - return /hc-black($| )/.test(themeId); +// Do not edit this file. It is machine generated. +{ + "undo": "Desfazer", + "redo": "Refazer", + "cut": "Recortar", + "copy": "Copiar", + "paste": "Colar", + "selectAll": "Selecionar Tudo", + "confirmOpen": "Tem certeza de que deseja abrir '{0}' pastas?", + "confirmOpenButton": "&&Abrir" } \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json b/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json new file mode 100644 index 00000000000..f0596b25871 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "extensionTestError": "Caminho {0} não aponta para um executor de testes com extensão válida." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json b/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json new file mode 100644 index 00000000000..18d7b3f26c8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json @@ -0,0 +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. +{ + "jsonParseFail": "Falha ao analisar {0}: {1}.", + "fileReadFail": "Não foi possível ler o arquivo {0}: {1}.", + "jsonsParseFail": "Falha ao analisar {0} ou {1}: {2}.", + "missingNLSKey": "Não foi possível encontrar a mensagem para a chave {0}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json new file mode 100644 index 00000000000..69df9b15d87 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "install": "Instalar o comando '{0}' em PATH", + "not available": "Este comando não está disponível", + "successIn": "Comando shell '{0}' instalado com sucesso em PATH.", + "warnEscalation": "O código solicitará com 'osascript' pelos privilégios de Administrador para instalar o comando shell.", + "ok": "OK", + "cantCreateBinFolder": "Não é possível criar '/usr/local/bin'.", + "cancel2": "Cancelar", + "aborted": "Abortado", + "uninstall": "Desinstalar o comando '{0}' de PATH", + "successFrom": "Comando shell '{0}' desinstalado com sucesso de PATH.", + "shellCommand": "Comando shell" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json new file mode 100644 index 00000000000..18ee740ae31 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "workbench.action.inspectKeyMap": "Desenvolvedor: Inspecionar Mapeamentos de Chave" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json new file mode 100644 index 00000000000..217bdf1c04e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleRenderControlCharacters": "Alternar caracteres de controle" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json new file mode 100644 index 00000000000..453104fcc6d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleRenderWhitespace": "Alternar Espaço em Branco Renderizado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json new file mode 100644 index 00000000000..058048058af --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -0,0 +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. +{ + "toggle.wordwrap": "Visualizar: Alternar Quebra de Linha", + "wordWrap.notInDiffEditor": "Não pode alternar quebra de linha em um editor diff.", + "unwrapMinified": "Desabilitar empacotamento para este arquivo", + "wrapMinified": "Habilitar empacotamento para este arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json new file mode 100644 index 00000000000..12f93be687c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json @@ -0,0 +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. +{ + "wordWrapMigration.ok": "OK", + "wordWrapMigration.dontShowAgain": "Não mostrar novamente", + "wordWrapMigration.openSettings": "Abrir configurações", + "wordWrapMigration.prompt": "A configuração `editor.wrappingColumn` foi descontinuada e substituída pela configuração `editor.wordWrap`" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json new file mode 100644 index 00000000000..3d748795633 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json @@ -0,0 +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. +{ + "breakpointWidgetExpressionPlaceholder": "Parar quando a expressão for avaliada como true. 'Enter' para aceitar, 'esc' para cancelar.", + "breakpointWidgetAriaLabel": "O programa só vai parar aqui se esta condição for verdadeira. Pressione Enter para aceitar ou Escape para cancelar.", + "breakpointWidgetHitCountPlaceholder": "Parar quando contagem de ocorrências condição for alcançada. 'Enter' para aceitar, 'esc' para cancelar.", + "breakpointWidgetHitCountAriaLabel": "O programa só vai parar aqui, se a contagem de ocorrências for alcançada. Pressione Enter para aceitar ou Escape para cancelar.", + "expression": "Expressão", + "hitCount": "Contagem de ocorrências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json new file mode 100644 index 00000000000..32a88b85efd --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "addConfiguration": "Adicionar Configuração...", + "noConfigurations": "Sem configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json new file mode 100644 index 00000000000..1bc052297a1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "openLaunchJson": "Abrir {0}", + "launchJsonNeedsConfigurtion": "Configurar ou corrigir 'launch.json'", + "noFolderDebugConfig": "Primeiro abra uma pasta para fazer uma configuração de depuração avançada.", + "startDebug": "Iniciar Depuração", + "startWithoutDebugging": "Iniciar Sem Depuração", + "selectAndStartDebugging": "Selecionar e Iniciar a Depuração", + "restartDebug": "Reiniciar", + "reconnectDebug": "Reconectar", + "stepOverDebug": "Pular Sobre", + "stepIntoDebug": "Pular Dentro", + "stepOutDebug": "Pular Fora", + "stopDebug": "Parar", + "disconnectDebug": "Desconectar", + "continueDebug": "Continuar", + "pauseDebug": "Pausa", + "restartFrame": "Reiniciar o Frame", + "removeBreakpoint": "Remover Ponto de Parada", + "removeAllBreakpoints": "Remover Todos os Pontos de Parada", + "enableBreakpoint": "Habilitar ponto de Parada", + "disableBreakpoint": "Desativar Ponto de Parada", + "enableAllBreakpoints": "Habilitar Todos os Pontos de Parada", + "disableAllBreakpoints": "Desabilitar Todos Pontos de Parada", + "activateBreakpoints": "Ativar Pontos de Parada", + "deactivateBreakpoints": "Desativar Pontos de Parada", + "reapplyAllBreakpoints": "Reaplicar Todos os Pontos de Parada", + "addFunctionBreakpoint": "Adicionar Ponto de Parada de Função", + "renameFunctionBreakpoint": "Renomeie o Ponto de Parada de Função", + "addConditionalBreakpoint": "Adicionar Ponto de Parada Condicional...", + "editConditionalBreakpoint": "Editar o Ponto de Parada...", + "setValue": "Definir Valor", + "addWatchExpression": "Adicionar Expressão", + "editWatchExpression": "Editar expressão", + "addToWatchExpressions": "Adicionar ao monitoramento", + "removeWatchExpression": "Remover Expressão", + "removeAllWatchExpressions": "Remover Todas as Expressões", + "clearRepl": "Limpar console", + "debugConsoleAction": "Console do Depurador", + "unreadOutput": "Nova Saída no Console de Depuração", + "debugFocusConsole": "Foco no Console de Depuração", + "focusProcess": "Foco no Processo", + "stepBackDebug": "Passo para trás", + "reverseContinue": "Reverter" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json new file mode 100644 index 00000000000..421e5b19c79 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "debugToolBarBackground": "Cor de fundo da barra de ferramentas de depuração." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json new file mode 100644 index 00000000000..d8aa95c869a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "unable": "Não é possível resolver o recurso sem uma sessão de depuração" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json new file mode 100644 index 00000000000..ef74c88413d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleBreakpointAction": "Depurar: Alternar Ponto de Parada", + "columnBreakpointAction": "Depurar: Ponto de Interrupção de Coluna", + "columnBreakpoint": "Adicionar Ponto de Interrupção de Coluna", + "conditionalBreakpointEditorAction": "Depurar: Adicionar Ponto de Interrupção Condicional...", + "runToCursor": "Executar até o Cursor", + "debugEvaluate": "Depurar: Avaliar", + "debugAddToWatch": "Depurar: Adicionar ao monitoramento", + "showDebugHover": "Mostrar Item Flutuante" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json new file mode 100644 index 00000000000..f30b378456b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json @@ -0,0 +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. +{ + "breakpointDisabledHover": "Ponto de Parada Desativado", + "breakpointUnverifieddHover": "Ponto de Parada Não Verificado", + "breakpointDirtydHover": "Ponto de parada não verificado. O arquivo foi modificado, por favor reinicie a sessão de depuração.", + "breakpointUnsupported": "Pontos de parada condicionais não são suportados por esse tipo de depurador" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json new file mode 100644 index 00000000000..01955c44965 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json @@ -0,0 +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. +{ + "entryAriaLabel": "depurar {0}", + "debugAriaLabel": "Digite um nome de uma configuração de lançamento para ser executado.", + "noConfigurationsMatching": "Não há configurações de depuração correspondentes", + "noConfigurationsFound": "Configurações de depuração não encontradas. Por favor, crie um arquivo 'launch.json'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json new file mode 100644 index 00000000000..a8802c13164 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json @@ -0,0 +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. +{ + "debugExceptionWidgetBorder": "Cor da borda da ferramenta de exceção.", + "debugExceptionWidgetBackground": "Cor de fundo da ferramenta de exceção.", + "exceptionThrownWithId": "Ocorreu exceção: {0}", + "exceptionThrown": "Ocorreu exceção." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..8c7a8761f41 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Clique para seguir (Cmd + clique abre ao lado)", + "fileLink": "Clique para seguir (Cmd + clique abre ao lado)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..3476b79d9e1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "Controla o comportamento do console depuração interna." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json new file mode 100644 index 00000000000..fa2f5e8ada5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "notAvailable": "não disponível", + "startDebugFirst": "Por favor, inicie uma sessão de depuração para avaliar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json new file mode 100644 index 00000000000..0e10c85d818 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "unknownSource": "Fonte desconhecida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json new file mode 100644 index 00000000000..05a7ccfe827 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleDebugViewlet": "Visualizar Depurador", + "toggleDebugPanel": "Console do Depurador", + "debug": "Depurar", + "debugPanel": "Console do Depurador", + "view": "Exibir", + "debugCategory": "Depurar", + "debugCommands": "Configuração do Depurador", + "debugConfigurationTitle": "Depurar", + "allowBreakpointsEverywhere": "Permite definir um ponto de interrupção em qualquer arquivo.", + "openExplorerOnEnd": "Automaticamente abre a visualização do explorador no final de uma sessão de depuração", + "inlineValues": "Mostrar valores de variáveis em linha no editor durante a depuração", + "hideActionBar": "Controlar se a barra de ação flutuante do depurador deve ser ocultada", + "launch": "Configuração global do lançamento do depurador. Deve ser usado como uma alternativa para o arquivo 'launch.json' que é compartilhado entre os espaços de trabalho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..85b353a37fe --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noFolderDebugConfig": "Primeiro abra uma pasta para fazer uma configuração de depuração avançada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json new file mode 100644 index 00000000000..ada60277e7b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.contributes.debuggers": "Contribui adaptadores de depuração.", + "vscode.extension.contributes.debuggers.type": "Identificador único para esse adaptador de depuração.", + "vscode.extension.contributes.debuggers.label": "Nome de exibição para esse adaptador de depuração.", + "vscode.extension.contributes.debuggers.program": "Caminho para o programa adaptador de depuração. O caminho pode ser absoluto ou relativo à pasta de extensão.", + "vscode.extension.contributes.debuggers.args": "Argumentos opcionais a serem informados para o adaptador.", + "vscode.extension.contributes.debuggers.runtime": "Runtime opcional no caso do atributo do programa não ser um executável, mas requerer um runtime.", + "vscode.extension.contributes.debuggers.runtimeArgs": "Argumentos opcionais do runtime.", + "vscode.extension.contributes.debuggers.variables": "Mapeamento de variáveis interativas (por exemplo ${action.pickProcess}) em 'launch.json' para um comando.", + "vscode.extension.contributes.debuggers.initialConfigurations": "Configurações para gerar o 'launch.json' inicial.", + "vscode.extension.contributes.debuggers.languages": "Lista de idiomas para os quais a extensão de depuração pode ser considerada o \"depurador padrão\".", + "vscode.extension.contributes.debuggers.adapterExecutableCommand": "Se especificado VS Code chamará este comando para determinar o caminho do executável do adaptador de depuração e os argumentos para passar.", + "vscode.extension.contributes.debuggers.startSessionCommand": "Se especificado VS Code chamará este comando para as ações de \"depurar\" ou \"executar\" direcionadas para esta extensão.", + "vscode.extension.contributes.debuggers.configurationSnippets": "Trechos de código para adicionar novas configurações em 'launch.json'.", + "vscode.extension.contributes.debuggers.configurationAttributes": "Configurações de esquema JSON para validar 'launch.json'.", + "vscode.extension.contributes.debuggers.windows": "Configurações específicas do Windows.", + "vscode.extension.contributes.debuggers.windows.runtime": "Runtime usado para Windows.", + "vscode.extension.contributes.debuggers.osx": "Configurações específicas do OS X.", + "vscode.extension.contributes.debuggers.osx.runtime": "Runtime usado para o OS X.", + "vscode.extension.contributes.debuggers.linux": "Configurações específicas do Linux.", + "vscode.extension.contributes.debuggers.linux.runtime": "Runtime usado para o Linux.", + "vscode.extension.contributes.breakpoints": "Contribui aos pontos de interrupção.", + "vscode.extension.contributes.breakpoints.language": "Permitir pontos de parada para este idioma.", + "app.launch.json.title": "Executar", + "app.launch.json.version": "Versão deste formato de arquivo.", + "app.launch.json.configurations": "Lista de configurações. Adicionar novas configurações ou editar as existentes usando o IntelliSense.", + "app.launch.json.compounds": "Lista de compostos. Cada composto faz referência a várias configurações que vão ser executadas juntas.", + "app.launch.json.compound.name": "Nome do composto. Aparece no menu drop-down da configuração de execução.", + "app.launch.json.compounds.configurations": "Nomes das configurações que serão iniciadas como parte deste composto.", + "debugNoType": "'type' do adaptador de depuração não pode ser omitido e deve ser do tipo 'string'.", + "DebugConfig.failed": "Não é possível criar o arquivo 'launch.json' dentro da pasta '.vscode' ({0}).", + "selectDebug": "Selecione o ambiente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json new file mode 100644 index 00000000000..1424499bfcc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeBreakpoints": "Remover pontos de interrupção", + "removeBreakpointOnColumn": "Remover ponto de interrupção na coluna {0}", + "removeLineBreakpoint": "Remover ponto de interrupção de linha", + "editBreakpoints": "Editar pontos de interrupção", + "editBreakpointOnColumn": "Editar o ponto de interrupção na coluna {0}", + "editLineBrekapoint": "Editar o ponto de interrupção de linha", + "enableDisableBreakpoints": "Habilitar/Desabilitar pontos de interrupção", + "disableColumnBreakpoint": "Desabilitar ponto de interrupção na coluna {0}", + "disableBreakpointOnLine": "Desabilitar ponto de interrupção de linha", + "enableBreakpoints": "Habilitar o ponto de interrupção na coluna {0}", + "enableBreakpointOnLine": "Habilitar o ponto de interrupção de linha", + "addBreakpoint": "Adicionar ponto de interrupção", + "addConfiguration": "Adicionar Configuração..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json new file mode 100644 index 00000000000..1853865a1ec --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeAriaLabel": "Depurar passando o mouse por cima" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json new file mode 100644 index 00000000000..6dc0bc48afb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "snapshotObj": "Apenas valores primitivos são mostrados para este objeto.", + "debuggingStarted": "Depuração Iniciada.", + "debuggingPaused": "Depuração pausada, razão {0}, {1} {2}", + "debuggingStopped": "Depuração parada.", + "breakpointAdded": "Adicionado ponto de interrupção, linha {0}, arquivo {1}", + "breakpointRemoved": "Ponto de interrupção removido, linha {0}, arquivo {1}", + "compoundMustHaveConfigurations": "Composição deve ter o atributo \"configurations\" definido para iniciar várias configurações.", + "configMissing": "Configuração '{0}' não tem 'launch.json'.", + "debugTypeNotSupported": "Tipo de depuração configurado '{0}' não é suportado.", + "debugTypeMissing": "Falta a propriedade 'type' para a configuração de lançamento escolhida.", + "preLaunchTaskErrors": "Erros de build foram detectados durante a preLaunchTask '{0}'.", + "preLaunchTaskError": "Erro de build foi detectado durante a preLaunchTask '{0}'.", + "preLaunchTaskExitCode": "A preLaunchTask '{0}' encerrada com código de saída {1}.", + "debugAnyway": "Depurar mesmo assim", + "noFolderWorkspaceDebugError": "O arquivo ativo não pode ser depurado. Certifique-se de que ele está salvo no disco e que tem uma extensão de depuração instalada para esse tipo de arquivo.", + "NewLaunchConfig": "Por favor, configure o arquivo de configuração de lançamento para seu aplicativo. {0}", + "DebugTaskNotFound": "Não foi possível encontrar o preLaunchTask '{0}'.", + "differentTaskRunning": "Há uma tarefa {0} sendo executada. Não pode executar a tarefa de pré-lançamento {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json new file mode 100644 index 00000000000..ae47cc6a47d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json @@ -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. +{ + "process": "Processar", + "paused": "Em pausa", + "running": "Em execução", + "thread": "Thread", + "pausedOn": "Pausado em {0}", + "loadMoreStackFrames": "Carregar mais segmentos de pilha", + "threadAriaLabel": "Thread {0}, pilha de chamadas, depuração", + "stackFrameAriaLabel": "Segmento de Pilha {0} linha {1} {2}, pilha de chamadas, depuração", + "variableValueAriaLabel": "Digite o novo valor da variável", + "variableScopeAriaLabel": "Escopo {0}, variáveis, depuração", + "variableAriaLabel": "{0} valor {1}, variáveis, depuração", + "watchExpressionPlaceholder": "Expressão para monitorar", + "watchExpressionInputAriaLabel": "Digitar expressão a monitorar", + "watchExpressionAriaLabel": "{0} valor {1}, monitorar, depuração", + "watchVariableAriaLabel": "{0} valor {1}, monitorar, depuração", + "functionBreakpointPlaceholder": "Função de parada", + "functionBreakPointInputAriaLabel": "Digitar Ponto de Parada de Função", + "functionBreakpointsNotSupported": "Pontos de parada de função não são suportados por este tipo de depuração", + "breakpointAriaLabel": "Ponto de parada linha {0} {1}, pontos de parada, depuração", + "functionBreakpointAriaLabel": "Ponto de parada de função {0}, pontos de parada, depuração", + "exceptionBreakpointAriaLabel": "Ponto de parada de exceção {0}, pontos de parada, depuração" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json new file mode 100644 index 00000000000..d14c4338ceb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "variablesSection": "Seção de variáveis", + "variables": "Variáveis", + "variablesAriaTreeLabel": "Variáveis de Depuração", + "expressionsSection": "Seção de Expressões", + "watch": "Monitoramento", + "watchAriaTreeLabel": "Depurar Expressões Monitoradas", + "callstackSection": "Seção de Pilha de Chamada", + "debugStopped": "Pausado em {0}", + "callStack": "Pilha de Chamadas", + "callStackAriaLabel": "Depurar a Pilha de Chamadas", + "breakpointsSection": "Seção de Pontos de Parada", + "breakpoints": "Pontos de Parada", + "breakpointsAriaTreeLabel": "Depurar os Pontos de Parada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json new file mode 100644 index 00000000000..227ca95927f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -0,0 +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. +{ + "copyValue": "Copiar valor", + "copy": "Copiar", + "copyAll": "Copiar todos", + "copyStackTrace": "Copiar Pilha de Chamadas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json new file mode 100644 index 00000000000..0ce97a8f796 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "moreInfo": "Mais Informações", + "unableToLaunchDebugAdapter": "Não é possível executar o adaptador de depuração de '{0}'.", + "unableToLaunchDebugAdapterNoArgs": "Não é possível executar o adaptador de depuração.", + "stoppingDebugAdapter": "{0}. Parando o adaptador de depuração.", + "debugAdapterCrash": "Processo do adaptador de depuração foi finalizado inesperadamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json new file mode 100644 index 00000000000..73f6f0be4c4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json @@ -0,0 +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. +{ + "replAriaLabel": "Ler o Painel de Impressão Eval", + "actions.repl.historyPrevious": "História anterior", + "actions.repl.historyNext": "Próxima história", + "actions.repl.acceptInput": "REPL Aceitar Entrada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json new file mode 100644 index 00000000000..4afd6d64d82 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "stateCapture": "Estado do objeto é capturado na primeira avaliação", + "replVariableAriaLabel": "Variável {0} tem valor {1}, ler a impressão do valor do loop, depurar", + "replExpressionAriaLabel": "Expressão {0} tem valor {1}, ler o laço de avaliação de impressão, depurar", + "replValueOutputAriaLabel": " impressão da avaliação do laço de leitura, depurar", + "replKeyValueOutputAriaLabel": "Variável de saída {0} tem valor {1}, ler o loop de avaliação de impressão, depurar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json new file mode 100644 index 00000000000..86bf6e71ecc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "statusBarDebuggingBackground": "Cor de fundo da barra de status quando um programa está sendo depurado. A barra de status é mostrada na parte inferior da janela", + "statusBarDebuggingForeground": "Cor de primeiro plano da barra de status quando um programa está sendo depurado. A barra de status é mostrada na parte inferior da janela" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json new file mode 100644 index 00000000000..898a18605fb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "debug.terminal.title": "depurado", + "debug.terminal.not.available.error": "Terminal integrado não disponível" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json new file mode 100644 index 00000000000..f0551dfe57b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugAdapterBinNotFound": "Executável do adaptador de depuração '{0}' não existe.", + "debugAdapterCannotDetermineExecutable": "Não é possível determinar o executável para o adaptador de depuração '{0}'.", + "debugType": "Tipo de configuração.", + "debugTypeNotRecognised": "O tipo de depuração não é reconhecido. Certifique-se de que você tem uma extensão de depuração correspondente instalada e que ela está habilitada.", + "node2NotSupported": "\"node2\" não é mais suportado, use \"node\" ao invés e defina o atributo \"protocol\" para \"inspector\".", + "debugName": "Nome da configuração; aparece no menu drop-down da configuração de lançamento. ", + "debugRequest": "Requer o tipo de configuração. Pode ser \"launch\" ou \"attach\".", + "debugServer": "Somente para o desenvolvimento de extensão de depuração: se uma porta é especificada, o VS Code tenta se conectar a um adaptador de depuração executando em modo de servidor", + "debugPrelaunchTask": "Tarefa para ser executada antes de começar a sessão de depuração.", + "debugWindowsConfiguration": "Atributos de configuração de lançamento específicos do Windows.", + "debugOSXConfiguration": "Atributos de configuração de lançamento específicos do OS X.", + "debugLinuxConfiguration": "Atributos de configuração de lançamento específicos do Linux.", + "deprecatedVariables": "'env.', 'config.' e 'command.' foram descontinuados, use ' env:', ' config:' e ' command:' em vez disso." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json new file mode 100644 index 00000000000..1e3a1c0f277 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "showEmmetCommands": "Mostrar Comandos do Emmet" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..1dc5e1e3b69 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: Saldo (interno)", + "balanceOutward": "Emmet: Saldo (externo)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..cccc82d8a01 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: Ponto de edição anterior", + "nextEditPoint": "Emmet: Ponto próxima edição" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..b4a6a03e213 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: Avaliar a expressão matemática" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..5a5dd3cc3e8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: Expandir Abreviação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..306332a4af2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: Incremento de 0.1", + "incrementNumberByOne": "Emmet: Incremento de 1", + "incrementNumberByTen": "Emmet: Incremento de 10", + "decrementNumberByOneTenth": "Emmet: Decréscimo por 0.1", + "decrementNumberByOne": "Emmet: Decréscimo por 1", + "decrementNumberByTen": "Emmet: Decréscimo por 10" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..6a742c4d5f9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: Ir para o par de correspondência" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..22ed3f5f533 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: Mesclar linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..bc0eefc2e00 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: Refletir valor CSS" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..a30414b08d2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: Remover Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..1343e2d6b36 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: Selecione o Item anterior", + "selectNextItem": "Emmet: Selecione o próximo Item" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..ea04346ea7c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: Dividir/Juntar Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..366cb874a0c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: Alternar Comentário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..1eff88ade9d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: Atualizar o Tamanho da Imagem" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..963a85e1671 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: Atualizar Rótulo", + "enterTag": "Insira o Rótulo", + "tag": "Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..501253b7dcb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: Envelope com a abreviatura", + "enterAbbreviation": "Digite a abreviação", + "abbreviation": "Abreviação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..7f32e3bf156 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Quando habilitado, abreviações emmet são expandidas ao pressionar TAB.", + "emmetPreferences": "Preferências usadas para modificar o comportamento de algumas ações e resolvedores de Emmet.", + "emmetSyntaxProfiles": "Definir o perfil para a sintaxe especificada ou usar seu próprio perfil com regras específicas.", + "emmetExclude": "Uma matriz de línguagens onde abreviaturas emmet não devem ser expandidas.", + "emmetExtensionsPath": "Caminho para uma pasta contendo perfis emmet, trechos e preferências", + "emmetUseModules": "Use os novos módulos emmet para características emmet ao invés da biblioteca emmet única." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 00000000000..95274daf750 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "terminalConfigurationTitle": "Terminal Externo", + "terminal.external.windowsExec": "Personalizar qual terminal executar no Windows.", + "terminal.external.osxExec": "Personalizar qual aplicativo de terminal executar no OS X.", + "terminal.external.linuxExec": "Personalizar qual terminal executar no Linux.", + "globalConsoleActionWin": "Abrir Novo Prompt de Comando", + "globalConsoleActionMacLinux": "Abrir Novo Terminal", + "scopedConsoleActionWin": "Abrir no Prompt de Comando", + "scopedConsoleActionMacLinux": "Abrir no Terminal" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json new file mode 100644 index 00000000000..fde640b09c5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "console.title": "Console VS Code", + "mac.terminal.script.failed": "Script '{0}' falhou com código de saída {1}", + "mac.terminal.type.not.supported": "'{0}' não suportado", + "press.any.key": "Pressione qualquer tecla para continuar...", + "linux.term.failed": "'{0}' falhou com código de saída {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json new file mode 100644 index 00000000000..d79e3c4ca0a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.contributes.view": "Contribui ao modo de exibição personalizado", + "vscode.extension.contributes.view.id": "Identificação única usada para identificar a vista criada por vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Sequência de caracteres legível usada para processar a visualização", + "vscode.extension.contributes.view.icon": "Caminho para o ícone da visualização", + "vscode.extension.contributes.views": "Contribui com visualizações personalizadas", + "showViewlet": "Mostrar {0}", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json new file mode 100644 index 00000000000..37735d10007 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "refresh": "Atualizar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json new file mode 100644 index 00000000000..7b7f16b3812 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorer.noMatchingProviderId": "Não há TreeExplorerNodeProvider com id {providerId} registrado." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json new file mode 100644 index 00000000000..0e7f5f9cd92 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "treeExplorerViewlet.tree": "Seção do Explorador da Ãrvore" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json new file mode 100644 index 00000000000..0ebd24a9fd8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error": "Erro", + "Unknown Dependency": "Dependência Desconhecida:" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json new file mode 100644 index 00000000000..1a3b9d4cd09 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "name": "Nome da extensão", + "extension id": "Identificador da extensão", + "publisher": "Nome do editor", + "install count": "Quantidade de Instalações", + "rating": "Avaliação", + "license": "Licença", + "details": "Detalhes", + "contributions": "Contribuições", + "changelog": "Registro de Alterações", + "dependencies": "Dependências", + "noReadme": "README não disponível.", + "noChangelog": "Registro de Alterações não disponível.", + "noContributions": "Sem Contribuições", + "noDependencies": "Sem Dependências", + "settings": "Configurações ({0})", + "setting name": "Nome", + "description": "Descrição", + "default": "Valor padrão", + "debuggers": "Depuradores ({0})", + "debugger name": "Nome", + "themes": "Temas ({0})", + "JSON Validation": "Validação JSON ({0})", + "commands": "Comandos ({0})", + "command name": "Nome", + "keyboard shortcuts": "Atalhos de Teclado", + "menuContexts": "Contextos de Menu", + "languages": "Linguagens ({0})", + "language id": "ID", + "language name": "Nome", + "file extensions": "Extensões de Arquivo", + "grammar": "Gramática", + "snippets": "Trechos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json new file mode 100644 index 00000000000..61966d0e312 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "installAction": "Instalar", + "installing": "Instalando", + "uninstallAction": "Desinstalar", + "Uninstalling": "Desinstalando", + "updateAction": "Atualizar", + "updateTo": "Atualizar para {0}", + "enableForWorkspaceAction.label": "Habilitar (Espaço de Trabalho)", + "enableAlwaysAction.label": "Habilitar (Sempre)", + "disableForWorkspaceAction.label": "Desabilitar (Espaço de Trabalho)", + "disableAlwaysAction.label": "Desabilitar (Sempre)", + "ManageExtensionAction.uninstallingTooltip": "Desinstalando", + "enableForWorkspaceAction": "Espaço de trabalho", + "enableGloballyAction": "Sempre", + "enableAction": "Habilitar", + "disableForWorkspaceAction": "Espaço de trabalho", + "disableGloballyAction": "Sempre", + "disableAction": "Desabilitar", + "checkForUpdates": "Verificar Atualizações", + "enableAutoUpdate": "Habilitar Extensões Auto-Atualizáveis", + "disableAutoUpdate": "Desabilitar Extensões Auto-Atualizáveis", + "updateAll": "Atualizar Todas as Extensões", + "reloadAction": "Recarregar", + "postUpdateTooltip": "Recarregar para atualizar", + "postUpdateMessage": "Recarregar esta janela para ativar a extensão atualizada '{0}'?", + "postEnableTooltip": "Recarregar para ativar", + "postEnableMessage": "Recarregar esta janela para ativar a extensão '{0}'?", + "postDisableTooltip": "Recarregar para desativar", + "postDisableMessage": "Recarregar esta janela para desativar a extensão '{0}'?", + "postUninstallTooltip": "Recarregar para desativar", + "postUninstallMessage": "Recarregar esta janela para desativar a extensão desinstalada '{0}'?", + "reload": "&&Recarregar Janela", + "toggleExtensionsViewlet": "Mostrar Extensões", + "installExtensions": "Instalar Extensões", + "showInstalledExtensions": "Mostrar Extensões Instaladas", + "showDisabledExtensions": "Mostrar Extensões Desabilitadas", + "clearExtensionsInput": "Limpar Entrada de Extensões", + "showOutdatedExtensions": "Mostrar Extensões Desatualizadas", + "showPopularExtensions": "Mostrar Extensões Populares", + "showRecommendedExtensions": "Mostrar Extensões Recomendadas", + "showWorkspaceRecommendedExtensions": "Mostrar Extensões Recomendadas para o Espaço de Trabalho", + "showRecommendedKeymapExtensions": "Mostrar Mapeamentos de Teclado Recomendados", + "showRecommendedKeymapExtensionsShort": "Mapeamentos de Teclado", + "showLanguageExtensions": "Mostrar Extensões de Linguagem", + "showLanguageExtensionsShort": "Extensões de Linguagem", + "configureWorkspaceRecommendedExtensions": "Configurar Extensões Recomendadas (Espaço de Trabalho)", + "ConfigureWorkspaceRecommendations.noWorkspace": "As recomendações somente estão disponíveis em uma pasta do espaço de trabalho.", + "OpenExtensionsFile.failed": "Não foi possível criar o arquivo 'extensions.json' na pasta '.vscode' ({0}).", + "builtin": "Intrínseco", + "disableAll": "Desabilitar Todas as Extensões Instaladas", + "disableAllWorkspace": "Desabilitar Todas as Extensões Instaladas para este Espaço de Trabalho", + "enableAll": "Habilitar Todas as Extensões Instaladas", + "enableAllWorkspace": "Habilitar Todas as Extensões Instaladas para este Espaço de Trabalho", + "extensionButtonProminentBackground": "Cor de fundo do botão para a ações de extensão que se destacam (por exemplo, o botão de instalar).", + "extensionButtonProminentForeground": "Cor de primeiro plano do botão para a ações de extensão que se destacam (por exemplo, o botão de instalar).", + "extensionButtonProminentHoverBackground": "Cor de fundo ao passar o mouse sobre o botão para a ações de extensão que se destacam (por exemplo, o botão de instalar)." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json new file mode 100644 index 00000000000..666a6692179 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json @@ -0,0 +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. +{ + "manage": "Pressione Enter para gerenciar suas extensões.", + "searchFor": "Pressione Enter para pesquisar por '{0}' na Loja.", + "noExtensionsToInstall": "Digite um nome de extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json new file mode 100644 index 00000000000..b90c0d5ac64 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json @@ -0,0 +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. +{ + "app.extensions.json.title": "Extensões", + "app.extensions.json.recommendations": "Lista de recomendações de extensões. O identificador de uma extensão é sempre ' ${publisher}. ${nome}'. Por exemplo: 'vscode.csharp'.", + "app.extension.identifier.errorMessage": "Formato esperado '${editor}.${nome}'. Exemplo: 'vscode.csharp'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json new file mode 100644 index 00000000000..333627e9619 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "extensionsInputName": "Extensão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json new file mode 100644 index 00000000000..663560d4d78 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reallyRecommended2": "A extensão {0} é recomendada para este tipo de arquivo.", + "showRecommendations": "Mostrar Recomendações", + "neverShowAgain": "Não mostrar novamente", + "close": "Fechar", + "workspaceRecommended": "Este espaço de trabalho possui recomendações de extensão.", + "ignoreExtensionRecommendations": "Deseja ignorar todas as recomendações de extensão?", + "ignoreAll": "Sim, Ignorar Tudo", + "no": "Não", + "cancel": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json new file mode 100644 index 00000000000..76bf0379481 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "extensionsCommands": "Gerenciar Extensões", + "galleryExtensionsCommands": "Instalar Extensões da Galeria", + "extension": "Extensão", + "extensions": "Extensões", + "view": "Exibir", + "extensionsConfigurationTitle": "Extensões", + "extensionsAutoUpdate": "Atualizar extensões automaticamente", + "extensionsIgnoreRecommendations": "Ignorar recomendações de extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json new file mode 100644 index 00000000000..731e4ef9491 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json @@ -0,0 +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. +{ + "openExtensionsFolder": "Abrir a Pasta de Extensões", + "installVSIX": "Instalar do VSIX...", + "InstallVSIXAction.success": "A extensão foi instalada com sucesso. Reinicie para habilitá-la.", + "InstallVSIXAction.reloadNow": "Recarregar Agora" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..7e8cde2d602 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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": "Sim", + "no": "Não", + "betterMergeDisabled": "A extensão Better Merge agora é intrínseca, a extensão instalada foi desabilitada e pode ser desinstalada.", + "uninstall": "Desinstalar", + "later": "Mais tarde" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json new file mode 100644 index 00000000000..a35f8bbe6c6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "searchExtensions": "Pesquisar Extensões na Loja", + "extensions": "Extensões", + "sort by installs": "Ordenar por: Quantidade de Instalações", + "sort by rating": "Ordenar por: Avaliação", + "sort by name": "Ordenar por: Nome", + "no extensions found": "Nenhuma extensão encontrada.", + "suggestProxyError": "A Loja retornou 'ECONNREFUSED'. Por favor, verifique a configuração de 'http.proxy'.", + "outdatedExtensions": "{0} Extensões Desatualizadas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json new file mode 100644 index 00000000000..f0313c20343 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json @@ -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. +{ + "enableDependeciesConfirmation": "Habilitando '{0}' também habilita suas dependências. Gostaria de continuar?", + "enable": "Sim", + "doNotEnable": "Não", + "disableDependeciesConfirmation": "Gostaria de desabilitar somente '{0}', ou as suas dependências também?", + "disableOnly": "Apenas", + "disableAll": "Todos", + "cancel": "Cancelar", + "singleDependentError": "Não é possível desabilitar a extensão '{0}'. A extensão '{1}' depende dela.", + "twoDependentsError": "Não é possível desabilitar a extensão '{0}'. As extensões '{1}' e '{2}' dependem dela.", + "multipleDependentsError": "Não é possível desabilitar a extensão '{0}'. As extensões '{1}', '{2}' e outras dependem dela." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json b/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json new file mode 100644 index 00000000000..5d3c22c39a8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "sendFeedback": "Tweetar Feedback", + "label.sendASmile": "Tweete feedback para nós", + "patchedVersion1": "Sua instalação está corrompida.", + "patchedVersion2": "Por favor especificar isso ao enviar um bug.", + "sentiment": "Como foi sua experiência?", + "smileCaption": "Feliz", + "frownCaption": "Triste", + "other ways to contact us": "Outras maneiras de nos contatar", + "submit a bug": "Submeter um bug", + "request a missing feature": "Solicitar um recurso ausente", + "tell us why?": "Diga-nos porquê?", + "commentsHeader": "Comentários", + "tweet": "Tweetar", + "character left": "caractere à esquerda", + "characters left": "caracteres à esquerda", + "feedbackSending": "Enviando", + "feedbackSent": "Obrigado", + "feedbackSendingError": "Tentar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json new file mode 100644 index 00000000000..9c33fd25246 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "binaryFileEditor": "Visualizador de Arquivo Binário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json new file mode 100644 index 00000000000..792781bc8c7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json @@ -0,0 +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. +{ + "textFileEditor": "Editor de Arquivo de Texto", + "createFile": "Criar arquivo", + "fileEditorWithInputAriaLabel": "{0}. Editor de Arquivo de Texto.", + "fileEditorAriaLabel": "Editor de Arquivo de Texto" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json new file mode 100644 index 00000000000..f203671c230 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json @@ -0,0 +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. +{ + "filesCategory": "Arquivos", + "revealInSideBar": "Revelar na Barra Lateral", + "acceptLocalChanges": "Usar mudanças locais e sobrescrever o conteúdo do disco", + "revertLocalChanges": "Descartar mudanças locais e reverter para conteúdo do disco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json new file mode 100644 index 00000000000..161e7a9a16c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "retry": "Tentar novamente", + "rename": "Renomear", + "newFile": "Novo Arquivo", + "newFolder": "Nova Pasta", + "openFolderFirst": "Abrir uma pasta primeiro para criar arquivos ou pastas dentro dele.", + "newUntitledFile": "Novo Arquivo Sem Título", + "createNewFile": "Novo Arquivo", + "createNewFolder": "Nova Pasta", + "deleteButtonLabelRecycleBin": "&&Mover para Lixeira", + "deleteButtonLabelTrash": "&&Mover para o Lixo", + "deleteButtonLabel": "&&Excluir", + "dirtyMessageFolderOneDelete": "Você está excluindo uma pasta com alterações não salvas em 1 arquivo. Você quer continuar?", + "dirtyMessageFolderDelete": "Você está excluindo uma pasta com alterações não salvas em {0} arquivos. Você quer continuar?", + "dirtyMessageFileDelete": "Você está excluindo um arquivo com alterações não salvas. Você quer continuar?", + "dirtyWarning": "Suas alterações serão perdidas se você não salvá-las.", + "confirmMoveTrashMessageFolder": "Tem certeza de que deseja excluir '{0}' e seu conteúdo?", + "confirmMoveTrashMessageFile": "Tem certeza de que deseja excluir '{0}'?", + "undoBin": "Você pode restaurar da lixeira.", + "undoTrash": "Você pode restaurar a partir do lixo.", + "confirmDeleteMessageFolder": "Tem certeza de que deseja excluir permanentemente '{0}' e seu conteúdo?", + "confirmDeleteMessageFile": "Tem certeza de que deseja excluir permanentemente '{0}'?", + "irreversible": "Esta ação é irreversível!", + "permDelete": "Excluir permanentemente", + "delete": "Excluir", + "importFiles": "Importar Arquivos", + "confirmOverwrite": "Um arquivo ou pasta com o mesmo nome já existe na pasta de destino. Você quer substituí-lo?", + "replaceButtonLabel": "&&Substituir", + "copyFile": "Copiar", + "pasteFile": "Colar", + "duplicateFile": "Duplicar", + "openToSide": "Aberto para o lado", + "compareSource": "Selecione para comparar", + "globalCompareFile": "Compare o Arquivo Ativo Com...", + "pickHistory": "Selecione um arquivo previamente aberto para comparar com", + "unableToFileToCompare": "O arquivo selecionado não pode ser comparado com '{0}'.", + "openFileToCompare": "Abrir um arquivo primeiro para compará-lo com outro arquivo.", + "compareWith": "Comparar com '{0}'", + "compareFiles": "Comparar Arquivos", + "refresh": "Atualizar", + "save": "Salvar", + "saveAs": "Salvar como...", + "saveAll": "Salvar Todos", + "saveAllInGroup": "Salvar Todos no Grupo", + "saveFiles": "Salvar Arquivos Sujos", + "revert": "Reverter Arquivo", + "focusOpenEditors": "Foco na Visualização dos Editores Abertos", + "focusFilesExplorer": "Foco no Explorador de Arquivos", + "showInExplorer": "Revelar o Arquivo Ativo na Barra Lateral", + "openFileToShow": "Abrir um arquivo primeiro para mostrá-lo no explorer", + "collapseExplorerFolders": "Esconder Pastas no Explorador", + "refreshExplorer": "Atualizar Explorador", + "openFile": "Abrir arquivo...", + "openFileInNewWindow": "Abrir o Arquivo Ativo em uma Nova Janela", + "openFileToShowInNewWindow": "Abrir um arquivo primeiro para abrir em uma nova janela", + "revealInWindows": "Revelar no Explorer", + "revealInMac": "Revelar no Finder", + "openContainer": "Abrir a Pasta", + "revealActiveFileInWindows": "Revelar Arquivo Ativo no Windows Explorer", + "revealActiveFileInMac": "Revelar Arquivo Ativo no Finder", + "openActiveFileContainer": "Abrir a Pasta do Arquivo Ativo.", + "copyPath": "Copiar Caminho", + "copyPathOfActive": "Copiar Caminho do Arquivo Ativo", + "emptyFileNameError": "Um nome de arquivo ou pasta deve ser fornecido.", + "fileNameExistsError": "Um arquivo ou pasta **{0}** já existe neste local. Escolha um nome diferente.", + "invalidFileNameError": "O nome **{0}** não é válido como um nome de arquivo ou pasta. Por favor, escolha um nome diferente.", + "filePathTooLongError": "O nome **{0}** resulta em um caminho muito longo. Escolha um nome mais curto." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json new file mode 100644 index 00000000000..2e61a1656c8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "openFileToCopy": "Abrir um arquivo primeiro para copiar seu caminho", + "openFileToReveal": "Abrir um arquivo primeiro para revelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json new file mode 100644 index 00000000000..f4309c6a9bc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "showExplorerViewlet": "Mostrar Explorer", + "explore": "Explorador", + "view": "Exibir", + "textFileEditor": "Editor de Arquivo de Texto", + "binaryFileEditor": "Editor de Arquivo Binário", + "filesConfigurationTitle": "Arquivos", + "exclude": "Configure os padrões glob para excluir arquivos e pastas.", + "files.exclude.boolean": "O padrão glob com o qual combinar os caminhos de arquivo. Defina para verdadeiro ou falso para habilitar ou desabilitar o padrão.", + "files.exclude.when": "Verificação adicional nos irmãos de um arquivo correspondente. Use $(basename) como variável para o nome do arquivo correspondente.", + "associations": "Configurar as associações de arquivo para linguagens (por exemplo, \"* Extension\": \"html\"). Estas têm precedência sobre as associações padrão das linguagens instaladas.", + "encoding": "A codificação padrão do conjunto de caracteres para ser usada ao ler e gravar arquivos.", + "autoGuessEncoding": "Quando habilitado, tentará adivinhar a codificação do conjunto de caracteres ao abrir arquivos", + "eol": "O caractere padrão de fim de linha. Use \\n para LF e \\r\\n para CRLF.", + "trimTrailingWhitespace": "Quando habilitado, removerá espaços em branco à direita ao salvar um arquivo.", + "insertFinalNewline": "Quando habilitado, inseririrá uma nova linha no final do arquivo quando salvá-lo.", + "files.autoSave.off": "Um arquivo sujo nunca é automaticamente salvo.", + "files.autoSave.afterDelay": "Um arquivo sujo é salvo automaticamente após configurado em 'files.autoSaveDelay'.", + "files.autoSave.onFocusChange": "Um arquivo sujo é salvo automaticamente quando o editor perde o foco.", + "files.autoSave.onWindowChange": "Um arquivo sujo é salvo automaticamente quando a janela perde o foco.", + "autoSave": "Controla o auto-salvamento de arquivos sujos. Aceita os valores: '{0}', '{1}', '{2}' (editor perde o foco), '{3}' (janela perde o foco). Se definido como '{4}', você pode configurar o atraso em 'files.autoSaveDelay'.", + "autoSaveDelay": "Controla o atraso em milissegundos depois que um arquivo sujo é salvo automaticamente. Só se aplica quando 'files.autoSave' for definida como '{0}'", + "watcherExclude": "Configure padrões glob de caminhos de arquivo para excluir do monitoramento de arquivos. Alterar essa configuração requer uma reinicialização. Quando você tiver consumo Code muito alto de cpu na inicialização, você pode excluir pastas grandes para reduzir a carga inicial.", + "hotExit.off": "Desabilitar a saída à quente.", + "hotExit.onExit": "Saída à quente será acionada quando o aplicativo for fechado, ou seja, quando a última janela é fechada no Windows/Linux ou quando o comando workbench.action.quit é acionado (paleta de comandos, keybinding, menu). Todas as janelas com backups serão restauradas na próxima execução.", + "hotExit.onExitAndWindowClose": "Saída à quente será acionada quando o aplicativo for fechado, ou seja, quando a última janela é fechada no Windows/Linux ou quando o comando workbench.action.quit é acionado (paleta de comando, keybinding, menu), e também para qualquer janela com uma pasta aberta independentemente se é a última janela. Todas as janelas sem pastas abertas serão restauradas na próxima execução. Para restaurar as janelas de pastas como eram antes do desligamento configure \"window.reopenFolders\" para \"todos\".", + "hotExit": "Controla se os arquivos não salvos são lembrados entre as sessões, permitindo salvar alerta ao sair do editor seja ignorada.", + "defaultLanguage": "O modo de linguagem padrão que é atribuída para novos arquivos.", + "editorConfigurationTitle": "Editor", + "formatOnSave": "Formata um arquivo no salvamento. Um formatador deve estar disponível, o arquivo não deve ser salvo automaticamente e editor não deve ser desligado.", + "explorerConfigurationTitle": "Explorador de arquivos", + "openEditorsVisible": "Número de editores mostrado no painel Abrir Editores. Configurá-lo para 0 irá ocultar o painel.", + "dynamicHeight": "Controla se a altura da seção de editores abertos deve adaptar-se dinamicamente para o número de elementos ou não.", + "autoReveal": "Controla se o explorador deve automaticamente revelar e selecionar arquivos ao abri-los.", + "enableDragAndDrop": "Controla se o explorador deve permitir mover arquivos e pastas através de arrastar e soltar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json new file mode 100644 index 00000000000..30a0a48f866 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "discard": "Descartar", + "overwrite": "Sobrescrever", + "retry": "Tentar novamente", + "readonlySaveError": "Falha ao salvar '{0}': O arquivo está protegido contra gravação. Selecione 'Substituir' para remover a proteção.", + "genericSaveError": "Erro ao salvar '{0}': {1}", + "staleSaveError": "Falha ao salvar '{0}': O conteúdo no disco é mais recente. Clique em **Comparar** para comparar a sua versão com a do disco.", + "compareChanges": "Comparar", + "saveConflictDiffLabel": "{0} (no disco) ↔ {1} (em {2}) - Resolver conflitos de salvamento", + "userGuide": "Use as ações na barra de ferramentas do editor para **desfazer** suas alterações ou **substituir** o conteúdo no disco com as suas alterações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json new file mode 100644 index 00000000000..58da5446b25 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -0,0 +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. +{ + "explorerSection": "Seção de Explorador de Arquivos", + "noWorkspace": "Nenhuma Pasta Aberta", + "noWorkspaceHelp": "Você ainda não abriu uma pasta.", + "openFolder": "Abrir Pasta" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json new file mode 100644 index 00000000000..4753a88bd4c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "explorerSection": "Seção de Explorador de Arquivos", + "treeAriaLabel": "Explorador de Arquivos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json new file mode 100644 index 00000000000..c670883e6ac --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileInputAriaLabel": "Digite o Nome do arquivo. Pressione Enter para confirmar ou Escape para cancelar.", + "filesExplorerViewerAriaLabel": "{0}, Explorador de Arquivos", + "confirmOverwriteMessage": "'{0}' já existe na pasta de destino. Deseja substituí-lo?", + "irreversible": "Esta ação é irreversível!", + "replaceButtonLabel": "&&Substituir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json new file mode 100644 index 00000000000..4db9c1f34d8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -0,0 +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. +{ + "openEditosrSection": "Abrir Seção de Editores", + "openEditors": "Abrir Editores", + "treeAriaLabel": "Abrir Editores: Lista de Arquivos Ativos", + "dirtyCounter": "{0} não salvos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json new file mode 100644 index 00000000000..dbef8f2ddb5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json @@ -0,0 +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. +{ + "editorGroupAriaLabel": "{0}, Agrupar Editor", + "openEditorAriaLabel": "{0}, Abrir Editor", + "saveAll": "Salvar Todos", + "closeAll": "Fechar todos", + "close": "Fechar", + "closeOthers": "Fechar Outros" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json new file mode 100644 index 00000000000..9e75b7b2a89 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "dirtyFiles": "{0} arquivos não salvos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json new file mode 100644 index 00000000000..f29992f5d95 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "orphanedFile": "{0} (excluído do disco)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json new file mode 100644 index 00000000000..f9530b0f6f6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "html.editor.label": "Visualização Html" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json new file mode 100644 index 00000000000..8df4c48f58c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "html.voidInput": "Entrada inválida do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json new file mode 100644 index 00000000000..2ef4463deb9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "devtools.webview": "Desenvolvedor: Ferramentas Webview" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json b/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json new file mode 100644 index 00000000000..8576955d609 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "viewCategory": "Exibir", + "problems.view.show.label": "Mostrar Problemas", + "problems.panel.configuration.title": "Visualização de Problemas", + "problems.panel.configuration.autoreveal": "Controla se a visaulização de problemas evela os arquivos automaticamente ao abri-los", + "markers.panel.title.problems": "Problemas", + "markers.panel.aria.label.problems.tree": "Problemas agrupados por arquivos", + "markers.panel.no.problems.build": "Nenhum problema foi detectado na área de trabalho até agora.", + "markers.panel.no.problems.filters": "Nenhum resultado encontrado com os critérios de filtro fornecidos", + "markers.panel.action.filter": "Problemas de Filtro", + "markers.panel.filter.placeholder": "Filtrar por tipo ou texto", + "markers.panel.filter.errors": "erros", + "markers.panel.filter.warnings": "avisos", + "markers.panel.filter.infos": "informações", + "markers.panel.single.error.label": "1 Erro", + "markers.panel.multiple.errors.label": "{0} Erros", + "markers.panel.single.warning.label": "1 Aviso", + "markers.panel.multiple.warnings.label": "{0} Avisos", + "markers.panel.single.info.label": "1 Informação", + "markers.panel.multiple.infos.label": "{0} Informações", + "markers.panel.single.unknown.label": "1 Desconhecido", + "markers.panel.multiple.unknowns.label": "{0} Desconhecidos", + "markers.panel.at.ln.col.number": "({0}, {1})", + "problems.tree.aria.label.resource": "{0} com {1} problemas", + "problems.tree.aria.label.error.marker": "Erro gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.error.marker.nosource": "Erro: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.warning.marker": "Aviso gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.warning.marker.nosource": "Aviso: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.info.marker": "Informação gerada por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.info.marker.nosource": "Informação: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.marker": "Problema gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.marker.nosource": "Problema: {0} na linha {1} e caractere {2}", + "errors.warnings.show.label": "Mostrar Erros e Avisos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json b/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json new file mode 100644 index 00000000000..027c80cca30 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "copyMarker": "Copiar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json new file mode 100644 index 00000000000..1ec18c632a4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json @@ -0,0 +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. +{ + "surveyQuestion": "Você deseja responder a uma pequena pesquisa?", + "takeSurvey": "Responder a pesquisa", + "remindLater": "Lembrar mais tarde", + "neverAgain": "Não mostrar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json new file mode 100644 index 00000000000..e36bdadf4e9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json @@ -0,0 +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. +{ + "output": "Saída", + "viewCategory": "Exibir", + "clearOutput.label": "Limpar saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json new file mode 100644 index 00000000000..00bca0dc309 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json @@ -0,0 +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. +{ + "toggleOutput": "Alternar Saída", + "clearOutput": "Limpar saída", + "toggleOutputScrollLock": "Alternar Scroll Lock de Saída", + "switchToOutput.label": "Mudar para Saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json new file mode 100644 index 00000000000..ec28fd7b2a3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "outputPanelWithInputAriaLabel": "{0}, Painel de saída", + "outputPanelAriaLabel": "Painel de saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json new file mode 100644 index 00000000000..a083a6e7d9d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "output": "Saída", + "channel": "para '{0}'" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json new file mode 100644 index 00000000000..5fda62eb168 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "slow": "Inicialização lenta detectada", + "slow.detail": "Pena que você teve uma inicialização lenta. Por favor reinicie '{0}' com perfil de desempenho habilitado, compartilhe os perfis conosco e nós trabalharemos duro para fazer com que a inicialização fique perfeita novamente.", + "prof.message": "Perfis criados com sucesso.", + "prof.detail": "Por favor, crie um problema e anexe manualmente os seguintes arquivos:\n{0}", + "prof.restartAndFileIssue": "Criar Problema e Reiniciar", + "prof.restart": "Reiniciar", + "prof.thanks": "Obrigado por nos ajudar.", + "prof.detail.restart": "É necessário um reinício final para continuar a usar '{0}'. Novamente, obrigado pela sua contribuição." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json new file mode 100644 index 00000000000..279307d4b87 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "defineKeybinding.initial": "Pressionar a combinação de teclas desejada e ENTER. ESCAPE para cancelar.", + "defineKeybinding.chordsTo": "Acorde para" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json new file mode 100644 index 00000000000..1cb6541687c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "keybindingsInputName": "Atalhos de Teclado", + "SearchKeybindings.AriaLabel": "Pesquisar keybindings", + "SearchKeybindings.Placeholder": "Pesquisar keybindings", + "sortByPrecedene": "Ordenar por precedência", + "header-message": "Para personalizações avançadas abrir e editar", + "keybindings-file-name": "keybindings.json", + "keybindingsLabel": "Keybindings", + "changeLabel": "Alterar Keybinding", + "addLabel": "Adicionar Keybinding", + "removeLabel": "Remover Keybinding", + "resetLabel": "Redefinir Keybinding", + "showConflictsLabel": "Mostrar Conflitos", + "copyLabel": "Copiar", + "error": "Erro '{0}' enquanto edita keybinding. Por favor, abra o arquivo 'keybindings.json' e verifique.", + "command": "Comando", + "keybinding": "KeyBinding", + "source": "Fonte", + "when": "Quando", + "editKeybindingLabelWithKey": "Alterar Keybinding {0}", + "editKeybindingLabel": "Alterar Keybinding", + "addKeybindingLabelWithKey": "Adicionar Keybinding {0}", + "addKeybindingLabel": "Adicionar Keybinding", + "commandAriaLabel": "Comando é {0}.", + "keybindingAriaLabel": "KeyBinding é {0}.", + "noKeybinding": "Nenhum Keybinding atribuído.", + "sourceAriaLabel": "Fonte é {0}.", + "whenAriaLabel": "Quando é {0}.", + "noWhen": "Sem contexto Quando." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json new file mode 100644 index 00000000000..15fd432f9fa --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -0,0 +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. +{ + "defineKeybinding.start": "Definir Keybinding", + "defineKeybinding.kbLayoutInfoMessage": "Para o seu layout de teclado atual pressionar", + "defineKeybinding.kbLayoutErrorMessage": "Você não será capaz de produzir esta combinação de teclas sob seu layout de teclado atual." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json new file mode 100644 index 00000000000..40e6d0841da --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json @@ -0,0 +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. +{ + "defaultPreferencesEditor": "Editor de Preferências Padrão", + "keybindingsEditor": "Editor de Keybindings", + "preferences": "Preferências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json new file mode 100644 index 00000000000..461e0fb96f7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "openGlobalSettings": "Abra as Configurações de Usuário", + "openGlobalKeybindings": "Abrir Atalhos de Teclado", + "openGlobalKeybindingsFile": "Abrir Arquivo de Atalhos de Teclado", + "openWorkspaceSettings": "Abrir as configurações do espaço de trabalho", + "configureLanguageBasedSettings": "Definir Configurações Específicas de Linguagem...", + "languageDescriptionConfigured": "({0})", + "pickLanguage": "Selecionar Linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json new file mode 100644 index 00000000000..e3ef1e68a73 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "settingsEditorName": "Configurações Padrão", + "SearchSettingsWidget.AriaLabel": "Configurações de Pesquisa", + "SearchSettingsWidget.Placeholder": "Configurações de Pesquisa", + "totalSettingsMessage": "Total {0} Configurações", + "noSettingsFound": "Nenhum resultado", + "oneSettingFound": "1 Configuração correspondente", + "settingsFound": "{0} Configurações correspondentes", + "preferencesAriaLabel": "Preferências padrão. Editor de texto somente leitura." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json new file mode 100644 index 00000000000..e35427eb2df --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -0,0 +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. +{ + "errorInvalidConfiguration": "Não é possível gravar em configurações. Corrija erros/avisos no arquivo e tente novamente.", + "editTtile": "Editar", + "replaceDefaultValue": "Substituir nas Configurações", + "copyDefaultValue": "Copiar para Configurações", + "unsupportedPHPExecutablePathSetting": "Essa configuração deve ser uma Configuração de Usuário. Para configurar o PHP para o espaço de trabalho, abra um arquivo PHP e clique em 'Caminho do PHP' na barra de status.", + "unsupportedWorkspaceSetting": "Essa configuração deve ser uma Configuração de Usuário." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json new file mode 100644 index 00000000000..3d94af63615 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json @@ -0,0 +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. +{ + "openFolderFirst": "Abrir uma pasta primeiro para criar configurações de espaço de trabalho", + "emptyKeybindingsHeader": "Coloque suas chaves de ligações neste arquivo para substituir os padrões", + "defaultKeybindings": "Keybindings Padrão", + "emptySettingsHeader": "Colocar suas configurações nesse arquivo para sobrecrever as configurações padrão", + "emptySettingsHeader1": "Colocar as suas configurações nesse arquivo para sobrescrever as configurações e usuário padrão.", + "fail.createSettings": "Não foi possível criar '{0}' ({1})." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json new file mode 100644 index 00000000000..556ef65c079 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json @@ -0,0 +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. +{ + "settingsSwitcherBarAriaLabel": "Chave de Configurações", + "userSettings": "Configurações de Usuário", + "workspaceSettings": "Configurações de Espaço de Trabalho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json new file mode 100644 index 00000000000..68e05e00daf --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -0,0 +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. +{ + "default": "Valor padrão", + "user": "Usuário", + "meta": "meta", + "option": "opção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json new file mode 100644 index 00000000000..6427118b75b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "commonlyUsed": "Comumente Utilizado", + "defaultKeybindingsHeader": "Substituir as chaves de ligações, colocando-os em seu arquivo de chave ligações." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json new file mode 100644 index 00000000000..7b246da25ad --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "showTriggerActions": "Mostrar todos os comandos", + "showCommands.label": "Paleta de comandos...", + "entryAriaLabelWithKey": "{0}, {1}, comandos", + "entryAriaLabel": "{0}, comandos", + "canNotRun": "O comando '{0}' não pode ser executado a partir daqui.", + "actionNotEnabled": "O comando '{0}' não está habilitado no contexto atual.", + "commandLabel": "{0}: {1}", + "cat.title": "{0}: {1}", + "noCommandsMatching": "Não há comandos correspondentes" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json new file mode 100644 index 00000000000..3f922e6deca --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "gotoLine": "Ir para linha...", + "gotoLineLabelEmptyWithLimit": "Digite um número de linha entre 1 e {0} para navegar para lá", + "gotoLineLabelEmpty": "Digite um número de linha para navegar para lá", + "gotoLineColumnLabel": "Ir para linha {0} e caractere {1}", + "gotoLineLabel": "Ir para linha {0}", + "gotoLineHandlerAriaLabel": "Digite um número de linha para navegar.", + "cannotRunGotoLine": "Abrir um arquivo de texto primeiro para ir a uma linha" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json new file mode 100644 index 00000000000..5e56bdc5890 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "gotoSymbol": "Ir para o Símbolo no Arquivo...", + "symbols": "símbolos ({0})", + "method": "métodos ({0})", + "function": "funções ({0})", + "_constructor": "construtores ({0})", + "variable": "variáveis ({0})", + "class": "classes ({0})", + "interface": "interfaces ({0})", + "namespace": "namespaces ({0})", + "package": "pacotes ({0})", + "modules": "módulos ({0})", + "property": "propriedades ({0})", + "enum": "enumerações ({0})", + "string": "cadeias de caracteres ({0})", + "rule": "regras ({0})", + "file": "arquivos ({0})", + "array": "matrizes ({0})", + "number": "números ({0})", + "boolean": "booleanos ({0})", + "object": "objetos ({0})", + "key": "chaves ({0})", + "entryAriaLabel": "{0}, símbolos", + "noSymbolsMatching": "Não há símbolos correspondentes", + "noSymbolsFound": "Nenhum símbolo encontrado", + "gotoSymbolHandlerAriaLabel": "Tipo para reduzir os símbolos do editor ativo atual.", + "cannotRunGotoSymbolInFile": "Não há informações de símbolo para o arquivo", + "cannotRunGotoSymbol": "Abrir um arquivo de texto primeiro para ir a um símbolo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json new file mode 100644 index 00000000000..0a2fc637f73 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json @@ -0,0 +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. +{ + "entryAriaLabel": "{0}, ajuda do seletor", + "globalCommands": "comandos globais", + "editorCommands": "comandos do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json new file mode 100644 index 00000000000..e3c6204b605 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "commandsHandlerDescriptionDefault": "Exibir e executar comandos", + "gotoLineDescriptionMac": "Ir para linha", + "gotoLineDescriptionWin": "Ir para linha", + "gotoSymbolDescription": "Ir para o Símbolo no Arquivo", + "gotoSymbolDescriptionScoped": "Ir para o Símbolo no Arquivo Por Categoria", + "helpDescription": "Mostrar ajuda", + "viewPickerDescription": "Abrir Visualização" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json new file mode 100644 index 00000000000..38804354794 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "entryAriaLabel": "{0}, visualizar seletor", + "views": "Modos de exibição", + "panels": "Painéis", + "terminals": "Terminal", + "terminalTitle": "{0}: {1}", + "channels": "Saída", + "openView": "Abrir Visualização", + "quickOpenView": "Abrir Visualização Rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json new file mode 100644 index 00000000000..1b5369ebeea --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleGitViewlet": "Mostrar Git", + "installAdditionalSCMProviders": "Instalar provedores de SCM adicionais...", + "source control": "Controle de código-fonte", + "toggleSCMViewlet": "Mostrar SCM", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json new file mode 100644 index 00000000000..7846e2b872d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "scmPendingChangesBadge": "{0} alterações pendentes" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json new file mode 100644 index 00000000000..5b93869e8d8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "installAdditionalSCMProviders": "Instalar provedores de SCM adicionais...", + "switch provider": "Mudar Provedor SCM..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json new file mode 100644 index 00000000000..c14da801978 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json @@ -0,0 +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. +{ + "commitMessage": "Mensagem (tecle {0} para confirmar)", + "source control": "Controle de código-fonte", + "viewletTitle": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json new file mode 100644 index 00000000000..8d523511515 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileAndTypeResults": "resultados do arquivo e símbolo", + "fileResults": "resultados do arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json new file mode 100644 index 00000000000..016a91f2c32 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "entryAriaLabel": "{0}, seletor de arquivo", + "searchResults": "resultados da pesquisa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json new file mode 100644 index 00000000000..ede0a0c718d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json @@ -0,0 +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. +{ + "entryAriaLabel": "{0}, selecionador de símbolos", + "symbols": "resultados de símbolo", + "noSymbolsMatching": "Não há símbolos correspondentes", + "noSymbolsWithoutInput": "Digitar para pesquisar símbolos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json new file mode 100644 index 00000000000..68c8c0ad6b7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "defaultLabel": "entrada", + "patternDescription": "Use Padrões Glob", + "patternHelpInclude": "O padrão para combinações. Por exemplo, **\\*\\*/*.js** para corresponder a todos os arquivos JavaScript ou **myFolder/\\*\\*** para corresponder a essa pasta com todas pastas aninhadas.\n\n**Referência**:\n**\\*** corresponde a 0 ou mais caracteres\n**?** corresponde a 1 caractere\n**\\*\\*** corresponde a zero ou mais diretórios\n**[a-z]** corresponde a um intervalo de caracteres\n**{a, b}** corresponde a qualquer um dos padrões)", + "useIgnoreFilesDescription": "Usar Ignorar Arquivos", + "useExcludeSettingsDescription": "Usar Configurações de Exclusão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json new file mode 100644 index 00000000000..05d7f4e4cd0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileReplaceChanges": "{0} ↔ {1} (Substituir Preview)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json new file mode 100644 index 00000000000..b14e20a1487 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "showTriggerActions": "Ir para Símbolo no Espaço de Trabalho...", + "name": "Pesquisar", + "showSearchViewlet": "Mostrar Busca", + "view": "Exibir", + "findInFiles": "Localizar nos Arquivos", + "openAnythingHandlerDescription": "Ir para o Arquivo", + "openSymbolDescriptionNormal": "Ir para o Símbolo em Ãrea de Trabalho", + "searchOutputChannelTitle": "Pesquisar", + "searchConfigurationTitle": "Pesquisar", + "exclude": "Configure os padrões glob para excluir arquivos e pastas nas pesquisas. Herda todos os padrões glob da configuração files.exclude.", + "exclude.boolean": "O padrão glob com o qual combinar os caminhos de arquivo. Defina para verdadeiro ou falso para habilitar ou desabilitar o padrão.", + "exclude.when": "Verificação adicional nos irmãos de um arquivo correspondente. Use $(basename) como variável para o nome do arquivo correspondente.", + "useRipgrep": "Controla se deve utilizar ripgrep na pesquisa de texto", + "useIgnoreFilesByDefault": "Controla se deve utilizar arquivos .gitignore e .ignore por padrão ao fazer pesquisas em um novo espaço de trabalho.", + "search.quickOpen.includeSymbols": "Configurar para incluir resultados de uma pesquisa símbolo global nos resultados do arquivo para Abertura Rápida." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json new file mode 100644 index 00000000000..94f7c40e782 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json @@ -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. +{ + "nextSearchTerm": "Mostrar o Próximo Termo de Pesquisa", + "previousSearchTerm": "Mostrar Termo de Pesquisa Anterior", + "focusNextInputBox": "Focalizar a Próxima Caixa de Entrada", + "focusPreviousInputBox": "Focalizar a Caixa de Entrada Anterior", + "replaceInFiles": "Substituir nos Arquivos", + "findInFolder": "Encontrar na pasta", + "RefreshAction.label": "Atualizar", + "ClearSearchResultsAction.label": "Limpar os Resultados da Pesquisa", + "FocusNextSearchResult.label": "Focalizar o Próximo Resultado da Pesquisa", + "FocusPreviousSearchResult.label": "Focalizar o Resultado da Pesquisa Anterior", + "RemoveAction.label": "Remover", + "file.replaceAll.label": "Substituir Tudo", + "match.replace.label": "Substituir", + "ConfigureGlobalExclusionsAction.label": "Abrir configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json new file mode 100644 index 00000000000..3edda1861fb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "searchMatches": "{0} correspondências encontradas", + "searchMatch": "{0} correspondência encontrada", + "fileMatchAriaLabel": "{0} correspondências no arquivo {1} da pasta {2}, Resultado da pesquisa", + "replacePreviewResultAria": "Substitua o termo {0} pelo termo {1} na coluna posição {2} correspondente ao texto {3}", + "searchResultAria": "Encontrado o termo {0} na posição da coluna {1} correspondente ao texto {2}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json new file mode 100644 index 00000000000..4ceea616010 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "moreSearch": "Alternar Detalhes da Pesquisa", + "searchScope.includes": "arquivos a serem incluídos", + "label.includes": "Pesquisa Padrões de Inclusão", + "searchScope.excludes": "arquivos a serem excluídos", + "label.excludes": "Pesquisa de Padrões de Exclusão", + "global.searchScope.folders": "arquivos excluídos pelas configurações", + "label.global.excludes": "Configurado pesquisa padrões de exclusão", + "replaceAll.confirmation.title": "Substituir Tudo", + "replaceAll.confirm.button": "Substituir", + "replaceAll.occurrence.file.message": "Substituída {0} ocorrência no arquivo {1} com '{2}'.", + "removeAll.occurrence.file.message": "Substituída {0} ocorrência no arquivo {1}'.", + "replaceAll.occurrence.files.message": "Substituída {0} ocorrência no arquivo {1} com '{2}'.", + "removeAll.occurrence.files.message": "Substituída {0} ocorrência nos arquivos {1}", + "replaceAll.occurrences.file.message": "Substituídas {0} ocorrências no arquivo {1} com '{2}'.", + "removeAll.occurrences.file.message": "Substituídas {0} ocorrências nos arquivo {1}.", + "replaceAll.occurrences.files.message": "Substituídas {0} ocorrências nos arquivos {1} com '{2}'.", + "removeAll.occurrences.files.message": "Substituídas {0} ocorrências nos arquivos {1}.", + "removeAll.occurrence.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1} com '{2}'?", + "replaceAll.occurrence.file.confirmation.message": "Substituir {0} ocorrência no arquivo {1}?", + "removeAll.occurrence.files.confirmation.message": "Substituir {0} ocorrência nos arquivos {1} com '{2}'?", + "replaceAll.occurrence.files.confirmation.message": "Substituir {0} ocorrência nos arquivos {1}?", + "removeAll.occurrences.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1} com '{2}'?", + "replaceAll.occurrences.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1}?", + "removeAll.occurrences.files.confirmation.message": "Substituir {0} ocorrências nos arquivos {1} com '{2}'?", + "replaceAll.occurrences.files.confirmation.message": "Substituir {0} ocorrências nos arquivos {1}?", + "treeAriaLabel": "Resultados da Pesquisa", + "globLabel": "{0} quando {1}", + "searchMaxResultsWarning": "O conjunto de resultados contém apenas um subconjunto de todas as correspondências. Seja mais específico na sua pesquisa para diminuir o número de resultados.", + "searchCanceled": "Pesquisa foi cancelada antes de qualquer resultado ser encontrado - ", + "noResultsIncludesExcludes": "Nenhum resultado encontrado em '{0}' excluindo '{1}' - ", + "noResultsIncludes": "Nenhum resultado encontrado em '{0}' -", + "noResultsExcludes": "Nenhum resultado encontrado excluindo '{0}' -", + "noResultsFound": "Nenhum resultado encontrado. Analise as configurações para exclusões configuradas - ", + "rerunSearch.message": "Pesquisar novamente", + "rerunSearchInAll.message": "Pesquisar novamente em todos os arquivos", + "openSettings.message": "Abrir configurações", + "ariaSearchResultsStatus": "Pesquisa retornou {0} resultados em {1} arquivos", + "search.file.result": "{0} resultado no arquivo {1}", + "search.files.result": "{0} resultado nos arquivos {1}", + "search.file.results": "{0} resultados no arquivo {1}", + "search.files.results": "{0} resultados nos arquivos {1}", + "searchWithoutFolder": "Você ainda não abriu uma pasta. Somente arquivos abertos são pesquisados - ", + "openFolder": "Abrir Pasta" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json new file mode 100644 index 00000000000..41178af28cc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "search.action.replaceAll.disabled.label": "Substituir Todos (Submeter Pesquisa para Habilitar)", + "search.action.replaceAll.enabled.label": "Substituir Tudo", + "search.replace.toggle.button.title": "Alternar Substituir", + "label.Search": "Pesquisar: Digite o termo de pesquisa e pressione Enter para pesquisar ou Escape para cancelar", + "search.placeHolder": "Pesquisar", + "label.Replace": "Substituir: Digite o termo a ser substituído e pressione Enter para visualizar ou Escape para cancelar", + "search.replace.placeHolder": "Substituir", + "regexp.validationFailure": "A expressão corresponde a tudo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json new file mode 100644 index 00000000000..b98cf8d0937 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.contributes.snippets": "Contribui aos trechos de código.", + "vscode.extension.contributes.snippets-language": "Identificador de linguagem para o qual este trecho de código contribui.", + "vscode.extension.contributes.snippets-path": "Caminho do arquivo de trechos de código. O caminho é relativo à pasta de extensão e normalmente começa com '. /snippets/'.", + "invalid.language": "Linguagem desconhecida em `contributes.{0}.language`. Valor fornecido: {1}", + "invalid.path.0": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "badVariableUse": "O trecho de código \"{0}\" muito provavelmente confunde as variáveis de trecho de código e espaços reservados do trecho de código. Consulte https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax para obter mais detalhes." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json new file mode 100644 index 00000000000..6c34a620b89 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "snippet.suggestions.label": "Inserir trecho de código" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json new file mode 100644 index 00000000000..05f799f7b6a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "openSnippet.label": "Abrir trechos de código do usuário", + "openSnippet.pickLanguage": "Selecionar Idioma para o Trecho", + "openSnippet.errorOnCreate": "Não é possível criar {0}", + "preferences": "Preferências", + "snippetSchema.json.default": "Trecho de código vazio", + "snippetSchema.json": "Configuração do trecho do usuário", + "snippetSchema.json.prefix": "O prefixo usado ao selecionar o trecho no intelliSense", + "snippetSchema.json.body": "O conteúdo do trecho de código. Use '${id}', '${id: rótulo}', '${1:label}' para variáveis e '$0', '$1' para posições do cursor", + "snippetSchema.json.description": "A descrição do trecho." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json new file mode 100644 index 00000000000..a4a18c1e970 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "detail.userSnippet": "Trecho de código do usuário", + "snippetSuggest.longLabel": "{0}, {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json new file mode 100644 index 00000000000..adfb9a4190d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "tabCompletion": "Inserir trechos de código quando seu prefixo corresponder. Funciona melhor quando 'quickSuggestions' não está habilitado." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json new file mode 100644 index 00000000000..be3fefb5d3d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -0,0 +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. +{ + "entryAriaLabel": "{0}, tarefas", + "workspace": "Do espaço de trabalho", + "extension": "De extensões" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json new file mode 100644 index 00000000000..4009d3b8154 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -0,0 +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. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para reiniciar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Não há tarefa para ser reiniciada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json new file mode 100644 index 00000000000..6b4d6134384 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -0,0 +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. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para executar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Não há tarefas encontradas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json new file mode 100644 index 00000000000..9c5ee4b4b59 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json @@ -0,0 +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. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para finalizar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Nenhuma tarefa para finalizar encontrada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json new file mode 100644 index 00000000000..2de0b161ac8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -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. +{ + "ConfigurationParser.invalidCWD": "Aviso: options.cwd deve ser do tipo string. Ignorando valor {0}\n", + "ConfigurationParser.noShell": "Aviso: A configuração do shell somente é suportada quando estiver executando tarefas no terminal.", + "ConfigurationParser.noargs": "Erro: Argumentos do comando devem ser uma matriz de strings. Valor informado é:\n{0}", + "ConfigurationParser.noName": "Erro: Problem Matcher no escopo declarado deve ter um nome:\n{0}\n", + "ConfigurationParser.unknownMatcherKind": "Aviso: a correspondência de problema definido é desconhecido. Tipos suportados são string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", + "ConfigurationParser.invalidVaraibleReference": "Erro: ProblemMatcher inválido referência: {0}\n", + "ConfigurationParser.noTaskName": "Erro: tarefas devem fornecer uma propriedade taskName. A tarefa será ignorada.\n{0}\n", + "taskConfiguration.shellArgs": "Aviso: a tarefa '{0}' é um comando do shell e o nome de comando ou um dos seus argumentos tem espaços sem escape. Para garantir a linha de comando correta por favor mesclar argumentos no comando.", + "taskConfiguration.noCommandOrDependsOn": "Erro: a tarefa '{0}' também não especifica um comando ou uma propriedade dependsOn. A tarefa será ignorada. Sua definição é: {1}", + "taskConfiguration.noCommand": "Erro: a tarefa '{0}' não define um comando. A tarefa será ignorada. Sua definição é: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json new file mode 100644 index 00000000000..268871153e3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json @@ -0,0 +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. +{ + "tsc.config": "Compila um projeto TypeScript", + "tsc.watch": "Compila um projeto TypeScript em mode de monitoramento", + "dotnetCore": "Executa comando de compilação do .NET Core", + "msbuild": "Executa a compilação destino", + "externalCommand": "Exemplo para executar um comando externo arbitrário", + "Maven": "Executa comandos comuns específicos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json new file mode 100644 index 00000000000..92ae501cdc8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "JsonSchema.options": "Opções de comando adicionais", + "JsonSchema.options.cwd": "O diretório de trabalho atual do programa executado ou do script. Se omitido raiz de espaço de trabalho atual do código é usado.", + "JsonSchema.options.env": "O ambiente do programa executado ou comando shell. Se omitido o ambiente do processo pai é usado.", + "JsonSchema.shell.executable": "O shell a ser usado.", + "JsonSchema.shell.args": "Os argumentos shell.", + "JsonSchema.command": "O comando a ser executado. Pode ser um programa externo ou um comando shell.", + "JsonSchema.tasks.args": "Argumentos passados para o comando quando esta tarefa é invocada.", + "JsonSchema.tasks.taskName": "Nome da tarefa", + "JsonSchema.tasks.windows": "Configuração de comando específica do Windows", + "JsonSchema.tasks.mac": "Configuração de comando específica do Mac", + "JsonSchema.tasks.linux": "Configuração de comando específica do Linux", + "JsonSchema.tasks.suppressTaskName": "Controla se o nome de tarefa é adicionado como um argumento para o comando. Se omitido o valor definido globalmente é usado.", + "JsonSchema.tasks.showOutput": "Controla se a saída da execução de tarefas é mostrada ou não. Se omitido o valor definido globalmente é usado.", + "JsonSchema.echoCommand": "Controla se o comando executado é enviado para a saída. O padrão é false.", + "JsonSchema.tasks.watching.deprecation": "Descontinuado. Use isBackground.", + "JsonSchema.tasks.watching": "Se a tarefa executada é mantida viva e está monitorando o sistema de arquivos.", + "JsonSchema.tasks.background": "Se a tarefa executada é mantida viva e é executado em segundo plano.", + "JsonSchema.tasks.promptOnClose": "Se o usuário é solicitado quando VS Code fecha com uma tarefa sendo executada.", + "JsonSchema.tasks.build": "Esta tarefa é mapeada para o comando de compilação padrão do código.", + "JsonSchema.tasks.test": "Esta tarefa é mapeada para o comando de teste padrão do código.", + "JsonSchema.tasks.matchers": "O problema matcher(s) a seu utilizado. Pode ser uma sequência de caracteres ou uma definição de problem matcher ou uma matriz de sequências de caracteres e problem matchers.", + "JsonSchema.args": "Argumentos adicionais passados para o comando.", + "JsonSchema.showOutput": "Controla se a saída da execução de tarefas é mostrada ou não. Se omitido 'sempre' é usado.", + "JsonSchema.watching.deprecation": "Descontinuado. Use isBackground.", + "JsonSchema.watching": "Se a tarefa executada é mantida viva e está monitorando o sistema de arquivos.", + "JsonSchema.background": "Se a tarefa executada é mantida viva e é executado em segundo plano.", + "JsonSchema.promptOnClose": "Se o usuário é solicitado quando VS Code fecha com uma tarefa de segundo plano em execução.", + "JsonSchema.suppressTaskName": "Controla se o nome de tarefa é adicionado como um argumento para o comando. O padrão é false.", + "JsonSchema.taskSelector": "Prefixo para indicar que um argumento é tarefa.", + "JsonSchema.matchers": "A correspondência de problemas a ser utilizada. Pode ser uma sequência de caracteres ou uma definição de correspondência de problemas ou uma matriz de sequências de caracteres e correspondência de problemas.", + "JsonSchema.tasks": "As configurações de tarefa. Normalmente são ampliações de tarefas já definidas na execução de tarefa externa." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json new file mode 100644 index 00000000000..dc0695101b0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "JsonSchema.version": "Número da versão do config", + "JsonSchema.windows": "Configuração de comando específica do Windows", + "JsonSchema.mac": "Configuração de comando específica do Mac", + "JsonSchema.linux": "Configuração de comando específica do Linux", + "JsonSchema.shell": "Especifica se o comando é um comando shell ou um programa externo. O padrão é falso se omitido." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json new file mode 100644 index 00000000000..3130e474d7e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "JsonSchema.version": "Número da versão do config", + "JsonSchema.windows": "Configuração de comando específica do Windows", + "JsonSchema.mac": "Configuração de comando específica do Mac", + "JsonSchema.linux": "Configuração de comando específica do Linux", + "JsonSchema.shell": "Especifica se o comando é um comando shell ou um programa externo. O padrão é falso se omitido.", + "JsonSchema.tasks.dependsOn.string": "Outra tarefa da qual esta tarefa depende.", + "JsonSchema.tasks.dependsOn.array": "A outra tarefa que esta tarefa depende." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json new file mode 100644 index 00000000000..a07be4d2850 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "tasksCategory": "Tarefas", + "ConfigureTaskRunnerAction.noWorkspace": "Tarefas somente estão disponíveis em uma pasta da área de trabalho.", + "ConfigureTaskRunnerAction.quickPick.template": "Selecione um gerenciador de tarefa", + "ConfigureTaskRunnerAction.autoDetecting": "Tarefas de auto detecção para {0}", + "ConfigureTaskRunnerAction.autoDetect": "A tarefa de sistema de auto detecção falhou. Usando o modelo padrão. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.autoDetectError": "A tarefa de sistema de auto detecção produziu erros. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.failed": "Não é possível criar o arquivo 'tasks.json' na pasta '.vscode'. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.label": "Configure o gerenciador de tarefas", + "ConfigureBuildTaskAction.label": "Configurar Tarefa de Compilação", + "CloseMessageAction.label": "Fechar", + "ShowTerminalAction.label": "Terminal Visualização", + "problems": "Problemas", + "manyMarkers": "99+", + "tasks": "Tarefas", + "TaskSystem.noHotSwap": "Alterar o mecanismo de execução de tarefa requer reiniciar o VS Code. A alteração será ignorada.", + "TaskService.noBuildTask": "Nenhuma tarefa de compilação definida. Marque uma tarefa com 'isBuildCommand' no arquivo tasks.json.", + "TaskService.noTestTask": "Nenhuma tarefa de teste definida. Marque uma tarefa com 'isTestCommand' no arquivo tasks.json.", + "TaskServer.noTask": "Tarefa {0} requisitada para execução não encontrada.", + "TaskSystem.activeSame": "A tarefa já está ativa e em modo de monitoramento. Para terminar a tarefa, use `F1 > terminar tarefa`", + "TaskSystem.active": "Já existe uma tarefa sendo executada. Finalize-a antes de executar outra tarefa.", + "TaskSystem.restartFailed": "Falha ao finalizar e reiniciar a tarefa {0}", + "TaskSystem.configurationErrors": "Erro: A configuração da tarefa informada possui erros de validação e não pode ser utilizada. Por favor, corrija os erros primeiro.", + "TaskSystem.invalidTaskJson": "Erro: O conteúdo do arquivo tasks.json possui erros de sintaxe. Por favor, corrija-os antes de executar uma tarefa.\n", + "TaskSystem.runningTask": "Há uma tarefa sendo executada. Deseja finalizá-la?", + "TaskSystem.terminateTask": "&&Finalizar Tarefa", + "TaskSystem.noProcess": "A tarefa executada não existe mais. Se a tarefa produziu processos em background, finalizar o VS Code pode resultar em processos órfãos. Para evitar isso inicie o último processo em background com uma flag de espera.", + "TaskSystem.exitAnyways": "&&Sair de qualquer maneira", + "TerminateAction.label": "Finalizar a tarefa sendo executada", + "TaskSystem.unknownError": "Ocorreu um erro enquanto a tarefa estava sendo executada. Verifique o log de tarefas para detalhes.", + "TaskService.noWorkspace": "Tarefas somente estão disponíveis em uma pasta da área de trabalho.", + "TerminateAction.noProcess": "O processo executado não existe mais. Se a tarefa produziu processos em background, finalizar o VS Code pode resultar em processos órfãos.", + "TerminateAction.failed": "Falha ao finalizar a tarefa sendo executada", + "ShowLogAction.label": "Visualizar o Log de Tarefas", + "RunTaskAction.label": "Executar Tarefa", + "RestartTaskAction.label": "Reiniciar Tarefa", + "BuildAction.label": "Executar Tarefa de compilação", + "TestAction.label": "Executar Tarefa de Teste", + "quickOpen.task": "Executar Tarefa", + "quickOpen.terminateTask": "Finalizar Tarefa", + "quickOpen.restartTask": "Reiniciar Tarefa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json new file mode 100644 index 00000000000..f21b7eebc35 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -0,0 +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. +{ + "TerminalTaskSystem.unknownError": "Um erro desconhecido ocorreu durante a execução de uma tarefa. Consulte o log de saída de tarefa para obter detalhes.", + "TerminalTaskSystem.terminalName": "Tarefa - {0}", + "TerminalTaskSystem": "Não é possível executar um comando shell em uma unidade UNC.", + "unkownProblemMatcher": "Problem matcher {0} não pode ser resolvido. O matcher será ignorado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json new file mode 100644 index 00000000000..a4f13c42f7c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "TaskSystemDetector.noGulpTasks": "Executando gulp..-tarefas-simples não listam nenhuma tarefa. Você executou a instalação do npm?", + "TaskSystemDetector.noJakeTasks": "Executando jake..-tarefas não listam nenhuma tarefa. Você instalou o npm?", + "TaskSystemDetector.noGulpProgram": "Gulp não está instalado no seu sistema. Execute npm install -g gulp para instalá-lo.", + "TaskSystemDetector.noJakeProgram": "Jake não está instalado no seu sistema. Execute npm install -g jake para instalá-lo.", + "TaskSystemDetector.noGruntProgram": "Grunhido não está instalado no seu sistema. Execute npm install -g grunt para instalá-lo.", + "TaskSystemDetector.noProgram": "Programa {0} não foi encontrado. Mensagem é {1}", + "TaskSystemDetector.buildTaskDetected": "Tarefa de construção chamada '{0}' detectada.", + "TaskSystemDetector.testTaskDetected": "Tarefa de teste chamada '{0}' detectada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json new file mode 100644 index 00000000000..72848a8cde1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "TaskRunnerSystem.unknownError": "Um erro desconhecido ocorreu durante a execução de uma tarefa. Consulte o log de saída de tarefa para obter detalhes.", + "TaskRunnerSystem.watchingBuildTaskFinished": "\nTarefas de compilação de monitoramento terminaram.", + "TaskRunnerSystem.childProcessError": "Falha ao iniciar o programa externo {0} {1}.", + "TaskRunnerSystem.cancelRequested": "\nA tarefa '{0}' foi finalizada por solicitação do usuário.", + "unkownProblemMatcher": "Problema matcher {0} não pode ser resolvido. O matcher será ignorado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 00000000000..de21ec3dca1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "terminalIntegratedConfigurationTitle": "Terminal Integrado", + "terminal.integrated.shell.linux": "O caminho do shell que o terminal usa no Linux.", + "terminal.integrated.shellArgs.linux": "Os argumentos de linha de comando a serem usados no terminal do Linux.", + "terminal.integrated.shell.osx": "O caminho do shell que o terminal usa no OS X.", + "terminal.integrated.shellArgs.osx": "Os argumentos de linha de comando a serem usados no terminal do OS X.", + "terminal.integrated.shell.windows": "O caminho do shell que o terminal usa no Windows. Quando usar um shell fornecido com o Windows (cmd, PowerShell ou Bash no Ubuntu), prefira utilizar C:\\Windows\\sysnative ao invés de C:\\Windows\\System32 para usar as versões de 64 bits.", + "terminal.integrated.shellArgs.windows": "Os argumentos de linha de comando a serem utilizados no terminal do Windows.", + "terminal.integrated.rightClickCopyPaste": "Quando configurado, isto evitará que o menu de contexto apareça quando pressionado o botão direito do mouse dentro do terminal, em vez disso vai copiar quando há uma seleção e colar quando não há nenhuma seleção.", + "terminal.integrated.fontFamily": "Controla a família de fontes do terminal, este padrão é o valor do editor.fontFamily.", + "terminal.integrated.fontLigatures": "Controla se as ligações de fonte são habilitadas no terminal.", + "terminal.integrated.fontSize": "Controla o tamanho da fonte em pixels do terminal.", + "terminal.integrated.lineHeight": "Controles a altura da linha do terminal, este número é multiplicada pelo tamanho da fonte terminal para obter a altura real da linha em pixels.", + "terminal.integrated.enableBold": "Se habilitar o texto em negrito dentro do terminal requer suporte do terminal shell.", + "terminal.integrated.cursorBlinking": "Controla se o cursor do terminal pisca.", + "terminal.integrated.cursorStyle": "Controla o estilo do cursor do terminal.", + "terminal.integrated.scrollback": "Controla a quantidade máxima de linhas que o terminal mantém em seu buffer.", + "terminal.integrated.setLocaleVariables": "Controla se as variáveis locais são definidas na inicialização do terminal, este padrão é verdadeiro no OS X e falso em outras plataformas.", + "terminal.integrated.cwd": "Um caminho de início explícito onde o terminal será lançado, isso é usado como o diretório de trabalho atual (cwd) para o processo shell. Isto pode ser particularmente útil em configurações de espaço de trabalho se o diretório raiz não é um cwd conveniente.", + "terminal.integrated.confirmOnExit": "Confirmar na saída se ainda houverem sessões de terminal ativas.", + "terminal.integrated.commandsToSkipShell": "Um conjunto de IDs de comando, cujas combinações de teclas não serão enviadas para o shell e sempre serão tratadas por código. Isto permite o uso de combinações de teclas que normalmente seriam consumidas pelo shell para agir da mesma forma quando o terminal não é focado, por exemplo ctrl+p para Execução Rápida.", + "terminal": "Terminal", + "terminalCategory": "Terminal", + "viewCategory": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json new file mode 100644 index 00000000000..e63bd5db0a0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "workbench.action.terminal.toggleTerminal": "Alternar Terminal Integrado", + "workbench.action.terminal.kill": "Finalizar a Instância de Terminal Ativa", + "workbench.action.terminal.kill.short": "Encerrar Terminal", + "workbench.action.terminal.copySelection": "Copiar Seleção", + "workbench.action.terminal.new": "Criar Novo Terminal Integrado", + "workbench.action.terminal.new.short": "Novo Terminal", + "workbench.action.terminal.focus": "Focalizar Terminal", + "workbench.action.terminal.focusNext": "Focalizar Próximo Terminal", + "workbench.action.terminal.focusAtIndex": "Focalizar Terminal {0}", + "workbench.action.terminal.focusPrevious": "Focalizar Terminal Anterior", + "workbench.action.terminal.paste": "Colar no Terminal Ativo", + "workbench.action.terminal.DefaultShell": "Selecionar Shell Padrão", + "workbench.action.terminal.runSelectedText": "Executar Texto Selecionado no Terminal Ativo", + "workbench.action.terminal.runActiveFile": "Executar Arquivo Ativo no Terminal Ativo", + "workbench.action.terminal.runActiveFile.noFile": "Apenas arquivos em disco podem ser executados no terminal", + "workbench.action.terminal.switchTerminalInstance": "Trocar a instância de Terminal", + "workbench.action.terminal.scrollDown": "Rolar para Baixo (Linha)", + "workbench.action.terminal.scrollDownPage": "Rolar para Baixo (Página)", + "workbench.action.terminal.scrollToBottom": "Rolar para baixo", + "workbench.action.terminal.scrollUp": "Rolar para Cima (Linha)", + "workbench.action.terminal.scrollUpPage": "Rolar para Cima (Página)", + "workbench.action.terminal.scrollToTop": "Rolar para cima", + "workbench.action.terminal.clear": "Limpar", + "workbench.action.terminal.allowWorkspaceShell": "Permitir a Configuração de Shell da Ãrea de Trabalho", + "workbench.action.terminal.disallowWorkspaceShell": "Não Permitir a Configuração de Shell da Ãrea de Trabalho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json new file mode 100644 index 00000000000..495bd79c4bb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -0,0 +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. +{ + "terminal.background": "A cor de fundo do terminal, isso permite colorir o terminal com uma cor diferente do painel.", + "terminal.foreground": "A cor de primeiro plano do terminal.", + "terminal.ansiColor": "'{0}' cor ansi no terminal." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json new file mode 100644 index 00000000000..b2b9a9a9843 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -0,0 +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. +{ + "terminal.integrated.allowWorkspaceShell": "Você permite {0} (definido como uma configuração de espaço de trabalho) a ser executado no terminal?", + "allow": "Permitir", + "disallow": "Não permitir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json new file mode 100644 index 00000000000..13b6933b1b9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -0,0 +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. +{ + "terminal.integrated.copySelection.noSelection": "Não é possível copiar seleção do terminal quando o terminal não tem foco", + "terminal.integrated.exitedWithCode": "O processo terminal encerrado com código de saída: {0}", + "terminal.integrated.waitOnExit": "Pressione qualquer tecla para fechar o terminal", + "terminal.integrated.launchFailed": "O comando de processo de terminal '{0}{1}' falhou ao ser iniciado (código de saída: {2})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json new file mode 100644 index 00000000000..fd175c5ad29 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "terminalLinkHandler.followLinkCmd": "Cmd + clique para seguir o link", + "terminalLinkHandler.followLinkCtrl": "Ctrl + clique para seguir o link" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json new file mode 100644 index 00000000000..5e811b86100 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json @@ -0,0 +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. +{ + "copy": "Copiar", + "createNewTerminal": "Novo Terminal", + "paste": "Colar", + "clear": "Limpar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json new file mode 100644 index 00000000000..08ec4bd9777 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "terminal.integrated.chooseWindowsShellInfo": "Você pode alterar o terminal shell padrão selecionando o botão Personalizar.", + "customize": "Personalizar", + "cancel": "Cancelar", + "never again": "Ok, Nunca Mostrar Novamente", + "terminal.integrated.chooseWindowsShell": "Selecione o seu terminal shell preferido, você pode alterar isso mais tarde em suas configurações", + "terminalService.terminalCloseConfirmationSingular": "Há uma sessão ativa de terminal, você quer finalizá-la?", + "terminalService.terminalCloseConfirmationPlural": "Existem {0} sessões ativas de terminal, você quer finalizá-las?", + "yes": "Sim" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json new file mode 100644 index 00000000000..9968bf0b9b1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectTheme.label": "Tema de Cores", + "installColorThemes": "Instalar temas de cor adicionais...", + "themes.selectTheme": "Selecione o tema de cor (teclas cima/baixo para visualização)", + "selectIconTheme.label": "Arquivo de Ãcone do Tema", + "installIconThemes": "Instalar Temas de Ãcones de Arquivos Adicionais...", + "noIconThemeLabel": "Nenhum", + "noIconThemeDesc": "Desabilitar ícones de arquivos", + "problemChangingIconTheme": "Problema configurando tema de ícones: {0}", + "themes.selectIconTheme": "Selecionar Tema de Ãcones de Arquivos", + "generateColorTheme.label": "Gerar Tema de Cores a Partir das Configurações Atuais", + "preferences": "Preferências", + "developer": "Desenvolvedor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json new file mode 100644 index 00000000000..1fc9c8fe3a4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json @@ -0,0 +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. +{ + "unsupportedWorkspaceSettings": "Esta área de trabalho contém configurações que só podem ser definidas nas configurações do usuário. ({0})", + "openWorkspaceSettings": "Abrir as configurações do espaço de trabalho", + "openDocumentation": "Saiba Mais", + "ignore": "Ignorar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json new file mode 100644 index 00000000000..213c54a3d24 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "releaseNotesInputName": "Notas da Versão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json new file mode 100644 index 00000000000..3634d3c2f2a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json @@ -0,0 +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. +{ + "release notes": "Notas da versão", + "updateConfigurationTitle": "Atualizar", + "updateChannel": "Configurar se você recebe atualizações automáticas de um canal de atualização. Requer uma reinicialização depois da mudança." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json new file mode 100644 index 00000000000..4199be74572 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateNow": "Atualizar Agora", + "later": "Mais tarde", + "unassigned": "Não atribuído", + "releaseNotes": "Notas da Versão", + "showReleaseNotes": "Mostrar Notas da Versão", + "downloadNow": "Baixar agora", + "read the release notes": "Bem-vindo a {0} v{1}! Gostaria de ler as Notas da Versão?", + "licenseChanged": "Nossos termos de licença mudaram, favor revisá-los.", + "license": "Ler Licença", + "updateAvailable": "{0} será atualizado após reiniciar.", + "thereIsUpdateAvailable": "Há uma atualização disponível.", + "noUpdatesAvailable": "Não há nenhuma atualização disponível." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json new file mode 100644 index 00000000000..dea49eef8d5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "watermark.showCommands": "Mostrar todos os comandos", + "watermark.quickOpen": "Ir para o Arquivo", + "watermark.openFile": "Abrir Arquivo", + "watermark.openFolder": "Abrir Pasta", + "watermark.openFileFolder": "Abrir Arquivo ou Pasta", + "watermark.openRecent": "Abrir Recente", + "watermark.newUntitledFile": "Novo Arquivo Sem Título", + "watermark.toggleTerminal": "Alternar Terminal", + "watermark.findInFiles": "Localizar nos Arquivos", + "watermark.startDebugging": "Iniciar Depuração", + "watermark.selectTheme": "Mudar Tema", + "watermark.selectKeymap": "Mudar Mapa de Teclas", + "watermark.keybindingsReference": "Referência de Teclado", + "watermark.openGlobalKeybindings": "Atalhos de Teclado", + "watermark.unboundCommand": "não vinculado", + "workbenchConfigurationTitle": "Ãrea de Trabalho", + "tips.enabled": "Quando habilitado, mostrará as dicas de marca d'água quando nenhum editor estiver aberto." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json new file mode 100644 index 00000000000..93d7a695382 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json @@ -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. +{ + "welcomeOverlay.explorer": "Explorador de arquivos", + "welcomeOverlay.search": "Pesquisar em arquivos", + "welcomeOverlay.git": "Gerenciamento de código fonte", + "welcomeOverlay.debug": "Executar e depurar", + "welcomeOverlay.extensions": "Gerenciar extensões", + "welcomeOverlay.problems": "Visualizar erros e avisos", + "welcomeOverlay.commandPalette": "Encontrar e executar todos os comandos", + "welcomeOverlay": "Visão geral da Interface do usuário", + "hideWelcomeOverlay": "Esconder a visão geral da Interface", + "help": "Ajuda" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json new file mode 100644 index 00000000000..a0b426025a4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "welcomePage.vscode": "Visual Studio Code", + "welcomePage.editingEvolved": "Edição evoluiu", + "welcomePage.start": "Início", + "welcomePage.newFile": "Novo arquivo", + "welcomePage.openFolder": "Abrir pasta...", + "welcomePage.cloneGitRepository": "Clonar repositório Git...", + "welcomePage.recent": "Recente", + "welcomePage.moreRecent": "Mais...", + "welcomePage.noRecentFolders": "Não há pastas recentes", + "welcomePage.help": "Ajuda", + "welcomePage.keybindingsCheatsheet": "Folha de dicas de teclado para impressão", + "welcomePage.introductoryVideos": "Vídeos introdutórios", + "welcomePage.productDocumentation": "Documentação do produto", + "welcomePage.gitHubRepository": "Repositório GitHub", + "welcomePage.stackOverflow": "Stack Overflow", + "welcomePage.showOnStartup": "Mostrar a página de boas-vindas na inicialização", + "welcomePage.customize": "Personalizar", + "welcomePage.installExtensionPacks": "Ferramentas e linguagens", + "welcomePage.installExtensionPacksDescription": "Instalar o suporte para {0} e {1}", + "welcomePage.moreExtensions": "mais", + "welcomePage.installKeymapDescription": "Instalar atalhos de teclado", + "welcomePage.installKeymapExtension": "Instalar os atalhos de teclado de {0} e {1}", + "welcomePage.others": "outros", + "welcomePage.colorTheme": "Tema de cores", + "welcomePage.colorThemeDescription": "Fazer o editor e seu código parecer do jeito que você gosta", + "welcomePage.learn": "Aprender", + "welcomePage.showCommands": "Encontrar e executar todos os comandos", + "welcomePage.showCommandsDescription": "Comandos de rápido acesso e de pesquisar do painel de controle ({0})", + "welcomePage.interfaceOverview": "Visão geral da interface", + "welcomePage.interfaceOverviewDescription": "Obter uma sobreposição visual, destacando os principais componentes da interface do usuário", + "welcomePage.interactivePlayground": "Playground interativo", + "welcomePage.interactivePlaygroundDescription": "Experimente as características essenciais do editor em um curto passo-a-passo", + "welcomePage.quickLinks": "Links rápidos", + "welcomePage.keybindingsReference": "Referência de atalhos de teclado", + "welcomePage.keybindingsReferenceDescription": "Um PDF para impressão com os atalhos de teclado mais comuns", + "welcomePage.configureSettings": "Configurar definições", + "welcomePage.configureSettingsDescription": "Desbloquear o poder completo do VS Coda ajustando as configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json new file mode 100644 index 00000000000..7012e078815 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -0,0 +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. +{ + "workbenchConfigurationTitle": "Ãrea de Trabalho", + "welcomePage.enabled": "Quando habilitado, irá mostrar a página de boas-vindas na inicialização.", + "help": "Ajuda" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json new file mode 100644 index 00000000000..29755259794 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "welcomePage": "Bem-vindo", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Suporte para {0} já está instalado.", + "welcomePage.willReloadAfterInstallingExtensionPack": "A janela irá recarregar depois de instalar o suporte para {0}.", + "welcomePage.installingExtensionPack": "Instalar o suporte para {0}...", + "welcomePage.extensionPackNotFound": "Suporte para {0} com o id {1} não pôde ser encontrado.", + "welcomePage.keymapAlreadyInstalled": "Os atalhos de teclado de {0} já estão instalados.", + "welcomePage.willReloadAfterInstallingKeymap": "A janela irá recarregar depois de instalar os {0} atalhos de teclado.", + "welcomePage.installingKeymap": "Instalando os {0} atalhos de teclado...", + "welcomePage.keymapNotFound": "Os {0} atalhos de teclado com o id {1} não podem ser encontrados.", + "welcome.title": "Bem-vindo", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installedExtension": "{0} (instalado)", + "ok": "OK", + "cancel": "Cancelar", + "welcomePage.quickLinkBackground": "Cor de fundo para as ligações rápidas na página de boas-vindas.", + "welcomePage.quickLinkHoverBackground": "Passar sobre a cor de fundo para as ligações rápidas na página de boas-vindas." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json new file mode 100644 index 00000000000..9c7c7f681fa --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorWalkThrough": "Playground Interativo", + "editorWalkThrough.title": "Playground Interativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json new file mode 100644 index 00000000000..a789ae1c81f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json @@ -0,0 +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. +{ + "walkThrough.editor.label": "Playground Interativo", + "help": "Ajuda", + "interactivePlayground": "Playground Interativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json new file mode 100644 index 00000000000..697623110b0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json @@ -0,0 +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. +{ + "editorWalkThrough.arrowUp": "Rolar para Cima (Linha)", + "editorWalkThrough.arrowDown": "Rolar para Baixo (Linha)", + "editorWalkThrough.pageUp": "Rolar para Cima (Página)", + "editorWalkThrough.pageDown": "Rolar para Baixo (Página)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json new file mode 100644 index 00000000000..4131ebae487 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -0,0 +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. +{ + "walkThrough.unboundCommand": "não vinculado", + "walkThrough.gitNotFound": "Parece que o Git não está instalado no seu sistema.", + "walkThrough.embeddedEditorBackground": "Cor de fundo para os editores incorporados no Playground Interativo." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json new file mode 100644 index 00000000000..188ab8da37e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -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. +{ + "open": "Abrir configurações", + "close": "Fechar", + "saveAndRetry": "Salvar as configurações e tentar novamente", + "errorUnknownKey": "Não é possível gravar no arquivo de configuração (chave desconhecida)", + "errorInvalidTarget": "Não é possível gravar no arquivo de configuração (destino inválido)", + "errorNoWorkspaceOpened": "Não é possível gravar em configurações porque nenhuma pasta está aberta. Por favor, abra uma pasta primeiro e tente novamente.", + "errorInvalidConfiguration": "Não é possível gravar em configurações. Por favor abra **User Settings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorInvalidConfigurationWorkspace": "Não é possível gravar em configurações. Por favor abra **Workspace Settings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorConfigurationFileDirty": "Não é possível gravar em configurações, porque o arquivo foi alterado. Por favor, salve o arquivo **User Settings** e tente novamente.", + "errorConfigurationFileDirtyWorkspace": "Não é possível gravar em configurações, porque o arquivo foi alterado. Por favor, salve o arquivo **Workspace Settings** e tente novamente." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json b/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json new file mode 100644 index 00000000000..50e968f8ee3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "compareLabels": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json b/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json new file mode 100644 index 00000000000..49e9152a1db --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json @@ -0,0 +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. +{ + "netVersionError": "O Microsoft .NET Framework 4.5 é necessário. Por favor siga o link para instalá-lo.", + "installNet": "Baixar o .NET Framework 4.5", + "neverShowAgain": "Não mostrar novamente", + "trashFailed": "Falha em mover '{0}' para a lixeira" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json b/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json new file mode 100644 index 00000000000..b84feecdb4f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileInvalidPath": "Recurso de arquivo inválido ({0})", + "fileIsDirectoryError": "Arquivo é diretório ({0})", + "fileBinaryError": "Arquivo parece ser binário e não pode ser aberto como texto", + "fileNotFoundError": "Arquivo não encontrado ({0})", + "unableToMoveCopyError": "Não é possível mover/copiar. Arquivo poderia substituir a pasta em que está contida.", + "foldersCopyError": "Pastas não podem ser copiadas para a área de trabalho. Por favor selecione arquivos individuais para serem copiados.", + "fileReadOnlyError": "Arquivo é Somente Leitura" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json b/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json new file mode 100644 index 00000000000..daa32f59ee9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json @@ -0,0 +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. +{ + "errorKeybindingsFileDirty": "Não é possível gravar porque o arquivo está sujo. Por favor, salve o arquivo **Keybindings** e tente novamente.", + "parseErrors": "Não é possível gravar as combinações de teclas. Por favor abra o **arquivo Keybindings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorInvalidConfiguration": "Não é possível gravar as combinações de teclas. **Arquivo Keybindings** tem um objeto que não é do tipo Matriz. Por favor, abra o arquivo para limpar e tentar novamente.", + "emptyKeybindingsHeader": "Coloque suas combinações de teclas neste arquivo para substituir os padrões" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json new file mode 100644 index 00000000000..2fac75a5675 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "nonempty": "Esperado um valor não vazio", + "requirestring": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "optstring": "a propriedade `{0}` é opcional ou pode ser do tipo `string`", + "vscode.extension.contributes.keybindings.command": "Identificador do comando a ser executado quando keybinding é acionado.", + "vscode.extension.contributes.keybindings.key": "Tecla ou sequência de teclas (teclas separadas com o sinal de adição e sequências com espaço, por exemplo Ctrl+O e Ctrl+L L para um acorde", + "vscode.extension.contributes.keybindings.mac": "Chave específica Mac ou sequência de teclas.", + "vscode.extension.contributes.keybindings.linux": "Chave específica Linux ou sequência de teclas.", + "vscode.extension.contributes.keybindings.win": "Chave específica Windows ou sequência de teclas.", + "vscode.extension.contributes.keybindings.when": "Condição quando a chave está ativa.", + "vscode.extension.contributes.keybindings": "Contribui para Atalhos de Teclado.", + "invalid.keybindings": "Inválido `contributes.{0}`: {1}", + "unboundCommands": "Aqui estão outros comandos disponíveis: ", + "keybindings.json.title": "Configuração de combinações de teclas", + "keybindings.json.key": "Tecla ou sequência de teclas (separados por espaço)", + "keybindings.json.command": "Nome do comando a ser executado", + "keybindings.json.when": "Condição quando a chave está ativa.", + "keybindings.json.args": "Argumentos a serem passados para o comando para executar.", + "keyboardConfigurationTitle": "Teclado", + "dispatch": "Controla a lógica de expedição para pressionamentos de teclas para usar `keydown.code` (recomendado) ou 'keydown.keyCode'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json b/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json new file mode 100644 index 00000000000..267b62d179d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "alertErrorMessage": "Erro: {0}", + "alertWarningMessage": "Aviso: {0}", + "alertInfoMessage": "Informações: {0}", + "error": "Erro", + "warning": "Aviso", + "info": "Informações", + "close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json b/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json new file mode 100644 index 00000000000..cecec4b4c3a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "yesButton": "&&Sim", + "cancelButton": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json new file mode 100644 index 00000000000..91df655432d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "invalid": "Inválido 'contributes.{0}`. Matriz esperada.", + "invalid.empty": "Valor em branco para` contributes.{0}`", + "require.id": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "opt.extensions": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.filenames": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.firstLine": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string`", + "opt.configuration": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string`", + "opt.aliases": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.mimetypes": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json new file mode 100644 index 00000000000..7eed5484379 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "saveFileFirst": "O arquivo está alterado. Por favor, salvá-lo primeiro antes reabri-lo com outra codificação.", + "genericSaveError": "Erro ao salvar '{0}': {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json new file mode 100644 index 00000000000..9fe74ad26f3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "files.backup.failSave": "Arquivos não poderiam ser backupeados (erro: {0}), tente salvar seus arquivos para sair." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json new file mode 100644 index 00000000000..491b19e87c4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "saveChangesMessage": "Você quer salvar as alterações feitas para {0}?", + "saveChangesMessages": "Você quer salvar as alterações para os seguintes {0} arquivos?", + "moreFile": "... 1 arquivo adicional não está mostrado", + "moreFiles": "... {0} arquivos adicionais não estão mostrados", + "saveAll": "&&Salvar tudo", + "save": "&&Salvar", + "dontSave": "&&Não Salvar", + "cancel": "Cancelar", + "saveChangesDetail": "Suas alterações serão perdidas se você não salvá-las.", + "allFiles": "Todos os arquivos", + "noExt": "Sem extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json new file mode 100644 index 00000000000..02e2bc18273 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -0,0 +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. +{ + "schema.colors": "Cores para o realce de sintaxe", + "schema.properties.name": "Descrição da regra", + "schema.fontStyle": "Estilo da fonte da regra: um estilo ou uma combinação de 'itálico', 'negrito' e 'sublinhado'", + "schema.tokenColors.path": "Caminho para um arquivo tmTheme (relativo ao arquivo atual)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json new file mode 100644 index 00000000000..3cf20c82de2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "schema.folderExpanded": "O ícone de pasta para pastas expandidas. O ícone da pasta expandido é opcional. Se não definido, o ícone definido para a pasta será mostrado.", + "schema.folder": "O ícone de pasta para pastas colapsadas, e se folderExpanded não estiver definido, também para pastas expandidas.", + "schema.file": "O ícone de arquivo padrão, indicado para todos os arquivos que não correspondem a qualquer extensão, nome de arquivo ou idioma.", + "schema.folderNames": "Associa os nomes de pasta à ícones. A chave do objeto é o nome da pasta, não incluindo quaisquer segmentos de caminho. Nenhum padrão ou curinga são permitidos. O nome da pasta de correspondência diferencia maiusculas de minúsculas.", + "schema.folderName": "A ID da definição do ícone para associação.", + "schema.folderNamesExpanded": "Associa os nomes de pasta a ícones para pastas expandidas. A chave do objeto é o nome da pasta, não incluindo quaisquer segmentos do caminho. Padrões ou curingas não são permitidas. A correspondência do nome de pastas não diferencia maiusculas de minúsculas.", + "schema.folderNameExpanded": "A ID da definição do ícone para a associação.", + "schema.fileExtensions": "Associa as extensões de arquivo aos ícones. A chave do objeto é o nome da extensão do arquivo. O nome da extensão é o último segmento de um nome de arquivo após o último ponto (não incluindo o ponto). As extensões não diferenciam maiúsculas de minúsculas.", + "schema.fileExtension": "A ID da definição do ícone para a associação.", + "schema.fileNames": "Associa os nomes de arquivo à ícones. A chave do objeto é o nome completo do arquivo, mas não incluindo quaisquer segmentos do caminho. O nome do arquivo pode incluir pontos e uma extensão de arquivo. Nenhum padrão ou curinga é permitido. A correspondência de nome de arquivo não diferencia maiúsculas de minúsculas.", + "schema.fileName": "A ID da definição do ícone para a associação.", + "schema.languageIds": "Associa idiomas a ícones. A chave do objeto é o id de idioma definido no ponto de contribuição de linguagem.", + "schema.languageId": "O ID da definição do ícone para a associação.", + "schema.fonts": "Fontes que são usadas nas definições de ícone.", + "schema.id": "O ID da fonte.", + "schema.src": "A localização da fonte.", + "schema.font-path": "O caminho do fonte, relativo ao arquivo de tema de ícone atual.", + "schema.font-format": "O formato da fonte.", + "schema.font-weight": "O peso da fonte.", + "schema.font-sstyle": "O estilo da fonte.", + "schema.font-size": "O tamanho padrão da fonte.", + "schema.iconDefinitions": "Descrição de todos os ícones que podem ser usados quando associar arquivos de ícones.", + "schema.iconDefinition": "Uma definição de ícone. A chave do objeto é o ID da definição.", + "schema.iconPath": "Ao usar um SVG ou PNG: O caminho para a imagem. O caminho é relativo ao arquivo de configuração do ícone.", + "schema.fontCharacter": "Ao usar uma fonte glyph: O caractere na fonte para usar.", + "schema.fontColor": "Ao usar uma fonte glyph: A cor a ser utilizada.", + "schema.fontSize": "Quando estiver utilizando uma fonte: O tamanho da fonte em porcentagem para a fonte de texto. Se não for definido, o padrão é o tamanho na definição de fonte.", + "schema.fontId": "Quando estiver utilizando uma fonte: A identificação da fonte. Se não for definido, o padrão é a primeira definição de fonte.", + "schema.light": "Associações opcionais para ícones de arquivo em temas de cor clara.", + "schema.highContrast": "Associações opcionais para ícones de arquivo em temas de alto contraste." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json new file mode 100644 index 00000000000..4ef6944ba73 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -0,0 +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. +{ + "error.cannotparsejson": "Problemas ao analisar o arquivo de tema JSON: {0}", + "error.invalidformat.colors": "Problema ao analisar o arquivo de tema de cor: {0}. A propriedade 'colors' não é do tipo 'object'.", + "error.invalidformat.tokenColors": "Problema ao analisar o arquivo de tema de cor: {0}. A propriedade 'tokenColors' deve ser também uma matriz especificando as cores ou um caminho para um arquivo de texto de tema correspondente", + "error.plist.invalidformat": "Problema ao analisar o arquivo tmTheme: {0}. 'settings' não é uma matriz.", + "error.cannotparse": "Problemas ao analisar o arquivo tmTheme: {0}", + "error.cannotload": "Problemas ao carregar o arquivo tmTheme {0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json new file mode 100644 index 00000000000..caeea848338 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "vscode.extension.contributes.themes": "Contribui com temas de cores do textmate.", + "vscode.extension.contributes.themes.id": "ID do tema do ícone conforme usado em configurações do usuário.", + "vscode.extension.contributes.themes.label": "Etiqueta da cor do tema como mostrado na interface do usuário.", + "vscode.extension.contributes.themes.uiTheme": "Tema base de definição das cores do editor: 'vs' é o tema de cor clara, 'vs-dark' é o tema de cor escura. 'hc preto' é o tema escuro de alto contraste.", + "vscode.extension.contributes.themes.path": "Caminho do arquivo tmTheme. O caminho é relativo à pasta de extensão e é normalmente './themes/themeFile.tmTheme'.", + "vscode.extension.contributes.iconThemes": "Contribui com temas de ícones de arquivo.", + "vscode.extension.contributes.iconThemes.id": "ID do tema do ícone como usado em configurações do usuário.", + "vscode.extension.contributes.iconThemes.label": "Etiqueta do tema do ícone como mostrado na interface do usuário.", + "vscode.extension.contributes.iconThemes.path": "Caminho do arquivo de definição do tema do ícone. O caminho é relativo à pasta de extensão e é normalmente './icons/awesome-icon-theme.json'.", + "migration.completed": "Foram adicionadas novas configurações de tema para as configurações de usuário. Backup está disponível em {0}.", + "error.cannotloadtheme": "Não é possível carregar {0}: {1}", + "reqarray": "Ponto de extensão '{0}' deve ser uma matriz.", + "reqpath": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "reqid": "Esperada sequência em 'contributes.{0}.ID'. Valor fornecido: {1}", + "error.cannotloadicontheme": "Não é possível carregar {0}", + "error.cannotparseicontheme": "Problemas de análise do arquivo de ícones: {0}", + "colorTheme": "Especifica o tema de cores usado no espaço de trabalho.", + "colorThemeError": "Tema é desconhecido ou não está instalado.", + "iconTheme": "Especifica o tema de ícone usado no espaço de trabalho.", + "noIconThemeDesc": "Nenhum arquivo de ícones", + "iconThemeError": "Arquivo de tema de ícones é desconhecido ou não está instalado.", + "workbenchColors": "Substitui as cores do tema do tema de cores atualmente selecionado.", + "workbenchColors.deprecated": "A configuração não é mais experimental e foi renomeada para 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "Use 'workbench.colorCustomizations'" +} \ No newline at end of file diff --git a/i18n/rus/extensions/git/out/commands.i18n.json b/i18n/rus/extensions/git/out/commands.i18n.json index dfbba57f8c3..0e28cfd0b9a 100644 --- a/i18n/rus/extensions/git/out/commands.i18n.json +++ b/i18n/rus/extensions/git/out/commands.i18n.json @@ -16,6 +16,10 @@ "confirm discard": "Ð’Ñ‹ дейÑтвительно хотите отменить Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² {0}?", "confirm discard multiple": "Ð’Ñ‹ дейÑтвительно хотите отменить Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² файлах ({0})?", "discard": "Отменить изменениÑ", + "confirm discard all": "Ð’Ñ‹ дейÑтвительно хотите отменить вÑе изменениÑ? Отменить Ñто дейÑтвие нельзÑ!", + "discardAll": "Отменить вÑе изменениÑ", + "yes": "Да", + "always": "Ð’Ñегда", "no changes": "Ðет изменений Ð´Ð»Ñ Ñ„Ð¸ÐºÑации.", "commit message": "Сообщение о фикÑации", "provide commit message": "Введите Ñообщение фикÑации.", @@ -31,6 +35,7 @@ "no remotes to publish": "Ð”Ð»Ñ Ð²Ð°ÑˆÐµÐ³Ð¾ Ñ€ÐµÐ¿Ð¾Ð·Ð¸Ñ‚Ð¾Ñ€Ð¸Ñ Ð½Ðµ наÑтроены удаленные репозитории Ð´Ð»Ñ Ð¿ÑƒÐ±Ð»Ð¸ÐºÐ°Ñ†Ð¸Ð¸.", "disabled": "GIT отключен или не поддерживаетÑÑ Ð² Ñтой рабочей облаÑти", "clean repo": "ОчиÑтите рабочее дерево Ñ€ÐµÐ¿Ð¾Ð·Ð¸Ñ‚Ð¾Ñ€Ð¸Ñ Ð¿ÐµÑ€ÐµÐ´ извлечением.", + "cant push": "Ðе удаетÑÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÑŒ ÑÑылки в удаленную ветвь. Сначала выберите \"Извлечь\", чтобы интегрировать изменениÑ.", "git error details": "Git: {0}", "git error": "Ошибка Git", "open git log": "Открыть журнал GIT" diff --git a/i18n/rus/extensions/git/package.i18n.json b/i18n/rus/extensions/git/package.i18n.json index 8b3e7480686..5236c98c974 100644 --- a/i18n/rus/extensions/git/package.i18n.json +++ b/i18n/rus/extensions/git/package.i18n.json @@ -38,5 +38,9 @@ "config.autorefresh": "Включено ли автоматичеÑкое обновление", "config.autofetch": "Включено ли автоматичеÑкое получение", "config.enableLongCommitWarning": "Следует ли предупреждать о длинных ÑообщениÑÑ… о фикÑации", - "config.confirmSync": "Подтвердите Ñинхронизацию репозиториев GIT." + "config.confirmSync": "Подтвердите Ñинхронизацию репозиториев GIT.", + "config.countBadge": "\nУправлÑет Ñчетчиком Git. При указании Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ \"all\" подÑчитываютÑÑ Ð²Ñе изменениÑ, при указании Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ \"tracked\" — только отÑлеживаемые изменениÑ, при указании Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ \"off\" Ñчетчик отключаетÑÑ.", + "config.checkoutType": "ОпределÑет типы ветвей, которые выводÑÑ‚ÑÑ Ð¿Ñ€Ð¸ выборе пункта меню \"Извлечь в...\". При указании Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ \"all\" отображаютÑÑ Ð²Ñе ÑÑылки, \"local\" — только локальные ветви, \"tags\" — только теги, а \"remote\" — только удаленные ветви.", + "config.ignoreLegacyWarning": "Игнорирует предупреждение об уÑтаревшей верÑии Git", + "config.ignoreLimitWarning": "Игнорировать предупреждение, когда в репозитории Ñлишком много изменений" } \ No newline at end of file diff --git a/i18n/rus/extensions/grunt/out/main.i18n.json b/i18n/rus/extensions/grunt/out/main.i18n.json index 8b6ad71cd4e..7d21b8b17d9 100644 --- a/i18n/rus/extensions/grunt/out/main.i18n.json +++ b/i18n/rus/extensions/grunt/out/main.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "execFailed": "Сбой автоматичеÑкого определений заданий Grunt. Ошибка: {0}" +} \ No newline at end of file diff --git a/i18n/rus/extensions/grunt/package.i18n.json b/i18n/rus/extensions/grunt/package.i18n.json index 8b6ad71cd4e..b73dd0e2788 100644 --- a/i18n/rus/extensions/grunt/package.i18n.json +++ b/i18n/rus/extensions/grunt/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.grunt.autoDetect": "Включает или отключает автоматичеÑкое определние заданий Grunt. Значение по умолчанию — \"включено\"." +} \ No newline at end of file diff --git a/i18n/rus/extensions/gulp/package.i18n.json b/i18n/rus/extensions/gulp/package.i18n.json index 8b6ad71cd4e..37a145323f2 100644 --- a/i18n/rus/extensions/gulp/package.i18n.json +++ b/i18n/rus/extensions/gulp/package.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "config.gulp.autoDetect": "Включает или отключает автоматичеÑкое определение заданий Gulp. Значение по умолчанию — \"включено\"." +} \ No newline at end of file diff --git a/i18n/rus/extensions/jake/out/main.i18n.json b/i18n/rus/extensions/jake/out/main.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/jake/out/main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/jake/package.i18n.json b/i18n/rus/extensions/jake/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/jake/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/markdown/out/extension.i18n.json b/i18n/rus/extensions/markdown/out/extension.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/markdown/package.i18n.json b/i18n/rus/extensions/markdown/package.i18n.json index d3ac28369f5..9583a03ad77 100644 --- a/i18n/rus/extensions/markdown/package.i18n.json +++ b/i18n/rus/extensions/markdown/package.i18n.json @@ -16,5 +16,7 @@ "markdown.previewSide.title": "Открыть облаÑть предварительного проÑмотра Ñбоку", "markdown.showSource.title": "Показать иÑточник", "markdown.styles.dec": "СпиÑок URL-адреÑов или локальных путей к таблицам Ñтилей CSS, иÑпользуемых из облаÑти предварительного проÑмотра файла Markdown. ОтноÑительные пути интерпретируютÑÑ Ð¾Ñ‚Ð½Ð¾Ñительно папки, открытой в проводнике. ЕÑли папка не открыта, они интерпретируютÑÑ Ð¾Ñ‚Ð½Ð¾Ñительно раÑÐ¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð° Markdown. Ð’Ñе Ñимволы '\\' должны запиÑыватьÑÑ Ð² виде '\\\\'.", - "markdown.showPreviewSecuritySelector.title": "Изменить параметры безопаÑноÑти Ð´Ð»Ñ Ð¿Ñ€ÐµÐ´Ð²Ð°Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ проÑмотра Markdown" + "markdown.showPreviewSecuritySelector.title": "Изменить параметры безопаÑноÑти Ð´Ð»Ñ Ð¿Ñ€ÐµÐ´Ð²Ð°Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ð³Ð¾ проÑмотра Markdown", + "markdown.preview.enableExperimentalExtensionApi.desc": "[ЭкÑÐ¿ÐµÑ€Ð¸Ð¼ÐµÐ½Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ] Разрешить раÑширениÑм раÑширÑть предварительный проÑмотр Markdown.", + "markdown.trace.desc": "Включить ведение журнала отладки Ð´Ð»Ñ Ñ€Ð°ÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Markdown." } \ No newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/package.i18n.json b/i18n/rus/extensions/merge-conflict/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/npm/package.i18n.json b/i18n/rus/extensions/npm/package.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/npm/package.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/php/package.i18n.json b/i18n/rus/extensions/php/package.i18n.json index b16d4c3729e..f722b3cf8cb 100644 --- a/i18n/rus/extensions/php/package.i18n.json +++ b/i18n/rus/extensions/php/package.i18n.json @@ -9,5 +9,6 @@ "configuration.validate.executablePath": "Указывает на иÑполнÑемый файл PHP.", "configuration.validate.run": "ЗапуÑкаетÑÑ Ð»Ð¸ анализатор кода при Ñохранении или при печати.", "configuration.title": "PHP", - "commands.categroy.php": "PHP" + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "Запретить иÑполнÑемый файл проверки PHP (определÑетÑÑ ÐºÐ°Ðº параметр рабочей облаÑти)" } \ No newline at end of file diff --git a/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/rus/extensions/typescript/out/typescriptServiceClient.i18n.json index aefaafd9373..bda2060f087 100644 --- a/i18n/rus/extensions/typescript/out/typescriptServiceClient.i18n.json +++ b/i18n/rus/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "channelName": "TypeScript", "noServerFound": "Путь {0} не указывает на допуÑтимый файл программы уÑтановки tsserver. ВыполнÑетÑÑ Ð¾Ñ‚ÐºÐ°Ñ‚ до пакетной верÑии TypeScript.", "noBundledServerFound": "Файл tsserver VSCode был удален другим приложением, например, в результате ошибочного ÑÑ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ð½Ð¸Ñ ÑредÑтва Ð¾Ð±Ð½Ð°Ñ€ÑƒÐ¶ÐµÐ½Ð¸Ñ Ð²Ð¸Ñ€ÑƒÑов. ПереуÑтановите VSCode.", "versionNumber.custom": "пользовательÑкий", diff --git a/i18n/rus/extensions/typescript/out/utils/logger.i18n.json b/i18n/rus/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 00000000000..bc738f43d0c --- /dev/null +++ b/i18n/rus/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json index 506fc2b22fb..4adb921367a 100644 --- a/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Получение данных Ð´Ð»Ñ Ð¿Ð¾Ð²Ñ‹ÑˆÐµÐ½Ð¸Ñ ÑффективноÑти IntelliSense TypeScript", + "typesInstallerInitializationFailed.title": "Ðе удалоÑÑŒ уÑтановить файлы типизации Ð´Ð»Ñ Ñзыка JavaScript. УбедитеÑÑŒ, что NPM уÑтановлен и путь к нему указан в переменной PATH", "typesInstallerInitializationFailed.moreInformation": "Дополнительные ÑведениÑ", "typesInstallerInitializationFailed.doNotCheckAgain": "Больше не проверÑть", "typesInstallerInitializationFailed.close": "Закрыть" diff --git a/i18n/rus/extensions/typescript/package.i18n.json b/i18n/rus/extensions/typescript/package.i18n.json index 8d5b98b675b..eefc82f18b2 100644 --- a/i18n/rus/extensions/typescript/package.i18n.json +++ b/i18n/rus/extensions/typescript/package.i18n.json @@ -11,6 +11,8 @@ "typescript.tsdk.desc": "Указывает путь к папке, Ñодержащей файлы tsserver и lib*.d.ts, которые необходимо иÑпользовать.", "typescript.disableAutomaticTypeAcquisition": "Отключает автоматичеÑкое получение типа. ТребуетÑÑ TypeScript 2.0.6 и более поздней верÑии и перезапуÑк поÑле его изменениÑ.", "typescript.check.tscVersion": "Проверка Ð¾Ñ‚Ð»Ð¸Ñ‡Ð¸Ñ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтора TypeScript глобальной уÑтановки (например, tsc) от иÑпользуемой Ñзыковой Ñлужбы TypeScript.", + "typescript.tsserver.log": "Включает ведение журнала Ð´Ð»Ñ Ñервера TS. Этот журнал можно иÑпользовать Ð´Ð»Ñ Ð´Ð¸Ð°Ð³Ð½Ð¾Ñтики проблем Ñервера TS. Ð’ журнале могут ÑодержатьÑÑ Ð¿ÑƒÑ‚Ð¸ к файлам, иÑходный код и другие ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¸Ð· вашего проекта, в том чиÑле ноÑÑщие конфиденциальный характер.", + "typescript.tsserver.trace": "Включает траÑÑировку Ñообщений, отправлÑемых на Ñервер TS. Эту траÑÑировку можно иÑпользовать Ð´Ð»Ñ Ð´Ð¸Ð°Ð³Ð½Ð¾Ñтики проблем Ñервера TS. ТраÑÑировка может Ñодержать пути к файлам, иÑходный код и другие ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¸Ð· вашего проекта, в том чиÑле конфиденциальные данные.", "typescript.tsserver.experimentalAutoBuild": "Включает ÑкÑпериментальную автоÑборку. ТребуетÑÑ Ð²ÐµÑ€ÑиÑ 1.9 dev или верÑиÑ 2.x tsserver и перезапуÑк VS Code поÑле изменениÑ.", "typescript.validate.enable": "Включение или отключение проверки TypeScript.", "typescript.format.enable": "Включение или отключение Ð¼Ð¾Ð´ÑƒÐ»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ TypeScript по умолчанию.", @@ -23,6 +25,7 @@ "format.insertSpaceBeforeFunctionParenthesis": "ОпределÑет метод обработки пробелов перед Ñкобками аргумента функции. Требует TypeScript >= 2.1.5.", "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "ОпределÑет метод обработки пробелов поÑле Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¸ до Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð½ÐµÐ¿ÑƒÑтых круглых Ñкобок.", "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "ОпределÑет метод обработки пробелов поÑле Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¸ до Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð½ÐµÐ¿ÑƒÑтых квадратных Ñкобок.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "ОпределÑет метод обработки пробелов поÑле Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¸ до Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð½ÐµÐ¿ÑƒÑтых Ñкобок. ТребуетÑÑ TypeScript 2.3.0 или более поздней верÑии.", "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "ОпределÑет метод обработки пробелов поÑле Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¸ до Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ñкобок в Ñтроке шаблона. ТребуетÑÑ TypeScript 2.0.6 или более поздней верÑии.", "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "ОпределÑет метод обработки пробелов поÑле Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¸ до Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ñкобок Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ JSX. ТребуетÑÑ TypeScript 2.0.6 или более поздней верÑии.", "format.placeOpenBraceOnNewLineForFunctions": "ОпределÑет, ÑтавитÑÑ Ð»Ð¸ Ð¾Ñ‚ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ Ñ„Ð¸Ð³ÑƒÑ€Ð½Ð°Ñ Ñкобка Ñ Ð½Ð¾Ð²Ð¾Ð¹ Ñтроки в функциÑÑ….", @@ -30,9 +33,9 @@ "javascript.validate.enable": "Включение или отключение проверки JavaScript.", "typescript.goToProjectConfig.title": "Перейти к конфигурации проекта", "javascript.goToProjectConfig.title": "Перейти к конфигурации проекта", - "typescript.referencesCodeLens.enabled": "Включить или отключить CodeLens Ð´Ð»Ñ ÑÑылок. ТребуетÑÑ TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Включить или отключить CodeLens Ð´Ð»Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ð¹. ТребуетÑÑ TypeScript >= 2.2.0.", - "typescript.openTsServerLog.title": "Открытие файла журнала Ñервера TS", "typescript.selectTypeScriptVersion.title": "Выберите верÑию TypeScript.", - "jsDocCompletion.enabled": "Включить или отключить JSDoc коментарии" + "jsDocCompletion.enabled": "Включить или отключить JSDoc коментарии", + "javascript.implicitProjectConfig.checkJs": "Включает/отключает ÑемантичеÑкую проверку файлов JavaScript. Этот параметр может переопределÑтьÑÑ Ð² файле jsconfig.json или tsconfig.json. ТребуетÑÑ TypeScript 2.3.1 или более поздней верÑии.", + "typescript.check.npmIsInstalled": "ПроверÑет, уÑтановлен ли NPM Ð´Ð»Ñ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑкого Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ñ‚Ð¸Ð¿Ð¾Ð²" } \ No newline at end of file diff --git a/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index af5b0c29d70..32fb4e4b4cd 100644 --- a/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,6 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "Изображение Ñлишком велико Ð´Ð»Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð² редакторе. ", - "resourceOpenExternalButton": "Открыть изображение", - "resourceOpenExternalText": " Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ внешней программы?", "nativeBinaryError": "Файл не будет отображен в редакторе, так как он двоичный, очень большой или иÑпользует неподдерживаемую кодировку текÑта.", "sizeB": "{0} Б", "sizeKB": "{0} КБ", diff --git a/i18n/rus/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/rus/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 00000000000..ec94fb83023 --- /dev/null +++ b/i18n/rus/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "error.invalidSymbol": "ÐедопуÑтимый Ñимвол", + "error.invalidNumberFormat": "ÐедопуÑтимый чиÑловой формат", + "error.propertyNameExpected": "ТребуетÑÑ Ð¸Ð¼Ñ ÑвойÑтва", + "error.valueExpected": "ТребуетÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ðµ", + "error.colonExpected": "ТребуетÑÑ Ð´Ð²Ð¾ÐµÑ‚Ð¾Ñ‡Ð¸Ðµ", + "error.commaExpected": "ТребуетÑÑ Ð·Ð°Ð¿ÑтаÑ", + "error.closeBraceExpected": "ТребуетÑÑ Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ Ñ„Ð¸Ð³ÑƒÑ€Ð½Ð°Ñ Ñкобка", + "error.closeBracketExpected": "ТребуетÑÑ Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ Ñкобка", + "error.endOfFileExpected": "ОжидаетÑÑ ÐºÐ¾Ð½ÐµÑ† файла" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/code/electron-main/menus.i18n.json b/i18n/rus/src/vs/code/electron-main/menus.i18n.json index 44d0d0569f3..68b593f2118 100644 --- a/i18n/rus/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/rus/src/vs/code/electron-main/menus.i18n.json @@ -5,13 +5,16 @@ // Do not edit this file. It is machine generated. { "mFile": "&&Файл", - "mEdit": "&&Изменить", - "mSelection": "&&Выделений", + "mEdit": "&&Правка", + "mSelection": "&&Выделение", + "mView": "&&Вид", + "mGoto": "&&Перейти", "mDebug": "&&Отладка", "mWindow": "Окно", "mHelp": "&&Справка", "miNewWindow": "&&Ðовое окно", "mAbout": "О программе {0}", + "mServices": "Службы", "mHide": "Скрыть {0}", "mHideOthers": "Скрыть другие", "mShowAll": "Показать вÑе", @@ -29,6 +32,7 @@ "miCloseWindow": "Закрыть &&окно", "miCloseFolder": "Закрыть &&папку", "miCloseEditor": "&&Закрыть редактор", + "miExit": "Ð’&&ыход", "miOpenSettings": "&&Параметры", "miOpenKeymap": "&&Ð¡Ð¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ", "miOpenKeymapExtensions": "&&РаÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ñ€Ð°Ñкладки клавиатуры", @@ -40,6 +44,7 @@ "miClearRecentOpen": "ОчиÑтить поÑледние файлы", "miUndo": "Отменить", "miRedo": "Вернуть", + "miCut": "Ð’Ñ‹&&резать", "miCopy": "Копировать", "miPaste": "Ð’Ñтавить", "miFind": "Ðайти", @@ -65,7 +70,7 @@ "miSmartSelectShrink": "&&Сжать выделение", "miViewExplorer": "Проводник", "miViewSearch": "ПоиÑк", - "miViewGit": "&&Git", + "miViewSCM": "S&&CM", "miViewDebug": "Отладка", "miViewExtensions": "Р&&аÑширениÑ", "miToggleOutput": "Вывод", @@ -93,6 +98,7 @@ "miZoomIn": "&&Увеличить", "miZoomOut": "У&&меньшить", "miZoomReset": "&&СброÑить маÑштаб", + "miBack": "&&Ðазад", "miForward": "&&Вперед", "miNextEditor": "&&Следующий редактор", "miPreviousEditor": "&&Предыдущий редактор", diff --git a/i18n/rus/src/vs/code/electron-main/windows.i18n.json b/i18n/rus/src/vs/code/electron-main/windows.i18n.json index 6a621782e32..b1934cff062 100644 --- a/i18n/rus/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/rus/src/vs/code/electron-main/windows.i18n.json @@ -7,7 +7,6 @@ "ok": "ОК", "pathNotExistTitle": "Путь не ÑущеÑтвует.", "pathNotExistDetail": "Путь \"{0}\" больше не ÑущеÑтвует на диÑке.", - "accessibilityOptionsWindowTitle": "Специальные возможноÑти", "reopen": "Открыть повторно", "wait": "Подождать", "close": "Закрыть", diff --git a/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json index 9b6838aa665..53078d0a5b6 100644 --- a/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -40,7 +40,6 @@ "formatOnType": "УправлÑет параметром, определÑющим, должен ли редактор автоматичеÑки форматировать Ñтроку поÑле ввода.", "formatOnPaste": "ОпределÑет, будет ли редактор автоматичеÑки форматировать вÑтавленное Ñодержимое. Модуль Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð´Ð¾Ð»Ð¶ÐµÐ½ быть доÑтупен и иметь возможноÑть форматировать диапазон в документе.", "suggestOnTriggerCharacters": "ОпределÑет, должны ли при вводе триггерных Ñимволов автоматичеÑки отображатьÑÑ Ð¿Ñ€ÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ.", - "acceptSuggestionOnEnter": "ОпределÑет, будут ли Ð¿Ñ€ÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸Ð½Ð¸Ð¼Ð°Ñ‚ÑŒÑÑ ÐºÐ»Ð°Ð²Ð¸ÑˆÐµÐ¹ ВВОД в дополнение к клавише TAB. Это помогает избежать неоднозначноÑти между вÑтавкой новых Ñтрок и принÑтием предложений.", "acceptSuggestionOnCommitCharacter": "ОпределÑет, будут ли Ð¿Ñ€ÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸Ð½Ð¸Ð¼Ð°Ñ‚ÑŒÑÑ Ñимволами фикÑации. Ðапример, в JavaScript точка Ñ Ð·Ð°Ð¿Ñтой (\";\") может быть Ñимволом фикÑации, принимающим предложение и вводÑщим данный Ñимвол.", "snippetSuggestions": "УправлÑет отображением фрагментов вмеÑте Ñ Ð´Ñ€ÑƒÐ³Ð¸Ð¼Ð¸ предложениÑми и их Ñортировкой.", "emptySelectionClipboard": "УправлÑет тем, копируетÑÑ Ð»Ð¸ Ñ‚ÐµÐºÑƒÑ‰Ð°Ñ Ñтрока при копировании без выделениÑ.", diff --git a/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 00000000000..90b3992a47d --- /dev/null +++ b/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "editorViewAccessibleLabel": "Содержимое редактора" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 00000000000..e61942e5d18 --- /dev/null +++ b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "noResultWord": "Определение Ð´Ð»Ñ \"{0}\" не найдено.", + "generic.noResults": "ÐžÐ¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð½Ðµ найдены.", + "meta.title": " — Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ {0}", + "actions.goToDecl.label": "Перейти к определению", + "actions.goToDeclToSide.label": "Открыть определение Ñбоку", + "actions.previewDecl.label": "Показать определение", + "goToImplementation.noResultWord": "Ðе найдена Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð´Ð»Ñ \"{0}\".", + "goToImplementation.generic.noResults": "Ðе найдена реализациÑ.", + "meta.implementations.title": "— {0} реализаций", + "actions.goToImplementation.label": "Перейти к реализации", + "actions.peekImplementation.label": "Показать реализацию", + "goToTypeDefinition.noResultWord": "Ðе найдено определение типа Ð´Ð»Ñ \"{0}\".", + "goToTypeDefinition.generic.noResults": "Ðе найдено определение типа.", + "meta.typeDefinitions.title": "— {0} определений типов", + "actions.goToTypeDefinition.label": "Перейти к определению типа", + "actions.peekTypeDefinition.label": "Показать определение типа" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 00000000000..a403ef380f2 --- /dev/null +++ b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "multipleResults": "Щелкните, чтобы отобразить Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ ({0})." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/rus/src/vs/editor/contrib/hover/browser/hover.i18n.json index 1140ec28ea0..61fdcdb90de 100644 --- a/i18n/rus/src/vs/editor/contrib/hover/browser/hover.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -4,8 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "showHover": "Показать при наведении", - "hoverHighlight": "Выделение под Ñловом, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ð³Ð¾ показано наведение.", - "hoverBackground": "Цвет фона при наведении ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Ð½Ð° редактор.", - "hoverBorder": "Цвет границ при наведении ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Ð½Ð° редактор." + "showHover": "Показать при наведении" } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index e5f25fad694..222d24b8288 100644 --- a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,8 +16,6 @@ "peekViewTitleInfoForeground": "Цвет Ñведений о заголовке быÑтрого редактора.", "peekViewBorder": "Цвет границ быÑтрого редактора и маÑÑива.", "peekViewResultsBackground": "Цвет фона в ÑпиÑке результатов предÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð±Ñ‹Ñтрого редактора.", - "peekViewResultsMatchForeground": "Передний план Ñовпадений в ÑпиÑке результатов быÑтрого редактора.", - "peekViewResultsFileForeground": "Передний план запиÑи файла в ÑпиÑке результатов быÑтрого редактора.", "peekViewResultsSelectionBackground": "Цвет фона выбранной запиÑи в ÑпиÑке результатов быÑтрого редактора.", "peekViewResultsSelectionForeground": "Цвет переднего плана выбранной запиÑи в ÑпиÑке результатов быÑтрого редактора.", "peekViewEditorBackground": "Цвет фона быÑтрого редактора.", diff --git a/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 1b508516908..83631e142ec 100644 --- a/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,7 +12,6 @@ "readMore": "Подробнее...{0}", "suggestionWithDetailsAriaLabel": "{0}, предложение, Ñодержит данные", "suggestionAriaLabel": "{0}, предложение", - "goback": "ВернутьÑÑ", "suggestWidget.loading": "Идет загрузка...", "suggestWidget.noSuggestions": "ÐŸÑ€ÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¾Ñ‚ÑутÑтвуют.", "suggestionAriaAccepted": "{0}, принÑто", diff --git a/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json index 3d34238d89c..2595229d2aa 100644 --- a/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,7 +34,6 @@ "ProblemMatcherParser.noValidIdentifier": "Ошибка: ÑвойÑтво шаблона {0} не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым именем переменной шаблона.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Ð’ ÑопоÑтавителе проблем должны быть определены как начальный, так и конечный шаблоны Ð´Ð»Ñ Ð¾Ñ‚ÑлеживаниÑ.", "ProblemMatcherParser.invalidRegexp": "Ошибка: Ñтрока {0} не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым регулÑрным выражением.\n", - "WatchingPatternSchema.regexp": "РегулÑрное выражение Ð´Ð»Ñ Ð¾Ð±Ð½Ð°Ñ€ÑƒÐ¶ÐµÐ½Ð¸Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° или конца задачи наблюдениÑ.", "WatchingPatternSchema.file": "Ð˜Ð½Ð´ÐµÐºÑ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ ÑопоÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð´Ð»Ñ Ð¸Ð¼ÐµÐ½Ð¸ файла. Может быть опущен.", "PatternTypeSchema.name": "Ð˜Ð¼Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð½Ð¾Ð³Ð¾ или предопределенного шаблона", "PatternTypeSchema.description": "Шаблон проблем либо Ð¸Ð¼Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð½Ð¾Ð³Ð¾ или предопределенного шаблона проблем. Его можно опуÑтить, еÑли указано базовое значение.", @@ -46,7 +45,6 @@ "ProblemMatcherSchema.watching.activeOnStart": "ЕÑли задано значение true, наблюдатель находитÑÑ Ð² активном режиме, когда задача запуÑкаетÑÑ. Это равноÑильно выдаче Ñтроки, ÑоответÑтвующей шаблону начала.", "ProblemMatcherSchema.watching.beginsPattern": "При ÑоответÑтвии в выходных данных Ñообщает о запуÑке задачи наблюдениÑ.", "ProblemMatcherSchema.watching.endsPattern": "При ÑоответÑтвии в выходных данных Ñообщает о завершении задачи наблюдениÑ.", - "ProblemMatcherSchema.watching": "Шаблоны Ð´Ð»Ñ Ð¾Ñ‚ÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° и Ð¾ÐºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ð° проÑмотра.", "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Это ÑвойÑтво уÑтарело. ИÑпользуйте ÑвойÑтво проÑмотра.", "LegacyProblemMatcherSchema.watchedBegin": "РегулÑрное выражение, Ñообщающее о том, что отÑÐ»ÐµÐ¶Ð¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð·Ð°Ð´Ð°Ñ‡Ð° начинает выполнÑтьÑÑ Ð² результате активации отÑÐ»ÐµÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð².", "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Это ÑвойÑтво уÑтарело. ИÑпользуйте ÑвойÑтво проÑмотра.", diff --git a/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json index fa30062c9db..6d4a756ac40 100644 --- a/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -7,14 +7,25 @@ "invalid.color": "ÐедопуÑтимый формат цвета. ИÑпользуйте #RGB, #RGBA, #RRGGBB или #RRGGBBAA", "schema.colors": "Цвета, иÑпользуемые на рабочем меÑте.", "foreground": "Общий цвет переднего плана. Этот цвет иÑпользуетÑÑ, только еÑли его не переопределит компонент.", + "errorForeground": "Общий цвет переднего плана Ð´Ð»Ñ Ñообщений об ошибках. Этот цвет иÑпользуетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ еÑли его не переопределÑет компонент.", + "descriptionForeground": "Цвет текÑта Ñлемента, Ñодержащего поÑÑнениÑ, например, Ð´Ð»Ñ Ð¼ÐµÑ‚ÐºÐ¸.", "focusBorder": "Общий цвет границ Ð´Ð»Ñ Ñлементов Ñ Ñ„Ð¾ÐºÑƒÑом. Этот цвет иÑпользуетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в том Ñлучае, еÑли не переопределен в компоненте.", "contrastBorder": "Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð³Ñ€Ð°Ð½Ð¸Ñ†Ð° вокруг Ñлементов, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð¾Ñ‚Ð´ÐµÐ»Ñет их от других Ñлементов Ð´Ð»Ñ ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ ÐºÐ¾Ð½Ñ‚Ñ€Ð°Ñта.", "activeContrastBorder": "Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð³Ñ€Ð°Ð½Ð¸Ñ†Ð° вокруг активных Ñлементов, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð¾Ñ‚Ð´ÐµÐ»Ñет их от других Ñлементов Ð´Ð»Ñ ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ ÐºÐ¾Ð½Ñ‚Ñ€Ð°Ñта.", + "selectionBackground": "Цвет фона выделенного текÑта в Ñлементах пользовательÑкого интерфейÑа (например, в поле Ð´Ð»Ñ Ð²Ð²Ð¾Ð´Ð° значений или текÑтовом поле). Ðе применÑетÑÑ Ðº облаÑти редактора и терминала.", + "textSeparatorForeground": "Цвет Ð´Ð»Ñ Ñ€Ð°Ð·Ð´ÐµÐ»Ð¸Ñ‚ÐµÐ»ÐµÐ¹ текÑта.", + "textLinkForeground": "Цвет переднего плана Ð´Ð»Ñ ÑÑылок в текÑте.", + "textLinkActiveForeground": "Цвет переднего фона Ð´Ð»Ñ Ð°ÐºÑ‚Ð¸Ð²Ð½Ñ‹Ñ… ÑÑылок в текÑте.", + "textPreformatForeground": "Цвет текÑта фикÑированного формата.", + "textBlockQuoteBackground": "Цвет фона Ð´Ð»Ñ Ð±Ð»Ð¾ÐºÐ¾Ð² Ñ Ñ†Ð¸Ñ‚Ð°Ñ‚Ð°Ð¼Ð¸ в текÑте.", + "textBlockQuoteBorder": "Цвет границ Ð´Ð»Ñ Ð±Ð»Ð¾ÐºÐ¾Ð² Ñ Ñ†Ð¸Ñ‚Ð°Ñ‚Ð°Ð¼Ð¸ в текÑте.", + "textCodeBlockBackground": "Цвет фона Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð½Ð¾Ð³Ð¾ кода в текÑте.", "widgetShadow": "Цвет тени мини-приложений редактора, таких как \"Ðайти/заменить\".", "inputBoxBackground": "Фон Ð¿Ð¾Ð»Ñ Ð²Ð²Ð¾Ð´Ð°.", "inputBoxForeground": "Передний план Ð¿Ð¾Ð»Ñ Ð²Ð²Ð¾Ð´Ð°.", "inputBoxBorder": "Граница Ð¿Ð¾Ð»Ñ Ð²Ð²Ð¾Ð´Ð°.", "inputBoxActiveOptionBorder": "Цвет границ активированных параметров в полÑÑ… ввода.", + "inputPlaceholderForeground": "Цвет фона поÑÑнÑющего текÑта в Ñлементе ввода.", "inputValidationInfoBackground": "Фоновый цвет проверки ввода Ð´Ð»Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ ÑерьезноÑти \"СведениÑ\".", "inputValidationInfoBorder": "Цвет границы проверки ввода Ð´Ð»Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ ÑерьезноÑти \"СведениÑ\".", "inputValidationWarningBackground": "Фоновый цвет проверки ввода Ð´Ð»Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ ÑерьезноÑти \"Предупреждение\".", @@ -26,10 +37,9 @@ "dropdownBorder": "Граница раÑкрывающегоÑÑ ÑпиÑка.", "listFocusBackground": "Фоновый цвет находÑщегоÑÑ Ð² фокуÑе Ñлемента List/Tree, когда Ñлемент List/Tree активен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", "listActiveSelectionBackground": "Фоновый цвет выбранного Ñлемента List/Tree, когда Ñлемент List/Tree активен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", - "listInactiveSelectionBackground": "Фоновый цвет выбранного Ñлемента List/Tree, когда Ñлемент List/Tree неактивен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", "listActiveSelectionForeground": "Цвет переднего плана выбранного Ñлемента List/Tree, когда Ñлемент List/Tree активен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", - "listFocusAndSelectionBackground": "Фоновый цвет находÑщегоÑÑ Ð² фокуÑе и выбранного Ñлемента List/Tree, когда Ñлемент List/Tree активен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет. Этот цвет имеет приоритет над индивидуальными цветами Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¸ фокуÑа.", - "listFocusAndSelectionForeground": "Цвет переднего плана находÑщегоÑÑ Ð² фокуÑе и выбранного Ñлемента List/Tree, когда Ñлемент List/Tree активен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет. Этот цвет имеет приоритет над индивидуальными цветами Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¸ фокуÑа.", + "listInactiveSelectionBackground": "Фоновый цвет выбранного Ñлемента List/Tree, когда Ñлемент List/Tree неактивен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", + "listInactiveSelectionForeground": "Цвет текÑта выбранного Ñлемента List/Tree, когда Ñлемент List/Tree неактивен. Ðа активном Ñлементе List/Tree еÑть Ñ„Ð¾ÐºÑƒÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹, на неактивном — нет.", "listHoverBackground": "Фоновый цвет Ñлементов List/Tree при наведении курÑора мыши.", "listDropBackground": "Фоновый цвет Ñлементов List/Tree при перемещении Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ мыши.", "highlight": "Цвет переднего плана Ð´Ð»Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ ÑоответÑÑ‚Ð²Ð¸Ñ Ð¿Ñ€Ð¸ поиÑке по Ñлементу List/Tree.", @@ -38,19 +48,27 @@ "buttonForeground": "Цвет переднего плана кнопки.", "buttonBackground": "Цвет фона кнопки.", "buttonHoverBackground": "Цвет фона кнопки при наведении.", + "badgeBackground": "Цвет фона бÑджа. БÑджи - небольшие информационные Ñлементы, отображающие количеÑтво, например, результатов поиÑка.", + "badgeForeground": "Цвет текÑта бÑджа. БÑджи - небольшие информационные Ñлементы, отображающие количеÑтво, например, результатов поиÑка.", "scrollbarShadow": "Цвет тени полоÑÑ‹ прокрутки, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ ÑвидетельÑтвует о том, что Ñодержимое прокручиваетÑÑ.", "scrollbarSliderBackground": "Цвет фона ползунка.", "scrollbarSliderHoverBackground": "Цвет фона ползунка при наведении.", "scrollbarSliderActiveBackground": "Цвет фона активного ползунка.", "editorBackground": "Цвет фона редактора.", "editorForeground": "Цвет переднего плана редактора по умолчанию.", + "editorWidgetBackground": "Цвет фона виджетов редактора, таких как найти/заменить.", "editorSelection": "Цвет Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð°.", "editorInactiveSelection": "Цвет Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² неактивном редакторе.", "editorSelectionHighlight": "Цвет регионов Ñ Ñ‚ÐµÐ¼ же Ñодержимым, что и в выделении.", "editorFindMatch": "Цвет текущего поиÑка Ñовпадений.", "findMatchHighlight": "Цвет других Ñовпадений поиÑка.", "findRangeHighlight": "Цвет диапазона, ограничивающего поиÑк.", + "hoverHighlight": "Выделение под Ñловом, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ð³Ð¾ показано наведение.", + "hoverBackground": "Цвет фона при наведении ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Ð½Ð° редактор.", + "hoverBorder": "Цвет границ при наведении ÑƒÐºÐ°Ð·Ð°Ñ‚ÐµÐ»Ñ Ð½Ð° редактор.", "activeLinkForeground": "Цвет активных ÑÑылок.", - "linkForeground": "Цвет ÑÑылок.", - "editorWidgetBackground": "Цвет фона виджетов редактора, таких как найти/заменить." + "diffEditorInserted": "Цвет фона Ð´Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð½Ñ‹Ñ… Ñтрок.", + "diffEditorRemoved": "Цвет фона Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð½Ñ‹Ñ… Ñтрок.", + "diffEditorInsertedOutline": "Цвет контура Ð´Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð½Ñ‹Ñ… Ñтрок.", + "diffEditorRemovedOutline": "Цвет контура Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ð½Ñ‹Ñ… Ñтрок." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 00000000000..b44407fa3f2 --- /dev/null +++ b/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "overwritingExtension": "Идет перезапиÑÑŒ раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ {0} на {1}.", + "extensionUnderDevelopment": "Идет загрузка раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ñ€Ð°Ð·Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ в {0}." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 00000000000..f2dc9ba9a20 --- /dev/null +++ b/i18n/rus/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +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. +{ + "close": "Закрыть", + "cancel": "Отмена", + "ok": "ОК" +} \ No newline at end of file diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.css b/i18n/rus/src/vs/workbench/api/node/extHostExplorerView.i18n.json similarity index 51% rename from src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.css rename to i18n/rus/src/vs/workbench/api/node/extHostExplorerView.i18n.json index 57e88bae1fa..69ab93e32fa 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.css +++ b/i18n/rus/src/vs/workbench/api/node/extHostExplorerView.i18n.json @@ -2,19 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -.monaco-editor .goto-definition-link { - text-decoration: underline; - cursor: pointer; -} - -.monaco-editor .goto-definition-link-hover { - margin: 0.5em; - padding: 0; - padding-left: 0.5em; - border-left: 4px solid rgba(0, 0, 0, 0.14); -} - -.monaco-editor.vs-dark .goto-definition-link-hover { - border-left: 4px solid rgba(255, 255, 255, 0.25); +// Do not edit this file. It is machine generated. +{ + "treeExplorer.notRegistered": "TreeExplorerNodeProvider Ñ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ‚Ð¾Ñ€Ð¾Ð¼ \"{0}\" не зарегиÑтрирован.", + "treeExplorer.failedToProvideRootNode": "TreeExplorerNodeProvider \"{0}\" не удалоÑÑŒ предоÑтавить корневой узел." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json index b6db31f0ebd..4b803b9827d 100644 --- a/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,7 +7,6 @@ "configureLocale": "ÐаÑтроить Ñзык", "displayLanguage": "ОпределÑет Ñзык интерфейÑа VSCode.", "doc": "СпиÑок поддерживаемых Ñзыков Ñм. в {0}.", - "restart": "Ð”Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñ‚Ñ€ÐµÐ±ÑƒÐµÑ‚ÑÑ Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿ÑƒÑк VSCode.", "fail.createSettings": "Ðевозможно Ñоздать \"{0}\" ({1}).", "JsonSchema.locale": "Язык пользовательÑкого интерфейÑа." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/rus/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index 2259656b83f..e8ab2008c46 100644 --- a/i18n/rus/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -44,6 +44,8 @@ "openPreviousRecentlyUsedEditorInGroup": "Открыть предыдущий недавно иÑпользованный редактор в группе", "openNextRecentlyUsedEditorInGroup": "Открыть Ñледующий недавно иÑпользованный редактор в группе", "navigateEditorHistoryByInput": "Открыть предыдущий редактор из журнала", + "openNextRecentlyUsedEditor": "Открыть Ñледующий недавно иÑпользованный редактор", + "openPreviousRecentlyUsedEditor": "Открыть предыдущий недавно иÑпользованный редактор", "clearEditorHistory": "ОчиÑтить журнал редактора", "focusLastEditorInStack": "Открыть поÑледний редактор в группе", "moveEditorLeft": "ПеремеÑтить редактор влево", diff --git a/i18n/rus/src/vs/workbench/common/theme.i18n.json b/i18n/rus/src/vs/workbench/common/theme.i18n.json index bf046e99759..76b8cda3228 100644 --- a/i18n/rus/src/vs/workbench/common/theme.i18n.json +++ b/i18n/rus/src/vs/workbench/common/theme.i18n.json @@ -4,16 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "tabsContainerBackground": "Цвет фона контейнера вкладок. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редакторов. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может быть неÑколько групп редакторов.", "tabActiveBackground": "Цвет фона активной вкладки. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", "tabInactiveBackground": "Цвет фона неактивной вкладки. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", "tabBorder": "Граница Ð´Ð»Ñ Ñ€Ð°Ð·Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð²ÐºÐ»Ð°Ð´Ð¾Ðº. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редакторов. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может быть неÑколько групп редакторов.", "tabActiveEditorGroupActiveForeground": "Цвет переднего плана активной вкладки в активной группе. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", - "tabActiveEditorGroupInactiveForeground": "Цвет переднего плана активной вкладки в неактивной группе. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", "tabInactiveEditorGroupActiveForeground": "Цвет переднего плана неактивной вкладки в активной группе. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", - "tabInactiveEditorGroupInactiveForeground": "Цвет переднего плана неактивной вкладки в неактивной группе. Вкладки — Ñто контейнеры Ð´Ð»Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€Ð¾Ð² в облаÑти редактора. Ð’ одной группе редакторов можно открыть неÑколько вкладок. Может приÑутÑтвовать неÑколько групп редакторов.", + "editorGroupBackground": "Цвет фона группы редакторов. Группы редакторов предÑтавлÑÑŽÑ‚ Ñобой контейнеры редакторов. Цвет фона отображаетÑÑ Ð¿Ñ€Ð¸ перетаÑкивании групп редакторов.", + "editorGroupHeaderBackground": "Цвет фона Ð´Ð»Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÐ° группы редакторов, когда вкладки отключены. Группы редакторов предÑтавлÑÑŽÑ‚ Ñобой контейнеры редакторов.", "editorGroupBorder": "Цвет Ð´Ð»Ñ Ñ€Ð°Ð·Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð½ÐµÑкольких групп редакторов. Группы редакторов — Ñто контейнеры редакторов.", - "editorDragAndDropBackground": "Цвет фона при перетаÑкивании редакторов.", "panelBackground": "Цвет фона панели. Панели показаны под облаÑтью редактора и Ñодержат такие предÑтавлениÑ, как выходные данные и вÑтроенный терминал.", "panelBorder": "Цвет верхней границы панели, отделÑющей ее от редактора. Панели показаны под облаÑтью редактора и Ñодержат такие предÑтавлениÑ, как выходные данные и вÑтроенный терминал.", "panelActiveTitleForeground": "Цвет заголовка Ð´Ð»Ñ Ð°ÐºÑ‚Ð¸Ð²Ð½Ð¾Ð¹ панели. Панели отображаютÑÑ Ð¿Ð¾Ð´ облаÑтью редактора и Ñодержат такие предÑтавлениÑ, как окно вывода и вÑтроенный терминал.", @@ -24,14 +22,19 @@ "statusBarNoFolderBackground": "Цвет фона панели ÑоÑтоÑниÑ, еÑли папка не открыта. Панель ÑоÑтоÑÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÐµÑ‚ÑÑ Ð²Ð½Ð¸Ð·Ñƒ окна.", "statusBarItemActiveBackground": "Цвет фона Ñлементов панели ÑоÑтоÑÐ½Ð¸Ñ Ð¿Ñ€Ð¸ щелчке. Панель ÑоÑтоÑÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÐµÑ‚ÑÑ Ð²Ð½Ð¸Ð·Ñƒ окна.", "statusBarItemHoverBackground": "Цвет фона Ñлементов панели ÑоÑтоÑÐ½Ð¸Ñ Ð¿Ñ€Ð¸ наведении. Панель ÑоÑтоÑÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÐµÑ‚ÑÑ Ð²Ð½Ð¸Ð·Ñƒ окна.", + "statusBarProminentItemBackground": "Цвет фона приоритетных Ñлементов панели ÑоÑтоÑниÑ. Приоритетные Ñлементы выделÑÑŽÑ‚ÑÑ Ð½Ð° фоне других Ñлементов панели ÑоÑтоÑниÑ, чтобы подчеркнуть их значение. Панель ÑоÑтоÑÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÐµÑ‚ÑÑ Ð² нижней чаÑти окна.", + "statusBarProminentItemHoverBackground": "Цвет фона приоритетных Ñлементов панели ÑоÑтоÑÐ½Ð¸Ñ Ð¿Ñ€Ð¸ наведении. Приоритетные Ñлементы выделÑÑŽÑ‚ÑÑ Ð½Ð° фоне других Ñлементов панели ÑоÑтоÑниÑ, чтобы подчеркнуть их значение. Панель ÑоÑтоÑÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÐµÑ‚ÑÑ Ð² нижней чаÑти окна.", "activityBarBackground": "Цвет фона панели дейÑтвий. Панель дейÑтвий отображаетÑÑ Ñлева или Ñправа и позволÑет переключатьÑÑ Ð¼ÐµÐ¶Ð´Ñƒ предÑтавлениÑми боковой панели.", - "activityBarDragAndDropBackground": "Цвет обратной ÑвÑзи при перетаÑкивании Ð´Ð»Ñ Ñлементов панели дейÑтвий. Панель дейÑтвий отображаетÑÑ Ñлева или Ñправа и позволÑет переключатьÑÑ Ð¼ÐµÐ¶Ð´Ñƒ предÑтавлениÑми боковой панели.", + "activityBarForeground": "Цвет переднего плана панели дейÑтвий (например, цвет, иÑпользуемый Ð´Ð»Ñ Ð·Ð½Ð°Ñ‡ÐºÐ¾Ð²). Панель дейÑтвий отображаетÑÑ Ñлева или Ñправа и позволÑет переключатьÑÑ Ð¼ÐµÐ¶Ð´Ñƒ предÑтавлениÑми боковой панели.", "activityBarBadgeBackground": "Цвет фона значка уведомлений о дейÑтвиÑÑ…. Панель дейÑтвий отображаетÑÑ Ñлева или Ñправа и позволÑет переключатьÑÑ Ð¼ÐµÐ¶Ð´Ñƒ предÑтавлениÑми боковой панели.", "activityBarBadgeForeground": "Цвет переднего плана значка уведомлений о дейÑтвиÑÑ…. Панель дейÑтвий отображаетÑÑ Ñлева или Ñправа и позволÑет переключатьÑÑ Ð¼ÐµÐ¶Ð´Ñƒ предÑтавлениÑми боковой панели.", "sideBarBackground": "Цвет фона боковой панели. Ð‘Ð¾ÐºÐ¾Ð²Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒÂ â€” Ñто контейнер таких предÑтавлений, как проводник и поиÑк.", "sideBarTitleForeground": "Цвет переднего плана заголовка боковой панели. Ð‘Ð¾ÐºÐ¾Ð²Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒÂ â€” Ñто контейнер Ð´Ð»Ñ Ñ‚Ð°ÐºÐ¸Ñ… предÑтавлений, как проводник и поиÑк.", + "sideBarSectionHeaderBackground": "Цвет фона Ð´Ð»Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÐ° раздела боковой панели. Ð‘Ð¾ÐºÐ¾Ð²Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒÂ â€” Ñто контейнер Ð´Ð»Ñ Ñ‚Ð°ÐºÐ¸Ñ… предÑтавлений, как проводник и поиÑк.", "titleBarActiveForeground": "Передний план панели заголовка, еÑли окно активно. Обратите внимание, что Ñтот цвет ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в macOS.", "titleBarInactiveForeground": "Передний план панели заголовка, еÑли окно неактивно. Обратите внимание, что Ñтот цвет ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в macOS.", "titleBarActiveBackground": "Фон панели заголовка, еÑли окно активно. Обратите внимание, что Ñтот цвет ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в macOS.", - "titleBarInactiveBackground": "Фон панели заголовка, еÑли окно неактивно. Обратите внимание, что Ñтот цвет ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в macOS." + "titleBarInactiveBackground": "Фон панели заголовка, еÑли окно неактивно. Обратите внимание, что Ñтот цвет ÑÐµÐ¹Ñ‡Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в macOS.", + "notificationsForeground": "Цвет переднего плана Ð´Ð»Ñ ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ð¹. Ð£Ð²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÑŽÑ‚ÑÑ Ð² верхней чаÑти окна.", + "notificationsBackground": "Цвет фона Ð´Ð»Ñ ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ð¹. Ð£Ð²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°ÑŽÑ‚ÑÑ Ð² верхней чаÑти окна." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json index 68ba046d916..f2bd599c1b9 100644 --- a/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "ПроÑмотреть", "help": "Справка", "file": "Файл", + "developer": "Разработчик", "showEditorTabs": "ОпределÑет, должны ли открытые редакторы отображатьÑÑ Ð½Ð° вкладках или нет.", "editorTabCloseButton": "ОпределÑет положение кнопок Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð²ÐºÐ»Ð°Ð´Ð¾Ðº редактора или отключает их, еÑли задано значение off.", "showIcons": "ОпределÑет, должны ли открытые редакторы отображатьÑÑ Ñо значком. Требует включить тему значков.", @@ -20,6 +21,7 @@ "statusBarVisibility": "УправлÑет видимоÑтью Ñтроки ÑоÑтоÑÐ½Ð¸Ñ Ð² нижней чаÑти рабочего меÑта.", "activityBarVisibility": "УправлÑет видимоÑтью панели дейÑтвий на рабочем меÑте.", "closeOnFileDelete": "ОпределÑет, Ñледует ли автоматичеÑки закрывать редакторы, когда отображаемый в них файл удален или переименован другим процеÑÑом. При отключении Ñтой функции редактор оÑтаетÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ñ‹Ð¼ в качеÑтве черновика. Обратите внимание, что при удалении из Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¾Ñ€ закрываетÑÑ Ð²Ñегда и что файлы черновиков никогда не закрываютÑÑ Ð´Ð»Ñ ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½Ñ‹Ñ….", + "swipeToNavigate": "ПереключайтеÑÑŒ между открытыми файлами, Ð¿Ñ€Ð¾Ð²Ð¾Ð´Ñ Ð¿Ð¾ Ñкрану по горизонтали Ñ‚Ñ€ÐµÐ¼Ñ Ð¿Ð°Ð»ÑŒÑ†Ð°Ð¼Ð¸.", "workbenchConfigurationTitle": "Workbench", "window.openFilesInNewWindow.on": "Файлы будут открыватьÑÑ Ð² новом окне.", "window.openFilesInNewWindow.off": "Файлы будут открыватьÑÑ Ð² окне Ñ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¾Ð¹ папкой файлов или поÑледнем активном окне.", @@ -40,7 +42,6 @@ "window.newWindowDimensions.inherit": "Открывать новые окна того же размера, что и поÑледнее активное окно.", "window.newWindowDimensions.maximized": "Открывать новые окна в развернутом ÑоÑтоÑнии.", "window.newWindowDimensions.fullscreen": "Открывать новые окна в полноÑкранном режиме.", - "newWindowDimensions": "ОпределÑет размеры открывающегоÑÑ Ð½Ð¾Ð²Ð¾Ð³Ð¾ окна. По умолчанию новое окно небольшого размера будет открыватьÑÑ Ð¿Ð¾ центру Ñкрана. ЕÑли задано значение inherit, окно будет открыватьÑÑ Ñ Ñ‚ÐµÐ¼Ð¸ же размерами, что и поÑледнее активное окно. ЕÑли задано значение maximized, окно будет открыватьÑÑ Ð² макÑимальном размере, и в полноÑкранном режиме, еÑли задано значение fullscreen.", "window.menuBarVisibility.default": "Меню Ñкрыто только в полноÑкранном режиме.", "window.menuBarVisibility.visible": "Меню вÑегда видимо, даже в полноÑкранном режиме.", "window.menuBarVisibility.toggle": "Меню Ñкрыто, но его можно вывеÑти Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ клавиши ALT.", @@ -48,10 +49,12 @@ "menuBarVisibility": "ОпределÑет видимоÑть Ñтроки меню. Значение toggle указывает, что Ñтрока меню Ñкрыта и Ð´Ð»Ñ ÐµÐµ вывода нужно один раз нажать клавишу ALT. По умолчанию Ñтрока меню не будет отображатьÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ в полноÑкранном режиме.", "autoDetectHighContrast": "ЕÑли включено, будет выполнÑтьÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑкий переход к выÑококонтраÑтной теме, еÑли в Windows иÑпользуетÑÑ Ñ‚ÐµÐ¼Ð° выÑокой контраÑтноÑти, или к темной теме при выходе из темы выÑокой контраÑтноÑти Windows.", "titleBarStyle": "ÐаÑтройка внешнего вида заголовка окна. Чтобы применить изменениÑ, потребуетÑÑ Ð¿Ð¾Ð»Ð½Ñ‹Ð¹ перезапуÑк.", + "window.nativeTabs": "Включает вкладки окна macOS Sierra. Обратите внимание, что Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ñтих изменений потребуетÑÑ Ð¿Ð¾Ð»Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ°, и что Ð´Ð»Ñ Ð²Ñех внутренних вкладок будет отключен пользовательÑкий Ñтиль заголовка, еÑли он был наÑтроен.", "windowConfigurationTitle": "Окно", "zenModeConfigurationTitle": "Режим Zen", "zenMode.fullScreen": "ОпределÑет, будет ли переключение в режим Zen переключать рабочее проÑтранÑтво в полноÑкранный режим.", "zenMode.hideTabs": "ОпределÑет, будет ли включение режима Zen также Ñкрывать вкладки рабочего меÑта.", "zenMode.hideStatusBar": "ОпределÑет, будет ли включение режима Zen также Ñкрывать Ñтроку ÑоÑтоÑÐ½Ð¸Ñ Ð² нижней чаÑти рабочего меÑта.", + "zenMode.hideActivityBar": "ОпределÑет, будет ли при включении режима Zen Ñкрыта панель дейÑтвий в левой чаÑти рабочей облаÑти.", "zenMode.restore": "ОпределÑет, должно ли окно воÑÑтанавливатьÑÑ Ð² режиме Zen, еÑли закрылоÑÑŒ в режиме Zen." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/shell.i18n.json index b2ec5a62b60..39183187ef0 100644 --- a/i18n/rus/src/vs/workbench/electron-browser/shell.i18n.json +++ b/i18n/rus/src/vs/workbench/electron-browser/shell.i18n.json @@ -4,9 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "runningAsRoot": "Ðе рекомендуетÑÑ Ð·Ð°Ð¿ÑƒÑкать код Ñ Ð¿Ñ€Ð°Ð²Ð°Ð¼Ð¸ админиÑтратора.", - "prof.message": "Профили уÑпешно Ñозданы.", - "prof.detail": "Создайте проблему и вручную вложите Ñледующие файлы:\n{0}", - "prof.restartAndFileIssue": "Создать проблему и выполнить перезапуÑк", - "prof.restart": "ПерезапуÑтить" + "runningAsRoot": "Ðе рекомендуетÑÑ Ð·Ð°Ð¿ÑƒÑкать код Ñ Ð¿Ñ€Ð°Ð²Ð°Ð¼Ð¸ админиÑтратора." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/window.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/window.i18n.json index 46ef3c781f0..fb864141a42 100644 --- a/i18n/rus/src/vs/workbench/electron-browser/window.i18n.json +++ b/i18n/rus/src/vs/workbench/electron-browser/window.i18n.json @@ -11,7 +11,5 @@ "paste": "Ð’Ñтавить", "selectAll": "Выбрать вÑе", "confirmOpen": "ДейÑтвительно открыть папки ({0})?", - "confirmOpenButton": "&&Открыть...", - "developer": "Разработчик", - "file": "Файл" + "confirmOpenButton": "&&Открыть..." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index 8b6ad71cd4e..5e643a61203 100644 --- a/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "workbench.action.inspectKeyMap": "Разработчик: иÑÑледование ÑопоÑтавлений ключей" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index d73136084f2..0a2abc6c1db 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -34,6 +34,7 @@ "editConditionalBreakpoint": "Изменить точку оÑтанова…", "setValue": "Задать значение", "addWatchExpression": "Добавить выражение", + "editWatchExpression": "Изменить выражение", "addToWatchExpressions": "Добавить контрольное значение", "removeWatchExpression": "Удалить выражение", "removeAllWatchExpressions": "Удалить вÑе выражениÑ", diff --git a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json index 8b6ad71cd4e..6543390a263 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "debugToolBarBackground": "Цвет фона Ð´Ð»Ñ Ð¿Ð°Ð½ÐµÐ»Ð¸ инÑтрументов отладки." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 00000000000..fab9558d4c2 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "fileLinkMac": "Щелкните, чтобы отÑлеживать (чтобы открыть Ñбоку Ñкрана, щелкните, ÑƒÐ´ÐµÑ€Ð¶Ð¸Ð²Ð°Ñ ÐºÐ»Ð°Ð²Ð¸ÑˆÑƒ CMD)", + "fileLink": "Щелкните, чтобы отÑлеживать (чтобы открыть Ñбоку Ñкрана, щелкните, ÑƒÐ´ÐµÑ€Ð¶Ð¸Ð²Ð°Ñ ÐºÐ»Ð°Ð²Ð¸ÑˆÑƒ CTRL)" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 00000000000..7f2fb6520d0 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "internalConsoleOptions": "УправлÑет поведением внутренней конÑоли отладки." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json index a0a2e364335..9c4ea4ee975 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -15,5 +15,6 @@ "allowBreakpointsEverywhere": "Разрешает задание точки оÑтанова в любом файле", "openExplorerOnEnd": "ÐвтоматичеÑки открывать предÑтавление Ð¾Ð±Ð¾Ð·Ñ€ÐµÐ²Ð°Ñ‚ÐµÐ»Ñ Ð² конце ÑеанÑа отладки", "inlineValues": "Показывать Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ñ… в редакторе во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ñ‚Ð»Ð°Ð´ÐºÐ¸", - "hideActionBar": "ОпределÑет, Ñледует ли Ñкрыть вÑплывающую панель дейÑтвий отладки." + "hideActionBar": "ОпределÑет, Ñледует ли Ñкрыть вÑплывающую панель дейÑтвий отладки.", + "launch": "Ð“Ð»Ð¾Ð±Ð°Ð»ÑŒÐ½Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð·Ð°Ð¿ÑƒÑка отладки. Должна иÑпользоватьÑÑ Ð² качеÑтве альтернативы Ð´Ð»Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ \"launch.json\", ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ ÑвлÑетÑÑ Ð¾Ð±Ñ‰ÐµÐ¹ Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‡Ð¸Ñ… проÑтранÑтв" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json index 188f271b73e..4c742d270df 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "stateCapture": "СоÑтоÑние объекта запиÑываетÑÑ Ð¿Ð¾Ñле первого вычиÑлениÑ", - "fileLinkMac": "Щелкните, чтобы отÑлеживать (чтобы открыть Ñбоку Ñкрана, щелкните, ÑƒÐ´ÐµÑ€Ð¶Ð¸Ð²Ð°Ñ ÐºÐ»Ð°Ð²Ð¸ÑˆÑƒ CMD)", - "fileLink": "Щелкните, чтобы отÑлеживать (чтобы открыть Ñбоку Ñкрана, щелкните, ÑƒÐ´ÐµÑ€Ð¶Ð¸Ð²Ð°Ñ ÐºÐ»Ð°Ð²Ð¸ÑˆÑƒ CTRL)", "replVariableAriaLabel": "ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ \"{0}\" имеет значение \"{1}\", read–eval–print loop, отладка", "replExpressionAriaLabel": "Выражение \"{0}\" имеет значение \"{1}\", read–eval–print loop, отладка", "replValueOutputAriaLabel": "{0}, read–eval–print loop, отладка", diff --git a/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 88d355f7a27..90a5d4e861e 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -12,7 +12,6 @@ "debugRequest": "ЗапроÑите тип конфигурации. Возможные типы: \"запуÑк\" и \"подключение\".", "debugServer": "Только Ð´Ð»Ñ Ñ€Ð°Ð·Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ раÑширений отладки: еÑли указан порт, VS Code пытаетÑÑ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒÑÑ Ðº адаптеру отладки, запущенному в режиме Ñервера.", "debugPrelaunchTask": "Задача, выполнÑÐµÐ¼Ð°Ñ Ð¿ÐµÑ€ÐµÐ´ началом ÑеанÑа отладки.", - "internalConsoleOptions": "УправлÑет поведением внутренней конÑоли отладки.", "debugWindowsConfiguration": "Ðтрибуты конфигурации запуÑка Ð´Ð»Ñ Windows.", "debugOSXConfiguration": "Ðтрибуты конфигурации запуÑка Ð´Ð»Ñ OS X.", "debugLinuxConfiguration": "Ðтрибуты конфигурации запуÑка Ð´Ð»Ñ Linux.", diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 00000000000..6f2d64eeffb --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "balanceInward": "Emmet: Ð±Ð°Ð»Ð°Ð½Ñ (входÑщий)", + "balanceOutward": "Emmet: Ð±Ð°Ð»Ð°Ð½Ñ (иÑходÑщий)" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 00000000000..4a07fdffeba --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "previousEditPoint": "Emmet: Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ Ñ‚Ð¾Ñ‡ÐºÐ° изменениÑ", + "nextEditPoint": "Emmet: ÑÐ»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ñ‚Ð¾Ñ‡ÐºÐ° изменениÑ" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 00000000000..24098651eac --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "evaluateMathExpression": "Emmet: вычиÑление математичеÑкого выражениÑ" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 00000000000..982ec325649 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "expandAbbreviationAction": "Emmet: раÑшифровать аббревиатуру" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 00000000000..1befe3f2264 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +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. +{ + "incrementNumberByOneTenth": "Emmet: увеличение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 0,1", + "incrementNumberByOne": "Emmet: увеличение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 1", + "incrementNumberByTen": "Emmet: увеличение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 10", + "decrementNumberByOneTenth": "Emmet: уменьшение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 0,1", + "decrementNumberByOne": "Emmet: уменьшение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 1", + "decrementNumberByTen": "Emmet: уменьшение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð½Ð° 10" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 00000000000..526b5d5303f --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "matchingPair": "Emmet: перейти к ÑоответÑтвующей паре" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 00000000000..81f00b3edbc --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "mergeLines": "Emmet: объединение Ñтрок" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 00000000000..4673022a248 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "reflectCSSValue": "Emmet: отражение Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ CSS" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 00000000000..99b383ac902 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "removeTag": "Emmet: удаление тега" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 00000000000..50ca8bd70b7 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "selectPreviousItem": "Emmet: выбор предыдущего Ñлемента", + "selectNextItem": "Emmet: выбор Ñледующего Ñлемента" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 00000000000..b2b30614cea --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "splitJoinTag": "Emmet: разделение и объединение тегов" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 00000000000..0bb940b0c93 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "toggleComment": "Emmet: переключение комментариев" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 00000000000..8c273b41250 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * 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. +{ + "updateImageSize": "Emmet: изменение размера изображениÑ" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 00000000000..3c3bd54c27a --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +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. +{ + "updateTag": "Emmet: изменение тега", + "enterTag": "Ввод тега", + "tag": "Тег" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 00000000000..f493f727ad3 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +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. +{ + "wrapWithAbbreviationAction": "Emmet: Ð¿ÐµÑ€ÐµÐ½Ð¾Ñ Ñ Ñокращением", + "enterAbbreviation": "Ввод ÑокращениÑ", + "abbreviation": "Сокращение" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 00000000000..b632b35fef6 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +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. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "ЕÑли включено, ÑÐ¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Emmet разворачиваютÑÑ Ð¿Ñ€Ð¸ нажатии клавиши TAB.", + "emmetPreferences": "ÐаÑтройки, которые иÑпользуютÑÑ Ð´Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð½ÐµÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… дейÑтвий и ÑопоÑтавителей Emmet.", + "emmetSyntaxProfiles": "Задайте профиль Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð³Ð¾ ÑинтакÑиÑа или иÑпользуйте Ñвой ÑобÑтвенный профиль Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð½Ñ‹Ð¼Ð¸ правилами.", + "emmetExclude": "МаÑÑив Ñзыков, в которых не должны развертыватьÑÑ ÑÐ¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Emmet.", + "emmetExtensionsPath": "Путь к папке, Ñодержащей профили Emmet, фрагменты кода и наÑтройки" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 91e553b6c73..2322bd36fa8 100644 --- a/i18n/rus/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,6 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "vscode.extension.contributes.view": "ДобавлÑет пользовательÑкое предÑтавление", + "vscode.extension.contributes.view.id": "Уникальный идентификатор предÑтавлениÑ, Ñозданного Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Строка Ð´Ð»Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð¿Ñ€ÐµÐ´ÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² понÑтном Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ðµ", + "vscode.extension.contributes.view.icon": "Путь к значку предÑтавлениÑ", + "vscode.extension.contributes.views": "ДобавлÑет пользовательÑкие предÑтавлениÑ", "showViewlet": "Показать {0}", "view": "ПроÑмотреть" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 6d9a00632d2..e3fabddede9 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -4,8 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "reallyRecommended2": "РаÑширение '{0}' не рекомендуетÑÑ Ð´Ð»Ñ Ñтого типа файлов.", "showRecommendations": "Показать рекомендации", "neverShowAgain": "Больше не показывать", "close": "Закрыть", - "workspaceRecommended": "Эта Ñ€Ð°Ð±Ð¾Ñ‡Ð°Ñ Ð¾Ð±Ð»Ð°Ñть включает рекомендации по раÑширениÑм." + "workspaceRecommended": "Эта Ñ€Ð°Ð±Ð¾Ñ‡Ð°Ñ Ð¾Ð±Ð»Ð°Ñть включает рекомендации по раÑширениÑм.", + "no": "Ðет", + "cancel": "Отмена" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 00000000000..82ee62547a4 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +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. +{ + "yes": "Да", + "no": "Ðет", + "uninstall": "Удаление", + "later": "Позже" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json index 183b5ea9535..325a13dfd7a 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -8,6 +8,7 @@ "extensions": "РаÑширениÑ", "sort by installs": "Сортировать по: чиÑлу уÑтановок", "sort by rating": "Сортировать по: рейтинг", + "sort by name": "Сортировать по: название", "no extensions found": "РаÑширений не найдено.", "suggestProxyError": "Marketplace вернул значение \"ECONNREFUSED\". Проверьте параметр \"http.proxy\".", "outdatedExtensions": "УÑтаревшие раÑширениÑ: {0}" diff --git a/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index a548f83b670..6c404cd1796 100644 --- a/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,6 @@ "associations": "ÐаÑтройте ÑопоÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² Ñ Ñзыками (например, \"*.extension\": \"html\"). У них будет приоритет перед заданными по умолчанию ÑопоÑтавлениÑми уÑтановленных Ñзыков.", "encoding": "Кодировка набора Ñимволов по умолчанию, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÐµÐ¼Ð°Ñ Ð¿Ñ€Ð¸ чтении и запиÑи файлов", "autoGuessEncoding": "ЕÑли параметр включен, производитÑÑ Ð¿Ð¾Ð¿Ñ‹Ñ‚ÐºÐ° определить кодировку набора Ñимволов при открытии файлов", - "eol": "Символ конца Ñтроки по умолчанию.", "trimTrailingWhitespace": "ЕÑли Ñтот параметр включен, при Ñохранении файла будут удалены концевые пробелы.", "insertFinalNewline": "ЕÑли Ñтот параметр включен, при Ñохранении файла в его конец вÑтавлÑетÑÑ Ñ„Ð¸Ð½Ð°Ð»ÑŒÐ½Ð°Ñ Ð½Ð¾Ð²Ð°Ñ Ñтрока.", "files.autoSave.off": "\"ГрÑзный\" файл не ÑохранÑетÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки.", @@ -27,8 +26,6 @@ "autoSaveDelay": "ОпределÑет задержку в мÑ, поÑле которой измененный файл ÑохранÑетÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки. ДейÑтвует, только еÑли параметр \"files.autoSave\" имеет значение \"{0}\".", "watcherExclude": "ÐаÑтройте Ñтандартные маÑки путей файлов, чтобы иÑключить их из ÑпиÑка отÑлеживаемых файлов. ПоÑле Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ñтого параметра потребуетÑÑ Ð¿ÐµÑ€ÐµÐ·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ°. При отображении ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ \"Код потреблÑет большое количеÑтво процеÑÑорного времени при запуÑке\" вы можете иÑключить большие папки, чтобы уменьшить первоначальную загрузку.", "hotExit.off": "Отключите \"горÑчий\" выход.", - "hotExit.onExit": "\"ГорÑчий\" выход будет активирован при закрытии приложениÑ, то еÑть когда закрываетÑÑ Ð¿Ð¾Ñледнее окно в Windows или Linux или при активации команды workbench.action.quit (палитра команд, наÑтраиваемое Ñочетание клавиш, меню). Ð’Ñе окна Ñ Ñ€ÐµÐ·ÐµÑ€Ð²Ð½Ñ‹Ð¼Ð¸ копиÑми будут воÑÑтановлены при Ñледующем запуÑке.", - "hotExit.onExitAndWindowClose": "\"ГорÑчий\" выход будет активирован при закрытии приложениÑ, то еÑть когда закрываетÑÑ Ð¿Ð¾Ñледнее окно в Windows или Linux или при активации команды workbench.action.quit (палитра команд, наÑтраиваемое Ñочетание клавиш, меню) и в любых окнах, где открыта папка, даже еÑли Ñто не поÑледнее окно. Окна без открытых папок будут воÑÑтановлены при Ñледующем запуÑке. Чтобы воÑÑтановить окна Ñ Ð¿Ð°Ð¿ÐºÐ°Ð¼Ð¸, перед завершением работы задайте Ð´Ð»Ñ \"window.reopenFolders\" значение \"all\".", "hotExit": "ОпределÑет, запоминаютÑÑ Ð»Ð¸ неÑохраненные файлы между ÑеанÑами. Ð’ Ñтом Ñлучае приглашение на их Ñохранение при выходе из редактора не поÑвлÑетÑÑ.", "defaultLanguage": "Режим Ñзыка по умолчанию, который назначаетÑÑ Ð½Ð¾Ð²Ñ‹Ð¼ файлам.", "editorConfigurationTitle": "Редактор", diff --git a/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index ef99a2ea9f3..5ac046256bd 100644 --- a/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,9 @@ // Do not edit this file. It is machine generated. { "slow": "Обнаружен замедленный запуÑк.", - "slow.detail": "Сожалеем, что у Ð²Ð°Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð¾ÑˆÐµÐ» замедленный запуÑк. ПерезапуÑтите \"{0}\" Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ‹Ð¼ профилированием и отправьте профили нам, чтобы мы могли уÑкорить загрузку." + "slow.detail": "Сожалеем, что у Ð²Ð°Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð¾ÑˆÐµÐ» замедленный запуÑк. ПерезапуÑтите \"{0}\" Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ‹Ð¼ профилированием и отправьте профили нам, чтобы мы могли уÑкорить загрузку.", + "prof.message": "Профили уÑпешно Ñозданы.", + "prof.detail": "Создайте проблему и вручную вложите Ñледующие файлы:\n{0}", + "prof.restartAndFileIssue": "Создать проблему и выполнить перезапуÑк", + "prof.restart": "ПерезапуÑтить" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json index 29ff1ceed65..4338bc61e7b 100644 --- a/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -7,6 +7,7 @@ "keybindingsInputName": "Ð¡Ð¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ", "SearchKeybindings.AriaLabel": "ПоиÑк наÑтраиваемых Ñочетаний клавиш", "SearchKeybindings.Placeholder": "ПоиÑк наÑтраиваемых Ñочетаний клавиш", + "sortByPrecedene": "Сортировать по приоритету", "header-message": "Ð”Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ€Ð°Ñширенных наÑтроек откройте и измените", "keybindings-file-name": "keybindings.json", "keybindingsLabel": "ÐаÑтраиваемые ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ", @@ -14,6 +15,7 @@ "addLabel": "Добавить наÑтраиваемое Ñочетание клавиш", "removeLabel": "Удаление наÑтраиваемого ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ", "resetLabel": "СброÑить наÑтраиваемое Ñочетание клавиш", + "showConflictsLabel": "Показать конфиликты", "copyLabel": "Копировать", "error": "Произошла ошибка \"{0}\" при редактировании наÑтраиваемого ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ. Откройте и проверьте файл \"keybindings.json\".", "command": "Команда", diff --git a/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index dd62a90ff3e..b82ad2f758e 100644 --- a/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,6 +6,7 @@ { "openGlobalSettings": "Открыть пользовательÑкие параметры", "openGlobalKeybindings": "Открыть ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ", + "openGlobalKeybindingsFile": "Открыть файл Ñочетаний клавиш", "openWorkspaceSettings": "Открыть параметры рабочей облаÑти", "configureLanguageBasedSettings": "ÐаÑтроить параметры Ñзыка...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/rus/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/rus/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json index 2ecce32e28a..01326f09a14 100644 --- a/i18n/rus/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -5,5 +5,7 @@ // Do not edit this file. It is machine generated. { "default": "По умолчанию", - "user": "Пользователь" + "user": "Пользователь", + "meta": "meta", + "option": "параметр" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 00000000000..8b6ad71cd4e --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * 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 newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/search/browser/replaceService.i18n.json b/i18n/rus/src/vs/workbench/parts/search/browser/replaceService.i18n.json index 8b6ad71cd4e..7f4464d3a78 100644 --- a/i18n/rus/src/vs/workbench/parts/search/browser/replaceService.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/search/browser/replaceService.i18n.json @@ -3,4 +3,6 @@ * 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 newline at end of file +{ + "fileReplaceChanges": "{0} ↔ {1} (заменить предварительную верÑию)" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index e7f3725b953..845c4f038e9 100644 --- a/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,7 +6,5 @@ { "searchMatches": "Ðайдено ÑоответÑтвий: {0}", "searchMatch": "Ðайдено ÑоответÑтвие: {0}", - "fileMatchAriaLabel": "Совпадений в файле {1} папки {2}: {0}, результат поиÑка", - "replacePreviewResultAria": "Результаты предварительного проÑмотра замены, {0}", - "searchResultAria": "{0}, результат поиÑка" + "fileMatchAriaLabel": "Совпадений в файле {1} папки {2}: {0}, результат поиÑка" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 6e9f10d466a..b24656f0f48 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, задачи", "tasksAriaLabel": "Введите Ð¸Ð¼Ñ Ð·Ð°Ð´Ð°Ñ‡Ð¸ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿ÑƒÑка", "noTasksMatching": "Ðет ÑоответÑтвующих задач", "noTasksFound": "Задачи Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿ÑƒÑка не найдены" diff --git a/i18n/rus/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 3b76f56cac0..d68fa91047a 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, задачи", "tasksAriaLabel": "Введите Ð¸Ð¼Ñ Ð·Ð°Ð´Ð°Ñ‡Ð¸, которую нужно выполнить", "noTasksMatching": "Ðет ÑоответÑтвующих задач", "noTasksFound": "Задачи не найдены" diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index c172163eb52..031f694786c 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -9,6 +9,7 @@ "ConfigureTaskRunnerAction.quickPick.template": "Выбрать ÑредÑтво Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð´Ð°Ñ‡", "ConfigureTaskRunnerAction.autoDetecting": "Ðвтообнаружение задач Ð´Ð»Ñ {0}", "ConfigureTaskRunnerAction.autoDetect": "Ðе удалоÑÑŒ автоматичеÑки определить ÑиÑтему задачи, иÑпользуетÑÑ ÑˆÐ°Ð±Ð»Ð¾Ð½ по умолчанию. ПодробноÑти Ñм. в выходных данных задачи.", + "ConfigureTaskRunnerAction.autoDetectError": "При определении ÑиÑтемы задачи возникли ошибки. Дополнительные ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ñм. в выходных данных задачи.", "ConfigureTaskRunnerAction.failed": "Ðе удаетÑÑ Ñоздать файл tasks.json в папке .vscode. ПодробноÑти Ñм. в выходных данных задачи.", "ConfigureTaskRunnerAction.label": "ÐаÑтроить ÑредÑтво Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð´Ð°Ñ‡", "ConfigureBuildTaskAction.label": "ÐаÑтроить задачу Ñборки", @@ -17,7 +18,6 @@ "problems": "Проблемы", "manyMarkers": "99+", "tasks": "Задачи", - "TaskSystem.noHotSwap": "Чтобы изменить подÑиÑтему Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð´Ð°Ñ‡, нужно перезапуÑтить VS Code. Изменение игнорируетÑÑ.", "TaskService.noBuildTask": "Задача Ñборки не определена. Отметьте задачу Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ \"isBuildCommand\" в файле tasks.json.", "TaskService.noTestTask": "Задача теÑта не определена. Отметьте задачу Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ \"isTestCommand\" в файле tasks.json.", "TaskServer.noTask": "Ð—Ð°Ð¿Ñ€Ð¾ÑˆÐµÐ½Ð½Ð°Ñ Ð·Ð°Ð´Ð°Ñ‡Ð° {0} Ð´Ð»Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð½Ðµ найдена.", diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json index 03b66cf3c55..4523bac1924 100644 --- a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -16,6 +16,7 @@ "terminal.integrated.fontLigatures": "ОпределÑет, будут ли включены лигатуры шрифтов Ð´Ð»Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð°.", "terminal.integrated.fontSize": "ОпределÑет размер шрифта (в пикÑелÑÑ…) Ð´Ð»Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð°.", "terminal.integrated.lineHeight": "ОпределÑет выÑоту Ñтроки терминала; Ñто чиÑло умножаетÑÑ Ð½Ð° размер шрифта терминала, что дает фактичеÑкую выÑоту Ñтроки в пикÑелÑÑ….", + "terminal.integrated.enableBold": "Следует ли разрешить полужирный текÑÑ‚ в терминале. Эта Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° поддерживатьÑÑ Ð¾Ð±Ð¾Ð»Ð¾Ñ‡ÐºÐ¾Ð¹ терминала.", "terminal.integrated.cursorBlinking": "УправлÑет миганием курÑора терминала.", "terminal.integrated.cursorStyle": "ОпределÑет Ñтиль курÑора терминала.", "terminal.integrated.scrollback": "ОпределÑет предельное чиÑло Ñтрок в буфере терминала.", diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json index 1ed48f98d58..d683bd1c3d9 100644 --- a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.integrated.allowWorkspaceShell": "Ð’Ñ‹ хотите разрешить запуÑк {0} (определÑетÑÑ ÐºÐ°Ðº параметр рабочей облаÑти) в терминале?", "allow": "Allow", "disallow": "Disallow" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index ab56be435f7..60eb5ce7cf9 100644 --- a/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,14 +6,13 @@ { "selectTheme.label": "Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ Ñ‚ÐµÐ¼Ð°", "installColorThemes": "УÑтановить дополнительные цветовые темы...", - "problemChangingTheme": "Проблема при задании темы: {0}", - "themes.selectTheme": "Выберите цветовую тему", "selectIconTheme.label": "Тема значков файлов", "installIconThemes": "УÑтановить дополнительные темы значков файлов...", "noIconThemeLabel": "Ðет", "noIconThemeDesc": "Отключить значки файлов", "problemChangingIconTheme": "Проблема при задании темы значка: {0}", "themes.selectIconTheme": "Выбрать тему значка файла", + "generateColorTheme.label": "Создать цветовую тему на оÑнове текущих параметров", "preferences": "Параметры", "developer": "Разработчик" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 4457de0a2d6..9cf8071dbbf 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -13,31 +13,25 @@ "welcomePage.recent": "ПоÑледние", "welcomePage.noRecentFolders": "Ðет поÑледних папок.", "welcomePage.help": "Справка", - "welcomePage.productDocumentation": "Ð”Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ð¿Ð¾ продукту", "welcomePage.introductoryVideos": "Ð’Ñтупительные видео", + "welcomePage.productDocumentation": "Ð”Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ð¿Ð¾ продукту", "welcomePage.gitHubRepository": "Репозиторий GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Отображать Ñтраницу приветÑÑ‚Ð²Ð¸Ñ Ð¿Ñ€Ð¸ запуÑке", - "welcomePage.quickLinks": "БыÑтрые ÑÑылки", - "welcomePage.interactivePlayground": "Ð˜Ð½Ñ‚ÐµÑ€Ð°ÐºÑ‚Ð¸Ð²Ð½Ð°Ñ Ð¿Ð»Ð¾Ñ‰Ð°Ð´ÐºÐ°", - "welcomePage.interactivePlaygroundDescription": "Опробуйте оÑновные функции редактора в ходе краткого пошагового руководÑтва.", - "welcomePage.interfaceOverview": "Общие ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± интерфейÑе", - "welcomePage.interfaceOverviewDescription": "ИÑпользуйте визуальное наложение Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸ÐµÐ¼ оÑновных компонентов пользовательÑкого интерфейÑа.", + "welcomePage.customize": "ÐаÑтроить", + "welcomePage.installKeymapDescription": "УÑтановка Ñочетаний клавиш", + "welcomePage.others": "Другие", "welcomePage.colorTheme": "Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ Ñ‚ÐµÐ¼Ð°", "welcomePage.colorThemeDescription": "ÐаÑтройте редактор и код удобным образом.", - "welcomePage.keybindingsReference": "Справочник по ÑочетаниÑм клавиш", - "welcomePage.keybindingsReferenceDescription": "Подготовленный к печати PDF-файл Ñ Ñамыми чаÑтыми ÑочетаниÑми клавиш", "welcomePage.showCommands": "Ðайти и выполнить вÑе команды.", "welcomePage.showCommandsDescription": "БыÑтрый доÑтуп и поиÑк команд на панели ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ ({0})", + "welcomePage.interfaceOverview": "Общие ÑÐ²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± интерфейÑе", + "welcomePage.interfaceOverviewDescription": "ИÑпользуйте визуальное наложение Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸ÐµÐ¼ оÑновных компонентов пользовательÑкого интерфейÑа.", + "welcomePage.interactivePlayground": "Ð˜Ð½Ñ‚ÐµÑ€Ð°ÐºÑ‚Ð¸Ð²Ð½Ð°Ñ Ð¿Ð»Ð¾Ñ‰Ð°Ð´ÐºÐ°", + "welcomePage.interactivePlaygroundDescription": "Опробуйте оÑновные функции редактора в ходе краткого пошагового руководÑтва.", + "welcomePage.quickLinks": "БыÑтрые ÑÑылки", + "welcomePage.keybindingsReference": "Справочник по ÑочетаниÑм клавиш", + "welcomePage.keybindingsReferenceDescription": "Подготовленный к печати PDF-файл Ñ Ñамыми чаÑтыми ÑочетаниÑми клавиш", "welcomePage.configureSettings": "ÐаÑтройка параметров", - "welcomePage.configureSettingsDescription": "ИÑпользуйте вÑе возможноÑти VS Code, подобрав нужные параметры.", - "welcomePage.installKeymapDescription": "УÑтановка Ñочетаний клавиш", - "welcomePage.installKeymap": "УÑтановите ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ {0}, {1}, {2} и {3}.", - "welcomePage.vim": "Vim", - "welcomePage.vimCurrent": "Vim (текущий)", - "welcomePage.sublime": "Sublime", - "welcomePage.sublimeCurrent": "Sublime (текущий)", - "welcomePage.atom": "Atom", - "welcomePage.atomCurrent": "Atom (текущий)", - "welcomePage.others": "Другие" + "welcomePage.configureSettingsDescription": "ИÑпользуйте вÑе возможноÑти VS Code, подобрав нужные параметры." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 16cf088164d..1365e07209b 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -5,11 +5,16 @@ // Do not edit this file. It is machine generated. { "welcomePage": "Добро пожаловать", - "welcome.title": "Добро пожаловать", + "welcomePage.typeScript": "TypeScript", + "welcomePage.php": "PHP", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", "welcomePage.keymapAlreadyInstalled": "Ð¡Ð¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ {0} уже уÑтановлены.", "welcomePage.willReloadAfterInstallingKeymap": "Окно перезагрузитÑÑ Ð¿Ð¾Ñле уÑтановки Ñочетаний клавиш {0}.", - "ok": "ОК", "welcomePage.installingKeymap": "УÑтанавливаютÑÑ ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ {0}...", "welcomePage.keymapNotFound": "Ðе удалоÑÑŒ найти ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ {0} Ñ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ‚Ð¾Ñ€Ð¾Ð¼ {1}.", + "welcome.title": "Добро пожаловать", + "ok": "ОК", "cancel": "Отмена" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index d599004ee21..c86c05dcae5 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkThrough.unboundCommand": "Ñвободный" + "walkThrough.unboundCommand": "Ñвободный", + "walkThrough.gitNotFound": "Похоже, Git не уÑтановлен в вашей ÑиÑтеме." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 819e2b3d58b..e87cb2bac28 100644 --- a/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -4,11 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "open": "Открыть параметры", + "close": "Закрыть", "errorUnknownKey": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ в файл конфигурации (неизвеÑтный ключ)", - "errorInvalidTarget": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ в файл конфигурации (недопуÑтимый целевой объект).", - "errorNoWorkspaceOpened": "Ðе удаетÑÑ Ð·Ð°Ð¿Ð¸Ñать параметры, так как нет открытых папок. Откройте папку и повторите попытку.", - "errorInvalidConfiguration": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ параметров. Откройте файл **User Settings**, чтобы разрешить ошибки и Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñ Ð² файле, и повторите попытку.", - "errorInvalidConfigurationWorkspace": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ параметров. Откройте файл **Workspace Settings**, чтобы разрешить ошибки и Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñ Ð² файле, и повторите попытку.", - "errorConfigurationFileDirty": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ параметров, так как файл изменен. Сохраните файл **User Settings** и повторите попытку.", - "errorConfigurationFileDirtyWorkspace": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ параметров, так как файл изменен. Сохраните файл **Workspace Settings** и повторите попытку." + "errorInvalidTarget": "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ запиÑÑŒ в файл конфигурации (недопуÑтимый целевой объект)." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/rus/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index e7103548926..1a285aa0137 100644 --- a/i18n/rus/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/rus/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -14,9 +14,6 @@ "vscode.extension.contributes.keybindings.win": "Клавиша или поÑледовательноÑть клавиш Ð´Ð»Ñ Windows.", "vscode.extension.contributes.keybindings.when": "УÑловие, когда клавиша нажата.", "vscode.extension.contributes.keybindings": "ДобавлÑет наÑтраиваемые ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ.", - "openDocumentation": "Дополнительные ÑведениÑ", - "keybindingMigration.ok": "ОК", - "keybindingMigration.prompt": "Ðекоторые ÑÐ¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ¹ раÑкладки клавиатуры изменилиÑÑŒ.", "invalid.keybindings": "ÐедопуÑтимое значение \"contributes.{0}\": {1}", "unboundCommands": "ДоÑтупные команды: ", "keybindings.json.title": "ÐаÑтройка наÑтраиваемых Ñочетаний клавиш", diff --git a/i18n/rus/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/rus/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json index c953639514d..9f08b3aed1f 100644 --- a/i18n/rus/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json +++ b/i18n/rus/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -6,5 +6,6 @@ { "schema.colors": "Цвета Ð´Ð»Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ ÑинтакÑичеÑких конÑтрукций", "schema.properties.name": "ОпиÑание правила", - "schema.fontStyle": "Ðачертание шрифта Ð´Ð»Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»Ð°: один либо Ñочетание курÑива, полужирного и подчеркиваниÑ." + "schema.fontStyle": "Ðачертание шрифта Ð´Ð»Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»Ð°: один либо Ñочетание курÑива, полужирного и подчеркиваниÑ.", + "schema.tokenColors.path": "Путь к файлу tmTheme (по отношению к текущему файлу)" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/rus/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json index 34c882751ea..ac6d9076357 100644 --- a/i18n/rus/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json +++ b/i18n/rus/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -4,5 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.cannotparsejson": "Возникли проблемы при анализе файла JSON THEME: {0}." + "error.cannotparsejson": "Возникли проблемы при анализе файла JSON THEME: {0}.", + "error.invalidformat.colors": "Ошибка при анализе файла цветовой темы: {0}. СвойÑтво 'colors' не имеет тип 'object'.", + "error.invalidformat.tokenColors": "Ошибка при анализе файла цветовой темы: {0}. СвойÑтво 'tokenColors' должно Ñодержать маÑÑив цветов или путь к текÑтовому файлу цветовой темы", + "error.plist.invalidformat": "Ошибка при анализе файла tmTheme: {0}. 'settings' не ÑвлÑетÑÑ Ð¼Ð°ÑÑивом.", + "error.cannotparse": "Ошибка при анализе файла tmTheme: {0}", + "error.cannotload": "Ошибка при загрузке файла tmTheme {0}: {1}" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/rus/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 2701a620e30..f7243407022 100644 --- a/i18n/rus/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/rus/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -25,5 +25,8 @@ "colorThemeError": "Theme is unknown or not installed.", "iconTheme": "Specifies the icon theme used in the workbench.", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed." + "iconThemeError": "File icon theme is unknown or not installed.", + "workbenchColors": "ПереопределÑет цвета из выбранной цветовой темы.", + "workbenchColors.deprecated": "Параметр больше не ÑвлÑетÑÑ ÑкÑпериментальным и был переименован в 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "ИÑпользуйте параметр 'workbench.colorCustomizations'" } \ No newline at end of file diff --git a/issue_template.md b/issue_template.md index 81a8470fc44..ad023f7b7c8 100644 --- a/issue_template.md +++ b/issue_template.md @@ -6,4 +6,4 @@ Steps to Reproduce: 1. -2. +1. diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index cc732031011..00000000000 --- a/jsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=759670 - // for the documentation about the jsconfig.json format - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "allowSyntheticDefaultImports": true - }, - "exclude": [ - "src", - "extensions", - "test", - "i18n", - "out", - "out-build", - "out-vscode", - "out-vscode-min", - "out-editor", - "out-editor-min", - "out-monaco-editor-core", - "resources", - "scripts", - ".build", - "node_modules", - "build/monaco/node_modules" - ] -} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index cc268be6f54..d7f219b1638 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -293,9 +293,9 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz" }, "native-keymap": { - "version": "1.2.3", - "from": "native-keymap@1.2.3", - "resolved": "https://registry.npmjs.org/native-keymap/-/native-keymap-1.2.3.tgz" + "version": "1.2.4", + "from": "native-keymap@1.2.4", + "resolved": "https://registry.npmjs.org/native-keymap/-/native-keymap-1.2.4.tgz" }, "normalize-path": { "version": "2.0.1", @@ -338,9 +338,9 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, "node-pty": { - "version": "0.6.4", - "from": "node-pty@0.6.4", - "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.6.4.tgz", + "version": "0.6.6", + "from": "node-pty@0.6.6", + "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.6.6.tgz", "dependencies": { "nan": { "version": "2.5.0", @@ -420,9 +420,9 @@ "resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-0.0.12.tgz" }, "vscode-textmate": { - "version": "3.1.4", - "from": "vscode-textmate@3.1.4", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-3.1.4.tgz" + "version": "3.1.5", + "from": "vscode-textmate@3.1.5", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-3.1.5.tgz" }, "windows-foreground-love": { "version": "0.1.0", @@ -440,9 +440,9 @@ "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.0.tgz" }, "xterm": { - "version": "2.5.0", - "from": "Tyriar/xterm.js#vscode-release/1.12", - "resolved": "git+https://github.com/Tyriar/xterm.js.git#dd94777309f3ce63952a7604b9c40e77370db3ca" + "version": "2.6.0", + "from": "Tyriar/xterm.js#vscode-release/1.13", + "resolved": "git+https://github.com/Tyriar/xterm.js.git#32c9eac8ee5a958093d126a06c1c06a7cd6052bf" }, "yauzl": { "version": "2.3.1", diff --git a/package.json b/package.json index 1aa328903d3..bfc4fed8575 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "code-oss-dev", "version": "1.13.0", "electronVersion": "1.6.6", - "distro": "c1989b3e8a8516b92a46c359eba624fb9f812201", + "distro": "20d9b7ca9af07894c19dbabde24c7c954510fb5b", "author": { "name": "Microsoft Corporation" }, @@ -16,7 +16,10 @@ "watch": "gulp watch --max_old_space_size=4096", "monaco-editor-setup": "node scripts/monaco-editor-setup.js", "monaco-editor-test": "mocha --only-monaco-editor", - "precommit": "node build/gulpfile.hygiene.js" + "precommit": "node build/gulpfile.hygiene.js", + "gulp": "gulp --max_old_space_size=4096", + "7z": "7z", + "update-grammars": "node build/npm/update-all-grammars.js" }, "dependencies": { "applicationinsights": "0.17.1", @@ -31,18 +34,19 @@ "iconv-lite": "0.4.15", "jschardet": "^1.4.2", "minimist": "1.2.0", - "native-keymap": "1.2.3", - "node-pty": "0.6.4", + "native-keymap": "1.2.4", + "node-pty": "0.6.6", "semver": "4.3.6", "v8-profiler": "jrieken/v8-profiler#vscode", "vscode-debugprotocol": "1.19.0", "vscode-ripgrep": "0.0.12", - "vscode-textmate": "^3.1.4", + "vscode-textmate": "^3.1.5", "winreg": "1.2.0", - "xterm": "Tyriar/xterm.js#vscode-release/1.12", + "xterm": "Tyriar/xterm.js#vscode-release/1.13", "yauzl": "2.3.1" }, "devDependencies": { + "7zip": "0.0.6", "@types/minimist": "^1.2.0", "@types/mocha": "^2.2.39", "@types/semver": "^5.3.30", @@ -60,7 +64,7 @@ "flatpak-bundler": "^0.1.1", "glob": "^5.0.13", "gulp": "^3.8.9", - "gulp-atom-electron": "^1.9.0", + "gulp-atom-electron": "^1.11.0", "gulp-azure-storage": "^0.7.0", "gulp-bom": "^1.0.0", "gulp-buffer": "0.0.2", @@ -100,7 +104,7 @@ "sinon": "^1.17.2", "source-map": "^0.4.4", "tslint": "^4.3.1", - "typescript": "2.2.2", + "typescript": "2.3.3", "typescript-formatter": "4.0.1", "uglify-js": "2.4.8", "underscore": "^1.8.2", @@ -120,4 +124,4 @@ "windows-mutex": "^0.2.0", "fsevents": "0.3.8" } -} \ No newline at end of file +} diff --git a/scripts/env.ps1 b/scripts/env.ps1 new file mode 100644 index 00000000000..3d34630f391 --- /dev/null +++ b/scripts/env.ps1 @@ -0,0 +1,5 @@ +$env:npm_config_disturl="https://atom.io/download/electron" +$env:npm_config_target=(node -p "require('./package.json').electronVersion") +$env:npm_config_runtime="electron" +$env:npm_config_cache="$HOME/.npm-electron" +New-Item -Path "$env:npm_config_cache" -Type directory -Force | out-null \ No newline at end of file diff --git a/scripts/env.sh b/scripts/env.sh new file mode 100755 index 00000000000..35d09f66bb2 --- /dev/null +++ b/scripts/env.sh @@ -0,0 +1,6 @@ +#!/bin/bash +export npm_config_disturl=https://atom.io/download/electron +export npm_config_target=$(node -p "require('./package.json').electronVersion") +export npm_config_runtime=electron +export npm_config_cache="$HOME/.npm-electron" +mkdir -p "$npm_config_cache" \ No newline at end of file diff --git a/scripts/npm.bat b/scripts/npm.bat index 943404a1078..3fc75df7b0e 100644 --- a/scripts/npm.bat +++ b/scripts/npm.bat @@ -1,12 +1,8 @@ @echo off setlocal - -set npm_config_disturl="https://atom.io/download/atom-shell" +set npm_config_disturl="https://atom.io/download/electron" for /f "tokens=2 delims=:, " %%a in ('findstr /R /C:"\"electronVersion\":.*" "%~dp0..\package.json"') do set npm_config_target=%%~a -set npm_config_arch="ia32" set npm_config_runtime="electron" -set HOME=~\.electron-gyp - +set npm_config_cache=~\.npm-electron npm %* - endlocal diff --git a/scripts/npm.sh b/scripts/npm.sh index b56ec27c7fd..69c6d0c48ae 100755 --- a/scripts/npm.sh +++ b/scripts/npm.sh @@ -22,7 +22,7 @@ ELECTRON_VERSION=$( ELECTRON_GYP_HOME=~/.electron-gyp mkdir -p $ELECTRON_GYP_HOME -npm_config_disturl=https://atom.io/download/atom-shell \ +npm_config_disturl=https://atom.io/download/electron \ npm_config_target=$ELECTRON_VERSION \ npm_config_runtime=electron \ HOME=$ELECTRON_GYP_HOME \ diff --git a/scripts/test.bat b/scripts/test.bat index 0f7ce8e9a85..6ac41fcc36e 100644 --- a/scripts/test.bat +++ b/scripts/test.bat @@ -5,12 +5,22 @@ set ELECTRON_RUN_AS_NODE= pushd %~dp0\.. +:: Get Code.exe location for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a set NAMESHORT=%NAMESHORT: "=% set NAMESHORT=%NAMESHORT:"=%.exe set CODE=".build\electron\%NAMESHORT%" -rem Run tests in electron +:: Download Electron if needed +for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a +set DESIREDVERSION=%DESIREDVERSION: "=% +set DESIREDVERSION=v%DESIREDVERSION:"=% +if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="") + +if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron +if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron + +:: Run tests %CODE% .\test\electron\index.js %* popd diff --git a/scripts/test.sh b/scripts/test.sh index ebe39774193..d39b1e76f18 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -26,17 +26,10 @@ test -d node_modules || ./scripts/npm.sh install # Get electron (test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron -# Build -test -d out || ./node_modules/.bin/gulp compile -echo "code $CODE" - # Unit Tests -export VSCODE_DEV=1 - if [[ "$1" == "--xvfb" ]]; then cd $ROOT ; \ - xvfb-run "$CODE" test/electron/index.js "$@" - + xvfb-run -a "$CODE" test/electron/index.js "$@" elif [[ "$OSTYPE" == "darwin"* ]]; then cd $ROOT ; ulimit -n 4096 ; \ "$CODE" \ diff --git a/src/.eslintrc b/src/.eslintrc index d84b7b2534d..fc504686e19 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -1,7 +1,10 @@ { + "parserOptions": { + "ecmaVersion": 3 + }, "env": { "node": true, - "es6": false + "es6": true }, "rules": { "no-console": 0, @@ -11,4 +14,4 @@ "semi": "warn" }, "extends": "eslint:recommended" -} \ No newline at end of file +} diff --git a/src/bootstrap.js b/src/bootstrap.js index 022aa50b6a3..3f94abadd31 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -126,4 +126,16 @@ if (process.env['VSCODE_PARENT_PID']) { } } +const crashReporterOptionsRaw = process.env['CRASH_REPORTER_START_OPTIONS']; +if (typeof crashReporterOptionsRaw === 'string') { + try { + const crashReporterOptions = JSON.parse(crashReporterOptionsRaw); + if (crashReporterOptions) { + process.crashReporter.start(crashReporterOptions); + } + } catch (error) { + console.error(error); + } +} + require('./bootstrap-amd').bootstrap(process.env['AMD_ENTRYPOINT']); \ No newline at end of file diff --git a/src/main.js b/src/main.js index 60070c76804..9576d766aaf 100644 --- a/src/main.js +++ b/src/main.js @@ -16,7 +16,12 @@ if (process.argv.indexOf('--prof-startup') >= 0) { // in certain locales (e.g. PL), image metrics are wrongly computed. We explicitly set the // LC_NUMERIC to prevent this from happening (selects the numeric formatting category of the // C locale, http://en.cppreference.com/w/cpp/locale/LC_categories). TODO@Ben temporary. -process.env.LC_NUMERIC = 'C'; +if (process.env.LC_ALL) { + process.env.LC_ALL = 'C'; +} +if (process.env.LC_NUMERIC) { + process.env.LC_NUMERIC = 'C'; +} // Perf measurements global.perfStartTime = Date.now(); @@ -222,13 +227,12 @@ var nodeCachedDataDir = getNodeCachedDataDir().then(function (value) { } }); -// Load our code once ready -app.once('ready', function () { - global.perfAppReady = Date.now(); - var nlsConfig = getNLSConfiguration(); - process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); +var nlsConfig = getNLSConfiguration(); +process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); - nodeCachedDataDir.then(function () { - require('./bootstrap-amd').bootstrap('vs/code/electron-main/main'); - }, console.error); +var bootstrap = require('./bootstrap-amd'); +nodeCachedDataDir.then(function () { + bootstrap.bootstrap('vs/code/electron-main/main'); +}, function (err) { + console.error(err); }); diff --git a/src/typings/chokidar.d.ts b/src/typings/chokidar.d.ts index 719eae1ea06..019a9e80e6c 100644 --- a/src/typings/chokidar.d.ts +++ b/src/typings/chokidar.d.ts @@ -57,6 +57,11 @@ declare module 'chokidar' { * (default: true). When false, only the symlinks themselves will be watched for changes instead of following the link references and bubbling events through the link's path. */ followSymlinks?: boolean; + + /** + * (default: false). If set to true then the strings passed to .watch() and .add() are treated as literal path names, even if they look like globs. + */ + disableGlobbing?: boolean; } export interface FSWatcher { diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index e85bb7d346f..05aab3a8161 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -2066,6 +2066,13 @@ declare namespace Electron { * Only string properties are sent correctly, nested objects are not supported. */ extra?: { [prop: string]: string }; + + /** + * Path to a folder where the crashes will be temporarily stored by the electron crash reporter + * Applies only to child processes that need crash reporting. + * Electron figures out the crashesDirectory on its own for Main and Renderer process + */ + crashesDirectory?: string; } interface CrashReport { @@ -4466,7 +4473,7 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Executes the editing command undo in web page. */ @@ -5161,7 +5168,7 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Sets a provider for spell checking in input fields and text areas. */ diff --git a/src/typings/native-keymap.d.ts b/src/typings/native-keymap.d.ts index 65acdb584fa..092191dd759 100644 --- a/src/typings/native-keymap.d.ts +++ b/src/typings/native-keymap.d.ts @@ -65,7 +65,7 @@ declare module 'native-keymap' { export function getCurrentKeyboardLayout(): IKeyboardLayoutInfo; - export function onDidChangeKeyboardLayout(callback: () => void); + export function onDidChangeKeyboardLayout(callback: () => void): void; export function isISOKeyboard(): boolean; } \ No newline at end of file diff --git a/src/typings/node-pty.d.ts b/src/typings/node-pty.d.ts index ef417f1156e..e09b1eb47e5 100644 --- a/src/typings/node-pty.d.ts +++ b/src/typings/node-pty.d.ts @@ -9,9 +9,11 @@ declare module 'node-pty' { export function createTerminal(file: string, args: string[], options: any): Terminal; export interface Terminal { + pid: number; + /** * The title of the active process. - */ + */ process: string; on(event: string, callback: (data: any) => void): void; @@ -19,5 +21,7 @@ declare module 'node-pty' { resize(columns: number, rows: number): void; write(data: string): void; + + kill(): void; } } \ No newline at end of file diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts index 558dcf75839..447f4fe3b2c 100644 --- a/src/vs/base/browser/browser.ts +++ b/src/vs/base/browser/browser.ts @@ -12,51 +12,43 @@ class WindowManager { public static INSTANCE = new WindowManager(); - private _fullscreen: boolean; - + // --- Zoom Level private _zoomLevel: number = 0; - private _zoomFactor: number = 0; - - private _pixelRatioCache: number = 0; - private _pixelRatioComputed: boolean = false; - + private _lastZoomLevelChangeTime: number = 0; private _onDidChangeZoomLevel: Emitter = new Emitter(); + public onDidChangeZoomLevel: Event = this._onDidChangeZoomLevel.event; - - private _onDidChangeFullscreen: Emitter = new Emitter(); - public onDidChangeFullscreen: Event = this._onDidChangeFullscreen.event; - public getZoomLevel(): number { return this._zoomLevel; } - - public setZoomLevel(zoomLevel: number): void { + public getTimeSinceLastZoomLevelChanged(): number { + return Date.now() - this._lastZoomLevelChangeTime; + } + public setZoomLevel(zoomLevel: number, isTrusted: boolean): void { if (this._zoomLevel === zoomLevel) { return; } this._zoomLevel = zoomLevel; - this._pixelRatioComputed = false; + // See https://github.com/Microsoft/vscode/issues/26151 + this._lastZoomLevelChangeTime = isTrusted ? 0 : Date.now(); this._onDidChangeZoomLevel.fire(this._zoomLevel); } + + // --- Zoom Factor + private _zoomFactor: number = 0; + public getZoomFactor(): number { return this._zoomFactor; } - public setZoomFactor(zoomFactor: number): void { this._zoomFactor = zoomFactor; } - public getPixelRatio(): number { - if (!this._pixelRatioComputed) { - this._pixelRatioCache = this._computePixelRatio(); - this._pixelRatioComputed = true; - } - return this._pixelRatioCache; - } - private _computePixelRatio(): number { + // --- Pixel Ratio + public getPixelRatio(): number { let ctx = document.createElement('canvas').getContext('2d'); let dpr = window.devicePixelRatio || 1; let bsr = (ctx).webkitBackingStorePixelRatio || @@ -67,6 +59,11 @@ class WindowManager { return dpr / bsr; } + // --- Fullscreen + private _fullscreen: boolean; + private _onDidChangeFullscreen: Emitter = new Emitter(); + + public onDidChangeFullscreen: Event = this._onDidChangeFullscreen.event; public setFullscreen(fullscreen: boolean): void { if (this._fullscreen === fullscreen) { return; @@ -75,32 +72,57 @@ class WindowManager { this._fullscreen = fullscreen; this._onDidChangeFullscreen.fire(); } - public isFullscreen(): boolean { return this._fullscreen; } + + // --- Accessibility + private _accessibilitySupport = Platform.AccessibilitySupport.Unknown; + private _onDidChangeAccessibilitySupport: Emitter = new Emitter(); + + public onDidChangeAccessibilitySupport: Event = this._onDidChangeAccessibilitySupport.event; + public setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void { + if (this._accessibilitySupport === accessibilitySupport) { + return; + } + + this._accessibilitySupport = accessibilitySupport; + this._onDidChangeAccessibilitySupport.fire(); + } + public getAccessibilitySupport(): Platform.AccessibilitySupport { + return this._accessibilitySupport; + } + + } /** A zoom index, e.g. 1, 2, 3 */ +export function setZoomLevel(zoomLevel: number, isTrusted: boolean): void { + WindowManager.INSTANCE.setZoomLevel(zoomLevel, isTrusted); +} export function getZoomLevel(): number { return WindowManager.INSTANCE.getZoomLevel(); } -/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */ -export function getZoomFactor(): number { - return WindowManager.INSTANCE.getZoomFactor(); -} -export function getPixelRatio(): number { - return WindowManager.INSTANCE.getPixelRatio(); -} -export function setZoomLevel(zoomLevel: number): void { - WindowManager.INSTANCE.setZoomLevel(zoomLevel); -} -export function setZoomFactor(zoomFactor: number): void { - WindowManager.INSTANCE.setZoomFactor(zoomFactor); +/** Returns the time (in ms) since the zoom level was changed */ +export function getTimeSinceLastZoomLevelChanged(): number { + return WindowManager.INSTANCE.getTimeSinceLastZoomLevelChanged(); } export function onDidChangeZoomLevel(callback: (zoomLevel: number) => void): IDisposable { return WindowManager.INSTANCE.onDidChangeZoomLevel(callback); } + +/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */ +export function getZoomFactor(): number { + return WindowManager.INSTANCE.getZoomFactor(); +} +export function setZoomFactor(zoomFactor: number): void { + WindowManager.INSTANCE.setZoomFactor(zoomFactor); +} + +export function getPixelRatio(): number { + return WindowManager.INSTANCE.getPixelRatio(); +} + export function setFullscreen(fullscreen: boolean): void { WindowManager.INSTANCE.setFullscreen(fullscreen); } @@ -111,6 +133,16 @@ export function onDidChangeFullscreen(callback: () => void): IDisposable { return WindowManager.INSTANCE.onDidChangeFullscreen(callback); } +export function setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void { + WindowManager.INSTANCE.setAccessibilitySupport(accessibilitySupport); +} +export function getAccessibilitySupport(): Platform.AccessibilitySupport { + return WindowManager.INSTANCE.getAccessibilitySupport(); +} +export function onDidChangeAccessibilitySupport(callback: () => void): IDisposable { + return WindowManager.INSTANCE.onDidChangeAccessibilitySupport(callback); +} + const userAgent = navigator.userAgent; export const isIE = (userAgent.indexOf('Trident') >= 0); @@ -124,10 +156,10 @@ export const isChrome = (userAgent.indexOf('Chrome') >= 0); export const isSafari = (userAgent.indexOf('Chrome') === -1) && (userAgent.indexOf('Safari') >= 0); export const isIPad = (userAgent.indexOf('iPad') >= 0); -const isChromev56 = ( - navigator.userAgent.indexOf('Chrome/56.') >= 0 +export const isChromev56 = ( + userAgent.indexOf('Chrome/56.') >= 0 // Edge likes to impersonate Chrome sometimes - && navigator.userAgent.indexOf('Edge/') === -1 + && userAgent.indexOf('Edge/') === -1 ); export const supportsTranslate3d = !isFirefox; @@ -153,8 +185,6 @@ export function canUseTranslate3d(): boolean { return true; } -export const enableEmptySelectionClipboard = isWebKit; - export function supportsExecCommand(command: string): boolean { return ( (isIE || Platform.isNative) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index efe82b59b3c..228550b57af 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -56,125 +56,139 @@ export function isInDOM(node: Node): boolean { return false; } -let lastStart: number, lastEnd: number; +const _manualClassList = new class { -function _findClassName(node: HTMLElement, className: string): void { + private _lastStart: number; + private _lastEnd: number; - let classes = node.className; - if (!classes) { - lastStart = -1; - return; - } + private _findClassName(node: HTMLElement, className: string): void { - className = className.trim(); - - let classesLen = classes.length, - classLen = className.length; - - if (classLen === 0) { - lastStart = -1; - return; - } - - if (classesLen < classLen) { - lastStart = -1; - return; - } - - if (classes === className) { - lastStart = 0; - lastEnd = classesLen; - return; - } - - let idx = -1, - idxEnd: number; - - while ((idx = classes.indexOf(className, idx + 1)) >= 0) { - - idxEnd = idx + classLen; - - // a class that is followed by another class - if ((idx === 0 || classes.charCodeAt(idx - 1) === CharCode.Space) && classes.charCodeAt(idxEnd) === CharCode.Space) { - lastStart = idx; - lastEnd = idxEnd + 1; + let classes = node.className; + if (!classes) { + this._lastStart = -1; return; } - // last class - if (idx > 0 && classes.charCodeAt(idx - 1) === CharCode.Space && idxEnd === classesLen) { - lastStart = idx - 1; - lastEnd = idxEnd; + className = className.trim(); + + let classesLen = classes.length, + classLen = className.length; + + if (classLen === 0) { + this._lastStart = -1; return; } - // equal - duplicate of cmp above - if (idx === 0 && idxEnd === classesLen) { - lastStart = 0; - lastEnd = idxEnd; + if (classesLen < classLen) { + this._lastStart = -1; return; } + + if (classes === className) { + this._lastStart = 0; + this._lastEnd = classesLen; + return; + } + + let idx = -1, + idxEnd: number; + + while ((idx = classes.indexOf(className, idx + 1)) >= 0) { + + idxEnd = idx + classLen; + + // a class that is followed by another class + if ((idx === 0 || classes.charCodeAt(idx - 1) === CharCode.Space) && classes.charCodeAt(idxEnd) === CharCode.Space) { + this._lastStart = idx; + this._lastEnd = idxEnd + 1; + return; + } + + // last class + if (idx > 0 && classes.charCodeAt(idx - 1) === CharCode.Space && idxEnd === classesLen) { + this._lastStart = idx - 1; + this._lastEnd = idxEnd; + return; + } + + // equal - duplicate of cmp above + if (idx === 0 && idxEnd === classesLen) { + this._lastStart = 0; + this._lastEnd = idxEnd; + return; + } + } + + this._lastStart = -1; } - lastStart = -1; -} + hasClass(node: HTMLElement, className: string): boolean { + this._findClassName(node, className); + return this._lastStart !== -1; + } -/** - * @param node a dom node - * @param className a class name - * @return true if the className attribute of the provided node contains the provided className - */ -export function hasClass(node: HTMLElement, className: string): boolean { - _findClassName(node, className); - return lastStart !== -1; -} - -/** - * Adds the provided className to the provided node. This is a no-op - * if the class is already set. - * @param node a dom node - * @param className a class name - */ -export function addClass(node: HTMLElement, className: string): void { - if (!node.className) { // doesn't have it for sure - node.className = className; - } else { - _findClassName(node, className); // see if it's already there - if (lastStart === -1) { - node.className = node.className + ' ' + className; + addClass(node: HTMLElement, className: string): void { + if (!node.className) { // doesn't have it for sure + node.className = className; + } else { + this._findClassName(node, className); // see if it's already there + if (this._lastStart === -1) { + node.className = node.className + ' ' + className; + } } } -} -/** - * Removes the className for the provided node. This is a no-op - * if the class isn't present. - * @param node a dom node - * @param className a class name - */ -export function removeClass(node: HTMLElement, className: string): void { - _findClassName(node, className); - if (lastStart === -1) { - return; // Prevent styles invalidation if not necessary - } else { - node.className = node.className.substring(0, lastStart) + node.className.substring(lastEnd); + removeClass(node: HTMLElement, className: string): void { + this._findClassName(node, className); + if (this._lastStart === -1) { + return; // Prevent styles invalidation if not necessary + } else { + node.className = node.className.substring(0, this._lastStart) + node.className.substring(this._lastEnd); + } } -} -/** - * @param node a dom node - * @param className a class name - * @param shouldHaveIt - */ -export function toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void { - _findClassName(node, className); - if (lastStart !== -1 && (shouldHaveIt === void 0 || !shouldHaveIt)) { - removeClass(node, className); + toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void { + this._findClassName(node, className); + if (this._lastStart !== -1 && (shouldHaveIt === void 0 || !shouldHaveIt)) { + this.removeClass(node, className); + } + if (this._lastStart === -1 && (shouldHaveIt === void 0 || shouldHaveIt)) { + this.addClass(node, className); + } } - if (lastStart === -1 && (shouldHaveIt === void 0 || shouldHaveIt)) { - addClass(node, className); +}; + +const _nativeClassList = new class { + hasClass(node: HTMLElement, className: string): boolean { + return className && node.classList && node.classList.contains(className); } -} + + addClass(node: HTMLElement, className: string): void { + if (className && node.classList) { + node.classList.add(className); + } + } + + removeClass(node: HTMLElement, className: string): void { + if (className && node.classList) { + node.classList.remove(className); + } + } + + toggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void { + if (node.classList) { + node.classList.toggle(className, shouldHaveIt); + } + } +}; + +// In IE11 there is only partial support for `classList` which makes us keep our +// custom implementation. Otherwise use the native implementation, see: http://caniuse.com/#search=classlist +const _classList = browser.isIE ? _manualClassList : _nativeClassList; +export const hasClass: (node: HTMLElement, className: string) => boolean = _classList.hasClass.bind(_classList); +export const addClass: (node: HTMLElement, className: string) => void = _classList.addClass.bind(_classList); +export const removeClass: (node: HTMLElement, className: string) => void = _classList.removeClass.bind(_classList); +export const toggleClass: (node: HTMLElement, className: string, shouldHaveIt?: boolean) => void = _classList.toggleClass.bind(_classList); class DomListener implements IDisposable { @@ -696,7 +710,7 @@ export function createCSSRule(selector: string, cssText: string, style: HTMLStyl return; } - (style.sheet).insertRule(selector + '{' + cssText + '}', 0); + (style.sheet).insertRule(selector + '{' + cssText + '}', 0); } export function getCSSRule(selector: string, style: HTMLStyleElement = sharedStyle): any { @@ -725,8 +739,7 @@ export function removeCSSRulesContainingSelector(ruleName: string, style = share let toDelete: number[] = []; for (let i = 0; i < rules.length; i++) { let rule = rules[i]; - let normalizedSelectorText = rule.selectorText.replace(/::/gi, ':'); - if (normalizedSelectorText.indexOf(ruleName) !== -1) { + if (rule.selectorText.indexOf(ruleName) !== -1) { toDelete.push(i); } } @@ -1027,4 +1040,4 @@ export function domContentLoaded(): TPromise { window.addEventListener('DOMContentLoaded', c, false); } }); -} \ No newline at end of file +} diff --git a/src/vs/base/browser/fastDomNode.ts b/src/vs/base/browser/fastDomNode.ts index 661860a4af2..ee1dd6cd58f 100644 --- a/src/vs/base/browser/fastDomNode.ts +++ b/src/vs/base/browser/fastDomNode.ts @@ -20,6 +20,7 @@ export abstract class FastDomNode { private _fontWeight: string; private _fontSize: number; private _lineHeight: number; + private _letterSpacing: number; private _className: string; private _display: string; private _position: string; @@ -39,6 +40,7 @@ export abstract class FastDomNode { this._fontWeight = ''; this._fontSize = -1; this._lineHeight = -1; + this._letterSpacing = -100; this._className = ''; this._display = ''; this._position = ''; @@ -166,6 +168,14 @@ export abstract class FastDomNode { this.domNode.style.lineHeight = this._lineHeight + 'px'; } + public setLetterSpacing(letterSpacing: number): void { + if (this._letterSpacing === letterSpacing) { + return; + } + this._letterSpacing = letterSpacing; + this.domNode.style.letterSpacing = this._letterSpacing + 'px'; + } + public setClassName(className: string): void { if (this._className === className) { return; diff --git a/src/vs/base/browser/keyboardEvent.ts b/src/vs/base/browser/keyboardEvent.ts index ca3450b61b4..6f90f1b1b07 100644 --- a/src/vs/base/browser/keyboardEvent.ts +++ b/src/vs/base/browser/keyboardEvent.ts @@ -120,6 +120,8 @@ let KEY_CODE_MAP: { [keyCode: number]: KeyCode } = {}; KEY_CODE_MAP[190] = KeyCode.US_DOT; KEY_CODE_MAP[191] = KeyCode.US_SLASH; KEY_CODE_MAP[192] = KeyCode.US_BACKTICK; + KEY_CODE_MAP[193] = KeyCode.ABNT_C1; + KEY_CODE_MAP[194] = KeyCode.ABNT_C2; KEY_CODE_MAP[219] = KeyCode.US_OPEN_SQUARE_BRACKET; KEY_CODE_MAP[220] = KeyCode.US_BACKSLASH; KEY_CODE_MAP[221] = KeyCode.US_CLOSE_SQUARE_BRACKET; diff --git a/src/vs/base/browser/ui/button/button.ts b/src/vs/base/browser/ui/button/button.ts index 21db87b36cb..356692bf766 100644 --- a/src/vs/base/browser/ui/button/button.ts +++ b/src/vs/base/browser/ui/button/button.ts @@ -21,6 +21,7 @@ export interface IButtonStyles { buttonBackground?: Color; buttonHoverBackground?: Color; buttonForeground?: Color; + buttonBorder?: Color; } const defaultOptions: IButtonStyles = { @@ -37,6 +38,7 @@ export class Button extends EventEmitter { private buttonBackground: Color; private buttonHoverBackground: Color; private buttonForeground: Color; + private buttonBorder: Color; constructor(container: Builder, options?: IButtonOptions); constructor(container: HTMLElement, options?: IButtonOptions); @@ -49,6 +51,7 @@ export class Button extends EventEmitter { this.buttonBackground = this.options.buttonBackground; this.buttonHoverBackground = this.options.buttonHoverBackground; this.buttonForeground = this.options.buttonForeground; + this.buttonBorder = this.options.buttonBorder; this.$el = $('a.monaco-button').attr({ 'tabIndex': '0', @@ -100,6 +103,7 @@ export class Button extends EventEmitter { this.buttonForeground = styles.buttonForeground; this.buttonBackground = styles.buttonBackground; this.buttonHoverBackground = styles.buttonHoverBackground; + this.buttonBorder = styles.buttonBorder; this.applyStyles(); } @@ -108,9 +112,14 @@ export class Button extends EventEmitter { if (this.$el) { const background = this.buttonBackground ? this.buttonBackground.toString() : null; const foreground = this.buttonForeground ? this.buttonForeground.toString() : null; + const border = this.buttonBorder ? this.buttonBorder.toString() : null; this.$el.style('color', foreground); this.$el.style('background-color', background); + + this.$el.style('border-width', border ? '1px' : null); + this.$el.style('border-style', border ? 'solid' : null); + this.$el.style('border-color', border); } } diff --git a/src/vs/base/browser/ui/countBadge/countBadge.css b/src/vs/base/browser/ui/countBadge/countBadge.css index aef2810df4c..e6f36db1adc 100644 --- a/src/vs/base/browser/ui/countBadge/countBadge.css +++ b/src/vs/base/browser/ui/countBadge/countBadge.css @@ -9,19 +9,5 @@ font-size: 85%; font-weight: normal; text-align: center; - background: #BEBEBE; - color: #FFF; display: inline; -} - -.vs-dark .monaco-count-badge { - color: #FFF; - background: #4D4D4D; -} - -/* High Contrast Theming */ -.hc-black .monaco-count-badge { - background: #000; - border: 1px solid #6FC3DF; - margin-top: 2px; } \ No newline at end of file diff --git a/src/vs/base/browser/ui/countBadge/countBadge.ts b/src/vs/base/browser/ui/countBadge/countBadge.ts index 36031fb9a1e..8ff58693925 100644 --- a/src/vs/base/browser/ui/countBadge/countBadge.ts +++ b/src/vs/base/browser/ui/countBadge/countBadge.ts @@ -8,6 +8,24 @@ import 'vs/css!./countBadge'; import { $, append } from 'vs/base/browser/dom'; import { format } from 'vs/base/common/strings'; +import { Color } from 'vs/base/common/color'; +import { mixin } from 'vs/base/common/objects'; + +export interface ICountBadgeOptions extends ICountBadgetyles { + count?: number; + titleFormat?: string; +} + +export interface ICountBadgetyles { + badgeBackground?: Color; + badgeForeground?: Color; + badgeBorder?: Color; +} + +const defaultOpts = { + badgeBackground: Color.fromHex('#4D4D4D'), + badgeForeground: Color.fromHex('#FFFFFF') +}; export class CountBadge { @@ -15,10 +33,23 @@ export class CountBadge { private count: number; private titleFormat: string; - constructor(container: HTMLElement, count?: number, titleFormat?: string) { + private badgeBackground: Color; + private badgeForeground: Color; + private badgeBorder: Color; + + private options: ICountBadgeOptions; + + constructor(container: HTMLElement, options?: ICountBadgeOptions) { + this.options = options || Object.create(null); + mixin(this.options, defaultOpts, false); + + this.badgeBackground = this.options.badgeBackground; + this.badgeForeground = this.options.badgeForeground; + this.badgeBorder = this.options.badgeBorder; + this.element = append(container, $('.monaco-count-badge')); - this.titleFormat = titleFormat || ''; - this.setCount(count || 0); + this.titleFormat = this.options.titleFormat || ''; + this.setCount(this.options.count || 0); } setCount(count: number) { @@ -34,5 +65,30 @@ export class CountBadge { private render() { this.element.textContent = '' + this.count; this.element.title = format(this.titleFormat, this.count); + + this.applyStyles(); + } + + style(styles: ICountBadgetyles): void { + this.badgeBackground = styles.badgeBackground; + this.badgeForeground = styles.badgeForeground; + this.badgeBorder = styles.badgeBorder; + + this.applyStyles(); + } + + private applyStyles(): void { + if (this.element) { + const background = this.badgeBackground ? this.badgeBackground.toString() : null; + const foreground = this.badgeForeground ? this.badgeForeground.toString() : null; + const border = this.badgeBorder ? this.badgeBorder.toString() : null; + + this.element.style.backgroundColor = background; + this.element.style.color = foreground; + + this.element.style.borderWidth = border ? '1px' : null; + this.element.style.borderStyle = border ? 'solid' : null; + this.element.style.borderColor = border; + } } } diff --git a/src/vs/base/browser/ui/dropdown/dropdown.css b/src/vs/base/browser/ui/dropdown/dropdown.css index dde80747c97..f48750fa83b 100644 --- a/src/vs/base/browser/ui/dropdown/dropdown.css +++ b/src/vs/base/browser/ui/dropdown/dropdown.css @@ -31,25 +31,6 @@ display: inline-block; } -.dropdown > .dropdown-label:not(:empty):not(.tick) { +.dropdown > .dropdown-label:not(:empty) { padding: 0 .5em; -} - -.dropdown > .dropdown-label:empty.tick { - padding: 0 1em 0 0; -} - -.dropdown > .dropdown-label.tick { - padding: 0 1em 0 .5em; -} - -.dropdown > .dropdown-label.tick:after { - content: ''; - width: 0; - height: 0; - position: relative; - top: 1em; - left: .5em; - border: 4px solid transparent; - border-top: 4px solid #fff; } \ No newline at end of file diff --git a/src/vs/base/browser/ui/dropdown/dropdown.ts b/src/vs/base/browser/ui/dropdown/dropdown.ts index f0b5d2ad32d..f670bf899e4 100644 --- a/src/vs/base/browser/ui/dropdown/dropdown.ts +++ b/src/vs/base/browser/ui/dropdown/dropdown.ts @@ -10,7 +10,7 @@ import { Builder, $ } from 'vs/base/browser/builder'; import { TPromise } from 'vs/base/common/winjs.base'; import { Gesture, EventType } from 'vs/base/browser/touch'; import { ActionRunner, IAction } from 'vs/base/common/actions'; -import { ActionItem, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; +import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; @@ -22,17 +22,14 @@ export interface ILabelRenderer { } export interface IBaseDropdownOptions { - tick?: boolean; label?: string; labelRenderer?: ILabelRenderer; - action?: IAction; } export class BaseDropdown extends ActionRunner { private _toDispose: IDisposable[]; private $el: Builder; private $boxContainer: Builder; - private $action: Builder; private $label: Builder; private $contents: Builder; @@ -45,29 +42,7 @@ export class BaseDropdown extends ActionRunner { this.$label = $('.dropdown-label'); - if (options.tick || options.action) { - this.$label.addClass('tick'); - } - let labelRenderer = options.labelRenderer; - - if (!labelRenderer && options.action) { - this.$action = $('.dropdown-action').appendTo(this.$el); - - let item = new ActionItem(null, options.action, { - icon: true, - label: true - }); - - item.actionRunner = this; - item.render(this.$action.getHTMLElement()); - - labelRenderer = (container: HTMLElement): IDisposable => { - container.innerText = ''; - return item; - }; - } - if (!labelRenderer) { labelRenderer = (container: HTMLElement): IDisposable => { $(container).text(options.label || ''); diff --git a/src/vs/base/browser/ui/findinput/findInput.css b/src/vs/base/browser/ui/findinput/findInput.css index 413c2dcafb3..b785b4fa4cc 100644 --- a/src/vs/base/browser/ui/findinput/findInput.css +++ b/src/vs/base/browser/ui/findinput/findInput.css @@ -28,28 +28,6 @@ right: 2px; } -.monaco-findInput > .controls > .matchCount { - margin-left: 2px; - float: left; - overflow: hidden; - max-width: 30px; - min-width: 20px; - text-align: center; - - border-radius: 5px; - padding: 0 4px; - - -webkit-box-sizing: border-box; - -o-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} - -.vs .monaco-findInput > .controls > .matchCount { - background: #ddd; -} - .vs .monaco-findInput.disabled { background-color: #E1E1E1; } @@ -59,10 +37,6 @@ background-color: #333; } -.vs-dark .monaco-findInput > .controls > .matchCount { - background: #555; -} - /* Highlighting */ .monaco-findInput.highlight-0 .controls { animation: monaco-findInput-highlight-0 100ms linear 0s; diff --git a/src/vs/base/browser/ui/findinput/findInput.ts b/src/vs/base/browser/ui/findinput/findInput.ts index 2d38be64dc9..2d447646974 100644 --- a/src/vs/base/browser/ui/findinput/findInput.ts +++ b/src/vs/base/browser/ui/findinput/findInput.ts @@ -13,6 +13,7 @@ import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview import { Widget } from 'vs/base/browser/ui/widget'; import Event, { Emitter } from 'vs/base/common/event'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { IMouseEvent } from 'vs/base/browser/mouseEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; import { CaseSensitiveCheckbox, WholeWordsCheckbox, RegexCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes'; import { Color } from 'vs/base/common/color'; @@ -69,6 +70,9 @@ export class FindInput extends Widget { private _onKeyDown = this._register(new Emitter()); public onKeyDown: Event = this._onKeyDown.event; + private _onMouseDown = this._register(new Emitter()); + public onMouseDown: Event = this._onMouseDown.event; + private _onInput = this._register(new Emitter()); public onInput: Event = this._onInput.event; @@ -113,6 +117,7 @@ export class FindInput extends Widget { this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)); this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)); this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()); + this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)); } public enable(): void { diff --git a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css index 6c7d094804a..bb681b3a863 100644 --- a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +++ b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css @@ -9,11 +9,11 @@ .monaco-kbkey { display: inline-block; - border: solid 1px #ccc; - border-bottom-color: #bbb; + border: solid 1px rgba(204, 204, 204, 0.4); + border-bottom-color: rgba(187, 187, 187, 0.4); border-radius: 3px; - box-shadow: inset 0 -1px 0 #bbb; - background-color: #ddd; + box-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4); + background-color: rgba(221, 221, 221, 0.4); vertical-align: middle; color: #555; line-height: 10px; @@ -25,7 +25,7 @@ .vs-dark .monaco-kbkey { background-color: rgba(128, 128, 128, 0.17); color: #ccc; - border: solid 1px #333; - border-bottom-color: #444; - box-shadow: inset 0 -1px 0 #444; + border: solid 1px rgba(51, 51, 51, 0.6); + border-bottom-color: rgba(68, 68, 68, 0.6); + box-shadow: inset 0 -1px 0 rgba(68, 68, 68, 0.6); } \ No newline at end of file diff --git a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts index e2a7ae59e08..cee68a0de3a 100644 --- a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts +++ b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts @@ -8,7 +8,7 @@ import 'vs/css!./keybindingLabel'; import { IDisposable } from 'vs/base/common/lifecycle'; import { equals } from 'vs/base/common/objects'; import { OperatingSystem } from 'vs/base/common/platform'; -import { ResolvedKeybinding } from 'vs/base/common/keycodes'; +import { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { UILabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; import * as dom from 'vs/base/browser/dom'; @@ -72,21 +72,21 @@ export class KeybindingLabel implements IDisposable { this.didEverRender = true; } - private renderPart(parent: HTMLElement, part: ResolvedKeybinding, match: PartMatches) { + private renderPart(parent: HTMLElement, part: ResolvedKeybindingPart, match: PartMatches) { const modifierLabels = UILabelProvider.modifierLabels[this.os]; - if (part.hasCtrlModifier()) { + if (part.ctrlKey) { this.renderKey(parent, modifierLabels.ctrlKey, match && match.ctrlKey, modifierLabels.separator); } - if (part.hasShiftModifier()) { + if (part.shiftKey) { this.renderKey(parent, modifierLabels.shiftKey, match && match.shiftKey, modifierLabels.separator); } - if (part.hasAltModifier()) { + if (part.altKey) { this.renderKey(parent, modifierLabels.altKey, match && match.altKey, modifierLabels.separator); } - if (part.hasMetaModifier()) { + if (part.metaKey) { this.renderKey(parent, modifierLabels.metaKey, match && match.metaKey, modifierLabels.separator); } - const keyLabel = part.getLabelWithoutModifiers(); + const keyLabel = part.keyLabel; if (keyLabel) { this.renderKey(parent, keyLabel, match && match.keyCode, ''); } diff --git a/src/vs/base/browser/ui/list/listPaging.ts b/src/vs/base/browser/ui/list/listPaging.ts index 70170ab730b..c11ff0e6f8d 100644 --- a/src/vs/base/browser/ui/list/listPaging.ts +++ b/src/vs/base/browser/ui/list/listPaging.ts @@ -85,6 +85,10 @@ export class PagedList { return mapEvent(this.list.onSelectionChange, ({ elements, indexes }) => ({ elements: elements.map(e => this._model.get(e)), indexes })); } + get onPin(): Event> { + return mapEvent(this.list.onPin, ({ elements, indexes }) => ({ elements: elements.map(e => this._model.get(e)), indexes })); + } + get model(): IPagedModel { return this._model; } diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 5750f6df6e0..1ed888d7f2a 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -321,6 +321,7 @@ class MouseController implements IDisposable { this.disposables = []; this.disposables.push(view.addListener('mousedown', e => this.onMouseDown(e))); this.disposables.push(view.addListener('click', e => this.onPointer(e))); + this.disposables.push(view.addListener('dblclick', e => this.onDoubleClick(e))); this.disposables.push(view.addListener(TouchEventType.Tap, e => this.onPointer(e))); } @@ -362,6 +363,19 @@ class MouseController implements IDisposable { this.list.open(focus); } + private onDoubleClick(e: IListMouseEvent): void { + e.preventDefault(); + e.stopPropagation(); + + if (isSelectionChangeEvent(e)) { + return; + } + + const focus = this.list.getFocus(); + this.list.setSelection(focus); + this.list.pin(focus); + } + private changeSelection(e: IListMouseEvent, reference: number | undefined): void { const focus = e.index; @@ -405,13 +419,16 @@ export interface IListOptions extends IListViewOptions, IMouseControllerOptio export interface IListStyles { listFocusBackground?: Color; + listFocusForeground?: Color; listActiveSelectionBackground?: Color; listActiveSelectionForeground?: Color; listFocusAndSelectionBackground?: Color; listFocusAndSelectionForeground?: Color; listInactiveSelectionBackground?: Color; + listInactiveSelectionForeground?: Color; listInactiveFocusBackground?: Color; listHoverBackground?: Color; + listHoverForeground?: Color; listDropBackground?: Color; listFocusOutline?: Color; listInactiveFocusOutline?: Color; @@ -571,6 +588,11 @@ export class List implements ISpliceable, IDisposable { return mapEvent(this._onOpen.event, indexes => this.toListEvent({ indexes })); } + private _onPin = new Emitter(); + @memoize get onPin(): Event> { + return mapEvent(this._onPin.event, indexes => this.toListEvent({ indexes })); + } + private _onDOMFocus = new Emitter(); get onDOMFocus(): Event { return this._onDOMFocus.event; } @@ -810,13 +832,21 @@ export class List implements ISpliceable, IDisposable { this._onOpen.fire(indexes); } + pin(indexes: number[]): void { + this._onPin.fire(indexes); + } + style(styles: IListStyles): void { - let content: string[] = []; + const content: string[] = []; if (styles.listFocusBackground) { content.push(`.monaco-list.${this.idPrefix}:focus .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`); } + if (styles.listFocusForeground) { + content.push(`.monaco-list.${this.idPrefix}:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`); + } + if (styles.listActiveSelectionBackground) { content.push(`.monaco-list.${this.idPrefix}:focus .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`); content.push(`.monaco-list.${this.idPrefix}:focus .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`); // overwrite :hover style in this case! @@ -844,12 +874,20 @@ export class List implements ISpliceable, IDisposable { content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); // overwrite :hover style in this case! } + if (styles.listInactiveSelectionForeground) { + content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`); + } + if (styles.listHoverBackground) { content.push(`.monaco-list.${this.idPrefix} .monaco-list-row:hover { background-color: ${styles.listHoverBackground}; }`); } + if (styles.listHoverForeground) { + content.push(`.monaco-list.${this.idPrefix} .monaco-list-row:hover { color: ${styles.listHoverForeground}; }`); + } + if (styles.listSelectionOutline) { - content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; }`); + content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); } if (styles.listFocusOutline) { diff --git a/src/vs/base/browser/ui/progressbar/progressbar.css b/src/vs/base/browser/ui/progressbar/progressbar.css index b067d6edefb..cd910840fb8 100644 --- a/src/vs/base/browser/ui/progressbar/progressbar.css +++ b/src/vs/base/browser/ui/progressbar/progressbar.css @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ .progress-container { width: 100%; - height: 5px; + height: 5px; } .progress-container .progress-bit { @@ -13,7 +13,6 @@ position: absolute; left: 0; display: none; - background-color: #0E70C0; } .progress-container.active .progress-bit { @@ -52,14 +51,6 @@ -moz-animation-timing-function: linear; } -.progress-container.infinite.done .progress-bit { - transition: opacity 200ms linear; - -webkit-transition: opacity 200ms linear; - -o-transition: opacity 200ms linear; - -moz-transition: opacity 200ms linear; - -ms-transition: opacity 200ms linear; -} - @keyframes progress { from { left: 0; width: 2%; } 50% { left: 50%; width: 5%; } to { left: 98%; width: 2%; } } @-ms-keyframes progress { from { left: 0; width: 2%; } 50% { left: 50%; width: 5%; } to { left: 98%; width: 2%; } } @-webkit-keyframes progress { from { left: 0; width: 2%; } 50% { left: 50%; width: 5%; } to { left: 98%; width: 2%; } } diff --git a/src/vs/base/browser/ui/progressbar/progressbar.ts b/src/vs/base/browser/ui/progressbar/progressbar.ts index 70fb8421bc6..ea34e06e1cb 100644 --- a/src/vs/base/browser/ui/progressbar/progressbar.ts +++ b/src/vs/base/browser/ui/progressbar/progressbar.ts @@ -11,6 +11,8 @@ import assert = require('vs/base/common/assert'); import { Builder, $ } from 'vs/base/browser/builder'; import DOM = require('vs/base/browser/dom'); import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Color } from 'vs/base/common/color'; +import { mixin } from 'vs/base/common/objects'; const css_done = 'done'; const css_active = 'active'; @@ -19,11 +21,22 @@ const css_discrete = 'discrete'; const css_progress_container = 'progress-container'; const css_progress_bit = 'progress-bit'; +export interface IProgressBarOptions extends IProgressBarStyles { +} + +export interface IProgressBarStyles { + progressBarBackground?: Color; +} + +const defaultOpts = { + progressBarBackground: Color.fromHex('#0E70C0') +}; + /** * A progress bar with support for infinite or discrete progress. */ export class ProgressBar { - + private options: IProgressBarOptions; private toUnbind: IDisposable[]; private workedVal: number; private element: Builder; @@ -31,11 +44,17 @@ export class ProgressBar { private bit: HTMLElement; private totalWork: number; private animationStopToken: ValueCallback; + private progressBarBackground: Color; + + constructor(builder: Builder, options?: IProgressBarOptions) { + this.options = options || Object.create(null); + mixin(this.options, defaultOpts, false); - constructor(builder: Builder) { this.toUnbind = []; this.workedVal = 0; + this.progressBarBackground = this.options.progressBarBackground; + this.create(builder); } @@ -61,6 +80,8 @@ export class ProgressBar { this.bit = builder.getHTMLElement(); }); + + this.applyStyles(); } private off(): void { @@ -189,6 +210,20 @@ export class ProgressBar { return $(this.element); } + public style(styles: IProgressBarStyles): void { + this.progressBarBackground = styles.progressBarBackground; + + this.applyStyles(); + } + + protected applyStyles(): void { + if (this.bit) { + const background = this.progressBarBackground ? this.progressBarBackground.toString() : null; + + this.bit.style.backgroundColor = background; + } + } + public dispose(): void { this.toUnbind = dispose(this.toUnbind); } diff --git a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts index c65314275c0..ea437ffc78b 100644 --- a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts +++ b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts @@ -166,12 +166,9 @@ export class ResourceViewer { .append($('a', { role: 'button', class: 'open-external', - text: nls.localize('resourceOpenExternalButton', "Open image") + text: nls.localize('resourceOpenExternalButton', "Open image using external program?") }).on(DOM.EventType.CLICK, (e) => { openExternal(descriptor.resource); - })) - .append($('span', { - text: nls.localize('resourceOpenExternalText', ' using external program?') })); } } diff --git a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts index 9d6879f176f..243d62b86f5 100644 --- a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts @@ -68,6 +68,8 @@ export abstract class AbstractScrollbar extends Widget { this._mouseMoveMonitor = this._register(new GlobalMouseMoveMonitor()); this._shouldRender = true; this.domNode = createFastDomNode(document.createElement('div')); + this.domNode.setAttribute('role', 'presentation'); + this.domNode.setAttribute('aria-hidden', 'true'); this._visibilityController.setDomNode(this.domNode); this.domNode.setPosition('absolute'); diff --git a/src/vs/base/browser/ui/splitview/splitview.css b/src/vs/base/browser/ui/splitview/splitview.css index 8936d95727e..4a6de69c521 100644 --- a/src/vs/base/browser/ui/splitview/splitview.css +++ b/src/vs/base/browser/ui/splitview/splitview.css @@ -30,6 +30,10 @@ display: flex; } +.monaco-split-view > .split-view-view > .header.hide { + display: none; +} + /* Bold font style does not go well with CJK fonts */ .monaco-split-view:lang(zh-Hans) > .split-view-view > .header, .monaco-split-view:lang(zh-Hant) > .split-view-view > .header, diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 09df1966a15..a328f784bdc 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -107,6 +107,7 @@ export interface IHeaderViewOptions extends IHeaderViewStyles { } export interface IHeaderViewStyles { + headerForeground?: Color; headerBackground?: Color; headerHighContrastBorder?: Color; } @@ -117,34 +118,46 @@ const headerDefaultOpts = { export abstract class HeaderView extends View { - protected headerSize: number; + private _headerSize: number; + private _showHeader: boolean; + protected header: HTMLElement; protected body: HTMLElement; + private headerForeground: Color; private headerBackground: Color; private headerHighContrastBorder; constructor(opts: IHeaderViewOptions) { super(opts); - this.headerSize = types.isUndefined(opts.headerSize) ? 22 : opts.headerSize; + this._headerSize = types.isUndefined(opts.headerSize) ? 22 : opts.headerSize; + this._showHeader = this._headerSize > 0; + this.headerForeground = opts.headerForeground; this.headerBackground = opts.headerBackground || headerDefaultOpts.headerBackground; this.headerHighContrastBorder = opts.headerHighContrastBorder; } style(styles: IHeaderViewStyles): void { + this.headerForeground = styles.headerForeground; this.headerBackground = styles.headerBackground; this.headerHighContrastBorder = styles.headerHighContrastBorder; this.applyStyles(); } + protected get headerSize(): number { + return this._showHeader ? this._headerSize : 0; + } + protected applyStyles(): void { if (this.header) { + const headerForegroundColor = this.headerForeground ? this.headerForeground.toString() : null; const headerBackgroundColor = this.headerBackground ? this.headerBackground.toString() : null; const headerHighContrastBorderColor = this.headerHighContrastBorder ? this.headerHighContrastBorder.toString() : null; + this.header.style.color = headerForegroundColor; this.header.style.backgroundColor = headerBackgroundColor; this.header.style.borderTop = headerHighContrastBorderColor ? `1px solid ${headerHighContrastBorderColor}` : null; } @@ -162,7 +175,7 @@ export abstract class HeaderView extends View { this.header.style.height = headerSize; } - if (this.headerSize > 0) { + if (this._showHeader) { this.renderHeader(this.header); container.appendChild(this.header); } @@ -177,6 +190,28 @@ export abstract class HeaderView extends View { this.applyStyles(); } + showHeader(): boolean { + if (!this._showHeader) { + if (!this.body.parentElement.contains(this.header)) { + this.renderHeader(this.header); + this.body.parentElement.insertBefore(this.header, this.body); + } + dom.removeClass(this.header, 'hide'); + this._showHeader = true; + return true; + } + return false; + } + + hideHeader(): boolean { + if (this._showHeader) { + dom.addClass(this.header, 'hide'); + this._showHeader = false; + return true; + } + return false; + } + layout(size: number, orientation: Orientation): void { this.layoutBodyContainer(orientation); this.layoutBody(size - this.headerSize); @@ -519,6 +554,11 @@ export class SplitView implements throw new Error('Initial weight must be a positive number.'); } + /** + * Reset size to null. This will layout newly added viees to initial weights. + */ + this.size = null; + let viewCount = this.views.length; // Create view container @@ -571,8 +611,10 @@ export class SplitView implements this.onViewChange(deadView, 0); let sashIndex = Math.max(index - 1, 0); - this.sashes[sashIndex].dispose(); - this.sashes.splice(sashIndex, 1); + if (sashIndex < this.sashes.length) { + this.sashes[sashIndex].dispose(); + this.sashes.splice(sashIndex, 1); + } this.viewChangeListeners[index].dispose(); this.viewChangeListeners.splice(index, 1); diff --git a/src/vs/base/browser/ui/toolbar/toolbar.css b/src/vs/base/browser/ui/toolbar/toolbar.css index a6cca1a32a6..4d91d3f5c9e 100644 --- a/src/vs/base/browser/ui/toolbar/toolbar.css +++ b/src/vs/base/browser/ui/toolbar/toolbar.css @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-toolbar .dropdown > .dropdown-label:not(:empty):not(.tick) { +.monaco-toolbar .dropdown > .dropdown-label:not(:empty) { padding: 0; } diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index e23dde3c9ac..ce2d4100429 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -66,6 +66,47 @@ export function findFirst(array: T[], p: (x: T) => boolean): number { return low; } +/** + * Like `Array#sort` but always stable. Comes at a cost: iterates 2n-times, + * creates n-objects in addition to sorting (log(n)) + */ +export function stableSort(data: T[], compare: (a: T, b: T) => number): T[] { + + let data2: { idx: number; e: T }[] = data; + + for (let idx = 0; idx < data2.length; idx++) { + data2[idx] = { idx, e: data[idx] }; + } + + data2.sort((a, b) => { + let ret = compare(a.e, b.e); + if (ret === 0) { + ret = a.idx - b.idx; + } + return ret; + }); + + for (let idx = 0; idx < data2.length; idx++) { + data[idx] = data2[idx].e; + } + + return data; +} + +export function groupBy(data: T[], compare: (a: T, b: T) => number): T[][] { + const result: T[][] = []; + let currentGroup: T[]; + for (const element of data.slice(0).sort(compare)) { + if (!currentGroup || compare(currentGroup[0], element) !== 0) { + currentGroup = [element]; + result.push(currentGroup); + } else { + currentGroup.push(element); + } + } + return result; +} + /** * Takes two *sorted* arrays and computes their delta (removed, added elements). * Finishes in `Math.min(before.length, after.length)` steps. diff --git a/src/vs/base/common/collections.ts b/src/vs/base/common/collections.ts index ddd96a7298a..ca4832b1ccb 100644 --- a/src/vs/base/common/collections.ts +++ b/src/vs/base/common/collections.ts @@ -27,9 +27,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * Returns an array which contains all values that reside * in the given set. */ -export function values(from: IStringDictionary): T[]; -export function values(from: INumberDictionary): T[]; -export function values(from: any): any[] { +export function values(from: IStringDictionary | INumberDictionary): T[] { const result: T[] = []; for (var key in from) { if (hasOwnProperty.call(from, key)) { @@ -53,10 +51,8 @@ export function size(from: IStringDictionary | INumberDictionary): numb * Iterates over each entry in the provided set. The iterator allows * to remove elements and will stop when the callback returns {{false}}. */ -export function forEach(from: IStringDictionary, callback: (entry: { key: string; value: T; }, remove: Function) => any): void; -export function forEach(from: INumberDictionary, callback: (entry: { key: number; value: T; }, remove: Function) => any): void; -export function forEach(from: any, callback: (entry: { key: any; value: T; }, remove: Function) => any): void { - for (var key in from) { +export function forEach(from: IStringDictionary | INumberDictionary, callback: (entry: { key: any; value: T; }, remove: Function) => any): void { + for (let key in from) { if (hasOwnProperty.call(from, key)) { const result = callback({ key: key, value: from[key] }, function () { delete from[key]; @@ -72,9 +68,7 @@ export function forEach(from: any, callback: (entry: { key: any; value: T; }, * Removes an element from the dictionary. Returns {{false}} if the property * does not exists. */ -export function remove(from: IStringDictionary, key: string): boolean; -export function remove(from: INumberDictionary, key: string): boolean; -export function remove(from: any, key: string): boolean { +export function remove(from: IStringDictionary | INumberDictionary, key: string): boolean { if (!hasOwnProperty.call(from, key)) { return false; } diff --git a/src/vs/base/common/color.ts b/src/vs/base/common/color.ts index ad17cab9171..e35bf39d7cb 100644 --- a/src/vs/base/common/color.ts +++ b/src/vs/base/common/color.ts @@ -382,6 +382,10 @@ export class Color { return new Color(new RGBA(p.r, p.g, p.b, Math.round(p.a * factor))); } + public isTransparent(): boolean { + return this.rgba.a === 0; + } + public opposite(): Color { return new Color(new RGBA( 255 - this.rgba.r, diff --git a/src/vs/base/common/filters.ts b/src/vs/base/common/filters.ts index dc376f9150b..d4b186650cc 100644 --- a/src/vs/base/common/filters.ts +++ b/src/vs/base/common/filters.ts @@ -446,6 +446,11 @@ _seps['/'] = true; _seps['\\'] = true; _seps['\''] = true; _seps['"'] = true; +_seps[':'] = true; + +const _ws: { [ch: string]: boolean } = Object.create(null); +_ws[' '] = true; +_ws['\t'] = true; const enum Arrow { Top = 0b1, Diag = 0b10, Left = 0b100 } @@ -454,8 +459,21 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { const patternLen = pattern.length > 100 ? 100 : pattern.length; const wordLen = word.length > 100 ? 100 : word.length; - if (patternLen === 0) { - return [-1, []]; + // Check for leading whitespace in the pattern and + // start matching just after that position. This is + // like `pattern = pattern.rtrim()` but doesn't create + // a new string + let patternStartPos = 0; + for (const ch of pattern) { + if (_ws[ch]) { + patternStartPos += 1; + } else { + break; + } + } + + if (patternLen === patternStartPos) { + return [-100, []]; } if (patternLen > wordLen) { @@ -464,38 +482,42 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { const lowPattern = pattern.toLowerCase(); const lowWord = word.toLowerCase(); - let i = 0; - let j = 0; - while (i < patternLen && j < wordLen) { - if (lowPattern[i] === lowWord[j]) { - i += 1; + let patternPos = patternStartPos; + let wordPos = 0; + + while (patternPos < patternLen && wordPos < wordLen) { + if (lowPattern[patternPos] === lowWord[wordPos]) { + patternPos += 1; } - j += 1; + wordPos += 1; } - if (i !== patternLen) { + if (patternPos !== patternLen) { // no simple matches found -> return early return undefined; } - for (i = 1; i <= patternLen; i++) { + // keep track of the maximum score + let maxScore = -1; + + for (patternPos = patternStartPos + 1; patternPos <= patternLen; patternPos++) { let lastLowWordChar = ''; - for (j = 1; j <= wordLen; j++) { + for (wordPos = 1; wordPos <= wordLen; wordPos++) { let score = -1; - let lowWordChar = lowWord[j - 1]; - if (lowPattern[i - 1] === lowWordChar) { + let lowWordChar = lowWord[wordPos - 1]; + if (lowPattern[patternPos - 1] === lowWordChar) { - if (j === 1) { - if (pattern[i - 1] === word[j - 1]) { + if (wordPos === 1) { + if (pattern[patternPos - 1] === word[wordPos - 1]) { score = 7; } else { score = 5; } - } else if (lowWordChar !== word[j - 1]) { - if (pattern[i - 1] === word[j - 1]) { + } else if (lowWordChar !== word[wordPos - 1]) { + if (pattern[patternPos - 1] === word[wordPos - 1]) { score = 7; } else { score = 5; @@ -508,35 +530,38 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { } } - _scores[i][j] = score; + _scores[patternPos][wordPos] = score; + if (score > maxScore) { + maxScore = score; + } - let diag = _table[i - 1][j - 1] + (score > 1 ? 1 : score); - let top = _table[i - 1][j] + -1; - let left = _table[i][j - 1] + -1; + let diag = _table[patternPos - 1][wordPos - 1] + (score > 1 ? 1 : score); + let top = _table[patternPos - 1][wordPos] + -1; + let left = _table[patternPos][wordPos - 1] + -1; if (left >= top) { // left or diag if (left > diag) { - _table[i][j] = left; - _arrows[i][j] = Arrow.Left; + _table[patternPos][wordPos] = left; + _arrows[patternPos][wordPos] = Arrow.Left; } else if (left === diag) { - _table[i][j] = left; - _arrows[i][j] = Arrow.Left | Arrow.Diag; + _table[patternPos][wordPos] = left; + _arrows[patternPos][wordPos] = Arrow.Left | Arrow.Diag; } else { - _table[i][j] = diag; - _arrows[i][j] = Arrow.Diag; + _table[patternPos][wordPos] = diag; + _arrows[patternPos][wordPos] = Arrow.Diag; } } else { // top or diag if (top > diag) { - _table[i][j] = top; - _arrows[i][j] = Arrow.Top; + _table[patternPos][wordPos] = top; + _arrows[patternPos][wordPos] = Arrow.Top; } else if (top === diag) { - _table[i][j] = top; - _arrows[i][j] = Arrow.Top | Arrow.Diag; + _table[patternPos][wordPos] = top; + _arrows[patternPos][wordPos] = Arrow.Top | Arrow.Diag; } else { - _table[i][j] = diag; - _arrows[i][j] = Arrow.Diag; + _table[patternPos][wordPos] = diag; + _arrows[patternPos][wordPos] = Arrow.Diag; } } @@ -544,6 +569,10 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { } } + if (maxScore <= 1) { + return undefined; + } + if (_debug) { console.log(printTable(_table, pattern, patternLen, word, wordLen)); console.log(printTable(_arrows, pattern, patternLen, word, wordLen)); @@ -551,7 +580,7 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { } let bucket: [number, number[]][] = []; - findAllMatches(patternLen, patternLen, wordLen, 0, [], bucket, false); + findAllMatches(patternLen, patternLen, patternStartPos, wordLen, 0, [], bucket, false); if (bucket.length === 0) { return undefined; @@ -569,7 +598,7 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { return topMatch; } -function findAllMatches(patternLen: number, patternPos: number, wordPos: number, total: number, matches: number[], bucket: [number, number[]][], lastMatched: boolean): void { +function findAllMatches(patternLen: number, patternPos: number, patternStartPos: number, wordPos: number, total: number, matches: number[], bucket: [number, number[]][], lastMatched: boolean): void { if (bucket.length >= 10) { return; @@ -577,7 +606,7 @@ function findAllMatches(patternLen: number, patternPos: number, wordPos: number, let simpleMatchCount = 0; - while (patternPos > 0 && wordPos > 0) { + while (patternPos > patternStartPos && wordPos > 0) { let score = _scores[patternPos][wordPos]; let arrow = _arrows[patternPos][wordPos]; @@ -598,7 +627,7 @@ function findAllMatches(patternLen: number, patternPos: number, wordPos: number, if (arrow & Arrow.Left) { // left findAllMatches( - patternLen, patternPos, + patternLen, patternPos, patternStartPos, wordPos - 1, matches.length !== 0 ? total - 1 : total, matches.slice(0), bucket, lastMatched @@ -624,7 +653,7 @@ function findAllMatches(patternLen: number, patternPos: number, wordPos: number, } } - if (matches.length !== patternLen) { + if (matches.length !== patternLen - patternStartPos) { // doesn't cover whole pattern return undefined; } diff --git a/src/vs/base/common/json.ts b/src/vs/base/common/json.ts index 03f8216334d..c54e96c9e9d 100644 --- a/src/vs/base/common/json.ts +++ b/src/vs/base/common/json.ts @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { localize } from 'vs/nls'; - export enum ScanError { None, UnexpectedEndOfComment, @@ -232,7 +230,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON break; } else { scanError = ScanError.InvalidCharacter; - break; + // mark as error but continue with string } } pos++; @@ -637,22 +635,6 @@ export enum ParseErrorCode { EndOfFileExpected } -export function getParseErrorMessage(errorCode: ParseErrorCode): string { - switch (errorCode) { - case ParseErrorCode.InvalidSymbol: return localize('error.invalidSymbol', 'Invalid symbol'); - case ParseErrorCode.InvalidNumberFormat: return localize('error.invalidNumberFormat', 'Invalid number format'); - case ParseErrorCode.PropertyNameExpected: return localize('error.propertyNameExpected', 'Property name expected'); - case ParseErrorCode.ValueExpected: return localize('error.valueExpected', 'Value expected'); - case ParseErrorCode.ColonExpected: return localize('error.colonExpected', 'Colon expected'); - case ParseErrorCode.CommaExpected: return localize('error.commaExpected', 'Comma expected'); - case ParseErrorCode.CloseBraceExpected: return localize('error.closeBraceExpected', 'Closing brace expected'); - case ParseErrorCode.CloseBracketExpected: return localize('error.closeBracketExpected', 'Closing bracket expected'); - case ParseErrorCode.EndOfFileExpected: return localize('error.endOfFileExpected', 'End of file expected'); - default: - return ''; - } -} - export type NodeType = 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null'; function getLiteralNodeType(value: any): NodeType { diff --git a/src/vs/base/common/jsonErrorMessages.ts b/src/vs/base/common/jsonErrorMessages.ts new file mode 100644 index 00000000000..96edf8e35a4 --- /dev/null +++ b/src/vs/base/common/jsonErrorMessages.ts @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +/** + * Extracted from json.ts to keep json nls free. + */ +import { localize } from 'vs/nls'; +import { ParseErrorCode } from './json'; + +export function getParseErrorMessage(errorCode: ParseErrorCode): string { + switch (errorCode) { + case ParseErrorCode.InvalidSymbol: return localize('error.invalidSymbol', 'Invalid symbol'); + case ParseErrorCode.InvalidNumberFormat: return localize('error.invalidNumberFormat', 'Invalid number format'); + case ParseErrorCode.PropertyNameExpected: return localize('error.propertyNameExpected', 'Property name expected'); + case ParseErrorCode.ValueExpected: return localize('error.valueExpected', 'Value expected'); + case ParseErrorCode.ColonExpected: return localize('error.colonExpected', 'Colon expected'); + case ParseErrorCode.CommaExpected: return localize('error.commaExpected', 'Comma expected'); + case ParseErrorCode.CloseBraceExpected: return localize('error.closeBraceExpected', 'Closing brace expected'); + case ParseErrorCode.CloseBracketExpected: return localize('error.closeBracketExpected', 'Closing bracket expected'); + case ParseErrorCode.EndOfFileExpected: return localize('error.endOfFileExpected', 'End of file expected'); + default: + return ''; + } +} \ No newline at end of file diff --git a/src/vs/base/common/keyCodes.ts b/src/vs/base/common/keyCodes.ts index 5ee34736992..b3a1ee94fbe 100644 --- a/src/vs/base/common/keyCodes.ts +++ b/src/vs/base/common/keyCodes.ts @@ -190,6 +190,9 @@ export const enum KeyCode { */ KEY_IN_COMPOSITION = 109, + ABNT_C1 = 110, // Brazilian (ABNT) Keyboard + ABNT_C2 = 111, // Brazilian (ABNT) Keyboard + /** * Placed last to cover the length of the enum. * Please do not depend on this value! @@ -197,218 +200,182 @@ export const enum KeyCode { MAX_VALUE } -export interface IReverseMap { - [str: string]: KeyCode; +class KeyCodeStrMap { + + private _keyCodeToStr: string[]; + private _strToKeyCode: { [str: string]: KeyCode; }; + + constructor() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + + define(keyCode: KeyCode, str: string): void { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; + } + + keyCodeToStr(keyCode: KeyCode): string { + return this._keyCodeToStr[keyCode]; + } + + strToKeyCode(str: string): KeyCode { + return this._strToKeyCode[str.toLowerCase()] || KeyCode.Unknown; + } } -export class Mapping { +const uiMap = new KeyCodeStrMap(); +const userSettingsUSMap = new KeyCodeStrMap(); +const userSettingsGeneralMap = new KeyCodeStrMap(); - _fromKeyCode: string[]; - _toKeyCode: IReverseMap; +(function () { - constructor(fromKeyCode: string[], toKeyCode: IReverseMap) { - this._fromKeyCode = fromKeyCode; - this._toKeyCode = toKeyCode; + function define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void { + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); } - fromKeyCode(keyCode: KeyCode): string { - return this._fromKeyCode[keyCode]; - } + define(KeyCode.Unknown, 'unknown'); - toKeyCode(str: string): KeyCode { - if (this._toKeyCode.hasOwnProperty(str)) { - return this._toKeyCode[str]; - } - return KeyCode.Unknown; - } + define(KeyCode.Backspace, 'Backspace'); + define(KeyCode.Tab, 'Tab'); + define(KeyCode.Enter, 'Enter'); + define(KeyCode.Shift, 'Shift'); + define(KeyCode.Ctrl, 'Ctrl'); + define(KeyCode.Alt, 'Alt'); + define(KeyCode.PauseBreak, 'PauseBreak'); + define(KeyCode.CapsLock, 'CapsLock'); + define(KeyCode.Escape, 'Escape'); + define(KeyCode.Space, 'Space'); + define(KeyCode.PageUp, 'PageUp'); + define(KeyCode.PageDown, 'PageDown'); + define(KeyCode.End, 'End'); + define(KeyCode.Home, 'Home'); -} + define(KeyCode.LeftArrow, 'LeftArrow', 'Left'); + define(KeyCode.UpArrow, 'UpArrow', 'Up'); + define(KeyCode.RightArrow, 'RightArrow', 'Right'); + define(KeyCode.DownArrow, 'DownArrow', 'Down'); + define(KeyCode.Insert, 'Insert'); + define(KeyCode.Delete, 'Delete'); -function createMapping(fill1: (map: string[]) => void, fill2: (reverseMap: IReverseMap) => void): Mapping { - let MAP: string[] = []; - fill1(MAP); + define(KeyCode.KEY_0, '0'); + define(KeyCode.KEY_1, '1'); + define(KeyCode.KEY_2, '2'); + define(KeyCode.KEY_3, '3'); + define(KeyCode.KEY_4, '4'); + define(KeyCode.KEY_5, '5'); + define(KeyCode.KEY_6, '6'); + define(KeyCode.KEY_7, '7'); + define(KeyCode.KEY_8, '8'); + define(KeyCode.KEY_9, '9'); - let REVERSE_MAP: IReverseMap = {}; - for (let i = 0, len = MAP.length; i < len; i++) { - if (!MAP[i]) { - continue; - } - REVERSE_MAP[MAP[i]] = i; - } - fill2(REVERSE_MAP); + define(KeyCode.KEY_A, 'A'); + define(KeyCode.KEY_B, 'B'); + define(KeyCode.KEY_C, 'C'); + define(KeyCode.KEY_D, 'D'); + define(KeyCode.KEY_E, 'E'); + define(KeyCode.KEY_F, 'F'); + define(KeyCode.KEY_G, 'G'); + define(KeyCode.KEY_H, 'H'); + define(KeyCode.KEY_I, 'I'); + define(KeyCode.KEY_J, 'J'); + define(KeyCode.KEY_K, 'K'); + define(KeyCode.KEY_L, 'L'); + define(KeyCode.KEY_M, 'M'); + define(KeyCode.KEY_N, 'N'); + define(KeyCode.KEY_O, 'O'); + define(KeyCode.KEY_P, 'P'); + define(KeyCode.KEY_Q, 'Q'); + define(KeyCode.KEY_R, 'R'); + define(KeyCode.KEY_S, 'S'); + define(KeyCode.KEY_T, 'T'); + define(KeyCode.KEY_U, 'U'); + define(KeyCode.KEY_V, 'V'); + define(KeyCode.KEY_W, 'W'); + define(KeyCode.KEY_X, 'X'); + define(KeyCode.KEY_Y, 'Y'); + define(KeyCode.KEY_Z, 'Z'); - let FINAL_REVERSE_MAP: IReverseMap = {}; - for (let entry in REVERSE_MAP) { - if (REVERSE_MAP.hasOwnProperty(entry)) { - FINAL_REVERSE_MAP[entry] = REVERSE_MAP[entry]; - FINAL_REVERSE_MAP[entry.toLowerCase()] = REVERSE_MAP[entry]; - } - } + define(KeyCode.Meta, 'Meta'); + define(KeyCode.ContextMenu, 'ContextMenu'); - return new Mapping(MAP, FINAL_REVERSE_MAP); -} + define(KeyCode.F1, 'F1'); + define(KeyCode.F2, 'F2'); + define(KeyCode.F3, 'F3'); + define(KeyCode.F4, 'F4'); + define(KeyCode.F5, 'F5'); + define(KeyCode.F6, 'F6'); + define(KeyCode.F7, 'F7'); + define(KeyCode.F8, 'F8'); + define(KeyCode.F9, 'F9'); + define(KeyCode.F10, 'F10'); + define(KeyCode.F11, 'F11'); + define(KeyCode.F12, 'F12'); + define(KeyCode.F13, 'F13'); + define(KeyCode.F14, 'F14'); + define(KeyCode.F15, 'F15'); + define(KeyCode.F16, 'F16'); + define(KeyCode.F17, 'F17'); + define(KeyCode.F18, 'F18'); + define(KeyCode.F19, 'F19'); -let STRING = createMapping((TO_STRING_MAP) => { - TO_STRING_MAP[KeyCode.Unknown] = 'unknown'; + define(KeyCode.NumLock, 'NumLock'); + define(KeyCode.ScrollLock, 'ScrollLock'); - TO_STRING_MAP[KeyCode.Backspace] = 'Backspace'; - TO_STRING_MAP[KeyCode.Tab] = 'Tab'; - TO_STRING_MAP[KeyCode.Enter] = 'Enter'; - TO_STRING_MAP[KeyCode.Shift] = 'Shift'; - TO_STRING_MAP[KeyCode.Ctrl] = 'Ctrl'; - TO_STRING_MAP[KeyCode.Alt] = 'Alt'; - TO_STRING_MAP[KeyCode.PauseBreak] = 'PauseBreak'; - TO_STRING_MAP[KeyCode.CapsLock] = 'CapsLock'; - TO_STRING_MAP[KeyCode.Escape] = 'Escape'; - TO_STRING_MAP[KeyCode.Space] = 'Space'; - TO_STRING_MAP[KeyCode.PageUp] = 'PageUp'; - TO_STRING_MAP[KeyCode.PageDown] = 'PageDown'; - TO_STRING_MAP[KeyCode.End] = 'End'; - TO_STRING_MAP[KeyCode.Home] = 'Home'; - TO_STRING_MAP[KeyCode.LeftArrow] = 'LeftArrow'; - TO_STRING_MAP[KeyCode.UpArrow] = 'UpArrow'; - TO_STRING_MAP[KeyCode.RightArrow] = 'RightArrow'; - TO_STRING_MAP[KeyCode.DownArrow] = 'DownArrow'; - TO_STRING_MAP[KeyCode.Insert] = 'Insert'; - TO_STRING_MAP[KeyCode.Delete] = 'Delete'; + define(KeyCode.US_SEMICOLON, ';', ';', 'OEM_1'); + define(KeyCode.US_EQUAL, '=', '=', 'OEM_PLUS'); + define(KeyCode.US_COMMA, ',', ',', 'OEM_COMMA'); + define(KeyCode.US_MINUS, '-', '-', 'OEM_MINUS'); + define(KeyCode.US_DOT, '.', '.', 'OEM_PERIOD'); + define(KeyCode.US_SLASH, '/', '/', 'OEM_2'); + define(KeyCode.US_BACKTICK, '`', '`', 'OEM_3'); + define(KeyCode.ABNT_C1, 'ABNT_C1'); + define(KeyCode.ABNT_C2, 'ABNT_C2'); + define(KeyCode.US_OPEN_SQUARE_BRACKET, '[', '[', 'OEM_4'); + define(KeyCode.US_BACKSLASH, '\\', '\\', 'OEM_5'); + define(KeyCode.US_CLOSE_SQUARE_BRACKET, ']', ']', 'OEM_6'); + define(KeyCode.US_QUOTE, '\'', '\'', 'OEM_7'); + define(KeyCode.OEM_8, 'OEM_8'); + define(KeyCode.OEM_102, 'OEM_102'); - TO_STRING_MAP[KeyCode.KEY_0] = '0'; - TO_STRING_MAP[KeyCode.KEY_1] = '1'; - TO_STRING_MAP[KeyCode.KEY_2] = '2'; - TO_STRING_MAP[KeyCode.KEY_3] = '3'; - TO_STRING_MAP[KeyCode.KEY_4] = '4'; - TO_STRING_MAP[KeyCode.KEY_5] = '5'; - TO_STRING_MAP[KeyCode.KEY_6] = '6'; - TO_STRING_MAP[KeyCode.KEY_7] = '7'; - TO_STRING_MAP[KeyCode.KEY_8] = '8'; - TO_STRING_MAP[KeyCode.KEY_9] = '9'; + define(KeyCode.NUMPAD_0, 'NumPad0'); + define(KeyCode.NUMPAD_1, 'NumPad1'); + define(KeyCode.NUMPAD_2, 'NumPad2'); + define(KeyCode.NUMPAD_3, 'NumPad3'); + define(KeyCode.NUMPAD_4, 'NumPad4'); + define(KeyCode.NUMPAD_5, 'NumPad5'); + define(KeyCode.NUMPAD_6, 'NumPad6'); + define(KeyCode.NUMPAD_7, 'NumPad7'); + define(KeyCode.NUMPAD_8, 'NumPad8'); + define(KeyCode.NUMPAD_9, 'NumPad9'); - TO_STRING_MAP[KeyCode.KEY_A] = 'A'; - TO_STRING_MAP[KeyCode.KEY_B] = 'B'; - TO_STRING_MAP[KeyCode.KEY_C] = 'C'; - TO_STRING_MAP[KeyCode.KEY_D] = 'D'; - TO_STRING_MAP[KeyCode.KEY_E] = 'E'; - TO_STRING_MAP[KeyCode.KEY_F] = 'F'; - TO_STRING_MAP[KeyCode.KEY_G] = 'G'; - TO_STRING_MAP[KeyCode.KEY_H] = 'H'; - TO_STRING_MAP[KeyCode.KEY_I] = 'I'; - TO_STRING_MAP[KeyCode.KEY_J] = 'J'; - TO_STRING_MAP[KeyCode.KEY_K] = 'K'; - TO_STRING_MAP[KeyCode.KEY_L] = 'L'; - TO_STRING_MAP[KeyCode.KEY_M] = 'M'; - TO_STRING_MAP[KeyCode.KEY_N] = 'N'; - TO_STRING_MAP[KeyCode.KEY_O] = 'O'; - TO_STRING_MAP[KeyCode.KEY_P] = 'P'; - TO_STRING_MAP[KeyCode.KEY_Q] = 'Q'; - TO_STRING_MAP[KeyCode.KEY_R] = 'R'; - TO_STRING_MAP[KeyCode.KEY_S] = 'S'; - TO_STRING_MAP[KeyCode.KEY_T] = 'T'; - TO_STRING_MAP[KeyCode.KEY_U] = 'U'; - TO_STRING_MAP[KeyCode.KEY_V] = 'V'; - TO_STRING_MAP[KeyCode.KEY_W] = 'W'; - TO_STRING_MAP[KeyCode.KEY_X] = 'X'; - TO_STRING_MAP[KeyCode.KEY_Y] = 'Y'; - TO_STRING_MAP[KeyCode.KEY_Z] = 'Z'; + define(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply'); + define(KeyCode.NUMPAD_ADD, 'NumPad_Add'); + define(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator'); + define(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract'); + define(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal'); + define(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide'); - TO_STRING_MAP[KeyCode.Meta] = 'Meta'; - TO_STRING_MAP[KeyCode.ContextMenu] = 'ContextMenu'; - - TO_STRING_MAP[KeyCode.F1] = 'F1'; - TO_STRING_MAP[KeyCode.F2] = 'F2'; - TO_STRING_MAP[KeyCode.F3] = 'F3'; - TO_STRING_MAP[KeyCode.F4] = 'F4'; - TO_STRING_MAP[KeyCode.F5] = 'F5'; - TO_STRING_MAP[KeyCode.F6] = 'F6'; - TO_STRING_MAP[KeyCode.F7] = 'F7'; - TO_STRING_MAP[KeyCode.F8] = 'F8'; - TO_STRING_MAP[KeyCode.F9] = 'F9'; - TO_STRING_MAP[KeyCode.F10] = 'F10'; - TO_STRING_MAP[KeyCode.F11] = 'F11'; - TO_STRING_MAP[KeyCode.F12] = 'F12'; - TO_STRING_MAP[KeyCode.F13] = 'F13'; - TO_STRING_MAP[KeyCode.F14] = 'F14'; - TO_STRING_MAP[KeyCode.F15] = 'F15'; - TO_STRING_MAP[KeyCode.F16] = 'F16'; - TO_STRING_MAP[KeyCode.F17] = 'F17'; - TO_STRING_MAP[KeyCode.F18] = 'F18'; - TO_STRING_MAP[KeyCode.F19] = 'F19'; - - - TO_STRING_MAP[KeyCode.NumLock] = 'NumLock'; - TO_STRING_MAP[KeyCode.ScrollLock] = 'ScrollLock'; - - TO_STRING_MAP[KeyCode.US_SEMICOLON] = ';'; - TO_STRING_MAP[KeyCode.US_EQUAL] = '='; - TO_STRING_MAP[KeyCode.US_COMMA] = ','; - TO_STRING_MAP[KeyCode.US_MINUS] = '-'; - TO_STRING_MAP[KeyCode.US_DOT] = '.'; - TO_STRING_MAP[KeyCode.US_SLASH] = '/'; - TO_STRING_MAP[KeyCode.US_BACKTICK] = '`'; - TO_STRING_MAP[KeyCode.US_OPEN_SQUARE_BRACKET] = '['; - TO_STRING_MAP[KeyCode.US_BACKSLASH] = '\\'; - TO_STRING_MAP[KeyCode.US_CLOSE_SQUARE_BRACKET] = ']'; - TO_STRING_MAP[KeyCode.US_QUOTE] = '\''; - TO_STRING_MAP[KeyCode.OEM_8] = 'OEM_8'; - TO_STRING_MAP[KeyCode.OEM_102] = 'OEM_102'; - - TO_STRING_MAP[KeyCode.NUMPAD_0] = 'NumPad0'; - TO_STRING_MAP[KeyCode.NUMPAD_1] = 'NumPad1'; - TO_STRING_MAP[KeyCode.NUMPAD_2] = 'NumPad2'; - TO_STRING_MAP[KeyCode.NUMPAD_3] = 'NumPad3'; - TO_STRING_MAP[KeyCode.NUMPAD_4] = 'NumPad4'; - TO_STRING_MAP[KeyCode.NUMPAD_5] = 'NumPad5'; - TO_STRING_MAP[KeyCode.NUMPAD_6] = 'NumPad6'; - TO_STRING_MAP[KeyCode.NUMPAD_7] = 'NumPad7'; - TO_STRING_MAP[KeyCode.NUMPAD_8] = 'NumPad8'; - TO_STRING_MAP[KeyCode.NUMPAD_9] = 'NumPad9'; - - TO_STRING_MAP[KeyCode.NUMPAD_MULTIPLY] = 'NumPad_Multiply'; - TO_STRING_MAP[KeyCode.NUMPAD_ADD] = 'NumPad_Add'; - TO_STRING_MAP[KeyCode.NUMPAD_SEPARATOR] = 'NumPad_Separator'; - TO_STRING_MAP[KeyCode.NUMPAD_SUBTRACT] = 'NumPad_Subtract'; - TO_STRING_MAP[KeyCode.NUMPAD_DECIMAL] = 'NumPad_Decimal'; - TO_STRING_MAP[KeyCode.NUMPAD_DIVIDE] = 'NumPad_Divide'; - - // for (let i = 0; i < KeyCode.MAX_VALUE; i++) { - // if (!TO_STRING_MAP[i]) { - // console.warn('Missing string representation for ' + KeyCode[i]); - // } - // } -}, (FROM_STRING_MAP) => { - FROM_STRING_MAP['\r'] = KeyCode.Enter; -}); - - -export let USER_SETTINGS = createMapping((TO_USER_SETTINGS_MAP) => { - for (let i = 0, len = STRING._fromKeyCode.length; i < len; i++) { - TO_USER_SETTINGS_MAP[i] = STRING._fromKeyCode[i]; - } - TO_USER_SETTINGS_MAP[KeyCode.LeftArrow] = 'Left'; - TO_USER_SETTINGS_MAP[KeyCode.UpArrow] = 'Up'; - TO_USER_SETTINGS_MAP[KeyCode.RightArrow] = 'Right'; - TO_USER_SETTINGS_MAP[KeyCode.DownArrow] = 'Down'; -}, (FROM_USER_SETTINGS_MAP) => { - FROM_USER_SETTINGS_MAP['OEM_1'] = KeyCode.US_SEMICOLON; - FROM_USER_SETTINGS_MAP['OEM_PLUS'] = KeyCode.US_EQUAL; - FROM_USER_SETTINGS_MAP['OEM_COMMA'] = KeyCode.US_COMMA; - FROM_USER_SETTINGS_MAP['OEM_MINUS'] = KeyCode.US_MINUS; - FROM_USER_SETTINGS_MAP['OEM_PERIOD'] = KeyCode.US_DOT; - FROM_USER_SETTINGS_MAP['OEM_2'] = KeyCode.US_SLASH; - FROM_USER_SETTINGS_MAP['OEM_3'] = KeyCode.US_BACKTICK; - FROM_USER_SETTINGS_MAP['OEM_4'] = KeyCode.US_OPEN_SQUARE_BRACKET; - FROM_USER_SETTINGS_MAP['OEM_5'] = KeyCode.US_BACKSLASH; - FROM_USER_SETTINGS_MAP['OEM_6'] = KeyCode.US_CLOSE_SQUARE_BRACKET; - FROM_USER_SETTINGS_MAP['OEM_7'] = KeyCode.US_QUOTE; - FROM_USER_SETTINGS_MAP['OEM_8'] = KeyCode.OEM_8; - FROM_USER_SETTINGS_MAP['OEM_102'] = KeyCode.OEM_102; -}); +})(); export namespace KeyCodeUtils { - export function toString(key: KeyCode): string { - return STRING.fromKeyCode(key); + export function toString(keyCode: KeyCode): string { + return uiMap.keyCodeToStr(keyCode); } export function fromString(key: string): KeyCode { - return STRING.toKeyCode(key); + return uiMap.strToKeyCode(key); + } + + export function toUserSettingsUS(keyCode: KeyCode): string { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + export function toUserSettingsGeneral(keyCode: KeyCode): string { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + export function fromUserSettings(key: string): KeyCode { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); } } @@ -546,26 +513,37 @@ export class ChordKeybinding { export type Keybinding = SimpleKeybinding | ChordKeybinding; +export class ResolvedKeybindingPart { + readonly ctrlKey: boolean; + readonly shiftKey: boolean; + readonly altKey: boolean; + readonly metaKey: boolean; + + readonly keyLabel: string; + readonly keyAriaLabel: string; + + constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string, kbAriaLabel: string) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } +} + /** - * A resolved keybinding. + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. */ export abstract class ResolvedKeybinding { /** * This prints the binding in a format suitable for displaying in the UI. */ public abstract getLabel(): string; - /** - * Returns the UI label of the binding without modifiers - */ - public abstract getLabelWithoutModifiers(): string; /** * This prints the binding in a format suitable for ARIA. */ public abstract getAriaLabel(): string; - /** - * Returns the ARIA label of the bindings without modifiers - */ - public abstract getAriaLabelWithoutModifiers(): string; /** * This prints the binding in a format suitable for electron's accelerators. * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md @@ -584,33 +562,14 @@ export abstract class ResolvedKeybinding { * Is the binding a chord? */ public abstract isChord(): boolean; - /** - * Does this binding use the ctrl modifier key. - * If it is a chord, it always returns false. - */ - public abstract hasCtrlModifier(): boolean; - /** - * Does this binding use the shift modifier key. - * If it is a chord, it always returns false. - */ - public abstract hasShiftModifier(): boolean; - /** - * Does this binding use the alt modifier key. - * If it is a chord, it always returns false. - */ - public abstract hasAltModifier(): boolean; - /** - * Does this binding use the meta modifier key. - * If it is a chord, it always returns false. - */ - public abstract hasMetaModifier(): boolean; /** * Returns the firstPart, chordPart that should be used for dispatching. */ public abstract getDispatchParts(): [string, string]; /** - * Returns the firstPart, chordPart of the keybinding + * Returns the firstPart, chordPart of the keybinding. + * For simple keybindings, the second element will be null. */ - public abstract getParts(): [ResolvedKeybinding, ResolvedKeybinding]; + public abstract getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart]; } diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts index 571b7e1fb3c..93de044478a 100644 --- a/src/vs/base/common/network.ts +++ b/src/vs/base/common/network.ts @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { TPromise } from 'vs/base/common/winjs.base'; - export namespace Schemas { /** @@ -42,65 +40,3 @@ export namespace Schemas { export const untitled: string = 'untitled'; } - -export interface IXHROptions { - type?: string; - url?: string; - user?: string; - password?: string; - responseType?: string; - headers?: any; - customRequestInitializer?: (req: any) => void; - data?: any; -} - -export function xhr(options: IXHROptions): TPromise { - let req: XMLHttpRequest = null; - let canceled = false; - - return new TPromise((c, e, p) => { - req = new XMLHttpRequest(); - - req.onreadystatechange = () => { - if (canceled) { - return; - } - - if (req.readyState === 4) { - // Handle 1223: http://bugs.jquery.com/ticket/1450 - if ((req.status >= 200 && req.status < 300) || req.status === 1223) { - c(req); - } else { - e(req); - } - req.onreadystatechange = () => { }; - } else { - p(req); - } - }; - - req.open( - options.type || 'GET', - options.url, - // Promise based XHR does not support sync. - // - true, - options.user, - options.password - ); - req.responseType = options.responseType as any || ''; - - Object.keys(options.headers || {}).forEach((k) => { - req.setRequestHeader(k, options.headers[k]); - }); - - if (options.customRequestInitializer) { - options.customRequestInitializer(req); - } - - req.send(options.data); - }, () => { - canceled = true; - req.abort(); - }); -} \ No newline at end of file diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index c073ced725f..9a814afa30c 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -304,7 +304,7 @@ export function getOrDefault(obj: T, fn: (obj: T) => R, defaultValue: R = * @param obj the object to use for diffing */ export type obj = { [key: string]: any; }; -export function distinct(base: obj, target: obj): obj { +export function distinct(base: obj, target: obj): obj { const result = Object.create(null); if (!base || !target) { diff --git a/src/vs/base/common/paging.ts b/src/vs/base/common/paging.ts index a8f8208c581..de3319b5038 100644 --- a/src/vs/base/common/paging.ts +++ b/src/vs/base/common/paging.ts @@ -6,7 +6,6 @@ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; -import { ArraySet } from 'vs/base/common/set'; import { isArray } from 'vs/base/common/types'; /** @@ -22,7 +21,7 @@ export interface IPager { interface IPage { isResolved: boolean; promise: TPromise; - promiseIndexes: ArraySet; + promiseIndexes: Set; elements: T[]; } @@ -55,12 +54,12 @@ export class PagedModel implements IPagedModel { constructor(private arg: IPager | T[], private pageTimeout: number = 500) { this.pager = isArray(arg) ? singlePagePager(arg) : arg; - this.pages = [{ isResolved: true, promise: null, promiseIndexes: new ArraySet(), elements: this.pager.firstPage.slice() }]; + this.pages = [{ isResolved: true, promise: null, promiseIndexes: new Set(), elements: this.pager.firstPage.slice() }]; const totalPages = Math.ceil(this.pager.total / this.pager.pageSize); for (let i = 0, len = totalPages - 1; i < len; i++) { - this.pages.push({ isResolved: false, promise: null, promiseIndexes: new ArraySet(), elements: [] }); + this.pages.push({ isResolved: false, promise: null, promiseIndexes: new Set(), elements: [] }); } } @@ -102,14 +101,14 @@ export class PagedModel implements IPagedModel { } return new TPromise((c, e) => { - page.promiseIndexes.set(index); + page.promiseIndexes.add(index); page.promise.done(() => c(page.elements[indexInPage])); }, () => { if (!page.promise) { return; } - page.promiseIndexes.unset(index); + page.promiseIndexes.delete(index); if (page.promiseIndexes.size === 0) { page.promise.cancel(); diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts index 77311e2dc58..bf1aa3268f4 100644 --- a/src/vs/base/common/platform.ts +++ b/src/vs/base/common/platform.ts @@ -12,7 +12,6 @@ let _isLinux = false; let _isRootUser = false; let _isNative = false; let _isWeb = false; -let _isQunit = false; let _locale: string = undefined; let _language: string = undefined; @@ -68,7 +67,6 @@ if (typeof process === 'object') { _isWeb = true; _locale = navigator.language; _language = _locale; - _isQunit = !!(self).QUnit; } export enum Platform { @@ -78,7 +76,7 @@ export enum Platform { Windows } -export let _platform: Platform = Platform.Web; +let _platform: Platform = Platform.Web; if (_isNative) { if (_isMacintosh) { _platform = Platform.Mac; @@ -95,7 +93,6 @@ export const isLinux = _isLinux; export const isRootUser = _isRootUser; export const isNative = _isNative; export const isWeb = _isWeb; -export const isQunit = _isQunit; export const platform = _platform; /** @@ -145,3 +142,14 @@ export const enum OperatingSystem { Linux = 3 } export const OS = (_isMacintosh ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux)); + +export const enum AccessibilitySupport { + /** + * This should be the browser case where it is not known if a screen reader is attached or no. + */ + Unknown = 0, + + Disabled = 1, + + Enabled = 2 +} diff --git a/src/vs/base/common/strings.ts b/src/vs/base/common/strings.ts index 85a902fd56b..83bbdaf61b0 100644 --- a/src/vs/base/common/strings.ts +++ b/src/vs/base/common/strings.ts @@ -202,7 +202,7 @@ export interface RegExpOptions { } export function createRegExp(searchString: string, isRegex: boolean, options: RegExpOptions = {}): RegExp { - if (searchString === '') { + if (!searchString) { throw new Error('Cannot create regex from empty string'); } if (!isRegex) { @@ -293,14 +293,14 @@ export function firstNonWhitespaceIndex(str: string): number { * Returns the leading whitespace of the string. * If the string contains only whitespaces, returns entire string */ -export function getLeadingWhitespace(str: string): string { - for (let i = 0, len = str.length; i < len; i++) { +export function getLeadingWhitespace(str: string, start: number = 0, end: number = str.length): string { + for (let i = start; i < end; i++) { let chCode = str.charCodeAt(i); if (chCode !== CharCode.Space && chCode !== CharCode.Tab) { - return str.substring(0, i); + return str.substring(start, i); } } - return str; + return str.substring(start, end); } /** @@ -503,6 +503,15 @@ export function containsRTL(str: string): boolean { return CONTAINS_RTL.test(str); } +/** + * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js + */ +const CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEF8]|\uD83E[\uDD00-\uDDE6])/; + +export function containsEmoji(str: string): boolean { + return CONTAINS_EMOJI.test(str); +} + const IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; /** * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t @@ -511,6 +520,15 @@ export function isBasicASCII(str: string): boolean { return IS_BASIC_ASCII.test(str); } +export function containsFullWidthCharacter(str: string): boolean { + for (let i = 0, len = str.length; i < len; i++) { + if (isFullWidthCharacter(str.charCodeAt(i))) { + return true; + } + } + return false; +} + export function isFullWidthCharacter(charCode: number): boolean { // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns // http://jrgraphix.net/research/unicode_blocks.php diff --git a/src/vs/base/node/decoder.ts b/src/vs/base/node/decoder.ts index a725903b510..112c6cdf6cb 100644 --- a/src/vs/base/node/decoder.ts +++ b/src/vs/base/node/decoder.ts @@ -36,9 +36,6 @@ export class LineDecoder { } let start = 0; let ch: number; - while (start < value.length && ((ch = value.charCodeAt(start)) === CharCode.CarriageReturn || ch === CharCode.LineFeed)) { - start++; - } let idx = start; while (idx < value.length) { ch = value.charCodeAt(idx); diff --git a/src/vs/base/node/profiler.ts b/src/vs/base/node/profiler.ts index febca07118e..c19ba021b69 100644 --- a/src/vs/base/node/profiler.ts +++ b/src/vs/base/node/profiler.ts @@ -45,7 +45,7 @@ export function stopProfiling(dir: string, prefix: string): TPromise { }); } -function removePiiPaths(profile: Profile) { +export function removePiiPaths(profile: Profile) { const stack = [profile.head]; while (stack.length > 0) { const element = stack.pop(); @@ -66,14 +66,14 @@ declare interface Profiler { stopProfiling(): Profile; } -declare interface Profile { +export declare interface Profile { title: string; export(callback: (err, data) => void); delete(); head: ProfileSample; } -declare interface ProfileSample { +export declare interface ProfileSample { // bailoutReason:"" // callUID:2333 // children:Array[39] diff --git a/src/vs/base/node/startupTimers.d.ts b/src/vs/base/node/startupTimers.d.ts new file mode 100644 index 00000000000..5a04270f4b6 --- /dev/null +++ b/src/vs/base/node/startupTimers.d.ts @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Profile } from './profiler' + +declare interface TickStart { + name: string; + started: number; +} + +export declare class Tick { + + readonly duration: number; + readonly name: string; + readonly started: number; + readonly stopped: number; + readonly profile: Profile; + + static compareByStart(a: Tick, b: Tick): number; +} + +declare interface TickController { + while>(t: T): T; + stop(stopped?: number): void; +} + +export function startTimer(name: string): TickController; + +export function stopTimer(name: string); + +export function ticks(): Tick[]; + +export function tick(name: string): Tick; + +export function setProfileList(names: string[]): void; + +export function disable(): void; diff --git a/src/vs/base/node/startupTimers.js b/src/vs/base/node/startupTimers.js new file mode 100644 index 00000000000..7fc81812efc --- /dev/null +++ b/src/vs/base/node/startupTimers.js @@ -0,0 +1,128 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +/*global define*/ + +var requireProfiler; + +if (typeof define !== "function" && typeof module === "object" && typeof module.exports === "object") { + // this is commonjs, fake amd + global.define = function (dep, callback) { + module.exports = callback(); + global.define = undefined; + }; + requireProfiler = function () { + return require('v8-profiler'); + }; +} else { + // this is amd + requireProfiler = function () { + return require.__$__nodeRequire('v8-profiler'); + }; +} + +define([], function () { + + function Tick(name, started, stopped, profile) { + this.name = name; + this.started = started; + this.stopped = stopped; + this.duration = Math.round(((stopped[0] * 1.e9 + stopped[1]) - (started[0] * 1e9 + started[1])) / 1.e6); + this.profile = profile; + } + Tick.compareByStart = function (a, b) { + if (a.started < b.started) { + return -1; + } else if (a.started > b.started) { + return 1; + } else { + return 0; + } + }; + + // This module can be loaded in an amd and commonjs-context. + // Because we want both instances to use the same tick-data + // we store them globally + global._perfStarts = global._perfStarts || new Map(); + global._perfTicks = global._perfTicks || new Map(); + global._perfToBeProfiled = global._perfToBeProfiled || new Set(); + + var _starts = global._perfStarts; + var _ticks = global._perfTicks; + var _toBeProfiled = global._perfToBeProfiled; + + function startTimer(name) { + if (_starts.has(name)) { + throw new Error("${name}" + " already exists"); + } + if (_toBeProfiled.has(name)) { + requireProfiler().startProfiling(name, true); + } + _starts.set(name, { name: name, started: process.hrtime() }); + var stop = stopTimer.bind(undefined, name); + return { + stop: stop, + while: function (thenable) { + thenable.then(function () { stop(); }, function () { stop(); }); + return thenable; + } + }; + } + + function stopTimer(name) { + var profile = _toBeProfiled.has(name) ? requireProfiler().stopProfiling(name) : undefined; + var start = _starts.get(name); + if (start !== undefined) { + var tick = new Tick(start.name, start.started, process.hrtime(), profile); + _ticks.set(name, tick); + _starts.delete(name); + } + } + + function ticks() { + var ret = []; + _ticks.forEach(function (value) { ret.push(value); }); + return ret; + } + + function tick(name) { + var ret = _ticks.get(name); + if (!ret) { + var now = Date.now(); + ret = new Tick(name, now, now); + } + return ret; + } + + function setProfileList(names) { + _toBeProfiled.clear(); + names.forEach(function (name) { _toBeProfiled.add(name); }); + } + + var exports = { + Tick: Tick, + startTimer: startTimer, + stopTimer: stopTimer, + ticks: ticks, + tick: tick, + setProfileList: setProfileList, + disable: disable, + }; + + function disable() { + var emptyController = Object.freeze({ while: function (t) { return t; }, stop: function () { } }); + var emptyTicks = Object.create([]); + exports.startTimer = function () { return emptyController; }; + exports.stopTimer = function () { }; + exports.ticks = function () { return emptyTicks; }; + + delete global._perfStarts; + delete global._perfTicks; + } + + return exports; +}); diff --git a/src/vs/base/node/terminateProcess.sh b/src/vs/base/node/terminateProcess.sh index 2ec9e1c2ec3..acdcbf8ed42 100755 --- a/src/vs/base/node/terminateProcess.sh +++ b/src/vs/base/node/terminateProcess.sh @@ -1,7 +1,7 @@ #!/bin/bash terminateTree() { - for cpid in $(pgrep -P $1); do + for cpid in $(/usr/bin/pgrep -P $1); do terminateTree $cpid done kill -9 $1 > /dev/null 2>&1 diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index c5e7f8c2ae7..5ac4eba8972 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -53,6 +53,7 @@ export interface IQuickOpenStyles extends IInputBoxStyles, ITreeStyles { pickerGroupForeground?: Color; pickerGroupBorder?: Color; widgetShadow?: Color; + progressBarBackground?: Color; } export interface IShowOptions { @@ -86,7 +87,8 @@ const defaultStyles = { foreground: Color.fromHex('#CCCCCC'), pickerGroupForeground: Color.fromHex('#0097FB'), pickerGroupBorder: Color.fromHex('#3F3F46'), - widgetShadow: Color.fromHex('#000000') + widgetShadow: Color.fromHex('#000000'), + progressBarBackground: Color.fromHex('#0E70C0') }; const DEFAULT_INPUT_ARIA_LABEL = nls.localize('quickOpenAriaLabel', "Quick picker. Type to narrow down results."); @@ -159,7 +161,7 @@ export class QuickOpenWidget implements IModelProvider { .on(DOM.EventType.BLUR, (e: Event) => this.loosingFocus(e), null, true); // Progress Bar - this.progressBar = new ProgressBar(div.clone()); + this.progressBar = new ProgressBar(div.clone(), { progressBarBackground: this.styles.progressBarBackground }); this.progressBar.getContainer().hide(); // Input Field @@ -279,11 +281,12 @@ export class QuickOpenWidget implements IModelProvider { // Select element when keys are pressed that signal it const quickNavKeys = this.quickNavigateConfiguration.keybindings; const wasTriggerKeyPressed = keyCode === KeyCode.Enter || quickNavKeys.some((k) => { - if (k.isChord()) { + const [firstPart, chordPart] = k.getParts(); + if (chordPart) { return false; } - if (k.hasShiftModifier() && keyCode === KeyCode.Shift) { + if (firstPart.shiftKey && keyCode === KeyCode.Shift) { if (keyboardEvent.ctrlKey || keyboardEvent.altKey || keyboardEvent.metaKey) { return false; // this is an optimistic check for the shift key being used to navigate back in quick open } @@ -291,15 +294,15 @@ export class QuickOpenWidget implements IModelProvider { return true; } - if (k.hasAltModifier() && keyCode === KeyCode.Alt) { + if (firstPart.altKey && keyCode === KeyCode.Alt) { return true; } - if (k.hasCtrlModifier() && keyCode === KeyCode.Ctrl) { + if (firstPart.ctrlKey && keyCode === KeyCode.Ctrl) { return true; } - if (k.hasMetaModifier() && keyCode === KeyCode.Meta) { + if (firstPart.metaKey && keyCode === KeyCode.Meta) { return true; } @@ -346,11 +349,17 @@ export class QuickOpenWidget implements IModelProvider { this.builder.style('color', foreground); this.builder.style('background-color', background); this.builder.style('border-color', borderColor); - this.builder.style('border-width', borderColor ? '2px' : null); + this.builder.style('border-width', borderColor ? '1px' : null); this.builder.style('border-style', borderColor ? 'solid' : null); this.builder.style('box-shadow', widgetShadow ? `0 5px 8px ${widgetShadow}` : null); } + if (this.progressBar) { + this.progressBar.style({ + progressBarBackground: this.styles.progressBarBackground + }); + } + if (this.inputBox) { this.inputBox.style({ inputBackground: this.styles.inputBackground, diff --git a/src/vs/base/parts/tree/browser/tree.css b/src/vs/base/parts/tree/browser/tree.css index 90df70bf9d1..6e835d22e0c 100644 --- a/src/vs/base/parts/tree/browser/tree.css +++ b/src/vs/base/parts/tree/browser/tree.css @@ -50,8 +50,6 @@ .monaco-tree-drag-image { display: inline-block; padding: 1px 7px; - color: white; - background-color: #4A4A4A; border-radius: 10px; font-size: 12px; position: absolute; diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index 59ecc80ad66..2b03b5f138b 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -283,9 +283,10 @@ export interface ITree extends Events.IEventEmitter { focusFirstChild(eventPayload?: any): void; /** - * Focuses the second element, in visible order. + * Focuses the second element, in visible order. Will focus the first + * child from the provided element's parent if any. */ - focusFirst(eventPayload?: any): void; + focusFirst(eventPayload?: any, from?: any): void; /** * Focuses the nth element, in visible order. @@ -293,9 +294,10 @@ export interface ITree extends Events.IEventEmitter { focusNth(index: number, eventPayload?: any): void; /** - * Focuses the last element, in visible order. + * Focuses the last element, in visible order. Will focus the last + * child from the provided element's parent if any. */ - focusLast(eventPayload?: any): void; + focusLast(eventPayload?: any, from?: any): void; /** * Focuses the element at the end of the next page, in visible order. @@ -665,12 +667,15 @@ export interface ITreeOptions extends ITreeStyles { export interface ITreeStyles { listFocusBackground?: Color; + listFocusForeground?: Color; listActiveSelectionBackground?: Color; listActiveSelectionForeground?: Color; listFocusAndSelectionBackground?: Color; listFocusAndSelectionForeground?: Color; listInactiveSelectionBackground?: Color; + listInactiveSelectionForeground?: Color; listHoverBackground?: Color; + listHoverForeground?: Color; listDropBackground?: Color; listFocusOutline?: Color; } diff --git a/src/vs/base/parts/tree/browser/treeImpl.ts b/src/vs/base/parts/tree/browser/treeImpl.ts index f2173a9bb2c..ba27e688847 100644 --- a/src/vs/base/parts/tree/browser/treeImpl.ts +++ b/src/vs/base/parts/tree/browser/treeImpl.ts @@ -327,16 +327,16 @@ export class Tree extends Events.EventEmitter implements _.ITree { this.model.focusFirstChild(eventPayload); } - public focusFirst(eventPayload?: any): void { - this.model.focusFirst(eventPayload); + public focusFirst(eventPayload?: any, from?: any): void { + this.model.focusFirst(eventPayload, from); } public focusNth(index: number, eventPayload?: any): void { this.model.focusNth(index, eventPayload); } - public focusLast(eventPayload?: any): void { - this.model.focusLast(eventPayload); + public focusLast(eventPayload?: any, from?: any): void { + this.model.focusLast(eventPayload, from); } public focusNextPage(eventPayload?: any): void { diff --git a/src/vs/base/parts/tree/browser/treeModel.ts b/src/vs/base/parts/tree/browser/treeModel.ts index 1c47debd861..a3fbdfa04d5 100644 --- a/src/vs/base/parts/tree/browser/treeModel.ts +++ b/src/vs/base/parts/tree/browser/treeModel.ts @@ -1207,12 +1207,13 @@ export class TreeModel extends Events.EventEmitter { } } - public focusFirst(eventPayload?: any): void { - this.focusNth(0, eventPayload); + public focusFirst(eventPayload?: any, from?: any): void { + this.focusNth(0, eventPayload, from); } - public focusNth(index: number, eventPayload?: any): void { - var nav = this.getNavigator(this.input); + public focusNth(index: number, eventPayload?: any, from?: any): void { + var navItem = this.getParent(from); + var nav = this.getNavigator(navItem); var item = nav.first(); for (var i = 0; i < index; i++) { item = nav.next(); @@ -1223,15 +1224,32 @@ export class TreeModel extends Events.EventEmitter { } } - public focusLast(eventPayload?: any): void { - var nav = this.getNavigator(this.input); - var item = nav.last(); + public focusLast(eventPayload?: any, from?: any): void { + var navItem = this.getParent(from); + var item: Item; + if (from) { + item = navItem.lastChild; + } else { + var nav = this.getNavigator(navItem); + item = nav.last(); + } if (item) { this.setFocus(item, eventPayload); } } + private getParent(from?: any): Item { + if (from) { + var fromItem = this.getItem(from); + if (fromItem && fromItem.parent) { + return fromItem.parent; + } + } + + return this.getItem(this.input); + } + public getNavigator(element: any = null, subTreeOnly: boolean = true): INavigator { return new TreeNavigator(this.getItem(element), subTreeOnly); } diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index 549608374c1..fbbef901f54 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -197,25 +197,21 @@ export class ViewItem implements IViewItem { // ARIA this.element.setAttribute('role', 'treeitem'); + const ariaLabel = this.context.accessibilityProvider.getAriaLabel(this.context.tree, this.model.getElement()); + if (ariaLabel) { + this.element.setAttribute('aria-label', ariaLabel); + } if (this.model.hasTrait('focused')) { const base64Id = strings.safeBtoa(this.model.id); - const ariaLabel = this.context.accessibilityProvider.getAriaLabel(this.context.tree, this.model.getElement()); this.element.setAttribute('aria-selected', 'true'); this.element.setAttribute('id', base64Id); - if (ariaLabel) { - this.element.setAttribute('aria-label', ariaLabel); - } else { - this.element.setAttribute('aria-labelledby', base64Id); // force screen reader to compute label from children (helps NVDA at least) - } } else { this.element.setAttribute('aria-selected', 'false'); this.element.removeAttribute('id'); - this.element.removeAttribute('aria-label'); - this.element.removeAttribute('aria-labelledby'); } if (this.model.hasChildren()) { - this.element.setAttribute('aria-expanded', String(this.model.isExpanded())); + this.element.setAttribute('aria-expanded', String(!!this.model.isExpanded())); } else { this.element.removeAttribute('aria-expanded'); } @@ -555,32 +551,75 @@ export class TreeView extends HeightMap { } public applyStyles(styles: _.ITreeStyles): void { + const content: string[] = []; - // Indicate selection/focus via background color - if (!styles.listFocusOutline) { - this.styleElement.innerHTML = ` - .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { background-color: ${styles.listFocusBackground}; } - .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listActiveSelectionBackground}; color: ${styles.listActiveSelectionForeground}; } - .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { background-color: ${styles.listFocusAndSelectionBackground}; color: ${styles.listFocusAndSelectionForeground}; } - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listInactiveSelectionBackground}; } - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; } - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-wrapper.drop-target, - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: ${styles.listDropBackground} !important; } - `; + if (styles.listFocusBackground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { background-color: ${styles.listFocusBackground}; }`); } - // Indicate selection/focus via outline - else { - this.styleElement.innerHTML = ` - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row { background: none !important; border: 1px solid transparent; } + if (styles.listFocusForeground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { color: ${styles.listFocusForeground}; }`); + } + + if (styles.listActiveSelectionBackground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listActiveSelectionBackground}; }`); + } + + if (styles.listActiveSelectionForeground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${styles.listActiveSelectionForeground}; }`); + } + + if (styles.listFocusAndSelectionBackground) { + content.push(` + .monaco-tree-drag-image, + .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { background-color: ${styles.listFocusAndSelectionBackground}; } + `); + } + + if (styles.listFocusAndSelectionForeground) { + content.push(` + .monaco-tree-drag-image, + .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { color: ${styles.listFocusAndSelectionForeground}; } + `); + } + + if (styles.listInactiveSelectionBackground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listInactiveSelectionBackground}; }`); + } + + if (styles.listInactiveSelectionForeground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${styles.listInactiveSelectionForeground}; }`); + } + + if (styles.listHoverBackground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`); + } + + if (styles.listHoverForeground) { + content.push(`.monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`); + } + + if (styles.listDropBackground) { + content.push(` + .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-wrapper.drop-target, + .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; } + `); + } + + if (styles.listFocusOutline) { + content.push(` + .monaco-tree-drag-image { border: 1px solid ${styles.listFocusOutline}; background: #000; } + .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row { border: 1px solid transparent; } .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { border: 1px dotted ${styles.listFocusOutline}; } .monaco-tree.monaco-tree-instance-${this.instance}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { border: 1px solid ${styles.listFocusOutline}; } .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { border: 1px solid ${styles.listFocusOutline}; } .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { border: 1px dashed ${styles.listFocusOutline}; } .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-wrapper.drop-target, - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { background: none !important; border: 1px dashed ${styles.listFocusOutline}; } - `; + .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { border: 1px dashed ${styles.listFocusOutline}; } + `); } + + this.styleElement.innerHTML = content.join('\n'); } protected createViewItem(item: Model.Item): IViewItem { diff --git a/src/vs/base/test/browser/dom.test.ts b/src/vs/base/test/browser/dom.test.ts index 3669f2eec12..4b8239985f1 100644 --- a/src/vs/base/test/browser/dom.test.ts +++ b/src/vs/base/test/browser/dom.test.ts @@ -58,7 +58,9 @@ suite('dom', () => { test('removeClass should consider hyphens', function () { let element = document.createElement('div'); - dom.addClass(element, 'foo-bar bar'); + dom.addClass(element, 'foo-bar'); + dom.addClass(element, 'bar'); + assert(dom.hasClass(element, 'foo-bar')); assert(dom.hasClass(element, 'bar')); @@ -179,4 +181,4 @@ suite('dom', () => { assert.equal(div.firstChild.textContent, 'hello'); }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/base/test/common/arrays.test.ts b/src/vs/base/test/common/arrays.test.ts index 95b7108f988..5037261bc73 100644 --- a/src/vs/base/test/common/arrays.test.ts +++ b/src/vs/base/test/common/arrays.test.ts @@ -33,6 +33,19 @@ suite('Arrays', () => { assert.equal(array[idx], 1); }); + test('stableSort', function () { + let counter = 0; + let data = arrays.fill(10000, () => ({ n: 1, m: counter++ })); + + arrays.stableSort(data, (a, b) => a.n - b.n); + + let lastM = -1; + for (const element of data) { + assert.ok(lastM < element.m); + lastM = element.m; + } + }); + test('delta', function () { function compare(a: number, b: number): number { return a - b; diff --git a/src/vs/base/test/common/diff/diff.test.ts b/src/vs/base/test/common/diff/diff.test.ts index a1eb6010406..b5467da27fc 100644 --- a/src/vs/base/test/common/diff/diff.test.ts +++ b/src/vs/base/test/common/diff/diff.test.ts @@ -19,7 +19,7 @@ class StringDiffSequence { return this.source.length; } - getElementHash(i) { + getElementHash(i: number) { return this.source.charAt(i); } } @@ -96,7 +96,7 @@ function lcsTest(Algorithm: any, originalStr: string, modifiedStr: string, answe } } -function lcsTests(Algorithm) { +function lcsTests(Algorithm: any) { lcsTest(Algorithm, 'heLLo world', 'hello orlando', 'heo orld'); lcsTest(Algorithm, 'abcde', 'acd', 'acd'); // simple lcsTest(Algorithm, 'abcdbce', 'bcede', 'bcde'); // skip diff --git a/src/vs/base/test/common/filters.test.ts b/src/vs/base/test/common/filters.test.ts index 3e9c41b735c..4753059f57c 100644 --- a/src/vs/base/test/common/filters.test.ts +++ b/src/vs/base/test/common/filters.test.ts @@ -195,7 +195,7 @@ suite('Filters', () => { function assertMatches(pattern: string, word: string, decoratedWord: string, filter: typeof fuzzyScore) { let r = filter(pattern, word); - assert.ok(Boolean(r) === Boolean(decoratedWord)); + assert.ok(!decoratedWord === (!r || r[1].length === 0)); if (r) { const [, matches] = r; let pos = 0; @@ -305,6 +305,38 @@ suite('Filters', () => { ); }); + test('fuzzyScore, issue #26423', function () { + assertMatches( + 'fsfsfs', + 'dsafdsafdsafdsafdsafdsafdsafasdfdsa', + undefined, + fuzzyScore + ); + assertMatches( + 'fsfsfsfsfsfsfsf', + 'dsafdsafdsafdsafdsafdsafdsafasdfdsafdsafdsafdsafdsfdsafdsfdfdfasdnfdsajfndsjnafjndsajlknfdsa', + undefined, + fuzzyScore + ); + }); + + test('Fuzzy IntelliSense matching vs Haxe metadata completion, #26995', function () { + assertMatches('f', ':Foo', ':^Foo', fuzzyScore); + assertMatches('f', ':foo', ':^foo', fuzzyScore); + }); + + test('Vscode 1.12 no longer obeys \'sortText\' in completion items (from language server), #26096', function () { + assertMatches(' ', ' group', undefined, fuzzyScore); + assertMatches(' g', ' group', ' ^group', fuzzyScore); + assertMatches('g', ' group', ' ^group', fuzzyScore); + assertMatches('g g', ' groupGroup', undefined, fuzzyScore); + assertMatches('g g', ' group Group', ' ^group^ ^Group', fuzzyScore); + assertMatches(' g g', ' group Group', ' ^group^ ^Group', fuzzyScore); + assertMatches('zz', 'zzGroup', '^z^zGroup', fuzzyScore); + assertMatches('zzg', 'zzGroup', '^z^z^Group', fuzzyScore); + assertMatches('g', 'zzGroup', 'zz^Group', fuzzyScore); + }); + function assertTopScore(filter: typeof fuzzyScore, pattern: string, expected: number, ...words: string[]) { let topScore = -(100 * 10); let topIdx = 0; diff --git a/src/vs/base/test/common/json.test.ts b/src/vs/base/test/common/json.test.ts index 5ad413c6f36..fe129f08808 100644 --- a/src/vs/base/test/common/json.test.ts +++ b/src/vs/base/test/common/json.test.ts @@ -6,9 +6,9 @@ import * as assert from 'assert'; import { - SyntaxKind, createScanner, parse, getLocation, Node, ParseError, parseTree, ParseErrorCode, - getParseErrorMessage, ParseOptions, Segment, findNodeAtLocation, getNodeValue, ScanError + SyntaxKind, createScanner, parse, getLocation, Node, ParseError, parseTree, ParseErrorCode, ParseOptions, Segment, findNodeAtLocation, getNodeValue, ScanError } from 'vs/base/common/json'; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; function assertKinds(text: string, ...kinds: SyntaxKind[]): void { var scanner = createScanner(text); diff --git a/src/vs/base/test/common/strings.test.ts b/src/vs/base/test/common/strings.test.ts index ef9e73d6c56..07d750b0ecd 100644 --- a/src/vs/base/test/common/strings.test.ts +++ b/src/vs/base/test/common/strings.test.ts @@ -231,6 +231,24 @@ suite('Strings', () => { assert.equal(strings.containsRTL('זוהי עובדה מבוססת שדעתו'), true); }); + test('containsEmoji', () => { + assert.equal(strings.containsEmoji('a'), false); + assert.equal(strings.containsEmoji(''), false); + assert.equal(strings.containsEmoji(strings.UTF8_BOM_CHARACTER + 'a'), false); + assert.equal(strings.containsEmoji('hello world!'), false); + assert.equal(strings.containsEmoji('هناك حقيقة مثبتة منذ زمن طويل'), false); + assert.equal(strings.containsEmoji('זוהי עובדה מבוססת שדעתו'), false); + + assert.equal(strings.containsEmoji('a📚📚b'), true); + assert.equal(strings.containsEmoji('1F600 # 😀 grinning face'), true); + assert.equal(strings.containsEmoji('1F47E # 👾 alien monster'), true); + assert.equal(strings.containsEmoji('1F467 1F3FD # 👧🽠girl: medium skin tone'), true); + assert.equal(strings.containsEmoji('26EA # ⛪ church'), true); + assert.equal(strings.containsEmoji('231B # ⌛ hourglass'), true); + assert.equal(strings.containsEmoji('2702 # ✂ scissors'), true); + assert.equal(strings.containsEmoji('1F1F7 1F1F4 # 🇷🇴 Romania'), true); + }); + // test('containsRTL speed', () => { // var SIZE = 1000000; // var REPEAT = 10; @@ -306,4 +324,17 @@ suite('Strings', () => { assert(!regExpWithFlags.ignoreCase); assert(regExpWithFlags.multiline); }); + + test('getLeadingWhitespace', () => { + assert.equal(strings.getLeadingWhitespace(' foo'), ' '); + assert.equal(strings.getLeadingWhitespace(' foo', 2), ''); + assert.equal(strings.getLeadingWhitespace(' foo', 1, 1), ''); + assert.equal(strings.getLeadingWhitespace(' foo', 0, 1), ' '); + assert.equal(strings.getLeadingWhitespace(' '), ' '); + assert.equal(strings.getLeadingWhitespace(' ', 1), ' '); + assert.equal(strings.getLeadingWhitespace(' ', 0, 1), ' '); + assert.equal(strings.getLeadingWhitespace('\t\tfunction foo(){', 0, 1), '\t'); + assert.equal(strings.getLeadingWhitespace('\t\tfunction foo(){', 0, 2), '\t\t'); + + }); }); diff --git a/src/vs/base/test/node/glob.test.ts b/src/vs/base/test/node/glob.test.ts index c48e8a3edf7..eb9ee5e8756 100644 --- a/src/vs/base/test/node/glob.test.ts +++ b/src/vs/base/test/node/glob.test.ts @@ -15,12 +15,12 @@ suite('Glob', () => { // let patterns = [ // '{**/*.cs,**/*.json,**/*.csproj,**/*.sln}', // '{**/*.cs,**/*.csproj,**/*.sln}', - // '{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.es6}', + // '{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.es6,**/*.mjs}', // '**/*.go', // '{**/*.ps,**/*.ps1}', // '{**/*.c,**/*.cpp,**/*.h}', // '{**/*.fsx,**/*.fsi,**/*.fs,**/*.ml,**/*.mli}', - // '{**/*.js,**/*.jsx,**/*.es6}', + // '{**/*.js,**/*.jsx,**/*.es6,**/*.mjs}', // '{**/*.ts,**/*.tsx}', // '{**/*.php}', // '{**/*.php}', diff --git a/src/vs/base/worker/workerMain.ts b/src/vs/base/worker/workerMain.ts index f80f9d44e16..9bf45f0b202 100644 --- a/src/vs/base/worker/workerMain.ts +++ b/src/vs/base/worker/workerMain.ts @@ -18,7 +18,7 @@ catchError: true }); - let loadCode = function (moduleId) { + let loadCode = function (moduleId: string) { require([moduleId], function (ws) { setTimeout(function () { let messageHandler = ws.create((msg: any) => { diff --git a/src/vs/code/electron-browser/sharedProcess.js b/src/vs/code/electron-browser/sharedProcess.js index 835eeee1330..992872ba260 100644 --- a/src/vs/code/electron-browser/sharedProcess.js +++ b/src/vs/code/electron-browser/sharedProcess.js @@ -83,12 +83,10 @@ function main() { window.MonacoEnvironment = {}; - const nodeCachedDataErrors = window.MonacoEnvironment.nodeCachedDataErrors = []; require.config({ baseUrl: rootUrl, 'vs/nls': nlsConfig, nodeCachedDataDir: configuration.nodeCachedDataDir, - onNodeCachedDataError: function (err) { nodeCachedDataErrors.push(err) }, nodeModules: [/*BUILD->INSERT_NODE_MODULES*/] }); diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 151d6ac5b20..f15971a75de 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -20,8 +20,6 @@ import { UpdateChannel } from 'vs/platform/update/common/updateIpc'; import { UpdateService } from 'vs/platform/update/electron-main/updateService'; import { Server as ElectronIPCServer } from 'vs/base/parts/ipc/electron-main/ipc.electron-main'; import { Server, connect, Client } from 'vs/base/parts/ipc/node/ipc.net'; -import { AskpassChannel } from 'vs/workbench/parts/git/common/gitIpc'; -import { GitAskpassService } from 'vs/workbench/parts/git/electron-main/askpassService'; import { SharedProcess } from 'vs/code/electron-main/sharedProcess'; import { Mutex } from 'windows-mutex'; import { LaunchService, LaunchChannel, ILaunchService } from './launch'; @@ -115,11 +113,15 @@ export class VSCodeApplication { }); ipc.on('vscode:fetchShellEnv', (event, windowId) => { - const win = BrowserWindow.fromId(windowId); + const { webContents } = BrowserWindow.fromId(windowId); getShellEnvironment().then(shellEnv => { - win.webContents.send('vscode:acceptShellEnv', shellEnv); + if (!webContents.isDestroyed()) { + webContents.send('vscode:acceptShellEnv', shellEnv); + } }, err => { - win.webContents.send('vscode:acceptShellEnv', {}); + if (!webContents.isDestroyed()) { + webContents.send('vscode:acceptShellEnv', {}); + } console.error('Error fetching shell env', err); }); }); @@ -138,11 +140,6 @@ export class VSCodeApplication { app.setAppUserModelId(product.win32AppUserModelId); } - // Register Main IPC connections - const askpassService = new GitAskpassService(); - const askpassChannel = new AskpassChannel(askpassService); - this.mainIpcServer.registerChannel('askpass', askpassChannel); - // Create Electron IPC Server this.electronIpcServer = new ElectronIPCServer(); @@ -272,4 +269,4 @@ export class VSCodeApplication { private dispose(): void { this.toDispose = dispose(this.toDispose); } -} \ No newline at end of file +} diff --git a/src/vs/code/electron-main/lifecycle.ts b/src/vs/code/electron-main/lifecycle.ts index 7623a917086..895f8b05684 100644 --- a/src/vs/code/electron-main/lifecycle.ts +++ b/src/vs/code/electron-main/lifecycle.ts @@ -17,10 +17,10 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' export const ILifecycleService = createDecorator('lifecycleService'); export enum UnloadReason { - CLOSE, - QUIT, - RELOAD, - LOAD + CLOSE = 1, + QUIT = 2, + RELOAD = 3, + LOAD = 4 } export interface ILifecycleService { @@ -264,4 +264,4 @@ export class LifecycleService implements ILifecycleService { public isQuitRequested(): boolean { return !!this.quitRequested; } -} \ No newline at end of file +} diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index e76e0685b51..8294cc1f22b 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -199,4 +199,16 @@ function main() { }).done(null, err => instantiationService.invokeFunction(quit, err)); } -main(); \ No newline at end of file +// Get going once we are ready +// TODO@Joh,Joao there more more potential here +// we should check for other instances etc while +// waiting for getting ready +if (app.isReady()) { + global.perfAppReady = Date.now(); + main(); +} else { + app.once('ready', () => { + global.perfAppReady = Date.now(); + main(); + }); +} diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 52428d389ee..249722e754c 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -9,7 +9,7 @@ import * as nls from 'vs/nls'; import { isMacintosh, isLinux, isWindows, language } from 'vs/base/common/platform'; import * as arrays from 'vs/base/common/arrays'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ipcMain as ipc, app, shell, dialog, Menu, MenuItem } from 'electron'; +import { ipcMain as ipc, app, shell, dialog, Menu, MenuItem, BrowserWindow } from 'electron'; import { OpenContext } from 'vs/code/common/windows'; import { IWindowsMainService } from 'vs/code/electron-main/windows'; import { VSCodeWindow } from 'vs/code/electron-main/window'; @@ -37,6 +37,9 @@ interface IExtensionViewlet { } interface IConfiguration extends IFilesConfiguration { + window: { + enableMenuBarMnemonics: boolean; + }; workbench: { sideBar: { location: 'left' | 'right'; @@ -153,6 +156,7 @@ export class VSCodeMenu { private currentSidebarLocation: 'left' | 'right'; private currentStatusbarVisible: boolean; private currentActivityBarVisible: boolean; + private currentEnableMenuBarMnemonics: boolean; private isQuitting: boolean; private appMenuInstalled: boolean; @@ -252,6 +256,15 @@ export class VSCodeMenu { updateMenu = true; } + let newEnableMenuBarMnemonics = config && config.window && config.window.enableMenuBarMnemonics; + if (typeof newEnableMenuBarMnemonics !== 'boolean') { + newEnableMenuBarMnemonics = true; + } + if (newEnableMenuBarMnemonics !== this.currentEnableMenuBarMnemonics) { + this.currentEnableMenuBarMnemonics = newEnableMenuBarMnemonics; + updateMenu = true; + } + if (handleMenu && updateMenu) { this.updateMenu(); } @@ -298,32 +311,32 @@ export class VSCodeMenu { // File const fileMenu = new Menu(); - const fileMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mFile', comment: ['&& denotes a mnemonic'] }, "&&File")), submenu: fileMenu }); + const fileMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mFile', comment: ['&& denotes a mnemonic'] }, "&&File")), submenu: fileMenu }); this.setFileMenu(fileMenu); // Edit const editMenu = new Menu(); - const editMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mEdit', comment: ['&& denotes a mnemonic'] }, "&&Edit")), submenu: editMenu }); + const editMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mEdit', comment: ['&& denotes a mnemonic'] }, "&&Edit")), submenu: editMenu }); this.setEditMenu(editMenu); // Selection const selectionMenu = new Menu(); - const selectionMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mSelection', comment: ['&& denotes a mnemonic'] }, "&&Selection")), submenu: selectionMenu }); + const selectionMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mSelection', comment: ['&& denotes a mnemonic'] }, "&&Selection")), submenu: selectionMenu }); this.setSelectionMenu(selectionMenu); // View const viewMenu = new Menu(); - const viewMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mView', comment: ['&& denotes a mnemonic'] }, "&&View")), submenu: viewMenu }); + const viewMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mView', comment: ['&& denotes a mnemonic'] }, "&&View")), submenu: viewMenu }); this.setViewMenu(viewMenu); // Goto const gotoMenu = new Menu(); - const gotoMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mGoto', comment: ['&& denotes a mnemonic'] }, "&&Go")), submenu: gotoMenu }); + const gotoMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mGoto', comment: ['&& denotes a mnemonic'] }, "&&Go")), submenu: gotoMenu }); this.setGotoMenu(gotoMenu); // Debug const debugMenu = new Menu(); - const debugMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mDebug', comment: ['&& denotes a mnemonic'] }, "&&Debug")), submenu: debugMenu }); + const debugMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mDebug', comment: ['&& denotes a mnemonic'] }, "&&Debug")), submenu: debugMenu }); this.setDebugMenu(debugMenu); @@ -331,13 +344,13 @@ export class VSCodeMenu { let macWindowMenuItem: Electron.MenuItem; if (isMacintosh) { const windowMenu = new Menu(); - macWindowMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize('mWindow', "Window")), submenu: windowMenu, role: 'window' }); + macWindowMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize('mWindow', "Window")), submenu: windowMenu, role: 'window' }); this.setMacWindowMenu(windowMenu); } // Help const helpMenu = new Menu(); - const helpMenuItem = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'mHelp', comment: ['&& denotes a mnemonic'] }, "&&Help")), submenu: helpMenu, role: 'help' }); + const helpMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mHelp', comment: ['&& denotes a mnemonic'] }, "&&Help")), submenu: helpMenu, role: 'help' }); this.setHelpMenu(helpMenu); // Menu Structure @@ -365,7 +378,7 @@ export class VSCodeMenu { this.appMenuInstalled = true; const dockMenu = new Menu(); - dockMenu.append(new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")), click: () => this.windowsService.openNewWindow(OpenContext.DOCK) })); + dockMenu.append(new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")), click: () => this.windowsService.openNewWindow(OpenContext.DOCK) })); app.dock.setMenu(dockMenu); } @@ -375,6 +388,8 @@ export class VSCodeMenu { const about = new MenuItem({ label: nls.localize('mAbout', "About {0}", product.nameLong), role: 'about' }); const checkForUpdates = this.getUpdateMenuItems(); const preferences = this.getPreferencesMenu(); + const servicesMenu = new Menu(); + const services = new MenuItem({ label: nls.localize('mServices', "Services"), role: 'services', submenu: servicesMenu }); const hide = new MenuItem({ label: nls.localize('mHide', "Hide {0}", product.nameLong), role: 'hide', accelerator: 'Command+H' }); const hideOthers = new MenuItem({ label: nls.localize('mHideOthers', "Hide Others"), role: 'hideothers', accelerator: 'Command+Alt+H' }); const showAll = new MenuItem({ label: nls.localize('mShowAll', "Show All"), role: 'unhide' }); @@ -386,6 +401,8 @@ export class VSCodeMenu { __separator__(), preferences, __separator__(), + services, + __separator__(), hide, hideOthers, showAll, @@ -401,42 +418,42 @@ export class VSCodeMenu { let newFile: Electron.MenuItem; if (hasNoWindows) { - newFile = new MenuItem(this.likeAction('workbench.action.files.newUntitledFile', { label: mnemonicLabel(nls.localize({ key: 'miNewFile', comment: ['&& denotes a mnemonic'] }, "&&New File")), click: () => this.windowsService.openNewWindow(OpenContext.MENU) })); + newFile = new MenuItem(this.likeAction('workbench.action.files.newUntitledFile', { label: this.mnemonicLabel(nls.localize({ key: 'miNewFile', comment: ['&& denotes a mnemonic'] }, "&&New File")), click: () => this.windowsService.openNewWindow(OpenContext.MENU) })); } else { newFile = this.createMenuItem(nls.localize({ key: 'miNewFile', comment: ['&& denotes a mnemonic'] }, "&&New File"), 'workbench.action.files.newUntitledFile'); } - const open = new MenuItem(this.likeAction('workbench.action.files.openFileFolder', { label: mnemonicLabel(nls.localize({ key: 'miOpen', comment: ['&& denotes a mnemonic'] }, "&&Open...")), click: (menuItem, win, event) => this.windowsService.openFileFolderPicker(this.isOptionClick(event), { from: telemetryFrom }) })); - const openFolder = new MenuItem(this.likeAction('workbench.action.files.openFolder', { label: mnemonicLabel(nls.localize({ key: 'miOpenFolder', comment: ['&& denotes a mnemonic'] }, "Open &&Folder...")), click: (menuItem, win, event) => this.windowsService.openFolderPicker(this.isOptionClick(event), undefined, { from: telemetryFrom }) })); + const open = new MenuItem(this.likeAction('workbench.action.files.openFileFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpen', comment: ['&& denotes a mnemonic'] }, "&&Open...")), click: (menuItem, win, event) => this.windowsService.openFileFolderPicker(this.isOptionClick(event), { from: telemetryFrom }) })); + const openFolder = new MenuItem(this.likeAction('workbench.action.files.openFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFolder', comment: ['&& denotes a mnemonic'] }, "Open &&Folder...")), click: (menuItem, win, event) => this.windowsService.openFolderPicker(this.isOptionClick(event), undefined, { from: telemetryFrom }) })); let openFile: Electron.MenuItem; if (hasNoWindows) { - openFile = new MenuItem(this.likeAction('workbench.action.files.openFile', { label: mnemonicLabel(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File...")), click: (menuItem, win, event) => this.windowsService.openFilePicker(this.isOptionClick(event), undefined, undefined, { from: telemetryFrom }) })); + openFile = new MenuItem(this.likeAction('workbench.action.files.openFile', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File...")), click: (menuItem, win, event) => this.windowsService.openFilePicker(this.isOptionClick(event), undefined, undefined, { from: telemetryFrom }) })); } else { openFile = this.createMenuItem(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File..."), ['workbench.action.files.openFile', 'workbench.action.files.openFileInNewWindow']); } const openRecentMenu = new Menu(); this.setOpenRecentMenu(openRecentMenu); - const openRecent = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent")), submenu: openRecentMenu, enabled: openRecentMenu.items.length > 0 }); + const openRecent = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent")), submenu: openRecentMenu, enabled: openRecentMenu.items.length > 0 }); const saveFile = this.createMenuItem(nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save"), 'workbench.action.files.save', this.windowsService.getWindowCount() > 0); const saveFileAs = this.createMenuItem(nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As..."), 'workbench.action.files.saveAs', this.windowsService.getWindowCount() > 0); const saveAllFiles = this.createMenuItem(nls.localize({ key: 'miSaveAll', comment: ['&& denotes a mnemonic'] }, "Save A&&ll"), 'workbench.action.files.saveAll', this.windowsService.getWindowCount() > 0); const autoSaveEnabled = [AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE].some(s => this.currentAutoSaveSetting === s); - const autoSave = new MenuItem(this.likeAction('vscode.toggleAutoSave', { label: mnemonicLabel(nls.localize('miAutoSave', "Auto Save")), type: 'checkbox', checked: autoSaveEnabled, enabled: this.windowsService.getWindowCount() > 0, click: () => this.windowsService.sendToFocused('vscode.toggleAutoSave') }, false)); + const autoSave = new MenuItem(this.likeAction('vscode.toggleAutoSave', { label: this.mnemonicLabel(nls.localize('miAutoSave', "Auto Save")), type: 'checkbox', checked: autoSaveEnabled, enabled: this.windowsService.getWindowCount() > 0, click: () => this.windowsService.sendToFocused('vscode.toggleAutoSave') }, false)); const preferences = this.getPreferencesMenu(); - const newWindow = new MenuItem(this.likeAction('workbench.action.newWindow', { label: mnemonicLabel(nls.localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")), click: () => this.windowsService.openNewWindow(OpenContext.MENU) })); + const newWindow = new MenuItem(this.likeAction('workbench.action.newWindow', { label: this.mnemonicLabel(nls.localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")), click: () => this.windowsService.openNewWindow(OpenContext.MENU) })); const revertFile = this.createMenuItem(nls.localize({ key: 'miRevert', comment: ['&& denotes a mnemonic'] }, "Re&&vert File"), 'workbench.action.files.revert', this.windowsService.getWindowCount() > 0); - const closeWindow = new MenuItem(this.likeAction('workbench.action.closeWindow', { label: mnemonicLabel(nls.localize({ key: 'miCloseWindow', comment: ['&& denotes a mnemonic'] }, "Clos&&e Window")), click: () => this.windowsService.getLastActiveWindow().win.close(), enabled: this.windowsService.getWindowCount() > 0 })); + const closeWindow = new MenuItem(this.likeAction('workbench.action.closeWindow', { label: this.mnemonicLabel(nls.localize({ key: 'miCloseWindow', comment: ['&& denotes a mnemonic'] }, "Clos&&e Window")), click: () => this.windowsService.getLastActiveWindow().win.close(), enabled: this.windowsService.getWindowCount() > 0 })); const closeFolder = this.createMenuItem(nls.localize({ key: 'miCloseFolder', comment: ['&& denotes a mnemonic'] }, "Close &&Folder"), 'workbench.action.closeFolder'); const closeEditor = this.createMenuItem(nls.localize({ key: 'miCloseEditor', comment: ['&& denotes a mnemonic'] }, "&&Close Editor"), 'workbench.action.closeActiveEditor'); - const exit = new MenuItem(this.likeAction('workbench.action.quit', { label: mnemonicLabel(nls.localize({ key: 'miExit', comment: ['&& denotes a mnemonic'] }, "E&&xit")), click: () => this.windowsService.quit() })); + const exit = new MenuItem(this.likeAction('workbench.action.quit', { label: this.mnemonicLabel(nls.localize({ key: 'miExit', comment: ['&& denotes a mnemonic'] }, "E&&xit")), click: () => this.windowsService.quit() })); arrays.coalesce([ newFile, @@ -483,7 +500,7 @@ export class VSCodeMenu { preferencesMenu.append(colorThemeSelection); preferencesMenu.append(iconThemeSelection); - return new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miPreferences', comment: ['&& denotes a mnemonic'] }, "&&Preferences")), submenu: preferencesMenu }); + return new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miPreferences', comment: ['&& denotes a mnemonic'] }, "&&Preferences")), submenu: preferencesMenu }); } private setOpenRecentMenu(openRecentMenu: Electron.Menu): void { @@ -522,7 +539,7 @@ export class VSCodeMenu { } return new MenuItem(this.likeAction(commandId, { - label: unMnemonicLabel(label), click: (menuItem, win, event) => { + label: this.unmnemonicLabel(label), click: (menuItem, win, event) => { const openInNewWindow = this.isOptionClick(event); const success = !!this.windowsService.open({ context: OpenContext.MENU, cli: this.environmentService.args, pathsToOpen: [path], forceNewWindow: openInNewWindow }); if (!success) { @@ -538,7 +555,7 @@ export class VSCodeMenu { private createRoleMenuItem(label: string, commandId: string, role: Electron.MenuItemRole): Electron.MenuItem { const options: Electron.MenuItemOptions = { - label: mnemonicLabel(label), + label: this.mnemonicLabel(label), role, enabled: true }; @@ -642,8 +659,7 @@ export class VSCodeMenu { private setViewMenu(viewMenu: Electron.Menu): void { const explorer = this.createMenuItem(nls.localize({ key: 'miViewExplorer', comment: ['&& denotes a mnemonic'] }, "&&Explorer"), 'workbench.view.explorer'); const search = this.createMenuItem(nls.localize({ key: 'miViewSearch', comment: ['&& denotes a mnemonic'] }, "&&Search"), 'workbench.view.search'); - const git = this.createMenuItem(nls.localize({ key: 'miViewGit', comment: ['&& denotes a mnemonic'] }, "&&Git"), 'workbench.view.git'); - // const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm'); + const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm'); const debug = this.createMenuItem(nls.localize({ key: 'miViewDebug', comment: ['&& denotes a mnemonic'] }, "&&Debug"), 'workbench.view.debug'); const extensions = this.createMenuItem(nls.localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions"), 'workbench.view.extensions'); const output = this.createMenuItem(nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output"), 'workbench.action.output.toggleOutput'); @@ -659,12 +675,12 @@ export class VSCodeMenu { additionalViewletsMenu.append(this.createMenuItem(viewlet.label, viewlet.id)); }); - additionalViewlets = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miAdditionalViews', comment: ['&& denotes a mnemonic'] }, "Additional &&Views")), submenu: additionalViewletsMenu, enabled: true }); + additionalViewlets = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miAdditionalViews', comment: ['&& denotes a mnemonic'] }, "Additional &&Views")), submenu: additionalViewletsMenu, enabled: true }); } const commands = this.createMenuItem(nls.localize({ key: 'miCommandPalette', comment: ['&& denotes a mnemonic'] }, "&&Command Palette..."), 'workbench.action.showCommands'); - const fullscreen = new MenuItem(this.withKeybinding('workbench.action.toggleFullScreen', { label: mnemonicLabel(nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "Toggle &&Full Screen")), click: () => this.windowsService.getLastActiveWindow().toggleFullScreen(), enabled: this.windowsService.getWindowCount() > 0 })); + const fullscreen = new MenuItem(this.withKeybinding('workbench.action.toggleFullScreen', { label: this.mnemonicLabel(nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "Toggle &&Full Screen")), click: () => this.windowsService.getLastActiveWindow().toggleFullScreen(), enabled: this.windowsService.getWindowCount() > 0 })); const toggleZenMode = this.createMenuItem(nls.localize('miToggleZenMode', "Toggle Zen Mode"), 'workbench.action.toggleZenMode', this.windowsService.getWindowCount() > 0); const toggleMenuBar = this.createMenuItem(nls.localize({ key: 'miToggleMenuBar', comment: ['&& denotes a mnemonic'] }, "Toggle Menu &&Bar"), 'workbench.action.toggleMenuBar'); const splitEditor = this.createMenuItem(nls.localize({ key: 'miSplitEditor', comment: ['&& denotes a mnemonic'] }, "Split &&Editor"), 'workbench.action.splitEditor'); @@ -711,8 +727,7 @@ export class VSCodeMenu { __separator__(), explorer, search, - git, - // scm, + scm, debug, extensions, additionalViewlets, @@ -763,7 +778,7 @@ export class VSCodeMenu { previousEditorInGroup ].forEach(item => switchEditorMenu.append(item)); - const switchEditor = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miSwitchEditor', comment: ['&& denotes a mnemonic'] }, "Switch &&Editor")), submenu: switchEditorMenu, enabled: true }); + const switchEditor = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miSwitchEditor', comment: ['&& denotes a mnemonic'] }, "Switch &&Editor")), submenu: switchEditorMenu, enabled: true }); const switchGroupMenu = new Menu(); @@ -782,12 +797,14 @@ export class VSCodeMenu { previousGroup ].forEach(item => switchGroupMenu.append(item)); - const switchGroup = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miSwitchGroup', comment: ['&& denotes a mnemonic'] }, "Switch &&Group")), submenu: switchGroupMenu, enabled: true }); + const switchGroup = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miSwitchGroup', comment: ['&& denotes a mnemonic'] }, "Switch &&Group")), submenu: switchGroupMenu, enabled: true }); const gotoFile = this.createMenuItem(nls.localize({ key: 'miGotoFile', comment: ['&& denotes a mnemonic'] }, "Go to &&File..."), 'workbench.action.quickOpen'); const gotoSymbolInFile = this.createMenuItem(nls.localize({ key: 'miGotoSymbolInFile', comment: ['&& denotes a mnemonic'] }, "Go to &&Symbol in File..."), 'workbench.action.gotoSymbol'); const gotoSymbolInWorkspace = this.createMenuItem(nls.localize({ key: 'miGotoSymbolInWorkspace', comment: ['&& denotes a mnemonic'] }, "Go to Symbol in &&Workspace..."), 'workbench.action.showAllSymbols'); const gotoDefinition = this.createMenuItem(nls.localize({ key: 'miGotoDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Definition"), 'editor.action.goToDeclaration'); + const gotoTypeDefinition = this.createMenuItem(nls.localize({ key: 'miGotoTypeDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Type Definition"), 'editor.action.goToTypeDefinition'); + const goToImplementation = this.createMenuItem(nls.localize({ key: 'miGotoImplementation', comment: ['&& denotes a mnemonic'] }, "Go to &&Implementation"), 'editor.action.goToImplementation'); const gotoLine = this.createMenuItem(nls.localize({ key: 'miGotoLine', comment: ['&& denotes a mnemonic'] }, "Go to &&Line..."), 'workbench.action.gotoLine'); [ @@ -801,6 +818,8 @@ export class VSCodeMenu { gotoSymbolInFile, gotoSymbolInWorkspace, gotoDefinition, + gotoTypeDefinition, + goToImplementation, gotoLine ].forEach(item => gotoMenu.append(item)); } @@ -824,7 +843,7 @@ export class VSCodeMenu { breakpointsMenu.append(this.createMenuItem(nls.localize({ key: 'miConditionalBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&Conditional Breakpoint..."), 'editor.debug.action.conditionalBreakpoint')); breakpointsMenu.append(this.createMenuItem(nls.localize({ key: 'miColumnBreakpoint', comment: ['&& denotes a mnemonic'] }, "C&&olumn Breakpoint"), 'editor.debug.action.toggleColumnBreakpoint')); breakpointsMenu.append(this.createMenuItem(nls.localize({ key: 'miFunctionBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&Function Breakpoint..."), 'workbench.debug.viewlet.action.addFunctionBreakpointAction')); - const newBreakpoints = new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint")), submenu: breakpointsMenu }); + const newBreakpoints = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint")), submenu: breakpointsMenu }); const disableAllBreakpoints = this.createMenuItem(nls.localize({ key: 'miDisableAllBreakpoints', comment: ['&& denotes a mnemonic'] }, "Disable A&&ll Breakpoints"), 'workbench.debug.viewlet.action.disableAllBreakpoints'); const removeAllBreakpoints = this.createMenuItem(nls.localize({ key: 'miRemoveAllBreakpoints', comment: ['&& denotes a mnemonic'] }, "Remove &&All Breakpoints"), 'workbench.debug.viewlet.action.removeAllBreakpoints'); @@ -880,16 +899,16 @@ export class VSCodeMenu { private setHelpMenu(helpMenu: Electron.Menu): void { const toggleDevToolsItem = new MenuItem(this.likeAction('workbench.action.toggleDevTools', { - label: mnemonicLabel(nls.localize({ key: 'miToggleDevTools', comment: ['&& denotes a mnemonic'] }, "&&Toggle Developer Tools")), + label: this.mnemonicLabel(nls.localize({ key: 'miToggleDevTools', comment: ['&& denotes a mnemonic'] }, "&&Toggle Developer Tools")), click: () => this.toggleDevTools(), enabled: (this.windowsService.getWindowCount() > 0) })); const showAccessibilityOptions = new MenuItem(this.likeAction('accessibilityOptions', { - label: mnemonicLabel(nls.localize({ key: 'miAccessibilityOptions', comment: ['&& denotes a mnemonic'] }, "Accessibility &&Options")), + label: this.mnemonicLabel(nls.localize({ key: 'miAccessibilityOptions', comment: ['&& denotes a mnemonic'] }, "Accessibility &&Options")), accelerator: null, click: () => { - this.windowsService.openAccessibilityOptions(); + this.openAccessibilityOptions(); } }, false)); @@ -900,25 +919,26 @@ export class VSCodeMenu { if (this.windowsService.getWindowCount() > 0) { reportIssuesItem = this.createMenuItem(label, 'workbench.action.reportIssues'); } else { - reportIssuesItem = new MenuItem({ label: mnemonicLabel(label), click: () => this.openUrl(product.reportIssueUrl, 'openReportIssues') }); + reportIssuesItem = new MenuItem({ label: this.mnemonicLabel(label), click: () => this.openUrl(product.reportIssueUrl, 'openReportIssues') }); } } const keyboardShortcutsUrl = isLinux ? product.keyboardShortcutsUrlLinux : isMacintosh ? product.keyboardShortcutsUrlMac : product.keyboardShortcutsUrlWin; arrays.coalesce([ - new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miWelcome', comment: ['&& denotes a mnemonic'] }, "&&Welcome")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.showWelcomePage') }), - product.documentationUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miDocumentation', comment: ['&& denotes a mnemonic'] }, "&&Documentation")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openDocumentationUrl') }) : null, - product.releaseNotesUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'update.showCurrentReleaseNotes') }) : null, + new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miWelcome', comment: ['&& denotes a mnemonic'] }, "&&Welcome")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.showWelcomePage') }), + new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miInteractivePlayground', comment: ['&& denotes a mnemonic'] }, "&&Interactive Playground")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.showInteractivePlayground') }), + product.documentationUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miDocumentation', comment: ['&& denotes a mnemonic'] }, "&&Documentation")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openDocumentationUrl') }) : null, + product.releaseNotesUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'update.showCurrentReleaseNotes') }) : null, __separator__(), - keyboardShortcutsUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.keybindingsReference') }) : null, - product.introductoryVideosUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openIntroductoryVideosUrl') }) : null, + keyboardShortcutsUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.keybindingsReference') }) : null, + product.introductoryVideosUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openIntroductoryVideosUrl') }) : null, (product.introductoryVideosUrl || keyboardShortcutsUrl) ? __separator__() : null, - product.twitterUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join us on Twitter")), click: () => this.openUrl(product.twitterUrl, 'openTwitterUrl') }) : null, - product.requestFeatureUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")), click: () => this.openUrl(product.requestFeatureUrl, 'openUserVoiceUrl') }) : null, + product.twitterUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join us on Twitter")), click: () => this.openUrl(product.twitterUrl, 'openTwitterUrl') }) : null, + product.requestFeatureUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")), click: () => this.openUrl(product.requestFeatureUrl, 'openUserVoiceUrl') }) : null, reportIssuesItem, (product.twitterUrl || product.requestFeatureUrl || product.reportIssueUrl) ? __separator__() : null, product.licenseUrl ? new MenuItem({ - label: mnemonicLabel(nls.localize({ key: 'miLicense', comment: ['&& denotes a mnemonic'] }, "View &&License")), click: () => { + label: this.mnemonicLabel(nls.localize({ key: 'miLicense', comment: ['&& denotes a mnemonic'] }, "View &&License")), click: () => { if (language) { const queryArgChar = product.licenseUrl.indexOf('?') > 0 ? '&' : '?'; this.openUrl(`${product.licenseUrl}${queryArgChar}lang=${language}`, 'openLicenseUrl'); @@ -928,7 +948,7 @@ export class VSCodeMenu { } }) : null, product.privacyStatementUrl ? new MenuItem({ - label: mnemonicLabel(nls.localize({ key: 'miPrivacyStatement', comment: ['&& denotes a mnemonic'] }, "&&Privacy Statement")), click: () => { + label: this.mnemonicLabel(nls.localize({ key: 'miPrivacyStatement', comment: ['&& denotes a mnemonic'] }, "&&Privacy Statement")), click: () => { if (language) { const queryArgChar = product.licenseUrl.indexOf('?') > 0 ? '&' : '?'; this.openUrl(`${product.privacyStatementUrl}${queryArgChar}lang=${language}`, 'openPrivacyStatement'); @@ -950,10 +970,26 @@ export class VSCodeMenu { } helpMenu.append(__separator__()); - helpMenu.append(new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miAbout', comment: ['&& denotes a mnemonic'] }, "&&About")), click: () => this.openAboutDialog() })); + helpMenu.append(new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miAbout', comment: ['&& denotes a mnemonic'] }, "&&About")), click: () => this.openAboutDialog() })); } } + private openAccessibilityOptions(): void { + let win = new BrowserWindow({ + alwaysOnTop: true, + skipTaskbar: true, + resizable: false, + width: 450, + height: 300, + show: true, + title: nls.localize('accessibilityOptionsWindowTitle', "Accessibility Options") + }); + + win.setMenuBarVisibility(false); + + win.loadURL('chrome://accessibility'); + } + private getUpdateMenuItems(): Electron.MenuItem[] { switch (this.updateService.state) { case UpdateState.Uninitialized: @@ -1000,7 +1036,7 @@ export class VSCodeMenu { private createMenuItem(label: string, commandId: string | string[], enabled?: boolean, checked?: boolean): Electron.MenuItem; private createMenuItem(label: string, click: () => void, enabled?: boolean, checked?: boolean): Electron.MenuItem; private createMenuItem(arg1: string, arg2: any, arg3?: boolean, arg4?: boolean): Electron.MenuItem { - const label = mnemonicLabel(arg1); + const label = this.mnemonicLabel(arg1); const click: () => void = (typeof arg2 === 'function') ? arg2 : (menuItem, win, event) => { let commandId = arg2; if (Array.isArray(arg2)) { @@ -1033,7 +1069,7 @@ export class VSCodeMenu { private createDevToolsAwareMenuItem(label: string, commandId: string, devToolsFocusedFn: (contents: Electron.WebContents) => void): Electron.MenuItem { return new MenuItem(this.withKeybinding(commandId, { - label: mnemonicLabel(label), + label: this.mnemonicLabel(label), enabled: this.windowsService.getWindowCount() > 0, click: () => { const windowInFocus = this.windowsService.getFocusedWindow(); @@ -1128,24 +1164,24 @@ export class VSCodeMenu { private reportMenuActionTelemetry(id: string): void { this.telemetryService.publicLog('workbenchActionExecuted', { id, from: telemetryFrom }); } + + private mnemonicLabel(label: string): string { + if (isMacintosh || !this.currentEnableMenuBarMnemonics) { + return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac + } + + return label.replace(/&&/g, '&'); + } + + private unmnemonicLabel(label: string): string { + if (isMacintosh || !this.currentEnableMenuBarMnemonics) { + return label; // no mnemonic support on mac + } + + return label.replace(/&/g, '&&'); + } } function __separator__(): Electron.MenuItem { return new MenuItem({ type: 'separator' }); } - -function mnemonicLabel(label: string): string { - if (isMacintosh) { - return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac - } - - return label.replace(/&&/g, '&'); -} - -function unMnemonicLabel(label: string): string { - if (isMacintosh) { - return label; // no mnemonic support on mac - } - - return label.replace(/&/g, '&&'); -} diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 610420ef668..b4151b960d3 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -22,7 +22,7 @@ import product from 'vs/platform/node/product'; import { getCommonHTTPHeaders } from 'vs/platform/environment/node/http'; import { IWindowSettings, MenuBarVisibility } from 'vs/platform/windows/common/windows'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; - +import { KeyboardLayoutMonitor } from 'vs/code/node/keyboard'; export interface IWindowState { width?: number; @@ -30,6 +30,7 @@ export interface IWindowState { x?: number; y?: number; mode?: WindowMode; + display?: number; } export interface IWindowCreationOptions { @@ -41,7 +42,7 @@ export interface IWindowCreationOptions { export enum WindowMode { Maximized, Normal, - Minimized, + Minimized, // not used anymore, but also cannot remove due to existing stored UI state (needs migration) Fullscreen } @@ -78,9 +79,10 @@ export interface IWindowConfiguration extends ParsedArgs { userEnv: platform.IProcessEnvironment; /** - * The physical keyboard is of ISO type (on OSX) + * The physical keyboard is of ISO type (on OSX). */ isISOKeyboard?: boolean; + zoomLevel?: number; fullscreen?: boolean; highContrast?: boolean; @@ -243,14 +245,14 @@ export class VSCodeWindow { } if (isFullscreenOrMaximized) { - this.win.maximize(); + this._win.maximize(); if (this.currentWindowMode === WindowMode.Fullscreen) { - this.win.setFullScreen(true); + this._win.setFullScreen(true); } - if (!this.win.isVisible()) { - this.win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize + if (!this._win.isVisible()) { + this._win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize } } @@ -385,13 +387,13 @@ export class VSCodeWindow { } // To prevent flashing, we set the window visible after the page has finished to load but before VSCode is loaded - if (!this.win.isVisible()) { + if (!this._win.isVisible()) { if (this.currentWindowMode === WindowMode.Maximized) { - this.win.maximize(); + this._win.maximize(); } - if (!this.win.isVisible()) { // maximize also makes visible - this.win.show(); + if (!this._win.isVisible()) { // maximize also makes visible + this._win.show(); } } }); @@ -553,6 +555,9 @@ export class VSCodeWindow { windowConfiguration.highContrast = platform.isWindows && systemPreferences.isInvertedColorScheme() && (!windowConfig || windowConfig.autoDetectHighContrast); windowConfiguration.accessibilitySupport = app.isAccessibilitySupportEnabled(); + // Set Keyboard Config + windowConfiguration.isISOKeyboard = KeyboardLayoutMonitor.INSTANCE.isISOKeyboard(); + // Theme windowConfiguration.baseTheme = this.getBaseTheme(); windowConfiguration.backgroundColor = this.getBackgroundColor(); @@ -599,9 +604,15 @@ export class VSCodeWindow { } public serializeWindowState(): IWindowState { - if (this.win.isFullScreen()) { + + // fullscreen gets special treatment + if (this._win.isFullScreen()) { + const display = screen.getDisplayMatching(this.getBounds()); + return { mode: WindowMode.Fullscreen, + display: display ? display.id : void 0, + // still carry over window dimensions from previous sessions! width: this.windowState.width, height: this.windowState.height, @@ -614,10 +625,8 @@ export class VSCodeWindow { let mode: WindowMode; // get window mode - if (!platform.isMacintosh && this.win.isMaximized()) { + if (!platform.isMacintosh && this._win.isMaximized()) { mode = WindowMode.Maximized; - } else if (this.win.isMinimized()) { - mode = WindowMode.Minimized; } else { mode = WindowMode.Normal; } @@ -625,19 +634,18 @@ export class VSCodeWindow { // we don't want to save minimized state, only maximized or normal if (mode === WindowMode.Maximized) { state.mode = WindowMode.Maximized; - } else if (mode !== WindowMode.Minimized) { + } else { state.mode = WindowMode.Normal; } // only consider non-minimized window states if (mode === WindowMode.Normal || mode === WindowMode.Maximized) { - const pos = this.win.getPosition(); - const size = this.win.getSize(); + const bounds = this.getBounds(); - state.x = pos[0]; - state.y = pos[1]; - state.width = size[0]; - state.height = size[1]; + state.x = bounds.x; + state.y = bounds.y; + state.width = bounds.width; + state.height = bounds.height; } return state; @@ -713,7 +721,19 @@ export class VSCodeWindow { return state; } - // Multi Monitor: be less strict because metrics can be crazy + // Multi Montior (fullscreen): try to find the previously used display + if (state.display && state.mode === WindowMode.Fullscreen) { + const display = displays.filter(d => d.id === state.display)[0]; + if (display && display.bounds && typeof display.bounds.x === 'number' && typeof display.bounds.y === 'number') { + const defaults = defaultWindowState(WindowMode.Fullscreen); // make sure we have good values when the user restores the window + defaults.x = display.bounds.x; // carefull to use displays x/y position so that the window ends up on the correct monitor + defaults.y = display.bounds.y; + + return defaults; + } + } + + // Multi Monitor (non-fullscreen): be less strict because metrics can be crazy const bounds = { x: state.x, y: state.y, width: state.width, height: state.height }; const display = screen.getDisplayMatching(bounds); if (display && display.bounds.x + display.bounds.width > bounds.x && display.bounds.y + display.bounds.height > bounds.y) { @@ -732,17 +752,17 @@ export class VSCodeWindow { } public getBounds(): Electron.Rectangle { - const pos = this.win.getPosition(); - const dimension = this.win.getSize(); + const pos = this._win.getPosition(); + const dimension = this._win.getSize(); return { x: pos[0], y: pos[1], width: dimension[0], height: dimension[1] }; } public toggleFullScreen(): void { - const willBeFullScreen = !this.win.isFullScreen(); + const willBeFullScreen = !this._win.isFullScreen(); // set fullscreen flag on window - this.win.setFullScreen(willBeFullScreen); + this._win.setFullScreen(willBeFullScreen); // respect configured menu bar visibility or default to toggle if not set this.setMenuBarVisibility(this.currentMenuBarVisibility, false); @@ -767,22 +787,22 @@ export class VSCodeWindow { return; // ignore for macOS platform } - const isFullscreen = this.win.isFullScreen(); + const isFullscreen = this._win.isFullScreen(); switch (visibility) { case ('default'): - this.win.setMenuBarVisibility(!isFullscreen); - this.win.setAutoHideMenuBar(isFullscreen); + this._win.setMenuBarVisibility(!isFullscreen); + this._win.setAutoHideMenuBar(isFullscreen); break; case ('visible'): - this.win.setMenuBarVisibility(true); - this.win.setAutoHideMenuBar(false); + this._win.setMenuBarVisibility(true); + this._win.setAutoHideMenuBar(false); break; case ('toggle'): - this.win.setMenuBarVisibility(false); - this.win.setAutoHideMenuBar(true); + this._win.setMenuBarVisibility(false); + this._win.setAutoHideMenuBar(true); if (notify) { this.send('vscode:showInfoMessage', nls.localize('hiddenMenuBar', "You can still access the menu bar by pressing the **Alt** key.")); @@ -796,13 +816,40 @@ export class VSCodeWindow { // fact that we want to hide the menu without being able to bring it back via Alt key makes Electron // still show the menu. Unable to reproduce from a simple Hello World application though... setTimeout(() => { - this.win.setMenuBarVisibility(false); - this.win.setAutoHideMenuBar(false); + this._win.setMenuBarVisibility(false); + this._win.setAutoHideMenuBar(false); }); break; }; } + public onWindowTitleDoubleClick(): void { + + // Respect system settings on mac with regards to title click on windows title + if (platform.isMacintosh) { + const action = systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string'); + switch (action) { + case 'Minimize': + this.win.minimize(); + break; + case 'None': + break; + case 'Maximize': + default: + this.win.maximize(); + } + } + + // Linux/Windows: just toggle maximize/minimized state + else { + if (this.win.isMaximized()) { + this.win.unmaximize(); + } else { + this.win.maximize(); + } + } + } + public sendWhenReady(channel: string, ...args: any[]): void { this.ready().then(() => { this.send(channel, ...args); diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 6fdb5efa1f4..cc0800f25e6 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -31,8 +31,7 @@ import product from 'vs/platform/node/product'; import { OpenContext } from 'vs/code/common/windows'; import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; import { isParent, isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; -import * as nativeKeymap from 'native-keymap'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { KeyboardLayoutMonitor } from 'vs/code/node/keyboard'; enum WindowError { UNRESPONSIVE, @@ -107,7 +106,6 @@ export interface IWindowsMainService { openFileFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): void; openFilePicker(forceNewWindow?: boolean, path?: string, window?: VSCodeWindow, data?: ITelemetryData): void; openFolderPicker(forceNewWindow?: boolean, window?: VSCodeWindow, data?: ITelemetryData): void; - openAccessibilityOptions(): void; focusLastActive(cli: ParsedArgs, context: OpenContext): VSCodeWindow; getLastActiveWindow(): VSCodeWindow; findWindow(workspacePath: string, filePath?: string, extensionDevelopmentPath?: string): VSCodeWindow; @@ -177,6 +175,11 @@ export class WindowsManager implements IWindowsMainService { } private registerListeners(): void { + + app.on('accessibility-support-changed', (event: Event, accessibilitySupportEnabled: boolean) => { + this.sendToAll('vscode:accessibilitySupportChanged', accessibilitySupportEnabled); + }); + app.on('activate', (event: Event, hasVisibleWindows: boolean) => { this.logService.log('App#activate'); @@ -253,11 +256,8 @@ export class WindowsManager implements IWindowsMainService { this.lifecycleService.onBeforeWindowClose(win => this.onBeforeWindowClose(win)); this.lifecycleService.onBeforeQuit(() => this.onBeforeQuit()); - KeyboardLayoutMonitor.INSTANCE.onDidChangeKeyboardLayout((isISOKeyboard: boolean) => { - WindowsManager.WINDOWS.forEach((window) => { - window.sendWhenReady('vscode:keyboardLayoutChanged', isISOKeyboard); - }); - }); + // Keyboard layout changes + KeyboardLayoutMonitor.INSTANCE.onDidChangeKeyboardLayout(isISOKeyboard => this.sendToAll('vscode:keyboardLayoutChanged', isISOKeyboard)); } // Note that onBeforeQuit() and onBeforeWindowClose() are fired in different order depending on the OS: @@ -271,7 +271,7 @@ export class WindowsManager implements IWindowsMainService { const currentWindowsState: IWindowsState = { openedFolders: [], lastPluginDevelopmentHostWindow: this.windowsState.lastPluginDevelopmentHostWindow, - lastActiveWindow: this.lastClosedWindowState //will be set on Win/Linux if last window was closed, resulting in an exit + lastActiveWindow: this.lastClosedWindowState }; // 1.) Find a last active window (pick any other first window otherwise) @@ -333,12 +333,15 @@ export class WindowsManager implements IWindowsMainService { // On Windows and Linux closing the last window will trigger quit. Since we are storing all UI state // before quitting, we need to remember the UI state of this window to be able to persist it. - if (!platform.isMacintosh && this.getWindowCount() === 1) { + // On macOS we keep the last closed window state ready in case the user wants to quit right after or + // wants to open another window, in which case we use this state over the persisted one. + if (this.getWindowCount() === 1) { this.lastClosedWindowState = state; } } private onBroadcast(event: string, payload: any): void { + // Theme changes if (event === 'vscode:changeColorTheme' && typeof payload === 'string') { @@ -733,7 +736,6 @@ export class WindowsManager implements IWindowsMainService { configuration.filesToCreate = filesToCreate; configuration.filesToDiff = filesToDiff; configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir; - configuration.isISOKeyboard = KeyboardLayoutMonitor.INSTANCE.isISOKeyboard(); return configuration; } @@ -924,8 +926,9 @@ export class WindowsManager implements IWindowsMainService { // First Window const lastActive = this.getLastActiveWindow(); - if (!lastActive && this.windowsState.lastActiveWindow) { - return this.windowsState.lastActiveWindow.uiState; + const lastActiveState = this.lastClosedWindowState || this.windowsState.lastActiveWindow; + if (!lastActive && lastActiveState) { + return lastActiveState.uiState; } // @@ -1022,22 +1025,6 @@ export class WindowsManager implements IWindowsMainService { this.doPickAndOpen({ pickFolders: true, forceNewWindow, window }, 'openFolder', data); } - public openAccessibilityOptions(): void { - let win = new BrowserWindow({ - alwaysOnTop: true, - skipTaskbar: true, - resizable: false, - width: 450, - height: 300, - show: true, - title: nls.localize('accessibilityOptionsWindowTitle', "Accessibility Options") - }); - - win.setMenuBarVisibility(false); - - win.loadURL('chrome://accessibility'); - } - private doPickAndOpen(options: INativeOpenDialogOptions, eventName: string, data?: ITelemetryData): void { this.getFileOrFolderPaths(options, (paths: string[]) => { const nOfPaths = paths ? paths.length : 0; @@ -1204,6 +1191,10 @@ export class WindowsManager implements IWindowsMainService { detail: nls.localize('appStalledDetail', "You can reopen or close the window or keep waiting."), noLink: true }, result => { + if (!vscodeWindow.win) { + return; // Return early if the window has been going down already + } + if (result === 0) { vscodeWindow.reload(); } else if (result === 2) { @@ -1223,6 +1214,10 @@ export class WindowsManager implements IWindowsMainService { detail: nls.localize('appCrashedDetail', "We are sorry for the inconvenience! You can reopen the window to continue where you left off."), noLink: true }, result => { + if (!vscodeWindow.win) { + return; // Return early if the window has been going down already + } + if (result === 0) { vscodeWindow.reload(); } else if (result === 1) { @@ -1324,63 +1319,4 @@ export class WindowsManager implements IWindowsMainService { }, 10 /* delay to unwind callback stack (IPC) */); } } -} - -class KeyboardLayoutMonitor { - - public static INSTANCE = new KeyboardLayoutMonitor(); - - private _emitter: Emitter; - private _registered: boolean; - private _isISOKeyboard: boolean; - - private constructor() { - this._emitter = new Emitter(); - this._registered = false; - this._isISOKeyboard = this._readIsISOKeyboard(); - } - - public onDidChangeKeyboardLayout(callback: (isISOKeyboard: boolean) => void): IDisposable { - if (!this._registered) { - this._registered = true; - - nativeKeymap.onDidChangeKeyboardLayout(() => { - this._emitter.fire(this._isISOKeyboard); - }); - - if (platform.isMacintosh) { - // See https://github.com/Microsoft/vscode/issues/24153 - // On OSX, on ISO keyboards, Chromium swaps the scan codes - // of IntlBackslash and Backquote. - // - // The C++ methods can give the current keyboard type (ISO or not) - // only after a NSEvent was handled. - // - // We therefore poll. - setInterval(() => { - let newValue = this._readIsISOKeyboard(); - if (this._isISOKeyboard === newValue) { - // no change - return; - } - - this._isISOKeyboard = newValue; - this._emitter.fire(this._isISOKeyboard); - - }, 3000); - } - } - return this._emitter.event(callback); - } - - private _readIsISOKeyboard(): boolean { - if (platform.isMacintosh) { - return nativeKeymap.isISOKeyboard(); - } - return false; - } - - public isISOKeyboard(): boolean { - return this._isISOKeyboard; - } -} +} \ No newline at end of file diff --git a/src/vs/code/node/keyboard.ts b/src/vs/code/node/keyboard.ts new file mode 100644 index 00000000000..16979fc90c0 --- /dev/null +++ b/src/vs/code/node/keyboard.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * 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 nativeKeymap from 'native-keymap'; +import { IDisposable } from 'vs/base/common/lifecycle'; +import { isMacintosh } from 'vs/base/common/platform'; +import { Emitter } from 'vs/base/common/event'; + +export class KeyboardLayoutMonitor { + + public static readonly INSTANCE = new KeyboardLayoutMonitor(); + + private _emitter: Emitter; + private _registered: boolean; + private _isISOKeyboard: boolean; + + private constructor() { + this._emitter = new Emitter(); + this._registered = false; + this._isISOKeyboard = this._readIsISOKeyboard(); + } + + public onDidChangeKeyboardLayout(callback: (isISOKeyboard: boolean) => void): IDisposable { + if (!this._registered) { + this._registered = true; + + nativeKeymap.onDidChangeKeyboardLayout(() => { + this._emitter.fire(this._isISOKeyboard); + }); + + if (isMacintosh) { + // See https://github.com/Microsoft/vscode/issues/24153 + // On OSX, on ISO keyboards, Chromium swaps the scan codes + // of IntlBackslash and Backquote. + // + // The C++ methods can give the current keyboard type (ISO or not) + // only after a NSEvent was handled. + // + // We therefore poll. + setInterval(() => { + let newValue = this._readIsISOKeyboard(); + if (this._isISOKeyboard === newValue) { + // no change + return; + } + + this._isISOKeyboard = newValue; + this._emitter.fire(this._isISOKeyboard); + + }, 3000); + } + } + return this._emitter.event(callback); + } + + private _readIsISOKeyboard(): boolean { + if (isMacintosh) { + return nativeKeymap.isISOKeyboard(); + } + return false; + } + + public isISOKeyboard(): boolean { + return this._isISOKeyboard; + } +} diff --git a/src/vs/editor/browser/codeEditor.ts b/src/vs/editor/browser/codeEditor.ts index 721d90d9bdd..77271726ba2 100644 --- a/src/vs/editor/browser/codeEditor.ts +++ b/src/vs/editor/browser/codeEditor.ts @@ -13,6 +13,7 @@ import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; import { EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; import { EditorBrowserRegistry } from 'vs/editor/browser/editorBrowserExtensions'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; export class CodeEditor extends CodeEditorWidget { @@ -22,9 +23,10 @@ export class CodeEditor extends CodeEditorWidget { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IContextKeyService contextKeyService: IContextKeyService + @IContextKeyService contextKeyService: IContextKeyService, + @IThemeService themeService: IThemeService ) { - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, themeService); } protected _getContributions(): IEditorContributionCtor[] { diff --git a/src/vs/editor/browser/config/charWidthReader.ts b/src/vs/editor/browser/config/charWidthReader.ts index d1e0b07bf1e..6e5d782a037 100644 --- a/src/vs/editor/browser/config/charWidthReader.ts +++ b/src/vs/editor/browser/config/charWidthReader.ts @@ -77,6 +77,7 @@ class DomCharWidthReader implements ICharWidthReader { regularDomNode.style.fontWeight = this._bareFontInfo.fontWeight; regularDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px'; regularDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px'; + regularDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px'; container.appendChild(regularDomNode); let boldDomNode = document.createElement('div'); @@ -84,6 +85,7 @@ class DomCharWidthReader implements ICharWidthReader { boldDomNode.style.fontWeight = 'bold'; boldDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px'; boldDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px'; + boldDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px'; container.appendChild(boldDomNode); let italicDomNode = document.createElement('div'); @@ -91,6 +93,7 @@ class DomCharWidthReader implements ICharWidthReader { italicDomNode.style.fontWeight = this._bareFontInfo.fontWeight; italicDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px'; italicDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px'; + italicDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px'; italicDomNode.style.fontStyle = 'italic'; container.appendChild(italicDomNode); diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts index 23a4a86c292..960faa7b1e6 100644 --- a/src/vs/editor/browser/config/configuration.ts +++ b/src/vs/editor/browser/config/configuration.ts @@ -8,7 +8,7 @@ import Event, { Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; import * as browser from 'vs/base/browser/browser'; -import { CommonEditorConfiguration } from 'vs/editor/common/config/commonEditorConfig'; +import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; import { IDimension } from 'vs/editor/common/editorCommon'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver'; @@ -90,6 +90,7 @@ export interface ISerializedFontInfo { readonly fontWeight: string; readonly fontSize: number; readonly lineHeight: number; + readonly letterSpacing: number; readonly isMonospace: boolean; readonly typicalHalfwidthCharacterWidth: number; readonly typicalFullwidthCharacterWidth: number; @@ -102,7 +103,7 @@ class CSSBasedConfiguration extends Disposable { public static INSTANCE = new CSSBasedConfiguration(); private _cache: CSSBasedConfigurationCache; - private _changeMonitorTimeout: number = -1; + private _evictUntrustedReadingsTimeout: number; private _onDidChange = this._register(new Emitter()); public onDidChange: Event = this._onDidChange.event; @@ -111,16 +112,44 @@ class CSSBasedConfiguration extends Disposable { super(); this._cache = new CSSBasedConfigurationCache(); + this._evictUntrustedReadingsTimeout = -1; } public dispose(): void { - if (this._changeMonitorTimeout !== -1) { - clearTimeout(this._changeMonitorTimeout); - this._changeMonitorTimeout = -1; + if (this._evictUntrustedReadingsTimeout !== -1) { + clearTimeout(this._evictUntrustedReadingsTimeout); + this._evictUntrustedReadingsTimeout = -1; } super.dispose(); } + private _writeToCache(item: BareFontInfo, value: FontInfo): void { + this._cache.put(item, value); + + if (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) { + // Try reading again after some time + this._evictUntrustedReadingsTimeout = setTimeout(() => { + this._evictUntrustedReadingsTimeout = -1; + this._evictUntrustedReadings(); + }, 5000); + } + } + + private _evictUntrustedReadings(): void { + let values = this._cache.getValues(); + let somethingRemoved = false; + for (let i = 0, len = values.length; i < len; i++) { + let item = values[i]; + if (!item.isTrusted) { + somethingRemoved = true; + this._cache.remove(item); + } + } + if (somethingRemoved) { + this._onDidChange.fire(); + } + } + public saveFontInfo(): ISerializedFontInfo[] { // Only save trusted font info (that has been measured in this running instance) return this._cache.getValues().filter(item => item.isTrusted); @@ -131,25 +160,8 @@ class CSSBasedConfiguration extends Disposable { // The reason for this is that a font might have been installed on the OS in the meantime. for (let i = 0, len = savedFontInfo.length; i < len; i++) { let fontInfo = new FontInfo(savedFontInfo[i], false); - this._cache.put(fontInfo, fontInfo); + this._writeToCache(fontInfo, fontInfo); } - - // Remove saved font info that does not have the trusted flag. - // (this forces it to be re-read). - setTimeout(() => { - let values = this._cache.getValues(); - let somethingRemoved = false; - for (let i = 0, len = values.length; i < len; i++) { - let item = values[i]; - if (!item.isTrusted) { - somethingRemoved = true; - this._cache.remove(item); - } - } - if (somethingRemoved) { - this._onDidChange.fire(); - } - }, 5000); } public readConfiguration(bareFontInfo: BareFontInfo): FontInfo { @@ -164,50 +176,20 @@ class CSSBasedConfiguration extends Disposable { fontWeight: readConfig.fontWeight, fontSize: readConfig.fontSize, lineHeight: readConfig.lineHeight, + letterSpacing: readConfig.letterSpacing, isMonospace: readConfig.isMonospace, typicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5), typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5), spaceWidth: Math.max(readConfig.spaceWidth, 5), maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5), - }, true); - this._installChangeMonitor(); + }, false); } - this._cache.put(bareFontInfo, readConfig); + this._writeToCache(bareFontInfo, readConfig); } return this._cache.get(bareFontInfo); } - private _installChangeMonitor(): void { - if (this._changeMonitorTimeout === -1) { - this._changeMonitorTimeout = setTimeout(() => { - this._changeMonitorTimeout = -1; - this._monitorForChanges(); - }, 500); - } - } - - private _monitorForChanges(): void { - let shouldInstallChangeMonitor = false; - let keys = this._cache.getKeys(); - for (let i = 0; i < keys.length; i++) { - let styling = keys[i]; - - let newValue = CSSBasedConfiguration._actualReadConfiguration(styling); - - if (newValue.typicalHalfwidthCharacterWidth <= 2 || newValue.typicalFullwidthCharacterWidth <= 2 || newValue.maxDigitWidth <= 2) { - // We still couldn't read the CSS config - shouldInstallChangeMonitor = true; - } else { - this._cache.put(styling, newValue); - this._onDidChange.fire(); - } - } - if (shouldInstallChangeMonitor) { - this._installChangeMonitor(); - } - } - private static createRequest(chr: string, type: CharWidthRequestType, all: CharWidthRequest[], monospace: CharWidthRequest[]): CharWidthRequest { let result = new CharWidthRequest(chr, type); all.push(result); @@ -278,18 +260,21 @@ class CSSBasedConfiguration extends Disposable { } } + // let's trust the zoom level only 2s after it was changed. + const canTrustBrowserZoomLevel = (browser.getTimeSinceLastZoomLevelChanged() > 2000); return new FontInfo({ zoomLevel: browser.getZoomLevel(), fontFamily: bareFontInfo.fontFamily, fontWeight: bareFontInfo.fontWeight, fontSize: bareFontInfo.fontSize, lineHeight: bareFontInfo.lineHeight, + letterSpacing: bareFontInfo.letterSpacing, isMonospace: isMonospace, typicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width, typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width, spaceWidth: space.width, maxDigitWidth: maxDigitWidth - }, true); + }, canTrustBrowserZoomLevel); } } @@ -300,6 +285,7 @@ export class Configuration extends CommonEditorConfiguration { domNode.style.fontWeight = fontInfo.fontWeight; domNode.style.fontSize = fontInfo.fontSize + 'px'; domNode.style.lineHeight = fontInfo.lineHeight + 'px'; + domNode.style.letterSpacing = fontInfo.letterSpacing + 'px'; } public static applyFontInfo(domNode: FastDomNode, fontInfo: BareFontInfo): void { @@ -307,18 +293,26 @@ export class Configuration extends CommonEditorConfiguration { domNode.setFontWeight(fontInfo.fontWeight); domNode.setFontSize(fontInfo.fontSize); domNode.setLineHeight(fontInfo.lineHeight); + domNode.setLetterSpacing(fontInfo.letterSpacing); } + private readonly _elementSizeObserver: ElementSizeObserver; + constructor(options: IEditorOptions, referenceDomElement: HTMLElement = null) { - super(options, new ElementSizeObserver(referenceDomElement, () => this._onReferenceDomElementSizeChanged())); + super(options); + + this._elementSizeObserver = this._register(new ElementSizeObserver(referenceDomElement, () => this._onReferenceDomElementSizeChanged())); this._register(CSSBasedConfiguration.INSTANCE.onDidChange(() => this._onCSSBasedConfigurationChanged())); - if (this._configWithDefaults.getEditorOptions().automaticLayout) { + if (this._validatedOptions.automaticLayout) { this._elementSizeObserver.startObserving(); } this._register(browser.onDidChangeZoomLevel(_ => this._recomputeOptions())); + this._register(browser.onDidChangeAccessibilitySupport(() => this._recomputeOptions())); + + this._recomputeOptions(); } private _onReferenceDomElementSizeChanged(): void { @@ -334,11 +328,10 @@ export class Configuration extends CommonEditorConfiguration { } public dispose(): void { - this._elementSizeObserver.dispose(); super.dispose(); } - protected _getEditorClassName(theme: string, fontLigatures: boolean, mouseStyle: 'text' | 'default' | 'copy'): string { + private _getExtraEditorClassName(): string { let extra = ''; if (browser.isIE) { extra += 'ie '; @@ -350,38 +343,23 @@ export class Configuration extends CommonEditorConfiguration { if (platform.isMacintosh) { extra += 'mac '; } - if (fontLigatures) { - extra += 'enable-ligatures '; - } - if (mouseStyle === 'default') { - extra += 'mouse-default '; - } else if (mouseStyle === 'copy') { - extra += 'mouse-copy '; - } - return 'monaco-editor ' + extra + theme; + return extra; } - protected getOuterWidth(): number { - return this._elementSizeObserver.getWidth(); - } - - protected getOuterHeight(): number { - return this._elementSizeObserver.getHeight(); - } - - protected _getCanUseTranslate3d(): boolean { - return browser.canUseTranslate3d(); - } - - protected _getPixelRatio(): number { - return browser.getPixelRatio(); + protected _getEnvConfiguration(): IEnvConfiguration { + return { + extraEditorClassName: this._getExtraEditorClassName(), + outerWidth: this._elementSizeObserver.getWidth(), + outerHeight: this._elementSizeObserver.getHeight(), + canUseTranslate3d: browser.canUseTranslate3d(), + emptySelectionClipboard: browser.isWebKit, + pixelRatio: browser.getPixelRatio(), + zoomLevel: browser.getZoomLevel(), + accessibilitySupport: browser.getAccessibilitySupport() + }; } protected readConfiguration(bareFontInfo: BareFontInfo): FontInfo { return CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo); } - - protected getZoomLevel(): number { - return browser.getZoomLevel(); - } } diff --git a/src/vs/editor/browser/config/elementSizeObserver.ts b/src/vs/editor/browser/config/elementSizeObserver.ts index ee21f6c21bd..bd8814cace9 100644 --- a/src/vs/editor/browser/config/elementSizeObserver.ts +++ b/src/vs/editor/browser/config/elementSizeObserver.ts @@ -6,9 +6,8 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IDimension } from 'vs/editor/common/editorCommon'; -import { IElementSizeObserver } from 'vs/editor/common/config/commonEditorConfig'; -export class ElementSizeObserver extends Disposable implements IElementSizeObserver { +export class ElementSizeObserver extends Disposable { private referenceDomElement: HTMLElement; private measureReferenceDomElementToken: number; diff --git a/src/vs/editor/browser/controller/input/textAreaWrapper.ts b/src/vs/editor/browser/controller/input/textAreaWrapper.ts deleted file mode 100644 index ab895c1831f..00000000000 --- a/src/vs/editor/browser/controller/input/textAreaWrapper.ts +++ /dev/null @@ -1,202 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 Event, { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as browser from 'vs/base/browser/browser'; -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IClipboardEvent, ICompositionEvent, IKeyboardEventWrapper, ITextAreaWrapper } from 'vs/editor/common/controller/textAreaState'; -import { FastDomNode } from 'vs/base/browser/fastDomNode'; - -class ClipboardEventWrapper implements IClipboardEvent { - - private _event: ClipboardEvent; - - constructor(event: ClipboardEvent) { - this._event = event; - } - - public canUseTextData(): boolean { - if (this._event.clipboardData) { - return true; - } - if ((window).clipboardData) { - return true; - } - return false; - } - - public setTextData(text: string, richText: string): void { - if (this._event.clipboardData) { - this._event.clipboardData.setData('text/plain', text); - if (richText !== null) { - this._event.clipboardData.setData('text/html', richText); - } - this._event.preventDefault(); - return; - } - - if ((window).clipboardData) { - (window).clipboardData.setData('Text', text); - this._event.preventDefault(); - return; - } - - throw new Error('ClipboardEventWrapper.setTextData: Cannot use text data!'); - } - - public getTextData(): string { - if (this._event.clipboardData) { - this._event.preventDefault(); - return this._event.clipboardData.getData('text/plain'); - } - - if ((window).clipboardData) { - this._event.preventDefault(); - return (window).clipboardData.getData('Text'); - } - - throw new Error('ClipboardEventWrapper.getTextData: Cannot use text data!'); - } -} - -class KeyboardEventWrapper implements IKeyboardEventWrapper { - - public _actual: IKeyboardEvent; - - constructor(actual: IKeyboardEvent) { - this._actual = actual; - } - - public equals(keybinding: number): boolean { - return this._actual.equals(keybinding); - } - - public preventDefault(): void { - this._actual.preventDefault(); - } - - public stopPropagation(): void { - this._actual.stopPropagation(); - } - - public isDefaultPrevented(): boolean { - if (this._actual.browserEvent) { - return this._actual.browserEvent.defaultPrevented; - } - return false; - } -} - -export class TextAreaWrapper extends Disposable implements ITextAreaWrapper { - - private _textArea: FastDomNode; - - private _onKeyDown = this._register(new Emitter()); - public onKeyDown: Event = this._onKeyDown.event; - - private _onKeyUp = this._register(new Emitter()); - public onKeyUp: Event = this._onKeyUp.event; - - private _onKeyPress = this._register(new Emitter()); - public onKeyPress: Event = this._onKeyPress.event; - - private _onCompositionStart = this._register(new Emitter()); - public onCompositionStart: Event = this._onCompositionStart.event; - - private _onCompositionUpdate = this._register(new Emitter()); - public onCompositionUpdate: Event = this._onCompositionUpdate.event; - - private _onCompositionEnd = this._register(new Emitter()); - public onCompositionEnd: Event = this._onCompositionEnd.event; - - private _onInput = this._register(new Emitter()); - public onInput: Event = this._onInput.event; - - private _onCut = this._register(new Emitter()); - public onCut: Event = this._onCut.event; - - private _onCopy = this._register(new Emitter()); - public onCopy: Event = this._onCopy.event; - - private _onPaste = this._register(new Emitter()); - public onPaste: Event = this._onPaste.event; - - constructor(_textArea: FastDomNode) { - super(); - this._textArea = _textArea; - - const textArea = this._textArea.domNode; - this._register(dom.addStandardDisposableListener(textArea, 'keydown', (e) => this._onKeyDown.fire(new KeyboardEventWrapper(e)))); - this._register(dom.addStandardDisposableListener(textArea, 'keyup', (e) => this._onKeyUp.fire(new KeyboardEventWrapper(e)))); - this._register(dom.addStandardDisposableListener(textArea, 'keypress', (e) => this._onKeyPress.fire(new KeyboardEventWrapper(e)))); - this._register(dom.addDisposableListener(textArea, 'compositionstart', (e) => this._onCompositionStart.fire(e))); - this._register(dom.addDisposableListener(textArea, 'compositionupdate', (e) => this._onCompositionUpdate.fire(e))); - this._register(dom.addDisposableListener(textArea, 'compositionend', (e) => this._onCompositionEnd.fire(e))); - this._register(dom.addDisposableListener(textArea, 'input', (e) => this._onInput.fire())); - this._register(dom.addDisposableListener(textArea, 'cut', (e: ClipboardEvent) => this._onCut.fire(new ClipboardEventWrapper(e)))); - this._register(dom.addDisposableListener(textArea, 'copy', (e: ClipboardEvent) => this._onCopy.fire(new ClipboardEventWrapper(e)))); - this._register(dom.addDisposableListener(textArea, 'paste', (e: ClipboardEvent) => this._onPaste.fire(new ClipboardEventWrapper(e)))); - } - - public get actual(): FastDomNode { - return this._textArea; - } - - public getValue(): string { - // console.log('current value: ' + this._textArea.value); - const textArea = this._textArea.domNode; - return textArea.value; - } - - public setValue(reason: string, value: string): void { - // console.log('reason: ' + reason + ', current value: ' + this._textArea.value + ' => new value: ' + value); - const textArea = this._textArea.domNode; - textArea.value = value; - } - - public getSelectionStart(): number { - const textArea = this._textArea.domNode; - return textArea.selectionStart; - } - - public getSelectionEnd(): number { - const textArea = this._textArea.domNode; - return textArea.selectionEnd; - } - - public setSelectionRange(selectionStart: number, selectionEnd: number): void { - const textArea = this._textArea.domNode; - const activeElement = document.activeElement; - if (activeElement === textArea) { - textArea.setSelectionRange(selectionStart, selectionEnd); - } else { - this._setSelectionRangeJumpy(selectionStart, selectionEnd); - } - } - - private _setSelectionRangeJumpy(selectionStart: number, selectionEnd: number): void { - const textArea = this._textArea.domNode; - try { - let scrollState = dom.saveParentsScrollTop(textArea); - textArea.focus(); - textArea.setSelectionRange(selectionStart, selectionEnd); - dom.restoreParentsScrollTop(textArea, scrollState); - } catch (e) { - // Sometimes IE throws when setting selection (e.g. textarea is off-DOM) - console.log('an error has been thrown!'); - } - } - - public isInOverwriteMode(): boolean { - // In IE, pressing Insert will bring the typing into overwrite mode - if (browser.isIE && document.queryCommandValue('OverWrite')) { - return true; - } - return false; - } -} diff --git a/src/vs/editor/browser/controller/keyboardHandler.ts b/src/vs/editor/browser/controller/keyboardHandler.ts deleted file mode 100644 index e138406fa13..00000000000 --- a/src/vs/editor/browser/controller/keyboardHandler.ts +++ /dev/null @@ -1,225 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 browser from 'vs/base/browser/browser'; -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { GlobalScreenReaderNVDA } from 'vs/editor/common/config/commonEditorConfig'; -import { TextAreaHandler } from 'vs/editor/common/controller/textAreaHandler'; -import { TextAreaStrategy } from 'vs/editor/common/controller/textAreaState'; -import { Range } from 'vs/editor/common/core/range'; -import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler'; -import { Configuration } from 'vs/editor/browser/config/configuration'; -import { ViewContext } from 'vs/editor/common/view/viewContext'; -import { HorizontalRange } from 'vs/editor/common/view/renderingContext'; -import { TextAreaWrapper } from 'vs/editor/browser/controller/input/textAreaWrapper'; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { FastDomNode } from 'vs/base/browser/fastDomNode'; -import { VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; -import { ViewController } from 'vs/editor/browser/view/viewController'; - -export interface IKeyboardHandlerHelper { - viewDomNode: FastDomNode; - textArea: FastDomNode; - visibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalRange; - getVerticalOffsetForLineNumber(lineNumber: number): number; -} - -class TextAreaVisiblePosition { - _textAreaVisiblePosition: void; - - public readonly top: number; - public readonly left: number; - - constructor(top: number, left: number) { - this.top = top; - this.left = left; - } -} -export class KeyboardHandler extends ViewEventHandler { - - private _context: ViewContext; - private viewController: ViewController; - private viewHelper: IKeyboardHandlerHelper; - private textArea: TextAreaWrapper; - private textAreaHandler: TextAreaHandler; - - private contentLeft: number; - private contentWidth: number; - private scrollLeft: number; - private scrollTop: number; - - private visiblePosition: TextAreaVisiblePosition; - - constructor(context: ViewContext, viewController: ViewController, viewHelper: IKeyboardHandlerHelper) { - super(); - - this._context = context; - this.viewController = viewController; - this.textArea = new TextAreaWrapper(viewHelper.textArea); - Configuration.applyFontInfo(this.textArea.actual, this._context.configuration.editor.fontInfo); - this.viewHelper = viewHelper; - this.visiblePosition = null; - - this.contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; - this.contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; - this.scrollLeft = 0; - this.scrollTop = 0; - - this.textAreaHandler = new TextAreaHandler(browser, this._getStrategy(), this.textArea, this._context.model); - - this._register(this.textAreaHandler.onKeyDown((e) => this.viewController.emitKeyDown(e._actual))); - this._register(this.textAreaHandler.onKeyUp((e) => this.viewController.emitKeyUp(e._actual))); - this._register(this.textAreaHandler.onPaste((e) => this.viewController.paste('keyboard', e.text, e.pasteOnNewLine))); - this._register(this.textAreaHandler.onCut((e) => this.viewController.cut('keyboard'))); - this._register(this.textAreaHandler.onType((e) => { - if (e.replaceCharCnt) { - this.viewController.replacePreviousChar('keyboard', e.text, e.replaceCharCnt); - } else { - this.viewController.type('keyboard', e.text); - } - })); - this._register(this.textAreaHandler.onCompositionStart((e) => { - const lineNumber = e.showAtLineNumber; - const column = e.showAtColumn; - - this._context.privateViewEventBus.emit(new viewEvents.ViewRevealRangeRequestEvent( - new Range(lineNumber, column, lineNumber, column), - VerticalRevealType.Simple, - true - )); - - // Find range pixel position - const visibleRange = this.viewHelper.visibleRangeForPositionRelativeToEditor(lineNumber, column); - - if (visibleRange) { - this.visiblePosition = new TextAreaVisiblePosition( - this.viewHelper.getVerticalOffsetForLineNumber(lineNumber), - visibleRange.left - ); - this.textArea.actual.setTop(this.visiblePosition.top - this.scrollTop); - this.textArea.actual.setLeft(this.contentLeft + this.visiblePosition.left - this.scrollLeft); - } - - // Show the textarea - this.textArea.actual.setHeight(this._context.configuration.editor.lineHeight); - this.viewHelper.viewDomNode.addClassName('ime-input'); - - this.viewController.compositionStart('keyboard'); - })); - - this._register(this.textAreaHandler.onCompositionUpdate((e) => { - if (browser.isEdgeOrIE) { - // Due to isEdgeOrIE (where the textarea was not cleared initially) - // we cannot assume the text consists only of the composited text - this.textArea.actual.setWidth(0); - } else { - // adjust width by its size - let canvasElem = document.createElement('canvas'); - let context = canvasElem.getContext('2d'); - let cs = dom.getComputedStyle(this.textArea.actual.domNode); - if (browser.isFirefox) { - // computedStyle.font is empty in Firefox... - context.font = `${cs.fontStyle} ${cs.fontVariant} ${cs.fontWeight} ${cs.fontStretch} ${cs.fontSize} / ${cs.lineHeight} ${cs.fontFamily}`; - let metrics = context.measureText(e.data); - this.textArea.actual.setWidth(metrics.width + 2); // +2 for Japanese... - } else { - context.font = cs.font; - let metrics = context.measureText(e.data); - this.textArea.actual.setWidth(metrics.width); - } - } - })); - - this._register(this.textAreaHandler.onCompositionEnd((e) => { - this.textArea.actual.unsetHeight(); - this.textArea.actual.unsetWidth(); - this.textArea.actual.setLeft(0); - this.textArea.actual.setTop(0); - this.viewHelper.viewDomNode.removeClassName('ime-input'); - - this.visiblePosition = null; - - this.viewController.compositionEnd('keyboard'); - })); - this._register(GlobalScreenReaderNVDA.onChange((value) => { - this.textAreaHandler.setStrategy(this._getStrategy()); - })); - - - this._context.addEventHandler(this); - } - - public dispose(): void { - this._context.removeEventHandler(this); - this.textAreaHandler.dispose(); - this.textArea.dispose(); - super.dispose(); - } - - private _getStrategy(): TextAreaStrategy { - if (GlobalScreenReaderNVDA.getValue()) { - return TextAreaStrategy.NVDA; - } - if (this._context.configuration.editor.viewInfo.experimentalScreenReader) { - return TextAreaStrategy.NVDA; - } - return TextAreaStrategy.IENarrator; - } - - public focusTextArea(): void { - this.textAreaHandler.focusTextArea(); - } - - // --- begin event handlers - - public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - // Give textarea same font size & line height as editor, for the IME case (when the textarea is visible) - if (e.fontInfo) { - Configuration.applyFontInfo(this.textArea.actual, this._context.configuration.editor.fontInfo); - } - if (e.viewInfo.experimentalScreenReader) { - this.textAreaHandler.setStrategy(this._getStrategy()); - } - if (e.layoutInfo) { - this.contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; - this.contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; - } - return false; - } - - private _lastCursorSelectionChanged: viewEvents.ViewCursorSelectionChangedEvent = null; - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - this._lastCursorSelectionChanged = e; - return false; - } - - public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean { - this.textAreaHandler.setHasFocus(e.isFocused); - return false; - } - - public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { - this.scrollLeft = e.scrollLeft; - this.scrollTop = e.scrollTop; - if (this.visiblePosition) { - this.textArea.actual.setTop(this.visiblePosition.top - this.scrollTop); - this.textArea.actual.setLeft(this.contentLeft + this.visiblePosition.left - this.scrollLeft); - } - return false; - } - - // --- end event handlers - - public writeToTextArea(): void { - if (this._lastCursorSelectionChanged) { - let e = this._lastCursorSelectionChanged; - this._lastCursorSelectionChanged = null; - this.textAreaHandler.setCursorSelections(e.selection, e.secondarySelections); - } - } - -} \ No newline at end of file diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index aaa0a3203e8..cc44acdd62d 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -10,7 +10,6 @@ import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import { Position } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler'; import { MouseTarget, MouseTargetFactory, IViewZoneData } from 'vs/editor/browser/controller/mouseTarget'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; @@ -22,7 +21,6 @@ import { StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; import { IViewCursorRenderData } from 'vs/editor/browser/viewParts/viewCursors/viewCursor'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel'; import { ViewController } from 'vs/editor/browser/view/viewController'; /** @@ -47,16 +45,6 @@ export interface IPointerHandlerHelper { focusTextArea(): void; - getScrollLeft(): number; - getScrollTop(): number; - - setScrollPosition(position: editorCommon.INewScrollPosition): void; - - isAfterLines(verticalOffset: number): boolean; - getLineNumberAtVerticalOffset(verticalOffset: number): number; - getVerticalOffsetForLineNumber(lineNumber: number): number; - getWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData; - /** * Get the last rendered information of the cursors. */ @@ -146,8 +134,8 @@ export class MouseHandler extends ViewEventHandler { } // --- begin event handlers - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - this._mouseDownOperation.onCursorSelectionChanged(e); + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { + this._mouseDownOperation.onCursorStateChanged(e); return false; } private _isFocused = false; @@ -277,20 +265,18 @@ export class MouseHandler extends ViewEventHandler { class MouseDownOperation extends Disposable { - private _context: ViewContext; - private _viewController: ViewController; - private _viewHelper: IPointerHandlerHelper; - private _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => editorBrowser.IMouseTarget; - private _getMouseColumn: (e: EditorMouseEvent) => number; + private readonly _context: ViewContext; + private readonly _viewController: ViewController; + private readonly _viewHelper: IPointerHandlerHelper; + private readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => editorBrowser.IMouseTarget; + private readonly _getMouseColumn: (e: EditorMouseEvent) => number; - private _mouseMoveMonitor: GlobalEditorMouseMoveMonitor; + private readonly _mouseMoveMonitor: GlobalEditorMouseMoveMonitor; + private readonly _onScrollTimeout: TimeoutTimer; + private readonly _mouseState: MouseDownState; private _currentSelection: Selection; - private _mouseState: MouseDownState; - - private _onScrollTimeout: TimeoutTimer; private _isActive: boolean; - private _lastMouseEvent: EditorMouseEvent; constructor( @@ -307,15 +293,13 @@ class MouseDownOperation extends Disposable { this._createMouseTarget = createMouseTarget; this._getMouseColumn = getMouseColumn; - this._currentSelection = new Selection(1, 1, 1, 1); + this._mouseMoveMonitor = this._register(new GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode)); + this._onScrollTimeout = this._register(new TimeoutTimer()); this._mouseState = new MouseDownState(); - this._onScrollTimeout = this._register(new TimeoutTimer()); + this._currentSelection = new Selection(1, 1, 1, 1); this._isActive = false; - this._lastMouseEvent = null; - - this._mouseMoveMonitor = this._register(new GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode)); } public dispose(): void { @@ -427,33 +411,35 @@ class MouseDownOperation extends Disposable { }, 10); } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): void { - this._currentSelection = e.selection; + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void { + this._currentSelection = e.selections[0]; } private _getPositionOutsideEditor(e: EditorMouseEvent): MouseTarget { const editorContent = e.editorPos; + const model = this._context.model; + const viewLayout = this._context.viewLayout; - let mouseColumn = this._getMouseColumn(e); + const mouseColumn = this._getMouseColumn(e); if (e.posy < editorContent.y) { - let aboveLineNumber = this._viewHelper.getLineNumberAtVerticalOffset(Math.max(this._viewHelper.getScrollTop() - (editorContent.y - e.posy), 0)); + let aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(Math.max(viewLayout.getScrollTop() - (editorContent.y - e.posy), 0)); return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(aboveLineNumber, 1)); } if (e.posy > editorContent.y + editorContent.height) { - let belowLineNumber = this._viewHelper.getLineNumberAtVerticalOffset(this._viewHelper.getScrollTop() + (e.posy - editorContent.y)); - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(belowLineNumber, this._context.model.getLineMaxColumn(belowLineNumber))); + let belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getScrollTop() + (e.posy - editorContent.y)); + return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber))); } - let possibleLineNumber = this._viewHelper.getLineNumberAtVerticalOffset(this._viewHelper.getScrollTop() + (e.posy - editorContent.y)); + let possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getScrollTop() + (e.posy - editorContent.y)); if (e.posx < editorContent.x) { return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, 1)); } if (e.posx > editorContent.x + editorContent.width) { - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, this._context.model.getLineMaxColumn(possibleLineNumber))); + return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber))); } return null; diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index 253c5bc8421..b91b491be6b 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -228,7 +228,7 @@ class HitTestContext { public getZoneAtCoord(mouseVerticalOffset: number): IViewZoneData { // The target is either a view zone or the empty space after the last view-line - let viewZoneWhitespace = this._viewHelper.getWhitespaceAtVerticalOffset(mouseVerticalOffset); + let viewZoneWhitespace = this._context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset); if (viewZoneWhitespace) { let viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2, @@ -268,7 +268,7 @@ class HitTestContext { } public getFullLineRangeAtCoord(mouseVerticalOffset: number): { range: EditorRange; isAfterLines: boolean; } { - if (this._viewHelper.isAfterLines(mouseVerticalOffset)) { + if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) { // Below the last line let lineNumber = this._context.model.getLineCount(); let maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); @@ -278,7 +278,7 @@ class HitTestContext { }; } - let lineNumber = this._viewHelper.getLineNumberAtVerticalOffset(mouseVerticalOffset); + let lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); let maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); return { range: new EditorRange(lineNumber, 1, lineNumber, maxLineColumn), @@ -287,15 +287,15 @@ class HitTestContext { } public getLineNumberAtVerticalOffset(mouseVerticalOffset: number): number { - return this._viewHelper.getLineNumberAtVerticalOffset(mouseVerticalOffset); + return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); } public isAfterLines(mouseVerticalOffset: number): boolean { - return this._viewHelper.isAfterLines(mouseVerticalOffset); + return this._context.viewLayout.isAfterLines(mouseVerticalOffset); } public getVerticalOffsetForLineNumber(lineNumber: number): number { - return this._viewHelper.getVerticalOffsetForLineNumber(lineNumber); + return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber); } public findAttribute(element: Element, attr: string): string { @@ -328,11 +328,11 @@ class HitTestContext { } public getScrollTop(): number { - return this._viewHelper.getScrollTop(); + return this._context.viewLayout.getScrollTop(); } public getScrollLeft(): number { - return this._viewHelper.getScrollLeft(); + return this._context.viewLayout.getScrollLeft(); } } @@ -649,7 +649,7 @@ export class MouseTargetFactory { public getMouseColumn(editorPos: EditorPagePosition, pos: PageCoordinates): number { let layoutInfo = this._context.configuration.editor.layoutInfo; - let mouseContentHorizontalOffset = this._viewHelper.getScrollLeft() + pos.x - editorPos.x - layoutInfo.contentLeft; + let mouseContentHorizontalOffset = this._context.viewLayout.getScrollLeft() + pos.x - editorPos.x - layoutInfo.contentLeft; return MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth); } diff --git a/src/vs/editor/browser/controller/pointerHandler.ts b/src/vs/editor/browser/controller/pointerHandler.ts index 96f6c014343..fdd809a2e1a 100644 --- a/src/vs/editor/browser/controller/pointerHandler.ts +++ b/src/vs/editor/browser/controller/pointerHandler.ts @@ -99,9 +99,10 @@ class MsPointerHandler extends MouseHandler implements IDisposable { } private _onGestureChange(e: IThrottledGestureEvent): void { - this.viewHelper.setScrollPosition({ - scrollLeft: this.viewHelper.getScrollLeft() - e.translationX, - scrollTop: this.viewHelper.getScrollTop() - e.translationY, + const viewLayout = this._context.viewLayout; + viewLayout.setScrollPosition({ + scrollLeft: viewLayout.getScrollLeft() - e.translationX, + scrollTop: viewLayout.getScrollTop() - e.translationY, }); } @@ -180,9 +181,10 @@ class StandardPointerHandler extends MouseHandler implements IDisposable { } private _onGestureChange(e: IThrottledGestureEvent): void { - this.viewHelper.setScrollPosition({ - scrollLeft: this.viewHelper.getScrollLeft() - e.translationX, - scrollTop: this.viewHelper.getScrollTop() - e.translationY, + const viewLayout = this._context.viewLayout; + viewLayout.setScrollPosition({ + scrollLeft: viewLayout.getScrollLeft() - e.translationX, + scrollTop: viewLayout.getScrollTop() - e.translationY, }); } @@ -225,9 +227,10 @@ class TouchHandler extends MouseHandler { } private onChange(e: GestureEvent): void { - this.viewHelper.setScrollPosition({ - scrollLeft: this.viewHelper.getScrollLeft() - e.translationX, - scrollTop: this.viewHelper.getScrollTop() - e.translationY, + const viewLayout = this._context.viewLayout; + viewLayout.setScrollPosition({ + scrollLeft: viewLayout.getScrollLeft() - e.translationX, + scrollTop: viewLayout.getScrollTop() - e.translationY, }); } } diff --git a/src/vs/editor/browser/controller/textAreaHandler.css b/src/vs/editor/browser/controller/textAreaHandler.css new file mode 100644 index 00000000000..19036f1115f --- /dev/null +++ b/src/vs/editor/browser/controller/textAreaHandler.css @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.monaco-editor .inputarea { + min-width: 0; + min-height: 0; + margin: 0; + padding: 0; + position: absolute; + outline: none !important; + resize: none; + border: none; + overflow: hidden; + color: transparent; + background-color: transparent; +} +/*.monaco-editor .inputarea { + position: fixed !important; + width: 800px !important; + height: 500px !important; + top: initial !important; + left: initial !important; + bottom: 0 !important; + right: 0 !important; + color: black !important; + background: white !important; + line-height: 15px !important; + font-size: 14px !important; +}*/ +.monaco-editor .inputarea.ime-input { + z-index: 10; +} diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts new file mode 100644 index 00000000000..e927fcb4ab1 --- /dev/null +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -0,0 +1,500 @@ +/*--------------------------------------------------------------------------------------------- + * 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 'vs/css!./textAreaHandler'; +import * as platform from 'vs/base/common/platform'; +import * as browser from 'vs/base/browser/browser'; +import { TextAreaInput, ITextAreaInputHost, IPasteData, ICompositionData } from 'vs/editor/browser/controller/textAreaInput'; +import { ISimpleModel, ITypeData, TextAreaState, PagedScreenReaderStrategy } from 'vs/editor/browser/controller/textAreaState'; +import { Range } from 'vs/editor/common/core/range'; +import { Selection } from 'vs/editor/common/core/selection'; +import { Position } from 'vs/editor/common/core/position'; +import { Configuration } from 'vs/editor/browser/config/configuration'; +import { ViewContext } from 'vs/editor/common/view/viewContext'; +import { HorizontalRange, RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; +import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; +import { ViewController } from 'vs/editor/browser/view/viewController'; +import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { PartFingerprints, PartFingerprint, ViewPart } from 'vs/editor/browser/view/viewPart'; +import { Margin } from 'vs/editor/browser/viewParts/margin/margin'; +import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers'; +import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; + +export interface ITextAreaHandlerHelper { + visibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalRange; +} + +class VisibleTextAreaData { + _visibleTextAreaBrand: void; + + public readonly top: number; + public readonly left: number; + public readonly width: number; + + constructor(top: number, left: number, width: number) { + this.top = top; + this.left = left; + this.width = width; + } + + public setWidth(width: number): VisibleTextAreaData { + return new VisibleTextAreaData(this.top, this.left, width); + } +} + +const canUseZeroSizeTextarea = (browser.isEdgeOrIE || browser.isFirefox); + +export class TextAreaHandler extends ViewPart { + + private readonly _viewController: ViewController; + private readonly _viewHelper: ITextAreaHandlerHelper; + + private _pixelRatio: number; + private _accessibilitySupport: platform.AccessibilitySupport; + private _contentLeft: number; + private _contentWidth: number; + private _contentHeight: number; + private _scrollLeft: number; + private _scrollTop: number; + private _fontInfo: BareFontInfo; + private _lineHeight: number; + private _emptySelectionClipboard: boolean; + + /** + * Defined only when the text area is visible (composition case). + */ + private _visibleTextArea: VisibleTextAreaData; + private _selections: Selection[]; + private _lastCopiedValue: string; + private _lastCopiedValueIsFromEmptySelection: boolean; + + public readonly textArea: FastDomNode; + public readonly textAreaCover: FastDomNode; + private readonly _textAreaInput: TextAreaInput; + + constructor(context: ViewContext, viewController: ViewController, viewHelper: ITextAreaHandlerHelper) { + super(context); + + this._viewController = viewController; + this._viewHelper = viewHelper; + + const conf = this._context.configuration.editor; + + this._pixelRatio = conf.pixelRatio; + this._accessibilitySupport = conf.accessibilitySupport; + this._contentLeft = conf.layoutInfo.contentLeft; + this._contentWidth = conf.layoutInfo.contentWidth; + this._contentHeight = conf.layoutInfo.contentHeight; + this._scrollLeft = 0; + this._scrollTop = 0; + this._fontInfo = conf.fontInfo; + this._lineHeight = conf.lineHeight; + this._emptySelectionClipboard = conf.emptySelectionClipboard; + + this._visibleTextArea = null; + this._selections = [new Selection(1, 1, 1, 1)]; + this._lastCopiedValue = null; + this._lastCopiedValueIsFromEmptySelection = false; + + // Text Area (The focus will always be in the textarea when the cursor is blinking) + this.textArea = createFastDomNode(document.createElement('textarea')); + PartFingerprints.write(this.textArea, PartFingerprint.TextArea); + this.textArea.setClassName('inputarea'); + this.textArea.setAttribute('wrap', 'off'); + this.textArea.setAttribute('autocorrect', 'off'); + this.textArea.setAttribute('autocapitalize', 'off'); + this.textArea.setAttribute('spellcheck', 'false'); + this.textArea.setAttribute('aria-label', conf.viewInfo.ariaLabel); + this.textArea.setAttribute('role', 'textbox'); + this.textArea.setAttribute('aria-multiline', 'true'); + this.textArea.setAttribute('aria-haspopup', 'false'); + this.textArea.setAttribute('aria-autocomplete', 'both'); + + this.textAreaCover = createFastDomNode(document.createElement('div')); + this.textAreaCover.setPosition('absolute'); + + const simpleModel: ISimpleModel = { + getLineCount: (): number => { + return this._context.model.getLineCount(); + }, + getLineMaxColumn: (lineNumber: number): number => { + return this._context.model.getLineMaxColumn(lineNumber); + }, + getValueInRange: (range: Range, eol: EndOfLinePreference): string => { + return this._context.model.getValueInRange(range, eol); + } + }; + + const textAreaInputHost: ITextAreaInputHost = { + getPlainTextToCopy: (): string => { + const whatToCopy = this._context.model.getPlainTextToCopy(this._selections, this._emptySelectionClipboard); + + if (this._emptySelectionClipboard) { + if (browser.isFirefox) { + // When writing "LINE\r\n" to the clipboard and then pasting, + // Firefox pastes "LINE\n", so let's work around this quirk + this._lastCopiedValue = whatToCopy.replace(/\r\n/g, '\n'); + } else { + this._lastCopiedValue = whatToCopy; + } + + let selections = this._selections; + this._lastCopiedValueIsFromEmptySelection = (selections.length === 1 && selections[0].isEmpty()); + } + + return whatToCopy; + }, + + getHTMLToCopy: (): string => { + return this._context.model.getHTMLToCopy(this._selections, this._emptySelectionClipboard); + }, + + getScreenReaderContent: (currentState: TextAreaState): TextAreaState => { + + if (browser.isIPad) { + // Do not place anything in the textarea for the iPad + return TextAreaState.EMPTY; + } + + if (this._accessibilitySupport === platform.AccessibilitySupport.Disabled) { + // We know for a fact that a screen reader is not attached + return TextAreaState.EMPTY; + } + + return PagedScreenReaderStrategy.fromEditorSelection(currentState, simpleModel, this._selections[0]); + } + }; + + this._textAreaInput = this._register(new TextAreaInput(textAreaInputHost, this.textArea)); + + this._register(this._textAreaInput.onKeyDown((e: IKeyboardEvent) => { + this._viewController.emitKeyDown(e); + })); + + this._register(this._textAreaInput.onKeyUp((e: IKeyboardEvent) => { + this._viewController.emitKeyUp(e); + })); + + this._register(this._textAreaInput.onPaste((e: IPasteData) => { + let pasteOnNewLine = false; + if (this._emptySelectionClipboard) { + pasteOnNewLine = (e.text === this._lastCopiedValue && this._lastCopiedValueIsFromEmptySelection); + } + this._viewController.paste('keyboard', e.text, pasteOnNewLine); + })); + + this._register(this._textAreaInput.onCut(() => { + this._viewController.cut('keyboard'); + })); + + this._register(this._textAreaInput.onType((e: ITypeData) => { + if (e.replaceCharCnt) { + this._viewController.replacePreviousChar('keyboard', e.text, e.replaceCharCnt); + } else { + this._viewController.type('keyboard', e.text); + } + })); + + this._register(this._textAreaInput.onCompositionStart(() => { + const lineNumber = this._selections[0].startLineNumber; + const column = this._selections[0].startColumn; + + this._context.privateViewEventBus.emit(new viewEvents.ViewRevealRangeRequestEvent( + new Range(lineNumber, column, lineNumber, column), + viewEvents.VerticalRevealType.Simple, + true + )); + + // Find range pixel position + const visibleRange = this._viewHelper.visibleRangeForPositionRelativeToEditor(lineNumber, column); + + if (visibleRange) { + this._visibleTextArea = new VisibleTextAreaData( + this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber), + visibleRange.left, + canUseZeroSizeTextarea ? 0 : 1 + ); + this._render(); + } + + // Show the textarea + this.textArea.setClassName('inputarea ime-input'); + + this._viewController.compositionStart('keyboard'); + })); + + this._register(this._textAreaInput.onCompositionUpdate((e: ICompositionData) => { + if (browser.isEdgeOrIE) { + // Due to isEdgeOrIE (where the textarea was not cleared initially) + // we cannot assume the text consists only of the composited text + this._visibleTextArea = this._visibleTextArea.setWidth(0); + } else { + // adjust width by its size + this._visibleTextArea = this._visibleTextArea.setWidth(measureText(e.data, this._fontInfo)); + } + this._render(); + })); + + this._register(this._textAreaInput.onCompositionEnd(() => { + + this._visibleTextArea = null; + this._render(); + + this.textArea.setClassName('inputarea'); + this._viewController.compositionEnd('keyboard'); + })); + + this._register(this._textAreaInput.onFocus(() => { + this._context.privateViewEventBus.emit(new viewEvents.ViewFocusChangedEvent(true)); + })); + + this._register(this._textAreaInput.onBlur(() => { + this._context.privateViewEventBus.emit(new viewEvents.ViewFocusChangedEvent(false)); + })); + } + + public dispose(): void { + super.dispose(); + } + + // --- begin event handlers + + public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { + const conf = this._context.configuration.editor; + + if (e.fontInfo) { + this._fontInfo = conf.fontInfo; + } + if (e.viewInfo) { + this.textArea.setAttribute('aria-label', conf.viewInfo.ariaLabel); + } + if (e.layoutInfo) { + this._contentLeft = conf.layoutInfo.contentLeft; + this._contentWidth = conf.layoutInfo.contentWidth; + this._contentHeight = conf.layoutInfo.contentHeight; + } + if (e.lineHeight) { + this._lineHeight = conf.lineHeight; + } + if (e.pixelRatio) { + this._pixelRatio = conf.pixelRatio; + } + if (e.accessibilitySupport) { + this._accessibilitySupport = conf.accessibilitySupport; + this._textAreaInput.writeScreenReaderContent('strategy changed'); + } + if (e.emptySelectionClipboard) { + this._emptySelectionClipboard = conf.emptySelectionClipboard; + } + + return true; + } + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { + this._selections = e.selections.slice(0); + this._textAreaInput.writeScreenReaderContent('selection changed'); + return true; + } + public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { + // true for inline decorations that can end up relayouting text + return true; + } + public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { + return true; + } + public onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean { + return true; + } + public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean { + return true; + } + public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { + return true; + } + public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { + this._scrollLeft = e.scrollLeft; + this._scrollTop = e.scrollTop; + return true; + } + public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean { + return true; + } + + // --- end event handlers + + // --- begin view API + + public isFocused(): boolean { + return this._textAreaInput.isFocused(); + } + + public focusTextArea(): void { + this._textAreaInput.focusTextArea(); + } + + public setAriaActiveDescendant(id: string): void { + if (id) { + this.textArea.setAttribute('role', 'combobox'); + if (this.textArea.getAttribute('aria-activedescendant') !== id) { + this.textArea.setAttribute('aria-haspopup', 'true'); + this.textArea.setAttribute('aria-activedescendant', id); + } + } else { + this.textArea.setAttribute('role', 'textbox'); + this.textArea.removeAttribute('aria-activedescendant'); + this.textArea.removeAttribute('aria-haspopup'); + } + } + + // --- end view API + + private _primaryCursorVisibleRange: HorizontalRange = null; + + public prepareRender(ctx: RenderingContext): void { + if (this._accessibilitySupport === platform.AccessibilitySupport.Enabled) { + // Do not move the textarea with the cursor, as this generates accessibility events that might confuse screen readers + // See https://github.com/Microsoft/vscode/issues/26730 + this._primaryCursorVisibleRange = null; + } else { + const primaryCursorPosition = new Position(this._selections[0].positionLineNumber, this._selections[0].positionColumn); + this._primaryCursorVisibleRange = ctx.visibleRangeForPosition(primaryCursorPosition); + } + } + + public render(ctx: RestrictedRenderingContext): void { + this._textAreaInput.writeScreenReaderContent('render'); + this._render(); + } + + private _render(): void { + if (this._visibleTextArea) { + // The text area is visible for composition reasons + this._renderInsideEditor( + this._visibleTextArea.top - this._scrollTop, + this._contentLeft + this._visibleTextArea.left - this._scrollLeft, + this._visibleTextArea.width, + this._lineHeight, + true + ); + return; + } + + if (!this._primaryCursorVisibleRange) { + // The primary cursor is outside the viewport => place textarea to the top left + this._renderAtTopLeft(); + return; + } + + const left = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft; + if (left < this._contentLeft || left > this._contentLeft + this._contentWidth) { + // cursor is outside the viewport + this._renderAtTopLeft(); + return; + } + + const top = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop; + if (top < 0 || top > this._contentHeight) { + // cursor is outside the viewport + this._renderAtTopLeft(); + return; + } + + // The primary cursor is in the viewport (at least vertically) => place textarea on the cursor + this._renderInsideEditor( + top, left, + canUseZeroSizeTextarea ? 0 : 1, canUseZeroSizeTextarea ? 0 : 1, + false + ); + } + + private _renderInsideEditor(top: number, left: number, width: number, height: number, useEditorFont: boolean): void { + const ta = this.textArea; + const tac = this.textAreaCover; + + if (useEditorFont) { + Configuration.applyFontInfo(ta, this._fontInfo); + } else { + ta.setFontSize(1); + // Chrome does not generate input events in empty textareas that end + // up having a line height smaller than 1 screen pixel. + ta.setLineHeight(Math.ceil(Math.max(this._pixelRatio, 1 / this._pixelRatio))); + } + + ta.setTop(top); + ta.setLeft(left); + ta.setWidth(width); + ta.setHeight(height); + + tac.setTop(0); + tac.setLeft(0); + tac.setWidth(0); + tac.setHeight(0); + } + + private _renderAtTopLeft(): void { + const ta = this.textArea; + const tac = this.textAreaCover; + + Configuration.applyFontInfo(ta, this._fontInfo); + ta.setTop(0); + ta.setLeft(0); + tac.setTop(0); + tac.setLeft(0); + + if (canUseZeroSizeTextarea) { + ta.setWidth(0); + ta.setHeight(0); + tac.setWidth(0); + tac.setHeight(0); + return; + } + + // (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea) + // specifically, when doing Korean IME, setting the textare to 0x0 breaks IME badly. + + ta.setWidth(1); + ta.setHeight(1); + tac.setWidth(1); + tac.setHeight(1); + + if (this._context.configuration.editor.viewInfo.glyphMargin) { + tac.setClassName('monaco-editor-background textAreaCover ' + Margin.CLASS_NAME); + } else { + if (this._context.configuration.editor.viewInfo.renderLineNumbers) { + tac.setClassName('monaco-editor-background textAreaCover ' + LineNumbersOverlay.CLASS_NAME); + } else { + tac.setClassName('monaco-editor-background textAreaCover'); + } + } + } +} + +function measureText(text: string, fontInfo: BareFontInfo): number { + // adjust width by its size + const canvasElem = document.createElement('canvas'); + const context = canvasElem.getContext('2d'); + context.font = createFontString(fontInfo); + const metrics = context.measureText(text); + + if (browser.isFirefox) { + return metrics.width + 2; // +2 for Japanese... + } else { + return metrics.width; + } +} + +function createFontString(bareFontInfo: BareFontInfo): string { + return doCreateFontString('normal', bareFontInfo.fontWeight, bareFontInfo.fontSize, bareFontInfo.lineHeight, bareFontInfo.fontFamily); +} + +function doCreateFontString(fontStyle: string, fontWeight: string, fontSize: number, lineHeight: number, fontFamily: string): string { + // The full font syntax is: + // style | variant | weight | stretch | size/line-height | fontFamily + // (https://developer.mozilla.org/en-US/docs/Web/CSS/font) + // But it appears Edge and IE11 cannot properly parse `stretch`. + return `${fontStyle} normal ${fontWeight} ${fontSize}px / ${lineHeight}px ${fontFamily}`; +} diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts new file mode 100644 index 00000000000..e1f99b036e8 --- /dev/null +++ b/src/vs/editor/browser/controller/textAreaInput.ts @@ -0,0 +1,468 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { RunOnceScheduler } from 'vs/base/common/async'; +import * as strings from 'vs/base/common/strings'; +import Event, { Emitter } from 'vs/base/common/event'; +import { KeyCode } from 'vs/base/common/keyCodes'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { ITypeData, TextAreaState, ITextAreaWrapper } from 'vs/editor/browser/controller/textAreaState'; +import * as browser from 'vs/base/browser/browser'; +import * as platform from 'vs/base/common/platform'; +import * as dom from 'vs/base/browser/dom'; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { FastDomNode } from 'vs/base/browser/fastDomNode'; + +export interface ICompositionData { + data: string; +} + +export const CopyOptions = { + forceCopyWithSyntaxHighlighting: false +}; + +const enum ReadFromTextArea { + Type, + Paste +} + +export interface IPasteData { + text: string; +} + +export interface ITextAreaInputHost { + getPlainTextToCopy(): string; + getHTMLToCopy(): string; + getScreenReaderContent(currentState: TextAreaState): TextAreaState; +} + +/** + * Writes screen reader content to the textarea and is able to analyze its input events to generate: + * - onCut + * - onPaste + * - onType + * + * Composition events are generated for presentation purposes (composition input is reflected in onType). + */ +export class TextAreaInput extends Disposable { + + private _onFocus = this._register(new Emitter()); + public onFocus: Event = this._onFocus.event; + + private _onBlur = this._register(new Emitter()); + public onBlur: Event = this._onBlur.event; + + private _onKeyDown = this._register(new Emitter()); + public onKeyDown: Event = this._onKeyDown.event; + + private _onKeyUp = this._register(new Emitter()); + public onKeyUp: Event = this._onKeyUp.event; + + private _onCut = this._register(new Emitter()); + public onCut: Event = this._onCut.event; + + private _onPaste = this._register(new Emitter()); + public onPaste: Event = this._onPaste.event; + + private _onType = this._register(new Emitter()); + public onType: Event = this._onType.event; + + private _onCompositionStart = this._register(new Emitter()); + public onCompositionStart: Event = this._onCompositionStart.event; + + private _onCompositionUpdate = this._register(new Emitter()); + public onCompositionUpdate: Event = this._onCompositionUpdate.event; + + private _onCompositionEnd = this._register(new Emitter()); + public onCompositionEnd: Event = this._onCompositionEnd.event; + + // --- + + private readonly _host: ITextAreaInputHost; + private readonly _textArea: TextAreaWrapper; + private readonly _asyncTriggerCut: RunOnceScheduler; + + private _textAreaState: TextAreaState; + + private _hasFocus: boolean; + private _isDoingComposition: boolean; + private _nextCommand: ReadFromTextArea; + + constructor(host: ITextAreaInputHost, textArea: FastDomNode) { + super(); + this._host = host; + this._textArea = this._register(new TextAreaWrapper(textArea)); + this._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0)); + + this._textAreaState = TextAreaState.EMPTY; + this.writeScreenReaderContent('ctor'); + + this._hasFocus = false; + this._isDoingComposition = false; + this._nextCommand = ReadFromTextArea.Type; + + this._register(dom.addStandardDisposableListener(textArea.domNode, 'keydown', (e: IKeyboardEvent) => { + if (this._isDoingComposition && e.equals(KeyCode.KEY_IN_COMPOSITION)) { + // Stop propagation for keyDown events if the IME is processing key input + e.stopPropagation(); + } + + if (e.equals(KeyCode.Escape)) { + // Prevent default always for `Esc`, otherwise it will generate a keypress + // See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx + e.preventDefault(); + } + this._onKeyDown.fire(e); + })); + + this._register(dom.addStandardDisposableListener(textArea.domNode, 'keyup', (e: IKeyboardEvent) => { + this._onKeyUp.fire(e); + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'compositionstart', (e: CompositionEvent) => { + if (this._isDoingComposition) { + return; + } + this._isDoingComposition = true; + + // In IE we cannot set .value when handling 'compositionstart' because the entire composition will get canceled. + if (!browser.isEdgeOrIE) { + this._setAndWriteTextAreaState('compositionstart', TextAreaState.EMPTY); + } + + this._onCompositionStart.fire(); + })); + + /** + * Deduce the typed input from a text area's value and the last observed state. + */ + const deduceInputFromTextAreaValue = (couldBeEmojiInput: boolean): [TextAreaState, ITypeData] => { + const oldState = this._textAreaState; + const newState = this._textAreaState.readFromTextArea(this._textArea); + return [newState, TextAreaState.deduceInput(oldState, newState, couldBeEmojiInput)]; + }; + + /** + * Deduce the composition input from a string. + */ + const deduceComposition = (text: string): [TextAreaState, ITypeData] => { + const oldState = this._textAreaState; + const newState = TextAreaState.selectedText(text); + const typeInput: ITypeData = { + text: newState.value, + replaceCharCnt: oldState.selectionEnd - oldState.selectionStart + }; + return [newState, typeInput]; + }; + + this._register(dom.addDisposableListener(textArea.domNode, 'compositionupdate', (e: CompositionEvent) => { + if (browser.isChromev56) { + // See https://github.com/Microsoft/monaco-editor/issues/320 + // where compositionupdate .data is broken in Chrome v55 and v56 + // See https://bugs.chromium.org/p/chromium/issues/detail?id=677050#c9 + // The textArea doesn't get the composition update yet, the value of textarea is still obsolete + // so we can't correct e at this moment. + return; + } + + if (browser.isEdgeOrIE && e.locale === 'ja') { + // https://github.com/Microsoft/monaco-editor/issues/339 + // Multi-part Japanese compositions reset cursor in Edge/IE, Chinese and Korean IME don't have this issue. + // The reason that we can't use this path for all CJK IME is IE and Edge behave differently when handling Korean IME, + // which breaks this path of code. + const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/false); + this._textAreaState = newState; + this._onType.fire(typeInput); + this._onCompositionUpdate.fire(e); + return; + } + + const [newState, typeInput] = deduceComposition(e.data); + this._textAreaState = newState; + this._onType.fire(typeInput); + this._onCompositionUpdate.fire(e); + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'compositionend', (e: CompositionEvent) => { + if (browser.isEdgeOrIE && e.locale === 'ja') { + // https://github.com/Microsoft/monaco-editor/issues/339 + const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/false); + this._textAreaState = newState; + this._onType.fire(typeInput); + } + else { + const [newState, typeInput] = deduceComposition(e.data); + this._textAreaState = newState; + this._onType.fire(typeInput); + } + + // Due to isEdgeOrIE (where the textarea was not cleared initially) and isChrome (the textarea is not updated correctly when composition ends) + // we cannot assume the text at the end consists only of the composited text + if (browser.isEdgeOrIE || browser.isChrome) { + this._textAreaState = this._textAreaState.readFromTextArea(this._textArea); + } + + if (!this._isDoingComposition) { + return; + } + this._isDoingComposition = false; + + this._onCompositionEnd.fire(); + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'input', () => { + if (this._isDoingComposition) { + // See https://github.com/Microsoft/monaco-editor/issues/320 + if (browser.isChromev56) { + const [newState, typeInput] = deduceComposition(this._textArea.getValue()); + this._textAreaState = newState; + + this._onType.fire(typeInput); + let e: ICompositionData = { + data: typeInput.text + }; + this._onCompositionUpdate.fire(e); + } + return; + } + + const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/platform.isMacintosh); + if (typeInput.replaceCharCnt === 0 && typeInput.text.length === 1 && strings.isHighSurrogate(typeInput.text.charCodeAt(0))) { + // Ignore invalid input but keep it around for next time + return; + } + + this._textAreaState = newState; + // console.log('==> DEDUCED INPUT: ' + JSON.stringify(typeInput)); + if (this._nextCommand === ReadFromTextArea.Type) { + if (typeInput.text !== '') { + this._onType.fire(typeInput); + } + } else { + if (typeInput.text !== '') { + this._onPaste.fire({ + text: typeInput.text + }); + } + this._nextCommand = ReadFromTextArea.Type; + } + })); + + // --- Clipboard operations + + this._register(dom.addDisposableListener(textArea.domNode, 'cut', (e: ClipboardEvent) => { + this._ensureClipboardGetsEditorSelection(e); + this._asyncTriggerCut.schedule(); + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'copy', (e: ClipboardEvent) => { + this._ensureClipboardGetsEditorSelection(e); + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'paste', (e: ClipboardEvent) => { + if (ClipboardEventUtils.canUseTextData(e)) { + const pastePlainText = ClipboardEventUtils.getTextData(e); + if (pastePlainText !== '') { + this._onPaste.fire({ + text: pastePlainText + }); + } + } else { + if (this._textArea.getSelectionStart() !== this._textArea.getSelectionEnd()) { + // Clean up the textarea, to get a clean paste + this._setAndWriteTextAreaState('paste', TextAreaState.EMPTY); + } + this._nextCommand = ReadFromTextArea.Paste; + } + })); + + this._register(dom.addDisposableListener(textArea.domNode, 'focus', () => this._setHasFocus(true))); + this._register(dom.addDisposableListener(textArea.domNode, 'blur', () => this._setHasFocus(false))); + } + + public dispose(): void { + super.dispose(); + } + + public focusTextArea(): void { + // Setting this._hasFocus and writing the screen reader content + // will result in a focus() and setSelectionRange() in the textarea + this._setHasFocus(true); + } + + public isFocused(): boolean { + return this._hasFocus; + } + + private _setHasFocus(newHasFocus: boolean): void { + if (this._hasFocus === newHasFocus) { + // no change + return; + } + this._hasFocus = newHasFocus; + + if (this._hasFocus) { + if (browser.isEdge) { + // Edge has a bug where setting the selection range while the focus event + // is dispatching doesn't work. To reproduce, "tab into" the editor. + this._setAndWriteTextAreaState('focusgain', TextAreaState.EMPTY); + } else { + this.writeScreenReaderContent('focusgain'); + } + } + + if (this._hasFocus) { + this._onFocus.fire(); + } else { + this._onBlur.fire(); + } + } + + private _setAndWriteTextAreaState(reason: string, textAreaState: TextAreaState): void { + if (!this._hasFocus) { + textAreaState = textAreaState.collapseSelection(); + } + + textAreaState.writeToTextArea(reason, this._textArea, this._hasFocus); + this._textAreaState = textAreaState; + } + + public writeScreenReaderContent(reason: string): void { + if (this._isDoingComposition) { + // Do not write to the text area when doing composition + return; + } + + this._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent(this._textAreaState)); + } + + private _ensureClipboardGetsEditorSelection(e: ClipboardEvent): void { + const copyPlainText = this._host.getPlainTextToCopy(); + if (!ClipboardEventUtils.canUseTextData(e)) { + // Looks like an old browser. The strategy is to place the text + // we'd like to be copied to the clipboard in the textarea and select it. + this._setAndWriteTextAreaState('copy or cut', TextAreaState.selectedText(copyPlainText)); + return; + } + + let copyHTML: string = null; + if (!browser.isEdgeOrIE && (copyPlainText.length < 65536 || CopyOptions.forceCopyWithSyntaxHighlighting)) { + copyHTML = this._host.getHTMLToCopy(); + } + ClipboardEventUtils.setTextData(e, copyPlainText, copyHTML); + } +} + +class ClipboardEventUtils { + + public static canUseTextData(e: ClipboardEvent): boolean { + if (e.clipboardData) { + return true; + } + if ((window).clipboardData) { + return true; + } + return false; + } + + public static getTextData(e: ClipboardEvent): string { + if (e.clipboardData) { + e.preventDefault(); + return e.clipboardData.getData('text/plain'); + } + + if ((window).clipboardData) { + e.preventDefault(); + return (window).clipboardData.getData('Text'); + } + + throw new Error('ClipboardEventUtils.getTextData: Cannot use text data!'); + } + + public static setTextData(e: ClipboardEvent, text: string, richText: string): void { + if (e.clipboardData) { + e.clipboardData.setData('text/plain', text); + if (richText !== null) { + e.clipboardData.setData('text/html', richText); + } + e.preventDefault(); + return; + } + + if ((window).clipboardData) { + (window).clipboardData.setData('Text', text); + e.preventDefault(); + return; + } + + throw new Error('ClipboardEventUtils.setTextData: Cannot use text data!'); + } +} + +class TextAreaWrapper extends Disposable implements ITextAreaWrapper { + + private readonly _actual: FastDomNode; + + constructor(_textArea: FastDomNode) { + super(); + this._actual = _textArea; + } + + public getValue(): string { + // console.log('current value: ' + this._textArea.value); + return this._actual.domNode.value; + } + + public setValue(reason: string, value: string): void { + const textArea = this._actual.domNode; + if (textArea.value === value) { + // No change + return; + } + // console.log('reason: ' + reason + ', current value: ' + textArea.value + ' => new value: ' + value); + textArea.value = value; + } + + public getSelectionStart(): number { + return this._actual.domNode.selectionStart; + } + + public getSelectionEnd(): number { + return this._actual.domNode.selectionEnd; + } + + public setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void { + const textArea = this._actual.domNode; + + const currentIsFocused = (document.activeElement === textArea); + const currentSelectionStart = textArea.selectionStart; + const currentSelectionEnd = textArea.selectionEnd; + + if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) { + // No change + return; + } + + // console.log('reason: ' + reason + ', setSelectionRange: ' + selectionStart + ' -> ' + selectionEnd); + + if (currentIsFocused) { + // No need to focus, only need to change the selection range + textArea.setSelectionRange(selectionStart, selectionEnd); + return; + } + + // If the focus is outside the textarea, browsers will try really hard to reveal the textarea. + // Here, we try to undo the browser's desperate reveal. + try { + const scrollState = dom.saveParentsScrollTop(textArea); + textArea.focus(); + textArea.setSelectionRange(selectionStart, selectionEnd); + dom.restoreParentsScrollTop(textArea, scrollState); + } catch (e) { + // Sometimes IE throws when setting selection (e.g. textarea is off-DOM) + } + } +} diff --git a/src/vs/editor/browser/controller/textAreaState.ts b/src/vs/editor/browser/controller/textAreaState.ts new file mode 100644 index 00000000000..d398f510147 --- /dev/null +++ b/src/vs/editor/browser/controller/textAreaState.ts @@ -0,0 +1,256 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { Range } from 'vs/editor/common/core/range'; +import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; +import * as strings from 'vs/base/common/strings'; + +export interface ITextAreaWrapper { + getValue(): string; + setValue(reason: string, value: string): void; + + getSelectionStart(): number; + getSelectionEnd(): number; + setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void; +} + +export interface ISimpleModel { + getLineCount(): number; + getLineMaxColumn(lineNumber: number): number; + getValueInRange(range: Range, eol: EndOfLinePreference): string; +} + +export interface ITypeData { + text: string; + replaceCharCnt: number; +} + +export class TextAreaState { + + public static EMPTY = new TextAreaState('', 0, 0); + + public readonly value: string; + public readonly selectionStart: number; + public readonly selectionEnd: number; + + constructor(value: string, selectionStart: number, selectionEnd: number) { + this.value = value; + this.selectionStart = selectionStart; + this.selectionEnd = selectionEnd; + } + + public equals(other: TextAreaState): boolean { + if (other instanceof TextAreaState) { + return ( + this.value === other.value + && this.selectionStart === other.selectionStart + && this.selectionEnd === other.selectionEnd + ); + } + return false; + } + + public toString(): string { + return '[ <' + this.value + '>, selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ']'; + } + + public readFromTextArea(textArea: ITextAreaWrapper): TextAreaState { + return new TextAreaState(textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd()); + } + + public collapseSelection(): TextAreaState { + return new TextAreaState(this.value, this.value.length, this.value.length); + } + + public writeToTextArea(reason: string, textArea: ITextAreaWrapper, select: boolean): void { + // console.log(Date.now() + ': applyToTextArea ' + reason + ': ' + this.toString()); + textArea.setValue(reason, this.value); + if (select) { + textArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd); + } + } + + public static selectedText(text: string): TextAreaState { + return new TextAreaState(text, 0, text.length); + } + + public static deduceInput(previousState: TextAreaState, currentState: TextAreaState, couldBeEmojiInput: boolean): ITypeData { + if (!previousState) { + // This is the EMPTY state + return { + text: '', + replaceCharCnt: 0 + }; + } + + // console.log('------------------------deduceInput'); + // console.log('PREVIOUS STATE: ' + previousState.toString()); + // console.log('CURRENT STATE: ' + currentState.toString()); + + let previousValue = previousState.value; + let previousSelectionStart = previousState.selectionStart; + let previousSelectionEnd = previousState.selectionEnd; + let currentValue = currentState.value; + let currentSelectionStart = currentState.selectionStart; + let currentSelectionEnd = currentState.selectionEnd; + + // Strip the previous suffix from the value (without interfering with the current selection) + const previousSuffix = previousValue.substring(previousSelectionEnd); + const currentSuffix = currentValue.substring(currentSelectionEnd); + const suffixLength = strings.commonSuffixLength(previousSuffix, currentSuffix); + currentValue = currentValue.substring(0, currentValue.length - suffixLength); + previousValue = previousValue.substring(0, previousValue.length - suffixLength); + + const previousPrefix = previousValue.substring(0, previousSelectionStart); + const currentPrefix = currentValue.substring(0, currentSelectionStart); + const prefixLength = strings.commonPrefixLength(previousPrefix, currentPrefix); + currentValue = currentValue.substring(prefixLength); + previousValue = previousValue.substring(prefixLength); + currentSelectionStart -= prefixLength; + previousSelectionStart -= prefixLength; + currentSelectionEnd -= prefixLength; + previousSelectionEnd -= prefixLength; + + // console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd); + // console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd); + + if (couldBeEmojiInput && currentSelectionStart === currentSelectionEnd && previousValue.length > 0) { + // on OSX, emojis from the emoji picker are inserted at random locations + // the only hints we can use is that the selection is immediately after the inserted emoji + // and that none of the old text has been deleted + + let potentialEmojiInput: string = null; + + if (currentSelectionStart === currentValue.length) { + // emoji potentially inserted "somewhere" after the previous selection => it should appear at the end of `currentValue` + if (strings.startsWith(currentValue, previousValue)) { + // only if all of the old text is accounted for + potentialEmojiInput = currentValue.substring(previousValue.length); + } + } else { + // emoji potentially inserted "somewhere" before the previous selection => it should appear at the start of `currentValue` + if (strings.endsWith(currentValue, previousValue)) { + // only if all of the old text is accounted for + potentialEmojiInput = currentValue.substring(0, currentValue.length - previousValue.length); + } + } + + if (potentialEmojiInput !== null && potentialEmojiInput.length > 0) { + // now we check that this is indeed an emoji + // emojis can grow quite long, so a length check is of no help + // e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F ; fully-qualified # ðŸ´ó §ó ¢ó ¥ó ®ó §ó ¿ England + + // Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint + // http://emojipedia.org/variation-selector-16/ + // > An invisible codepoint which specifies that the preceding character + // > should be displayed with emoji presentation. Only required if the + // > preceding character defaults to text presentation. + if (/\uFE0F/.test(potentialEmojiInput) || strings.containsEmoji(potentialEmojiInput)) { + return { + text: potentialEmojiInput, + replaceCharCnt: 0 + }; + } + } + } + + if (currentSelectionStart === currentSelectionEnd) { + // composition accept case (noticed in FF + Japanese) + // [blahblah] => blahblah| + if ( + previousValue === currentValue + && previousSelectionStart === 0 + && previousSelectionEnd === previousValue.length + && currentSelectionStart === currentValue.length + && currentValue.indexOf('\n') === -1 + ) { + if (strings.containsFullWidthCharacter(currentValue)) { + return { + text: '', + replaceCharCnt: 0 + }; + } + } + + // no current selection + const replacePreviousCharacters = (previousPrefix.length - prefixLength); + // console.log('REMOVE PREVIOUS: ' + (previousPrefix.length - prefixLength) + ' chars'); + + return { + text: currentValue, + replaceCharCnt: replacePreviousCharacters + }; + } + + // there is a current selection => composition case + const replacePreviousCharacters = previousSelectionEnd - previousSelectionStart; + return { + text: currentValue, + replaceCharCnt: replacePreviousCharacters + }; + } +} + +export class PagedScreenReaderStrategy { + private static _LINES_PER_PAGE = 10; + + private static _getPageOfLine(lineNumber: number): number { + return Math.floor((lineNumber - 1) / PagedScreenReaderStrategy._LINES_PER_PAGE); + } + + private static _getRangeForPage(page: number): Range { + let offset = page * PagedScreenReaderStrategy._LINES_PER_PAGE; + let startLineNumber = offset + 1; + let endLineNumber = offset + PagedScreenReaderStrategy._LINES_PER_PAGE; + return new Range(startLineNumber, 1, endLineNumber + 1, 1); + } + + public static fromEditorSelection(previousState: TextAreaState, model: ISimpleModel, selection: Range): TextAreaState { + + let selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber); + let selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage); + + let selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber); + let selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage); + + let pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn)); + let pretext = model.getValueInRange(pretextRange, EndOfLinePreference.LF); + + let lastLine = model.getLineCount(); + let lastLineMaxColumn = model.getLineMaxColumn(lastLine); + let posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn)); + let posttext = model.getValueInRange(posttextRange, EndOfLinePreference.LF); + + let text: string = null; + if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { + // take full selection + text = model.getValueInRange(selection, EndOfLinePreference.LF); + } else { + let selectionRange1 = selectionStartPageRange.intersectRanges(selection); + let selectionRange2 = selectionEndPageRange.intersectRanges(selection); + text = ( + model.getValueInRange(selectionRange1, EndOfLinePreference.LF) + + String.fromCharCode(8230) + + model.getValueInRange(selectionRange2, EndOfLinePreference.LF) + ); + } + + // Chromium handles very poorly text even of a few thousand chars + // Cut text to avoid stalling the entire UI + const LIMIT_CHARS = 500; + if (pretext.length > LIMIT_CHARS) { + pretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length); + } + if (posttext.length > LIMIT_CHARS) { + posttext = posttext.substring(0, LIMIT_CHARS); + } + if (text.length > 2 * LIMIT_CHARS) { + text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); + } + + return new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length); + } +} diff --git a/src/vs/editor/browser/editor.all.ts b/src/vs/editor/browser/editor.all.ts index 00c3abd0200..4223fbac790 100644 --- a/src/vs/editor/browser/editor.all.ts +++ b/src/vs/editor/browser/editor.all.ts @@ -5,6 +5,7 @@ 'use strict'; +import 'vs/editor/common/controller/coreCommands'; import 'vs/editor/browser/widget/codeEditorWidget'; import 'vs/editor/browser/widget/diffEditorWidget'; @@ -22,10 +23,10 @@ import 'vs/editor/contrib/dnd/browser/dnd'; import 'vs/editor/contrib/find/browser/find'; import 'vs/editor/contrib/folding/browser/folding'; import 'vs/editor/contrib/format/browser/formatActions'; -import 'vs/editor/contrib/goToDeclaration/browser/goToDeclaration'; +import 'vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands'; +import 'vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse'; import 'vs/editor/contrib/gotoError/browser/gotoError'; import 'vs/editor/contrib/hover/browser/hover'; -import 'vs/css!vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace'; import 'vs/editor/contrib/inPlaceReplace/common/inPlaceReplace'; import 'vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard'; import 'vs/editor/contrib/linesOperations/common/linesOperations'; @@ -37,8 +38,7 @@ import 'vs/editor/contrib/quickFix/browser/quickFixCommands'; import 'vs/editor/contrib/referenceSearch/browser/referenceSearch'; import 'vs/editor/contrib/rename/browser/rename'; import 'vs/editor/contrib/smartSelect/common/smartSelect'; -import 'vs/editor/contrib/snippet/common/snippet'; -import 'vs/editor/contrib/snippet/browser/snippet'; +import 'vs/editor/contrib/snippet/browser/snippetController2'; import 'vs/editor/contrib/suggest/browser/suggestController'; import 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode'; import 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; diff --git a/src/vs/editor/browser/editorDom.ts b/src/vs/editor/browser/editorDom.ts index 78427527605..504c830dda1 100644 --- a/src/vs/editor/browser/editorDom.ts +++ b/src/vs/editor/browser/editorDom.ts @@ -146,17 +146,35 @@ export class GlobalEditorMouseMoveMonitor extends Disposable { private _editorViewDomNode: HTMLElement; private _globalMouseMoveMonitor: GlobalMouseMoveMonitor; + private _keydownListener: IDisposable; constructor(editorViewDomNode: HTMLElement) { super(); this._editorViewDomNode = editorViewDomNode; this._globalMouseMoveMonitor = this._register(new GlobalMouseMoveMonitor()); + this._keydownListener = null; } public startMonitoring(merger: EditorMouseEventMerger, mouseMoveCallback: (e: EditorMouseEvent) => void, onStopCallback: () => void): void { + + // Add a <> keydown event listener that will cancel the monitoring + // if something other than a modifier key is pressed + this._keydownListener = dom.addStandardDisposableListener(document, 'keydown', (e) => { + const kb = e.toKeybinding(); + if (kb.isModifierKey()) { + // Allow modifier keys + return; + } + this._globalMouseMoveMonitor.stopMonitoring(true); + }, true); + let myMerger: dom.IEventMerger = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => { return merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode)); }; - this._globalMouseMoveMonitor.startMonitoring(myMerger, mouseMoveCallback, onStopCallback); + + this._globalMouseMoveMonitor.startMonitoring(myMerger, mouseMoveCallback, () => { + this._keydownListener.dispose(); + onStopCallback(); + }); } } diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index 8782b344a49..cad86e56150 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -4,36 +4,43 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import * as objects from 'vs/base/common/objects'; -import { parse, stringify } from 'vs/base/common/marshalling'; import * as strings from 'vs/base/common/strings'; import URI from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; import { IDecorationRenderOptions, IModelDecorationOptions, IModelDecorationOverviewRulerOptions, IThemeDecorationRenderOptions, - IContentDecorationRenderOptions, OverviewRulerLane, TrackedRangeStickiness + IContentDecorationRenderOptions, OverviewRulerLane, TrackedRangeStickiness, ThemeColor, isThemeColor } from 'vs/editor/common/editorCommon'; import { AbstractCodeEditorService } from 'vs/editor/common/services/abstractCodeEditorService'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose as disposeAll } from 'vs/base/common/lifecycle'; +import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; export class CodeEditorServiceImpl extends AbstractCodeEditorService { private _styleSheet: HTMLStyleElement; private _decorationOptionProviders: { [key: string]: IModelDecorationOptionsProvider }; + private _themeService: IThemeService; - constructor(styleSheet = dom.createStyleSheet()) { + constructor( @IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) { super(); this._styleSheet = styleSheet; this._decorationOptionProviders = Object.create(null); + this._themeService = themeService; } public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void { let provider = this._decorationOptionProviders[key]; if (!provider) { + let providerArgs: ProviderArguments = { + styleSheet: this._styleSheet, + key: key, + parentTypeKey: parentTypeKey, + options: options + }; if (!parentTypeKey) { - provider = new DecorationTypeOptionsProvider(this._styleSheet, key, options); + provider = new DecorationTypeOptionsProvider(this._themeService, providerArgs); } else { - provider = new DecorationSubTypeOptionsProvider(this._styleSheet, key, parentTypeKey, options); + provider = new DecorationSubTypeOptionsProvider(this._themeService, providerArgs); } this._decorationOptionProviders[key] = provider; } @@ -71,67 +78,52 @@ class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvide public refCount: number; - private _disposable: IDisposable; private _parentTypeKey: string; - private _beforeContentClassName: string; - private _afterContentClassName: string; + private _beforeContentRules: DecorationCSSRules; + private _afterContentRules: DecorationCSSRules; - constructor(styleSheet: HTMLStyleElement, key: string, parentTypeKey: string, options: IDecorationRenderOptions) { - this._parentTypeKey = parentTypeKey; + constructor(themeService: IThemeService, providerArgs: ProviderArguments) { + this._parentTypeKey = providerArgs.parentTypeKey; this.refCount = 0; - let themedOpts = getThemedRenderOptions(options); - - this._beforeContentClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - parentTypeKey, - ModelDecorationCSSRuleType.BeforeContentClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.light.before), - dark: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.dark.before) - } - ); - - this._afterContentClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - parentTypeKey, - ModelDecorationCSSRuleType.AfterContentClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.light.after), - dark: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.dark.after) - } - ); - if (this._beforeContentClassName || this._afterContentClassName) { - this._disposable = toDisposable(() => { - dom.removeCSSRulesContainingSelector(CSSNameHelper.getDeletionSubstring(key), styleSheet); - }); - } + this._beforeContentRules = new DecorationCSSRules(ModelDecorationCSSRuleType.BeforeContentClassName, providerArgs, themeService); + this._afterContentRules = new DecorationCSSRules(ModelDecorationCSSRuleType.AfterContentClassName, providerArgs, themeService); } public getOptions(codeEditorService: AbstractCodeEditorService, writable: boolean): IModelDecorationOptions { let options = codeEditorService.resolveDecorationOptions(this._parentTypeKey, true); - if (this._beforeContentClassName) { - options.beforeContentClassName = this._beforeContentClassName; + if (this._beforeContentRules) { + options.beforeContentClassName = this._beforeContentRules.className; } - if (this._afterContentClassName) { - options.afterContentClassName = this._afterContentClassName; + if (this._afterContentRules) { + options.afterContentClassName = this._afterContentRules.className; } return options; } public dispose(): void { - if (this._disposable) { - this._disposable.dispose(); - delete this._disposable; + if (this._beforeContentRules) { + this._beforeContentRules.dispose(); + this._beforeContentRules = null; + } + if (this._afterContentRules) { + this._afterContentRules.dispose(); + this._afterContentRules = null; } } } +interface ProviderArguments { + styleSheet: HTMLStyleElement; + key: string; + parentTypeKey?: string; + options: IDecorationRenderOptions; +} + + class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { - private _disposable: IDisposable; + private _disposables: IDisposable[]; public refCount: number; public className: string; @@ -143,83 +135,41 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { public overviewRuler: IModelDecorationOverviewRulerOptions; public stickiness: TrackedRangeStickiness; - constructor(styleSheet: HTMLStyleElement, key: string, options: IDecorationRenderOptions) { + constructor(themeService: IThemeService, providerArgs: ProviderArguments) { this.refCount = 0; + this._disposables = []; - let themedOpts = getThemedRenderOptions(options); - - this.className = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - null, - ModelDecorationCSSRuleType.ClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationClassName(themedOpts.light), - dark: DecorationRenderHelper.getCSSTextForModelDecorationClassName(themedOpts.dark) + let createCSSRules = (type: ModelDecorationCSSRuleType) => { + let rules = new DecorationCSSRules(type, providerArgs, themeService); + if (rules.hasContent) { + this._disposables.push(rules); + return rules.className; } - ); + return void 0; + }; - this.inlineClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - null, - ModelDecorationCSSRuleType.InlineClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationInlineClassName(themedOpts.light), - dark: DecorationRenderHelper.getCSSTextForModelDecorationInlineClassName(themedOpts.dark) - } - ); - - this.beforeContentClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - null, - ModelDecorationCSSRuleType.BeforeContentClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.light.before), - dark: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.dark.before) - } - ); - - this.afterContentClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - null, - ModelDecorationCSSRuleType.AfterContentClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.light.after), - dark: DecorationRenderHelper.getCSSTextForModelDecorationContentClassName(themedOpts.dark.after) - } - ); - - this.glyphMarginClassName = DecorationRenderHelper.createCSSRules( - styleSheet, - key, - null, - ModelDecorationCSSRuleType.GlyphMarginClassName, - { - light: DecorationRenderHelper.getCSSTextForModelDecorationGlyphMarginClassName(themedOpts.light), - dark: DecorationRenderHelper.getCSSTextForModelDecorationGlyphMarginClassName(themedOpts.dark) - } - ); + this.className = createCSSRules(ModelDecorationCSSRuleType.ClassName); + this.inlineClassName = createCSSRules(ModelDecorationCSSRuleType.InlineClassName); + this.beforeContentClassName = createCSSRules(ModelDecorationCSSRuleType.BeforeContentClassName); + this.afterContentClassName = createCSSRules(ModelDecorationCSSRuleType.AfterContentClassName); + this.glyphMarginClassName = createCSSRules(ModelDecorationCSSRuleType.GlyphMarginClassName); + let options = providerArgs.options; this.isWholeLine = Boolean(options.isWholeLine); this.stickiness = options.stickiness; + let lightOverviewRulerColor = options.light && options.light.overviewRulerColor || options.overviewRulerColor; + let darkOverviewRulerColor = options.dark && options.dark.overviewRulerColor || options.overviewRulerColor; if ( - typeof themedOpts.light.overviewRulerColor !== 'undefined' - || typeof themedOpts.dark.overviewRulerColor !== 'undefined' + typeof lightOverviewRulerColor !== 'undefined' + || typeof darkOverviewRulerColor !== 'undefined' ) { this.overviewRuler = { - color: themedOpts.light.overviewRulerColor || themedOpts.dark.overviewRulerColor, - darkColor: themedOpts.dark.overviewRulerColor || themedOpts.light.overviewRulerColor, + color: lightOverviewRulerColor || darkOverviewRulerColor, + darkColor: darkOverviewRulerColor || lightOverviewRulerColor, position: options.overviewRulerLane || OverviewRulerLane.Center }; } - - this._disposable = toDisposable(() => { - dom.removeCSSRulesContainingSelector(CSSNameHelper.getDeletionSubstring(key), styleSheet); - }); } public getOptions(codeEditorService: AbstractCodeEditorService, writable: boolean): IModelDecorationOptions { @@ -239,51 +189,162 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { } public dispose(): void { - if (this._disposable) { - this._disposable.dispose(); - delete this._disposable; - } + this._disposables = disposeAll(this._disposables); } } -class DecorationRenderHelper { - private static _CSS_MAP = { - color: 'color:{0} !important;', - backgroundColor: 'background-color:{0};', - outline: 'outline:{0};', - outlineColor: 'outline-color:{0};', - outlineStyle: 'outline-style:{0};', - outlineWidth: 'outline-width:{0};', +const _CSS_MAP = { + color: 'color:{0} !important;', + backgroundColor: 'background-color:{0};', - border: 'border:{0};', - borderColor: 'border-color:{0};', - borderRadius: 'border-radius:{0};', - borderSpacing: 'border-spacing:{0};', - borderStyle: 'border-style:{0};', - borderWidth: 'border-width:{0};', + outline: 'outline:{0};', + outlineColor: 'outline-color:{0};', + outlineStyle: 'outline-style:{0};', + outlineWidth: 'outline-width:{0};', - textDecoration: 'text-decoration:{0};', - cursor: 'cursor:{0};', - letterSpacing: 'letter-spacing:{0};', + border: 'border:{0};', + borderColor: 'border-color:{0};', + borderRadius: 'border-radius:{0};', + borderSpacing: 'border-spacing:{0};', + borderStyle: 'border-style:{0};', + borderWidth: 'border-width:{0};', - gutterIconPath: 'background:url(\'{0}\') center center no-repeat;', - gutterIconSize: 'background-size:{0};', + textDecoration: 'text-decoration:{0};', + cursor: 'cursor:{0};', + letterSpacing: 'letter-spacing:{0};', - contentText: 'content:\'{0}\';', - contentIconPath: 'content:url(\'{0}\');', - margin: 'margin:{0};', - width: 'width:{0};', - height: 'height:{0};' - }; + gutterIconPath: 'background:url(\'{0}\') center center no-repeat;', + gutterIconSize: 'background-size:{0};', + + contentText: 'content:\'{0}\';', + contentIconPath: 'content:url(\'{0}\');', + margin: 'margin:{0};', + width: 'width:{0};', + height: 'height:{0};' +}; + + +class DecorationCSSRules { + + private _theme: ITheme; + private _className: string; + private _unThemedSelector: string; + private _hasContent: boolean; + private _ruleType: ModelDecorationCSSRuleType; + private _themeListener: IDisposable; + private _providerArgs: ProviderArguments; + private _usesThemeColors: boolean; + + public constructor(ruleType: ModelDecorationCSSRuleType, providerArgs: ProviderArguments, themeService: IThemeService) { + this._theme = themeService.getTheme(); + this._ruleType = ruleType; + this._providerArgs = providerArgs; + this._usesThemeColors = false; + this._hasContent = false; + + let className = CSSNameHelper.getClassName(this._providerArgs.key, ruleType); + if (this._providerArgs.parentTypeKey) { + className = className + ' ' + CSSNameHelper.getClassName(this._providerArgs.parentTypeKey, ruleType); + } + this._className = className; + + this._unThemedSelector = CSSNameHelper.getSelector(this._providerArgs.key, this._providerArgs.parentTypeKey, ruleType); + + this._buildCSS(); + + if (this._usesThemeColors) { + this._themeListener = themeService.onThemeChange(theme => { + this._theme = themeService.getTheme(); + this._removeCSS(); + this._buildCSS(); + }); + } + } + + public dispose() { + if (this._hasContent) { + this._removeCSS(); + this._hasContent = false; + } + if (this._themeListener) { + this._themeListener.dispose(); + this._themeListener = null; + } + } + + public get hasContent(): boolean { + return this._hasContent; + } + + public get className(): string { + return this._className; + } + + private _buildCSS(): void { + let options = this._providerArgs.options; + let unthemedCSS, lightCSS, darkCSS: string; + switch (this._ruleType) { + case ModelDecorationCSSRuleType.ClassName: + unthemedCSS = this.getCSSTextForModelDecorationClassName(options); + lightCSS = this.getCSSTextForModelDecorationClassName(options.light); + darkCSS = this.getCSSTextForModelDecorationClassName(options.dark); + break; + case ModelDecorationCSSRuleType.InlineClassName: + unthemedCSS = this.getCSSTextForModelDecorationInlineClassName(options); + lightCSS = this.getCSSTextForModelDecorationInlineClassName(options.light); + darkCSS = this.getCSSTextForModelDecorationInlineClassName(options.dark); + break; + case ModelDecorationCSSRuleType.GlyphMarginClassName: + unthemedCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options); + lightCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.light); + darkCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.dark); + break; + case ModelDecorationCSSRuleType.BeforeContentClassName: + unthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.before); + lightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.before); + darkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.before); + break; + case ModelDecorationCSSRuleType.AfterContentClassName: + unthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.after); + lightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.after); + darkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.after); + break; + default: + throw new Error('Unknown rule type: ' + this._ruleType); + } + let sheet = this._providerArgs.styleSheet.sheet; + + let hasContent = false; + if (unthemedCSS.length > 0) { + sheet.insertRule(`${this._unThemedSelector} {${unthemedCSS}}`, 0); + hasContent = true; + } + if (lightCSS.length > 0) { + sheet.insertRule(`.vs${this._unThemedSelector} {${lightCSS}}`, 0); + hasContent = true; + } + if (darkCSS.length > 0) { + sheet.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${darkCSS}}`, 0); + hasContent = true; + } + this._hasContent = hasContent; + } + + private _removeCSS(): void { + dom.removeCSSRulesContainingSelector(this._unThemedSelector, this._providerArgs.styleSheet); + } /** * Build the CSS for decorations styled via `className`. */ - public static getCSSTextForModelDecorationClassName(opts: IThemeDecorationRenderOptions): string { - let cssTextArr = []; - DecorationRenderHelper.collectCSSText(opts, ['backgroundColor', 'outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr); - DecorationRenderHelper.collectBorderSettingsCSSText(opts, cssTextArr); + private getCSSTextForModelDecorationClassName(opts: IThemeDecorationRenderOptions): string { + if (!opts) { + return ''; + } + let cssTextArr: string[] = []; + this.collectCSSText(opts, ['backgroundColor', 'outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr); + this.collectBorderSettingsCSSText(opts, cssTextArr); return cssTextArr.join(''); } @@ -291,33 +352,39 @@ class DecorationRenderHelper { /** * Build the CSS for decorations styled via `inlineClassName`. */ - public static getCSSTextForModelDecorationInlineClassName(opts: IThemeDecorationRenderOptions): string { - let cssTextArr = []; - DecorationRenderHelper.collectCSSText(opts, ['textDecoration', 'cursor', 'color', 'letterSpacing'], cssTextArr); + private getCSSTextForModelDecorationInlineClassName(opts: IThemeDecorationRenderOptions): string { + if (!opts) { + return ''; + } + let cssTextArr: string[] = []; + this.collectCSSText(opts, ['textDecoration', 'cursor', 'color', 'letterSpacing'], cssTextArr); return cssTextArr.join(''); } /** * Build the CSS for decorations styled before or after content. */ - public static getCSSTextForModelDecorationContentClassName(opts: IContentDecorationRenderOptions): string { - let cssTextArr = []; + private getCSSTextForModelDecorationContentClassName(opts: IContentDecorationRenderOptions): string { + if (!opts) { + return ''; + } + let cssTextArr: string[] = []; if (typeof opts !== 'undefined') { - DecorationRenderHelper.collectBorderSettingsCSSText(opts, cssTextArr); + this.collectBorderSettingsCSSText(opts, cssTextArr); if (typeof opts.contentIconPath === 'string') { - cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, URI.file(opts.contentIconPath).toString().replace(/'/g, '%27'))); + cssTextArr.push(strings.format(_CSS_MAP.contentIconPath, URI.file(opts.contentIconPath).toString().replace(/'/g, '%27'))); } else if (opts.contentIconPath instanceof URI) { - cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, opts.contentIconPath.toString(true).replace(/'/g, '%27'))); + cssTextArr.push(strings.format(_CSS_MAP.contentIconPath, opts.contentIconPath.toString(true).replace(/'/g, '%27'))); } if (typeof opts.contentText === 'string') { const truncated = opts.contentText.match(/^.*$/m)[0]; // only take first line const escaped = truncated.replace(/['\\]/g, '\\$&'); - cssTextArr.push(strings.format(this._CSS_MAP.contentText, escaped)); + cssTextArr.push(strings.format(_CSS_MAP.contentText, escaped)); } - DecorationRenderHelper.collectCSSText(opts, ['textDecoration', 'color', 'backgroundColor', 'margin'], cssTextArr); - if (DecorationRenderHelper.collectCSSText(opts, ['width', 'height'], cssTextArr)) { + this.collectCSSText(opts, ['textDecoration', 'color', 'backgroundColor', 'margin'], cssTextArr); + if (this.collectCSSText(opts, ['width', 'height'], cssTextArr)) { cssTextArr.push('display:inline-block;'); } } @@ -328,17 +395,20 @@ class DecorationRenderHelper { /** * Build the CSS for decorations styled via `glpyhMarginClassName`. */ - public static getCSSTextForModelDecorationGlyphMarginClassName(opts: IThemeDecorationRenderOptions): string { + private getCSSTextForModelDecorationGlyphMarginClassName(opts: IThemeDecorationRenderOptions): string { + if (!opts) { + return ''; + } let cssTextArr = []; if (typeof opts.gutterIconPath !== 'undefined') { if (typeof opts.gutterIconPath === 'string') { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.file(opts.gutterIconPath).toString())); + cssTextArr.push(strings.format(_CSS_MAP.gutterIconPath, URI.file(opts.gutterIconPath).toString())); } else { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, opts.gutterIconPath.toString(true).replace(/'/g, '%27'))); + cssTextArr.push(strings.format(_CSS_MAP.gutterIconPath, opts.gutterIconPath.toString(true).replace(/'/g, '%27'))); } if (typeof opts.gutterIconSize !== 'undefined') { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconSize, opts.gutterIconSize)); + cssTextArr.push(strings.format(_CSS_MAP.gutterIconSize, opts.gutterIconSize)); } } @@ -347,59 +417,38 @@ class DecorationRenderHelper { private static border_rules = ['border', 'borderRadius', 'borderColor', 'borderSpacing', 'borderStyle', 'borderWidth']; - public static collectBorderSettingsCSSText(opts: any, cssTextArr: string[]): boolean { - if (DecorationRenderHelper.collectCSSText(opts, DecorationRenderHelper.border_rules, cssTextArr)) { + private collectBorderSettingsCSSText(opts: any, cssTextArr: string[]): boolean { + if (this.collectCSSText(opts, DecorationCSSRules.border_rules, cssTextArr)) { cssTextArr.push(strings.format('box-sizing: border-box;')); return true; } return false; } - private static collectCSSText(opts: any, properties: string[], cssTextArr: string[]): boolean { + private collectCSSText(opts: any, properties: string[], cssTextArr: string[]): boolean { let lenBefore = cssTextArr.length; for (let property of properties) { - if (typeof opts[property] !== 'undefined') { - cssTextArr.push(strings.format(this._CSS_MAP[property], opts[property])); + let value = this.resolveValue(opts[property]); + if (typeof value === 'string') { + cssTextArr.push(strings.format(_CSS_MAP[property], value)); } } return cssTextArr.length !== lenBefore; } - /** - * Create CSS rules for `cssTexts` with the generated class names from `ruleType` - */ - public static createCSSRules(styleSheet: HTMLStyleElement, key: string, parentKey: string, ruleType: ModelDecorationCSSRuleType, cssTexts: { light: string, dark: string }): string { - function createCSSSelector(themeType: ThemeType, cssText: string) { - let selector = CSSNameHelper.getSelector(themeType, key, parentKey, ruleType); - dom.createCSSRule(selector, cssText, styleSheet); - } - - let hasContent = false; - if (cssTexts.light.length > 0) { - createCSSSelector(ThemeType.Light, cssTexts.light); - hasContent = true; - } - if (cssTexts.dark.length > 0) { - createCSSSelector(ThemeType.Dark, cssTexts.dark); - createCSSSelector(ThemeType.HighContrastBlack, cssTexts.dark); - hasContent = true; - } - if (hasContent) { - let className = CSSNameHelper.getClassName(key, ruleType); - if (parentKey) { - className = className + ' ' + CSSNameHelper.getClassName(parentKey, ruleType); + private resolveValue(value: string | ThemeColor): string { + if (isThemeColor(value)) { + this._usesThemeColors = true; + let color = this._theme.getColor(value.id); + if (color) { + return color.toString(); } - return className; + return void 0; } - return void 0; + return value; } } -const enum ThemeType { - Light = 0, - Dark = 1, - HighContrastBlack = 2 -} const enum ModelDecorationCSSRuleType { ClassName = 0, InlineClassName = 1, @@ -410,22 +459,12 @@ const enum ModelDecorationCSSRuleType { class CSSNameHelper { - private static _getSelectorPrefixOf(theme: ThemeType): string { - if (theme === ThemeType.Light) { - return '.monaco-editor.vs'; - } - if (theme === ThemeType.Dark) { - return '.monaco-editor.vs-dark'; - } - return '.monaco-editor.hc-black'; - } - public static getClassName(key: string, type: ModelDecorationCSSRuleType): string { return 'ced-' + key + '-' + type; } - public static getSelector(themeType: ThemeType, key: string, parentKey: string, ruleType: ModelDecorationCSSRuleType): string { - let selector = this._getSelectorPrefixOf(themeType) + ' .' + this.getClassName(key, ruleType); + public static getSelector(key: string, parentKey: string, ruleType: ModelDecorationCSSRuleType): string { + let selector = '.monaco-editor .' + this.getClassName(key, ruleType); if (parentKey) { selector = selector + '.' + this.getClassName(parentKey, ruleType); } @@ -436,31 +475,4 @@ class CSSNameHelper { } return selector; } - - public static getDeletionSubstring(key: string): string { - return '.ced-' + key + '-'; - } } - -// ---- Normalize decoration render options per theme -interface IResolvedDecorationRenderOptions { - light: IThemeDecorationRenderOptions; - dark: IThemeDecorationRenderOptions; -} -function getThemedRenderOptions(opts: { light?: T, dark?: T }): { light?: T, dark?: T } { - // TODO@alex,joh - not really how/what deep clone is being used - // for here but it will break the URI TODO@martin - - // let light = objects.deepClone(opts); - let light = parse(stringify(opts)); - objects.mixin(light, opts.light); - - // let dark = objects.deepClone(opts); - let dark = parse(stringify(opts)); - objects.mixin(dark, opts.dark); - - return { - light: light, - dark: dark - }; -} \ No newline at end of file diff --git a/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts b/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts index 09969e5f768..ed9e8f753df 100644 --- a/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts +++ b/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts @@ -24,7 +24,6 @@ const themingRegistry = Registry.as(ThemingExtensions.ThemingC class StandaloneTheme implements IStandaloneTheme { id: string; - selector: string; private rules: ITokenThemeRule[]; base: string; private colors: { [colorId: string]: Color }; @@ -34,10 +33,8 @@ class StandaloneTheme implements IStandaloneTheme { constructor(base: string, name: string, colors: IColors, rules: ITokenThemeRule[]) { if (name.length > 0) { this.id = base + ' ' + name; - this.selector = base + '.' + name; } else { this.id = base; - this.selector = base; } this.base = base; this.rules = rules; @@ -67,13 +64,8 @@ class StandaloneTheme implements IStandaloneTheme { return color; } - public isDefault(colorId: ColorIdentifier): boolean { - if (!this.colors.hasOwnProperty(colorId)) { - return true; - } - let color = this.colors[colorId]; - let defaultValue = this.getDefault(colorId); - return color ? !!defaultValue : color.equals(defaultValue); + public defines(colorId: ColorIdentifier): boolean { + return this.colors.hasOwnProperty(colorId); } public get type() { @@ -180,8 +172,8 @@ export class StandaloneThemeServiceImpl implements IStandaloneThemeService { } this._theme = theme; - let cssRules = []; - let hasRule = {}; + let cssRules: string[] = []; + let hasRule: { [rule: string]: boolean; } = {}; let ruleCollector: ICssStyleCollector = { addRule: (rule: string) => { if (!hasRule[rule]) { diff --git a/src/vs/editor/browser/standalone/media/standalone-tokens.css b/src/vs/editor/browser/standalone/media/standalone-tokens.css index 89184ea1f66..8c3ae996849 100644 --- a/src/vs/editor/browser/standalone/media/standalone-tokens.css +++ b/src/vs/editor/browser/standalone/media/standalone-tokens.css @@ -6,7 +6,7 @@ /* Default standalone editor font */ .monaco-editor { - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; + font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; } .monaco-menu .monaco-action-bar.vertical .action-item [tabindex="0"]:focus { diff --git a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts index 4f7c626bc77..2a3a9789ed4 100644 --- a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts +++ b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts @@ -44,12 +44,26 @@ export interface IEditorConstructionOptions extends IEditorOptions { * To not create automatically a model, use `model: null`. */ language?: string; + /** + * Initial theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } /** * The options to create a diff editor. */ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * Initial theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } export interface IStandaloneCodeEditor extends ICodeEditor { @@ -83,9 +97,10 @@ export class StandaloneCodeEditor extends CodeEditor implements IStandaloneCodeE @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, @IContextKeyService contextKeyService: IContextKeyService, - @IKeybindingService keybindingService: IKeybindingService + @IKeybindingService keybindingService: IKeybindingService, + @IThemeService themeService: IThemeService ) { - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, themeService); if (keybindingService instanceof StandaloneKeybindingService) { this._standaloneKeybindingService = keybindingService; @@ -192,7 +207,6 @@ export class StandaloneCodeEditor extends CodeEditor implements IStandaloneCodeE export class StandaloneEditor extends StandaloneCodeEditor implements IStandaloneCodeEditor { private _contextViewService: IEditorContextViewService; - private _standaloneThemeService: IStandaloneThemeService; private _ownsModel: boolean; constructor( @@ -205,26 +219,23 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService keybindingService: IKeybindingService, @IContextViewService contextViewService: IContextViewService, - @IStandaloneThemeService standaloneThemeService: IStandaloneThemeService + @IStandaloneThemeService themeService: IStandaloneThemeService ) { options = options || {}; if (typeof options.theme === 'string') { - options.theme = standaloneThemeService.setTheme(options.theme); + themeService.setTheme(options.theme); } - - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService); + let model: IModel = options.model; + delete options.model; + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService); this._contextViewService = contextViewService; - this._standaloneThemeService = standaloneThemeService; this._register(toDispose); - let model: IModel = null; - if (typeof options.model === 'undefined') { + if (typeof model === 'undefined') { model = (self).monaco.editor.createModel(options.value || '', options.language || 'text/plain'); this._ownsModel = true; } else { - model = options.model; - delete options.model; this._ownsModel = false; } @@ -246,13 +257,6 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon this.dispose(); } - public updateOptions(newOptions: IEditorOptions): void { - if (typeof newOptions.theme === 'string') { - newOptions.theme = this._standaloneThemeService.setTheme(newOptions.theme); - } - super.updateOptions(newOptions); - } - _attachModel(model: IModel): void { super._attachModel(model); if (this._view) { @@ -272,7 +276,6 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon export class StandaloneDiffEditor extends DiffEditorWidget implements IStandaloneDiffEditor { private _contextViewService: IEditorContextViewService; - private _standaloneThemeService: IStandaloneThemeService; private _standaloneKeybindingService: StandaloneKeybindingService; constructor( @@ -283,14 +286,13 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService keybindingService: IKeybindingService, @IContextViewService contextViewService: IContextViewService, - @IStandaloneThemeService standaloneColorService: IStandaloneThemeService, @IEditorWorkerService editorWorkerService: IEditorWorkerService, @ICodeEditorService codeEditorService: ICodeEditorService, - @IThemeService themeService: IThemeService + @IStandaloneThemeService themeService: IStandaloneThemeService ) { options = options || {}; if (typeof options.theme === 'string') { - options.theme = standaloneColorService.setTheme(options.theme); + options.theme = themeService.setTheme(options.theme); } super(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService); @@ -300,7 +302,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon } this._contextViewService = contextViewService; - this._standaloneThemeService = standaloneColorService; this._register(toDispose); @@ -315,13 +316,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon this.dispose(); } - public updateOptions(newOptions: IEditorOptions): void { - if (typeof newOptions.theme === 'string') { - newOptions.theme = this._standaloneThemeService.setTheme(newOptions.theme); - } - super.updateOptions(newOptions); - } - protected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: IEditorOptions): CodeEditor { return instantiationService.createInstance(StandaloneCodeEditor, container, options); } diff --git a/src/vs/editor/browser/standalone/standaloneEditor.ts b/src/vs/editor/browser/standalone/standaloneEditor.ts index fc453d6e545..776016912c4 100644 --- a/src/vs/editor/browser/standalone/standaloneEditor.ts +++ b/src/vs/editor/browser/standalone/standaloneEditor.ts @@ -125,7 +125,6 @@ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorC services.get(IContextKeyService), services.get(IKeybindingService), services.get(IContextViewService), - services.get(IStandaloneThemeService), services.get(IEditorWorkerService), services.get(ICodeEditorService), services.get(IStandaloneThemeService) @@ -309,6 +308,13 @@ export function defineTheme(themeName: string, themeData: IStandaloneThemeData): StaticServices.standaloneThemeService.get().defineTheme(themeName, themeData); } +/** + * Switches to a theme. + */ +export function setTheme(themeName: string): void { + StaticServices.standaloneThemeService.get().setTheme(themeName); +} + /** * @internal */ @@ -336,6 +342,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor { colorizeModelLine: colorizeModelLine, tokenize: tokenize, defineTheme: defineTheme, + setTheme: setTheme, // enums ScrollbarVisibility: ScrollbarVisibility, @@ -354,14 +361,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor { RenderMinimap: editorOptions.RenderMinimap, // classes - InternalEditorScrollbarOptions: editorOptions.InternalEditorScrollbarOptions, - InternalEditorMinimapOptions: editorOptions.InternalEditorMinimapOptions, - EditorWrappingInfo: editorOptions.EditorWrappingInfo, - InternalEditorViewOptions: editorOptions.InternalEditorViewOptions, - EditorContribOptions: editorOptions.EditorContribOptions, InternalEditorOptions: editorOptions.InternalEditorOptions, - OverviewRulerPosition: editorOptions.OverviewRulerPosition, - EditorLayoutInfo: editorOptions.EditorLayoutInfo, BareFontInfo: BareFontInfo, FontInfo: FontInfo, TextModelResolvedOptions: editorCommon.TextModelResolvedOptions, diff --git a/src/vs/editor/browser/standalone/standaloneLanguages.ts b/src/vs/editor/browser/standalone/standaloneLanguages.ts index f3f5584a0db..2e23e5a33ec 100644 --- a/src/vs/editor/browser/standalone/standaloneLanguages.ts +++ b/src/vs/editor/browser/standalone/standaloneLanguages.ts @@ -242,7 +242,7 @@ export function registerHoverProvider(languageId: string, provider: modes.HoverP return undefined; } if (!value.range && word) { - value.range = new Range(position.lineNumber, word.startColumn, position.column, word.endColumn); + value.range = new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); } if (!value.range) { value.range = new Range(position.lineNumber, position.column, position.lineNumber, position.column); diff --git a/src/vs/editor/browser/standalone/standaloneServices.ts b/src/vs/editor/browser/standalone/standaloneServices.ts index 1ce2c0d30b3..550b5294605 100644 --- a/src/vs/editor/browser/standalone/standaloneServices.ts +++ b/src/vs/editor/browser/standalone/standaloneServices.ts @@ -133,13 +133,14 @@ export module StaticServices { export const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), configurationService.get(o), modeService.get(o))); - export const codeEditorService = define(ICodeEditorService, () => new CodeEditorServiceImpl()); + export const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl()); + + export const codeEditorService = define(ICodeEditorService, (o) => new CodeEditorServiceImpl(standaloneThemeService.get(o))); export const progressService = define(IProgressService, () => new SimpleProgressService()); export const storageService = define(IStorageService, () => NullStorageService); - export const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl()); } export class DynamicStandaloneServices extends Disposable { diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index 34828bc9f92..51beeeade27 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -11,7 +11,8 @@ import { IEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents'; -import { CoreCommands, CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; +import { CoreNavigationCommands, CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; +import { Configuration } from 'vs/editor/browser/config/configuration'; export interface ExecCoreEditorCommandFunc { (editorCommand: CoreEditorCommand, args: any): void; @@ -35,17 +36,20 @@ export interface IMouseDispatchData { export class ViewController { + private readonly configuration: Configuration; private readonly viewModel: IViewModel; private readonly _execCoreEditorCommandFunc: ExecCoreEditorCommandFunc; private readonly outgoingEvents: ViewOutgoingEvents; private readonly commandService: ICommandService; constructor( + configuration: Configuration, viewModel: IViewModel, execCommandFunc: ExecCoreEditorCommandFunc, outgoingEvents: ViewOutgoingEvents, commandService: ICommandService ) { + this.configuration = configuration; this.viewModel = viewModel; this._execCoreEditorCommandFunc = execCommandFunc; this.outgoingEvents = outgoingEvents; @@ -97,10 +101,34 @@ export class ViewController { return viewPosition; } + private _hasMulticursorModifier(data: IMouseDispatchData): boolean { + switch (this.configuration.editor.multicursorModifier) { + case 'altKey': + return data.altKey; + case 'ctrlKey': + return data.ctrlKey; + case 'metaKey': + return data.metaKey; + } + return false; + } + + private _hasNonMulticursorModifier(data: IMouseDispatchData): boolean { + switch (this.configuration.editor.multicursorModifier) { + case 'altKey': + return data.ctrlKey || data.metaKey; + case 'ctrlKey': + return data.altKey || data.metaKey; + case 'metaKey': + return data.ctrlKey || data.altKey; + } + return false; + } + public dispatchMouse(data: IMouseDispatchData): void { if (data.startedOnLineNumbers) { // If the dragging started on the gutter, then have operations work on the entire line - if (data.altKey) { + if (this._hasMulticursorModifier(data)) { if (data.inSelectionMode) { this.lastCursorLineSelect(data.position); } else { @@ -116,7 +144,7 @@ export class ViewController { } else if (data.mouseDownCount >= 4) { this.selectAll(); } else if (data.mouseDownCount === 3) { - if (data.altKey) { + if (this._hasMulticursorModifier(data)) { if (data.inSelectionMode) { this.lastCursorLineSelectDrag(data.position); } else { @@ -130,7 +158,7 @@ export class ViewController { } } } else if (data.mouseDownCount === 2) { - if (data.altKey) { + if (this._hasMulticursorModifier(data)) { this.lastCursorWordSelect(data.position); } else { if (data.inSelectionMode) { @@ -140,8 +168,8 @@ export class ViewController { } } } else { - if (data.altKey) { - if (!data.ctrlKey && !data.metaKey) { + if (this._hasMulticursorModifier(data)) { + if (!this._hasNonMulticursorModifier(data)) { if (data.shiftKey) { this.columnSelect(data.position, data.mouseColumn); } else { @@ -163,25 +191,25 @@ export class ViewController { } } - public moveTo(viewPosition: Position): void { + private _usualArgs(viewPosition: Position) { viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.MoveTo, { + return { position: this.convertViewToModelPosition(viewPosition), viewPosition: viewPosition - }); + }; + } + + public moveTo(viewPosition: Position): void { + this._execMouseCommand(CoreNavigationCommands.MoveTo, this._usualArgs(viewPosition)); } private moveToSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.MoveToSelect, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.MoveToSelect, this._usualArgs(viewPosition)); } private columnSelect(viewPosition: Position, mouseColumn: number): void { viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.ColumnSelect, { + this._execMouseCommand(CoreNavigationCommands.ColumnSelect, { position: this.convertViewToModelPosition(viewPosition), viewPosition: viewPosition, mouseColumn: mouseColumn @@ -190,7 +218,7 @@ export class ViewController { private createCursor(viewPosition: Position, wholeLine: boolean): void { viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.CreateCursor, { + this._execMouseCommand(CoreNavigationCommands.CreateCursor, { position: this.convertViewToModelPosition(viewPosition), viewPosition: viewPosition, wholeLine: wholeLine @@ -198,68 +226,39 @@ export class ViewController { } private lastCursorMoveToSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LastCursorMoveToSelect, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.LastCursorMoveToSelect, this._usualArgs(viewPosition)); } private wordSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.WordSelect, { - position: this.convertViewToModelPosition(viewPosition) - }); + this._execMouseCommand(CoreNavigationCommands.WordSelect, this._usualArgs(viewPosition)); } private wordSelectDrag(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.WordSelectDrag, { - position: this.convertViewToModelPosition(viewPosition) - }); + this._execMouseCommand(CoreNavigationCommands.WordSelectDrag, this._usualArgs(viewPosition)); } private lastCursorWordSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LastCursorWordSelect, { - position: this.convertViewToModelPosition(viewPosition) - }); + this._execMouseCommand(CoreNavigationCommands.LastCursorWordSelect, this._usualArgs(viewPosition)); } private lineSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LineSelect, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.LineSelect, this._usualArgs(viewPosition)); } private lineSelectDrag(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LineSelectDrag, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.LineSelectDrag, this._usualArgs(viewPosition)); } private lastCursorLineSelect(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LastCursorLineSelect, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.LastCursorLineSelect, this._usualArgs(viewPosition)); } private lastCursorLineSelectDrag(viewPosition: Position): void { - viewPosition = this._validateViewColumn(viewPosition); - this._execMouseCommand(CoreCommands.LastCursorLineSelectDrag, { - position: this.convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }); + this._execMouseCommand(CoreNavigationCommands.LastCursorLineSelectDrag, this._usualArgs(viewPosition)); } private selectAll(): void { - this._execMouseCommand(CoreCommands.SelectAll, {}); + this._execMouseCommand(CoreNavigationCommands.SelectAll, {}); } // ---------------------- diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index 82d1a1914bb..2ac56ac2773 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -6,21 +6,18 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { IDisposable } from 'vs/base/common/lifecycle'; -import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler'; import { Configuration } from 'vs/editor/browser/config/configuration'; -import { KeyboardHandler, IKeyboardHandlerHelper } from 'vs/editor/browser/controller/keyboardHandler'; +import { TextAreaHandler, ITextAreaHandlerHelper } from 'vs/editor/browser/controller/textAreaHandler'; import { PointerHandler } from 'vs/editor/browser/controller/pointerHandler'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { ViewController, ExecCoreEditorCommandFunc } from 'vs/editor/browser/view/viewController'; import { ViewEventDispatcher } from 'vs/editor/common/view/viewEventDispatcher'; import { ContentViewOverlays, MarginViewOverlays } from 'vs/editor/browser/view/viewOverlays'; -import { LayoutProvider } from 'vs/editor/common/viewLayout/viewLayout'; import { ViewContentWidgets } from 'vs/editor/browser/viewParts/contentWidgets/contentWidgets'; import { CurrentLineHighlightOverlay } from 'vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight'; import { CurrentLineMarginHighlightOverlay } from 'vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight'; @@ -50,7 +47,8 @@ import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData' import { EditorScrollbar } from 'vs/editor/browser/viewParts/editorScrollbar/editorScrollbar'; import { Minimap } from 'vs/editor/browser/viewParts/minimap/minimap'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; +import { IThemeService, getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; +import { Cursor } from 'vs/editor/common/controller/cursor'; export interface IContentWidgetData { widget: editorBrowser.IContentWidget; @@ -66,9 +64,8 @@ export class View extends ViewEventHandler { private eventDispatcher: ViewEventDispatcher; - private layoutProvider: LayoutProvider; private _scrollbar: EditorScrollbar; - public _context: ViewContext; + private _context: ViewContext; // The view lines private viewLines: ViewLines; @@ -80,20 +77,17 @@ export class View extends ViewEventHandler { private viewCursors: ViewCursors; private viewParts: ViewPart[]; - private keyboardHandler: KeyboardHandler; - private pointerHandler: PointerHandler; + private readonly _textAreaHandler: TextAreaHandler; + private readonly pointerHandler: PointerHandler; - private outgoingEvents: ViewOutgoingEvents; + private readonly outgoingEvents: ViewOutgoingEvents; // Dom nodes private linesContent: FastDomNode; public domNode: FastDomNode; - public textArea: FastDomNode; - private textAreaCover: FastDomNode; private overflowGuardContainer: FastDomNode; // Actual mutable state - private hasFocus: boolean; private _isDisposed: boolean; private _renderAnimationFrame: IDisposable; @@ -101,7 +95,9 @@ export class View extends ViewEventHandler { constructor( commandService: ICommandService, configuration: Configuration, + themeService: IThemeService, model: IViewModel, + cursor: Cursor, execCoreEditorCommandFunc: ExecCoreEditorCommandFunc ) { super(); @@ -109,7 +105,7 @@ export class View extends ViewEventHandler { this._renderAnimationFrame = null; this.outgoingEvents = new ViewOutgoingEvents(model); - let viewController = new ViewController(model, execCoreEditorCommandFunc, this.outgoingEvents, commandService); + let viewController = new ViewController(configuration, model, execCoreEditorCommandFunc, this.outgoingEvents, commandService); // The event dispatcher will always go through _renderOnce before dispatching any events this.eventDispatcher = new ViewEventDispatcher((callback: () => void) => this._renderOnce(callback)); @@ -117,71 +113,34 @@ export class View extends ViewEventHandler { // Ensure the view is the first event handler in order to update the layout this.eventDispatcher.addEventHandler(this); - // The layout provider has such responsibilities as: - // - scrolling (i.e. viewport / full size) & co. - // - whitespaces (a.k.a. view zones) management & co. - // - line heights updating & co. - this.layoutProvider = new LayoutProvider(configuration, model.getLineCount(), this.eventDispatcher); - // The view context is passed on to most classes (basically to reduce param. counts in ctors) - this._context = new ViewContext(configuration, model, this.eventDispatcher); + this._context = new ViewContext(configuration, themeService.getTheme(), model, this.eventDispatcher); - this.createTextArea(); - this.createViewParts(); - this._setLayout(); + this._register(themeService.onThemeChange(theme => { + this._context.theme = theme; + this.eventDispatcher.emit(new viewEvents.ViewThemeChangedEvent()); + this.render(true, false); + })); + + this.viewParts = []; // Keyboard handler - this.keyboardHandler = new KeyboardHandler(this._context, viewController, this.createKeyboardHandlerHelper()); + this._textAreaHandler = new TextAreaHandler(this._context, viewController, this.createTextAreaHandlerHelper()); + this.viewParts.push(this._textAreaHandler); + + this.createViewParts(); + this._setLayout(); // Pointer handler this.pointerHandler = new PointerHandler(this._context, viewController, this.createPointerHandlerHelper()); - this.hasFocus = false; - this._register(model.addEventListener((events: viewEvents.ViewEvent[]) => { this.eventDispatcher.emitMany(events); })); - } - private createTextArea(): void { - // Text Area (The focus will always be in the textarea when the cursor is blinking) - this.textArea = createFastDomNode(document.createElement('textarea')); - PartFingerprints.write(this.textArea, PartFingerprint.TextArea); - this.textArea.setClassName('inputarea'); - this.textArea.setAttribute('wrap', 'off'); - this.textArea.setAttribute('autocorrect', 'off'); - this.textArea.setAttribute('autocapitalize', 'off'); - this.textArea.setAttribute('spellcheck', 'false'); - this.textArea.setAttribute('aria-label', this._context.configuration.editor.viewInfo.ariaLabel); - this.textArea.setAttribute('role', 'textbox'); - this.textArea.setAttribute('aria-multiline', 'true'); - this.textArea.setAttribute('aria-haspopup', 'false'); - this.textArea.setAttribute('aria-autocomplete', 'both'); - - this.textArea.setTop(0); - this.textArea.setLeft(0); - - this._register(dom.addDisposableListener(this.textArea.domNode, 'focus', () => this._setHasFocus(true))); - this._register(dom.addDisposableListener(this.textArea.domNode, 'blur', () => this._setHasFocus(false))); - - // On top of the text area, we position a dom node to cover it up - // (there have been reports of tiny blinking cursors) - // (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea) - this.textAreaCover = createFastDomNode(document.createElement('div')); - if (this._context.configuration.editor.viewInfo.glyphMargin) { - this.textAreaCover.setClassName('monaco-editor-background ' + Margin.CLASS_NAME + ' ' + 'textAreaCover'); - } else { - if (this._context.configuration.editor.viewInfo.renderLineNumbers) { - this.textAreaCover.setClassName('monaco-editor-background ' + LineNumbersOverlay.CLASS_NAME + ' ' + 'textAreaCover'); - } else { - this.textAreaCover.setClassName('monaco-editor-background ' + 'textAreaCover'); - } - } - this.textAreaCover.setPosition('absolute'); - this.textAreaCover.setWidth(1); - this.textAreaCover.setHeight(1); - this.textAreaCover.setTop(0); - this.textAreaCover.setLeft(0); + this._register(cursor.addEventListener((events: viewEvents.ViewEvent[]) => { + this.eventDispatcher.emitMany(events); + })); } private createViewParts(): void { @@ -191,29 +150,24 @@ export class View extends ViewEventHandler { this.linesContent.setPosition('absolute'); this.domNode = createFastDomNode(document.createElement('div')); - this.domNode.setClassName(this._context.configuration.editor.viewInfo.editorClassName); + this.domNode.setClassName(this.getEditorClassName()); this.overflowGuardContainer = createFastDomNode(document.createElement('div')); PartFingerprints.write(this.overflowGuardContainer, PartFingerprint.OverflowGuard); this.overflowGuardContainer.setClassName('overflow-guard'); - this.viewParts = []; - - this._scrollbar = new EditorScrollbar(this._context, this.layoutProvider.getScrollable(), this.linesContent, this.domNode, this.overflowGuardContainer); + this._scrollbar = new EditorScrollbar(this._context, this.linesContent, this.domNode, this.overflowGuardContainer); this.viewParts.push(this._scrollbar); // View Lines - this.viewLines = new ViewLines(this._context, this.linesContent, this.layoutProvider); + this.viewLines = new ViewLines(this._context, this.linesContent); // View Zones - this.viewZones = new ViewZones(this._context, this.layoutProvider); + this.viewZones = new ViewZones(this._context); this.viewParts.push(this.viewZones); // Decorations overview ruler - let decorationsOverviewRuler = new DecorationsOverviewRuler( - this._context, this.layoutProvider.getScrollHeight(), - (lineNumber: number) => this.layoutProvider.getVerticalOffsetForLineNumber(lineNumber) - ); + let decorationsOverviewRuler = new DecorationsOverviewRuler(this._context); this.viewParts.push(decorationsOverviewRuler); @@ -254,7 +208,7 @@ export class View extends ViewEventHandler { let rulers = new Rulers(this._context); this.viewParts.push(rulers); - let minimap = new Minimap(this._context, this.layoutProvider, this._scrollbar); + let minimap = new Minimap(this._context, this._scrollbar); this.viewParts.push(minimap); // -------------- Wire dom nodes up @@ -273,9 +227,9 @@ export class View extends ViewEventHandler { this.overflowGuardContainer.appendChild(margin.getDomNode()); this.overflowGuardContainer.appendChild(this._scrollbar.getDomNode()); this.overflowGuardContainer.appendChild(scrollDecoration.getDomNode()); + this.overflowGuardContainer.appendChild(this._textAreaHandler.textArea); + this.overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover); this.overflowGuardContainer.appendChild(this.overlayWidgets.getDomNode()); - this.overflowGuardContainer.appendChild(this.textArea); - this.overflowGuardContainer.appendChild(this.textAreaCover); this.overflowGuardContainer.appendChild(minimap.getDomNode()); this.domNode.appendChild(this.overflowGuardContainer); this.domNode.appendChild(this.contentWidgets.overflowingContentWidgetsDomNode); @@ -294,29 +248,6 @@ export class View extends ViewEventHandler { this.focus(); }, - getScrollLeft: () => { - return this.layoutProvider.getScrollLeft(); - }, - getScrollTop: () => { - return this.layoutProvider.getScrollTop(); - }, - - setScrollPosition: (position: editorCommon.INewScrollPosition) => { - this.layoutProvider.setScrollPosition(position); - }, - - isAfterLines: (verticalOffset: number) => { - return this.layoutProvider.isAfterLines(verticalOffset); - }, - getLineNumberAtVerticalOffset: (verticalOffset: number) => { - return this.layoutProvider.getLineNumberAtVerticalOffset(verticalOffset); - }, - getVerticalOffsetForLineNumber: (lineNumber: number) => { - return this.layoutProvider.getVerticalOffsetForLineNumber(lineNumber); - }, - getWhitespaceAtVerticalOffset: (verticalOffset: number) => { - return this.layoutProvider.getWhitespaceAtVerticalOffset(verticalOffset); - }, getLastViewCursorsRenderData: () => { return this.viewCursors.getLastRenderData() || []; }, @@ -347,10 +278,8 @@ export class View extends ViewEventHandler { }; } - private createKeyboardHandlerHelper(): IKeyboardHandlerHelper { + private createTextAreaHandlerHelper(): ITextAreaHandlerHelper { return { - viewDomNode: this.domNode, - textArea: this.textArea, visibleRangeForPositionRelativeToEditor: (lineNumber: number, column: number) => { this._flushAccumulatedAndRenderNow(); let visibleRanges = this.viewLines.visibleRangesForRange2(new Range(lineNumber, column, lineNumber, column)); @@ -358,22 +287,12 @@ export class View extends ViewEventHandler { return null; } return visibleRanges[0]; - }, - getVerticalOffsetForLineNumber: (lineNumber: number) => { - return this.layoutProvider.getVerticalOffsetForLineNumber(lineNumber); } }; } private _setLayout(): void { const layoutInfo = this._context.configuration.editor.layoutInfo; - if (browser.isChrome) { - /* tslint:disable:no-unused-variable */ - // Access overflowGuardContainer.clientWidth to prevent relayouting bug in Chrome - // See Bug 19676: Editor misses a layout event - let clientWidth = this.overflowGuardContainer.domNode.clientWidth + 'px'; - /* tslint:enable:no-unused-variable */ - } this.domNode.setWidth(layoutInfo.width); this.domNode.setHeight(layoutInfo.height); @@ -385,23 +304,19 @@ export class View extends ViewEventHandler { } + private getEditorClassName() { + return this._context.configuration.editor.editorClassName + ' ' + getThemeTypeSelector(this._context.theme.type); + } + // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.viewInfo.editorClassName) { - this.domNode.setClassName(this._context.configuration.editor.viewInfo.editorClassName); - } - if (e.viewInfo.ariaLabel) { - this.textArea.setAttribute('aria-label', this._context.configuration.editor.viewInfo.ariaLabel); + if (e.editorClassName) { + this.domNode.setClassName(this.getEditorClassName()); } if (e.layoutInfo) { this._setLayout(); } - this.layoutProvider.onConfigurationChanged(e); - return false; - } - public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { - this.layoutProvider.onFlushed(this._context.model.getLineCount()); return false; } public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean { @@ -413,22 +328,12 @@ export class View extends ViewEventHandler { } return false; } - public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean { - this.layoutProvider.onLinesDeleted(e); - return false; - } - public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { - this.layoutProvider.onLinesInserted(e); - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { this.outgoingEvents.emitScrollChanged(e); return false; } - public onScrollRequest(e: viewEvents.ViewScrollRequestEvent): boolean { - this.layoutProvider.setScrollPosition({ - scrollTop: e.desiredScrollTop - }); + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + this.domNode.setClassName(this.getEditorClassName()); return false; } @@ -444,7 +349,6 @@ export class View extends ViewEventHandler { this.eventDispatcher.removeEventHandler(this); this.outgoingEvents.dispose(); - this.keyboardHandler.dispose(); this.pointerHandler.dispose(); this.viewLines.dispose(); @@ -455,8 +359,6 @@ export class View extends ViewEventHandler { } this.viewParts = []; - this.layoutProvider.dispose(); - super.dispose(); } @@ -501,28 +403,23 @@ export class View extends ViewEventHandler { if (!this.viewLines.shouldRender() && viewPartsToRender.length === 0) { // Nothing to render - this.keyboardHandler.writeToTextArea(); return; } - let partialViewportData = this.layoutProvider.getLinesViewportData(); + const partialViewportData = this._context.viewLayout.getLinesViewportData(); this._context.model.setViewport(partialViewportData.startLineNumber, partialViewportData.endLineNumber, partialViewportData.centeredLineNumber); let viewportData = new ViewportData(partialViewportData, this._context.model); if (this.viewLines.shouldRender()) { - this.viewLines.renderText(viewportData, () => { - this.keyboardHandler.writeToTextArea(); - }); + this.viewLines.renderText(viewportData); this.viewLines.onDidRender(); // Rendering of viewLines might cause scroll events to occur, so collect view parts to render again viewPartsToRender = this._getViewPartsToRender(); - } else { - this.keyboardHandler.writeToTextArea(); } - let renderingContext = new RenderingContext(this.layoutProvider, viewportData, this.viewLines); + let renderingContext = new RenderingContext(this._context.viewLayout, viewportData, this.viewLines); // Render the rest of the parts for (let i = 0, len = viewPartsToRender.length; i < len; i++) { @@ -537,39 +434,8 @@ export class View extends ViewEventHandler { } } - private _setHasFocus(newHasFocus: boolean): void { - if (this.hasFocus !== newHasFocus) { - this.hasFocus = newHasFocus; - this._context.privateViewEventBus.emit(new viewEvents.ViewFocusChangedEvent(this.hasFocus)); - } - } - // --- BEGIN CodeEditor helpers - public getScrollWidth(): number { - return this.layoutProvider.getScrollWidth(); - } - - public getScrollLeft(): number { - return this.layoutProvider.getScrollLeft(); - } - - public getScrollHeight(): number { - return this.layoutProvider.getScrollHeight(); - } - - public getScrollTop(): number { - return this.layoutProvider.getScrollTop(); - } - - public setScrollPosition(scrollPosition: editorCommon.INewScrollPosition): void { - this.layoutProvider.setScrollPosition(scrollPosition); - } - - public getVerticalOffsetForViewLineNumber(viewLineNumber: number): number { - return this.layoutProvider.getVerticalOffsetForLineNumber(viewLineNumber); - } - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { this._scrollbar.delegateVerticalScrollbarMouseDown(browserEvent); } @@ -592,37 +458,12 @@ export class View extends ViewEventHandler { return this.pointerHandler.getTargetAtClientPoint(clientX, clientY); } - public getCompletelyVisibleViewRange(): Range { - const partialData = this.layoutProvider.getLinesViewportData(); - const startViewLineNumber = partialData.completelyVisibleStartLineNumber; - const endViewLineNumber = partialData.completelyVisibleEndLineNumber; - - return new Range( - startViewLineNumber, this._context.model.getLineMinColumn(startViewLineNumber), - endViewLineNumber, this._context.model.getLineMaxColumn(endViewLineNumber) - ); - } - - public getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range { - const partialData = this.layoutProvider.getLinesViewportDataAtScrollTop(scrollTop); - const startViewLineNumber = partialData.completelyVisibleStartLineNumber; - const endViewLineNumber = partialData.completelyVisibleEndLineNumber; - - return new Range( - startViewLineNumber, this._context.model.getLineMinColumn(startViewLineNumber), - endViewLineNumber, this._context.model.getLineMaxColumn(endViewLineNumber) - ); - } - public getInternalEventBus(): ViewOutgoingEvents { return this.outgoingEvents; } public createOverviewRuler(cssClassName: string, minimumHeight: number, maximumHeight: number): OverviewRuler { - return new OverviewRuler( - this._context, cssClassName, this.layoutProvider.getScrollHeight(), minimumHeight, maximumHeight, - (lineNumber: number) => this.layoutProvider.getVerticalOffsetForLineNumber(lineNumber) - ); + return new OverviewRuler(this._context, cssClassName, minimumHeight, maximumHeight); } public change(callback: (changeAccessor: editorBrowser.IViewZoneChangeAccessor) => any): boolean { @@ -655,17 +496,13 @@ export class View extends ViewEventHandler { changeAccessor.removeZone = null; if (zonesHaveChanged) { - this.layoutProvider.onHeightMaybeChanged(); + this._context.viewLayout.onHeightMaybeChanged(); this._context.privateViewEventBus.emit(new viewEvents.ViewZonesChangedEvent()); } }); return zonesHaveChanged; } - public getWhitespaces(): IEditorWhitespace[] { - return this.layoutProvider.getWhitespaces(); - } - public render(now: boolean, everything: boolean): void { if (everything) { // Force everything to render... @@ -683,38 +520,15 @@ export class View extends ViewEventHandler { } public setAriaActiveDescendant(id: string): void { - if (id) { - this.textArea.setAttribute('role', 'combobox'); - if (this.textArea.getAttribute('aria-activedescendant') !== id) { - this.textArea.setAttribute('aria-haspopup', 'true'); - this.textArea.setAttribute('aria-activedescendant', id); - } - } else { - this.textArea.setAttribute('role', 'textbox'); - this.textArea.removeAttribute('aria-activedescendant'); - this.textArea.removeAttribute('aria-haspopup'); - } - } - - public saveState(): editorCommon.IViewState { - return this.layoutProvider.saveState(); - } - - public restoreState(state: editorCommon.IViewState): void { - return this.layoutProvider.restoreState(state); + this._textAreaHandler.setAriaActiveDescendant(id); } public focus(): void { - this.keyboardHandler.focusTextArea(); - - // IE does not trigger the focus event immediately, so we must help it a little bit - if (document.activeElement === this.textArea.domNode) { - this._setHasFocus(true); - } + this._textAreaHandler.focusTextArea(); } public isFocused(): boolean { - return this.hasFocus; + return this._textAreaHandler.isFocused(); } public addContentWidget(widgetData: IContentWidgetData): void { diff --git a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts index 3a2a8ae1fe1..15adceca2e1 100644 --- a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts +++ b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts @@ -14,36 +14,6 @@ import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/v import { Position, IPosition } from 'vs/editor/common/core/position'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -interface IWidgetData { - allowEditorOverflow: boolean; - widget: IContentWidget; - position: IPosition; - preference: ContentWidgetPositionPreference[]; - isVisible: boolean; - domNode: FastDomNode; -} - -interface IWidgetMap { - [key: string]: IWidgetData; -} - -interface IBoxLayoutResult { - aboveTop: number; - fitsAbove: boolean; - belowTop: number; - fitsBelow: boolean; - left: number; -} - -interface IMyWidgetRenderData { - top: number; - left: number; -} - -interface IMyRenderData { - [id: string]: IMyWidgetRenderData; -} - class Coordinate { _coordinateBrand: void; @@ -58,25 +28,16 @@ class Coordinate { export class ViewContentWidgets extends ViewPart { - private _widgets: IWidgetMap; - private _contentWidth: number; - private _contentLeft: number; - private _lineHeight: number; - private _renderData: IMyRenderData; + private _viewDomNode: FastDomNode; + private _widgets: { [key: string]: Widget; }; public domNode: FastDomNode; public overflowingContentWidgetsDomNode: FastDomNode; - private _viewDomNode: FastDomNode; constructor(context: ViewContext, viewDomNode: FastDomNode) { super(context); this._viewDomNode = viewDomNode; - this._widgets = {}; - this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; - this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; - this._lineHeight = this._context.configuration.editor.lineHeight; - this._renderData = {}; this.domNode = createFastDomNode(document.createElement('div')); PartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets); @@ -98,39 +59,16 @@ export class ViewContentWidgets extends ViewPart { // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.lineHeight) { - this._lineHeight = this._context.configuration.editor.lineHeight; - } - if (e.layoutInfo) { - this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; - - if (this._contentWidth !== this._context.configuration.editor.layoutInfo.contentWidth) { - this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; - // update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout` - // below can read out the adjusted width/height of widgets - let keys = Object.keys(this._widgets); - for (let i = 0, len = keys.length; i < len; i++) { - const widgetId = keys[i]; - const widgetData = this._widgets[widgetId]; - const maxWidth = widgetData.allowEditorOverflow - ? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth - : this._contentWidth; - - widgetData.domNode.setMaxWidth(maxWidth); - } - } + let keys = Object.keys(this._widgets); + for (let i = 0, len = keys.length; i < len; i++) { + const widgetId = keys[i]; + this._widgets[widgetId].onConfigurationChanged(e); } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - return false; - } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { // true for inline decorations that can end up relayouting text - return true;//e.inlineDecorationsChanged; + return true; } public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { return true; @@ -144,9 +82,6 @@ export class ViewContentWidgets extends ViewPart { public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { return true; } - public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return true; } @@ -156,49 +91,33 @@ export class ViewContentWidgets extends ViewPart { // ---- end view event handlers - public addWidget(widget: IContentWidget): void { - const domNode = createFastDomNode(widget.getDomNode()); + public addWidget(_widget: IContentWidget): void { + const myWidget = new Widget(this._context, this._viewDomNode, _widget); + this._widgets[myWidget.id] = myWidget; - const widgetData: IWidgetData = { - allowEditorOverflow: widget.allowEditorOverflow || false, - widget: widget, - position: null, - preference: null, - isVisible: false, - domNode: domNode - }; - this._widgets[widget.getId()] = widgetData; - - domNode.setPosition((this._context.configuration.editor.viewInfo.fixedOverflowWidgets && widget.allowEditorOverflow) ? 'fixed' : 'absolute'); - domNode.setMaxWidth(this._contentWidth); - domNode.setVisibility('hidden'); - domNode.setAttribute('widgetId', widget.getId()); - - if (widgetData.allowEditorOverflow) { - this.overflowingContentWidgetsDomNode.appendChild(domNode); + if (myWidget.allowEditorOverflow) { + this.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode); } else { - this.domNode.appendChild(domNode); + this.domNode.appendChild(myWidget.domNode); } this.setShouldRender(); } public setWidgetPosition(widget: IContentWidget, position: IPosition, preference: ContentWidgetPositionPreference[]): void { - let widgetData = this._widgets[widget.getId()]; - - widgetData.position = position; - widgetData.preference = preference; + const myWidget = this._widgets[widget.getId()]; + myWidget.setPosition(position, preference); this.setShouldRender(); } public removeWidget(widget: IContentWidget): void { - let widgetId = widget.getId(); + const widgetId = widget.getId(); if (this._widgets.hasOwnProperty(widgetId)) { - let widgetData = this._widgets[widgetId]; + const myWidget = this._widgets[widgetId]; delete this._widgets[widgetId]; - const domNode = widgetData.domNode.domNode; + const domNode = myWidget.domNode.domNode; domNode.parentNode.removeChild(domNode); domNode.removeAttribute('monaco-visible-content-widget'); @@ -208,12 +127,107 @@ export class ViewContentWidgets extends ViewPart { public shouldSuppressMouseDownOnWidget(widgetId: string): boolean { if (this._widgets.hasOwnProperty(widgetId)) { - let widgetData = this._widgets[widgetId]; - return widgetData.widget.suppressMouseDown; + return this._widgets[widgetId].suppressMouseDown; } return false; } + public prepareRender(ctx: RenderingContext): void { + let keys = Object.keys(this._widgets); + for (let i = 0, len = keys.length; i < len; i++) { + const widgetId = keys[i]; + this._widgets[widgetId].prepareRender(ctx); + } + } + + public render(ctx: RestrictedRenderingContext): void { + let keys = Object.keys(this._widgets); + for (let i = 0, len = keys.length; i < len; i++) { + const widgetId = keys[i]; + this._widgets[widgetId].render(ctx); + } + } +} + +interface IBoxLayoutResult { + aboveTop: number; + fitsAbove: boolean; + belowTop: number; + fitsBelow: boolean; + left: number; +} + +class Widget { + private readonly _context: ViewContext; + private readonly _viewDomNode: FastDomNode; + private readonly _actual: IContentWidget; + + public readonly domNode: FastDomNode; + public readonly id: string; + public readonly allowEditorOverflow: boolean; + public readonly suppressMouseDown: boolean; + + private _fixedOverflowWidgets: boolean; + private _contentWidth: number; + private _contentLeft: number; + private _lineHeight: number; + + private _position: IPosition; + private _preference: ContentWidgetPositionPreference[]; + private _isVisible: boolean; + private _renderData: Coordinate; + + constructor(context: ViewContext, viewDomNode: FastDomNode, actual: IContentWidget) { + this._context = context; + this._viewDomNode = viewDomNode; + this._actual = actual; + this.domNode = createFastDomNode(this._actual.getDomNode()); + + this.id = this._actual.getId(); + this.allowEditorOverflow = this._actual.allowEditorOverflow || false; + this.suppressMouseDown = this._actual.suppressMouseDown || false; + + this._fixedOverflowWidgets = this._context.configuration.editor.viewInfo.fixedOverflowWidgets; + this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; + this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; + this._lineHeight = this._context.configuration.editor.lineHeight; + + this._position = null; + this._preference = null; + this._isVisible = false; + this._renderData = null; + + this.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute'); + this._updateMaxWidth(); + this.domNode.setVisibility('hidden'); + this.domNode.setAttribute('widgetId', this.id); + } + + public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void { + if (e.lineHeight) { + this._lineHeight = this._context.configuration.editor.lineHeight; + } + if (e.layoutInfo) { + this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; + this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; + + this._updateMaxWidth(); + } + } + + private _updateMaxWidth(): void { + const maxWidth = this.allowEditorOverflow + ? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth + : this._contentWidth; + + this.domNode.setMaxWidth(maxWidth); + } + + public setPosition(position: IPosition, preference: ContentWidgetPositionPreference[]): void { + this._position = position; + this._preference = preference; + } + private _layoutBoxInViewport(topLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult { // Our visible box is split horizontally by the current line => 2 boxes @@ -285,7 +299,7 @@ export class ViewContentWidgets extends ViewPart { left -= delta; } - if (this._context.configuration.editor.viewInfo.fixedOverflowWidgets) { + if (this._fixedOverflowWidgets) { aboveTop = absoluteAboveTop; belowTop = absoluteBelowTop; left = absoluteLeft; @@ -294,17 +308,8 @@ export class ViewContentWidgets extends ViewPart { return { aboveTop, fitsAbove, belowTop, fitsBelow, left }; } - private _prepareRenderWidgetAtExactPosition(topLeft: Coordinate): IMyWidgetRenderData { - return { - top: topLeft.top, - left: topLeft.left - }; - } - - private _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): IMyWidgetRenderData { - let r = this._prepareRenderWidgetAtExactPosition(topLeft); - r.left += this._contentLeft; - return r; + private _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate { + return new Coordinate(topLeft.top, topLeft.left + this._contentLeft); } private _getTopLeft(ctx: RenderingContext, position: Position): Coordinate { @@ -317,13 +322,13 @@ export class ViewContentWidgets extends ViewPart { return new Coordinate(top, visibleRange.left); } - private _prepareRenderWidget(widgetData: IWidgetData, ctx: RenderingContext): IMyWidgetRenderData { - if (!widgetData.position || !widgetData.preference) { + private _prepareRenderWidget(ctx: RenderingContext): Coordinate { + if (!this._position || !this._preference) { return null; } // Do not trust that widgets have a valid position - let validModelPosition = this._context.model.validateModelPosition(widgetData.position); + let validModelPosition = this._context.model.validateModelPosition(this._position); if (!this._context.model.coordinatesConverter.modelPositionIsVisible(validModelPosition)) { // this position is hidden by the view model @@ -333,21 +338,21 @@ export class ViewContentWidgets extends ViewPart { let position = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition); let placement: IBoxLayoutResult = null; - let fetchPlacement = () => { + let fetchPlacement = (): void => { if (placement) { return; } const topLeft = this._getTopLeft(ctx, position); if (!topLeft) { - return null; + return; } - const domNode = widgetData.domNode.domNode; + const domNode = this.domNode.domNode; const width = domNode.clientWidth; const height = domNode.clientHeight; - if (widgetData.allowEditorOverflow) { + if (this.allowEditorOverflow) { placement = this._layoutBoxInPage(topLeft, width, height, ctx); } else { placement = this._layoutBoxInViewport(topLeft, width, height, ctx); @@ -356,8 +361,8 @@ export class ViewContentWidgets extends ViewPart { // Do two passes, first for perfect fit, second picks first option for (let pass = 1; pass <= 2; pass++) { - for (let i = 0; i < widgetData.preference.length; i++) { - let pref = widgetData.preference[i]; + for (let i = 0; i < this._preference.length; i++) { + let pref = this._preference[i]; if (pref === ContentWidgetPositionPreference.ABOVE) { fetchPlacement(); if (!placement) { @@ -365,10 +370,7 @@ export class ViewContentWidgets extends ViewPart { return null; } if (pass === 2 || placement.fitsAbove) { - return { - top: placement.aboveTop, - left: placement.left - }; + return new Coordinate(placement.aboveTop, placement.left); } } else if (pref === ContentWidgetPositionPreference.BELOW) { fetchPlacement(); @@ -377,10 +379,7 @@ export class ViewContentWidgets extends ViewPart { return null; } if (pass === 2 || placement.fitsBelow) { - return { - top: placement.belowTop, - left: placement.left - }; + return new Coordinate(placement.belowTop, placement.left); } } else { const topLeft = this._getTopLeft(ctx, position); @@ -388,10 +387,10 @@ export class ViewContentWidgets extends ViewPart { // Widget outside of viewport return null; } - if (widgetData.allowEditorOverflow) { + if (this.allowEditorOverflow) { return this._prepareRenderWidgetAtExactPositionOverflowing(topLeft); } else { - return this._prepareRenderWidgetAtExactPosition(topLeft); + return topLeft; } } } @@ -400,49 +399,33 @@ export class ViewContentWidgets extends ViewPart { } public prepareRender(ctx: RenderingContext): void { - let data: IMyRenderData = {}; - - let keys = Object.keys(this._widgets); - for (let i = 0, len = keys.length; i < len; i++) { - let widgetId = keys[i]; - let renderData = this._prepareRenderWidget(this._widgets[widgetId], ctx); - if (renderData) { - data[widgetId] = renderData; - } - } - - this._renderData = data; + this._renderData = this._prepareRenderWidget(ctx); } public render(ctx: RestrictedRenderingContext): void { - let data = this._renderData; - - let keys = Object.keys(this._widgets); - for (let i = 0, len = keys.length; i < len; i++) { - const widgetId = keys[i]; - const widget = this._widgets[widgetId]; - const domNode = widget.domNode; - - if (data.hasOwnProperty(widgetId)) { - if (widget.allowEditorOverflow) { - domNode.setTop(data[widgetId].top); - domNode.setLeft(data[widgetId].left); - } else { - domNode.setTop(data[widgetId].top + ctx.scrollTop - ctx.bigNumbersDelta); - domNode.setLeft(data[widgetId].left); - } - if (!widget.isVisible) { - domNode.setVisibility('inherit'); - domNode.setAttribute('monaco-visible-content-widget', 'true'); - widget.isVisible = true; - } - } else { - if (widget.isVisible) { - domNode.removeAttribute('monaco-visible-content-widget'); - widget.isVisible = false; - domNode.setVisibility('hidden'); - } + if (!this._renderData) { + // This widget should be invisible + if (this._isVisible) { + this.domNode.removeAttribute('monaco-visible-content-widget'); + this._isVisible = false; + this.domNode.setVisibility('hidden'); } + return; + } + + // This widget should be visible + if (this.allowEditorOverflow) { + this.domNode.setTop(this._renderData.top); + this.domNode.setLeft(this._renderData.left); + } else { + this.domNode.setTop(this._renderData.top + ctx.scrollTop - ctx.bigNumbersDelta); + this.domNode.setLeft(this._renderData.left); + } + + if (!this._isVisible) { + this.domNode.setVisibility('inherit'); + this.domNode.setAttribute('monaco-visible-content-widget', 'true'); + this._isVisible = true; } } } diff --git a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts index e0ec23a3868..58e4ee7b40c 100644 --- a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts +++ b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts @@ -55,7 +55,7 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay { if (e.readOnly) { this._readOnly = this._context.configuration.editor.readOnly; } - if (e.viewInfo.renderLineHighlight) { + if (e.viewInfo) { this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight; } if (e.layoutInfo) { @@ -63,30 +63,30 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay { } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { let hasChanged = false; + if (this._primaryCursorIsInEditableRange !== e.isInEditableRange) { this._primaryCursorIsInEditableRange = e.isInEditableRange; hasChanged = true; } - if (this._primaryCursorLineNumber !== e.position.lineNumber) { - this._primaryCursorLineNumber = e.position.lineNumber; + + const primaryCursorLineNumber = e.selections[0].positionLineNumber; + if (this._primaryCursorLineNumber !== primaryCursorLineNumber) { + this._primaryCursorLineNumber = primaryCursorLineNumber; hasChanged = true; } - return hasChanged; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - let isEmpty = e.selection.isEmpty(); - if (this._selectionIsEmpty !== isEmpty) { - this._selectionIsEmpty = isEmpty; + + const selectionIsEmpty = e.selections[0].isEmpty(); + if (this._selectionIsEmpty !== selectionIsEmpty) { + this._selectionIsEmpty = selectionIsEmpty; + hasChanged = true; return true; } - return false; + + return hasChanged; } public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { - this._primaryCursorIsInEditableRange = true; - this._selectionIsEmpty = true; - this._primaryCursorLineNumber = 1; return true; } public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean { @@ -134,14 +134,15 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay { registerThemingParticipant((theme, collector) => { let lineHighlight = theme.getColor(editorLineHighlight); if (lineHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .view-overlays .current-line { background-color: ${lineHighlight}; border: none; }`); - } else { + collector.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${lineHighlight}; }`); + } + if (!lineHighlight || lineHighlight.isTransparent() || theme.defines(editorLineHighlightBorder)) { let lineHighlightBorder = theme.getColor(editorLineHighlightBorder); if (lineHighlightBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .view-overlays .current-line { border: 2px solid ${lineHighlightBorder}; }`); - } - if (theme.type === 'hc') { - collector.addRule(`.monaco-editor.${theme.selector} .view-overlays .current-line { border-width: 1px; }`); + collector.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${lineHighlightBorder}; }`); + if (theme.type === 'hc') { + collector.addRule(`.monaco-editor .view-overlays .current-line { border-width: 1px; }`); + } } } }); diff --git a/src/vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight.ts b/src/vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight.ts index 1ceb0914cc8..38d980922e9 100644 --- a/src/vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight.ts +++ b/src/vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight.ts @@ -46,7 +46,7 @@ export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay { if (e.lineHeight) { this._lineHeight = this._context.configuration.editor.lineHeight; } - if (e.viewInfo.renderLineHighlight) { + if (e.viewInfo) { this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight; } if (e.layoutInfo) { @@ -54,21 +54,23 @@ export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay { } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { let hasChanged = false; + if (this._primaryCursorIsInEditableRange !== e.isInEditableRange) { this._primaryCursorIsInEditableRange = e.isInEditableRange; hasChanged = true; } - if (this._primaryCursorLineNumber !== e.position.lineNumber) { - this._primaryCursorLineNumber = e.position.lineNumber; + + const primaryCursorLineNumber = e.selections[0].positionLineNumber; + if (this._primaryCursorLineNumber !== primaryCursorLineNumber) { + this._primaryCursorLineNumber = primaryCursorLineNumber; hasChanged = true; } + return hasChanged; } public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { - this._primaryCursorIsInEditableRange = true; - this._primaryCursorLineNumber = 1; return true; } public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean { @@ -110,14 +112,14 @@ export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay { registerThemingParticipant((theme, collector) => { let lineHighlight = theme.getColor(editorLineHighlight); if (lineHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`); + collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`); } else { let lineHighlightBorder = theme.getColor(editorLineHighlightBorder); if (lineHighlightBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`); + collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`); } if (theme.type === 'hc') { - collector.addRule(`.monaco-editor.${theme.selector} .margin-view-overlays .current-line-margin { border-width: 1px; }`); + collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }`); } } }); diff --git a/src/vs/editor/browser/viewParts/decorations/decorations.ts b/src/vs/editor/browser/viewParts/decorations/decorations.ts index fc067376be2..2cc107d4037 100644 --- a/src/vs/editor/browser/viewParts/decorations/decorations.ts +++ b/src/vs/editor/browser/viewParts/decorations/decorations.ts @@ -9,7 +9,7 @@ import 'vs/css!./decorations'; import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; import { Range } from 'vs/editor/common/core/range'; import { ViewContext } from 'vs/editor/common/view/viewContext'; -import { RenderingContext } from 'vs/editor/common/view/renderingContext'; +import { RenderingContext, HorizontalRange } from 'vs/editor/common/view/renderingContext'; import { ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; @@ -17,12 +17,14 @@ export class DecorationsOverlay extends DynamicViewOverlay { private _context: ViewContext; private _lineHeight: number; + private _typicalHalfwidthCharacterWidth: number; private _renderResult: string[]; constructor(context: ViewContext) { super(); this._context = context; this._lineHeight = this._context.configuration.editor.lineHeight; + this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth; this._renderResult = null; this._context.addEventHandler(this); @@ -41,14 +43,11 @@ export class DecorationsOverlay extends DynamicViewOverlay { if (e.lineHeight) { this._lineHeight = this._context.configuration.editor.lineHeight; } + if (e.fontInfo) { + this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth; + } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - return false; - } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { return true; } @@ -64,9 +63,6 @@ export class DecorationsOverlay extends DynamicViewOverlay { public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { return true; } - public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return e.scrollTopChanged || e.scrollWidthChanged; } @@ -150,26 +146,40 @@ export class DecorationsOverlay extends DynamicViewOverlay { let visibleStartLineNumber = ctx.visibleRange.startLineNumber; for (let i = 0, lenI = decorations.length; i < lenI; i++) { - let d = decorations[i]; + const d = decorations[i]; if (d.source.options.isWholeLine) { continue; } - let className = d.source.options.className; + const className = d.source.options.className; + const showIfCollapsed = d.source.options.showIfCollapsed; - let linesVisibleRanges = ctx.linesVisibleRangesForRange(d.range, /*TODO@Alex*/className === 'findMatch'); + let range = d.range; + if (showIfCollapsed && range.endColumn === 1 && range.endLineNumber !== range.startLineNumber) { + range = new Range(range.startLineNumber, range.startColumn, range.endLineNumber - 1, this._context.model.getLineMaxColumn(range.endLineNumber - 1)); + } + + let linesVisibleRanges = ctx.linesVisibleRangesForRange(range, /*TODO@Alex*/className === 'findMatch'); if (!linesVisibleRanges) { continue; } for (let j = 0, lenJ = linesVisibleRanges.length; j < lenJ; j++) { let lineVisibleRanges = linesVisibleRanges[j]; - let lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber; + const lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber; + + if (showIfCollapsed && lineVisibleRanges.ranges.length === 1) { + const singleVisibleRange = lineVisibleRanges.ranges[0]; + if (singleVisibleRange.width === 0) { + // collapsed range case => make the decoration visible by faking its width + lineVisibleRanges.ranges[0] = new HorizontalRange(singleVisibleRange.left, this._typicalHalfwidthCharacterWidth); + } + } for (let k = 0, lenK = lineVisibleRanges.ranges.length; k < lenK; k++) { - let visibleRange = lineVisibleRanges.ranges[k]; - let decorationOutput = ( + const visibleRange = lineVisibleRanges.ranges[k]; + const decorationOutput = ( '
' + modelLineNumber + ''; + } + return String(diff); + } + + return String(modelLineNumber); + } + public prepareRender(ctx: RenderingContext): void { if (!this._renderLineNumbers) { this._renderResult = null; @@ -114,7 +132,7 @@ export class LineNumbersOverlay extends DynamicViewOverlay { for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { let lineIndex = lineNumber - visibleStartLineNumber; - let renderLineNumber = this._context.model.getLineRenderLineNumber(lineNumber); + let renderLineNumber = this._getLineRenderLineNumber(lineNumber); if (renderLineNumber) { output[lineIndex] = ( common @@ -146,6 +164,6 @@ export class LineNumbersOverlay extends DynamicViewOverlay { registerThemingParticipant((theme, collector) => { let lineNumbers = theme.getColor(editorLineNumbers); if (lineNumbers) { - collector.addRule(`.monaco-editor.${theme.selector} .line-numbers { color: ${lineNumbers}; }`); + collector.addRule(`.monaco-editor .line-numbers { color: ${lineNumbers}; }`); } }); \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index a5fdd8b254a..f6bb857221b 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -15,10 +15,9 @@ import { Configuration } from 'vs/editor/browser/config/configuration'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; import { IViewLines, HorizontalRange, LineVisibleRanges } from 'vs/editor/common/view/renderingContext'; -import { IViewLayout, Viewport } from 'vs/editor/common/viewModel/viewModel'; +import { Viewport } from 'vs/editor/common/viewModel/viewModel'; import { ViewPart, PartFingerprint, PartFingerprints } from 'vs/editor/browser/view/viewPart'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; class LastRenderedData { @@ -48,7 +47,6 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, private static HORIZONTAL_EXTRA_PX = 30; private readonly _linesContent: FastDomNode; - private readonly _viewLayout: IViewLayout; private readonly _textRangeRestingSpot: HTMLElement; private readonly _visibleLines: VisibleLinesCollection; private readonly domNode: FastDomNode; @@ -67,10 +65,9 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, private _lastCursorRevealRangeHorizontallyEvent: viewEvents.ViewRevealRangeRequestEvent; private _lastRenderedData: LastRenderedData; - constructor(context: ViewContext, linesContent: FastDomNode, viewLayout: IViewLayout) { + constructor(context: ViewContext, linesContent: FastDomNode) { super(context); this._linesContent = linesContent; - this._viewLayout = viewLayout; this._textRangeRestingSpot = document.createElement('div'); this._visibleLines = new VisibleLinesCollection(this); this.domNode = this._visibleLines.domNode; @@ -78,7 +75,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, this._lineHeight = this._context.configuration.editor.lineHeight; this._isViewportWrapping = this._context.configuration.editor.wrappingInfo.isViewportWrapping; this._revealHorizontalRightPadding = this._context.configuration.editor.viewInfo.revealHorizontalRightPadding; - this._canUseTranslate3d = this._context.configuration.editor.viewInfo.canUseTranslate3d; + this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; this._viewLineOptions = new ViewLineOptions(this._context.configuration); PartFingerprints.write(this.domNode, PartFingerprint.ViewLines); @@ -127,11 +124,11 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, if (e.wrappingInfo) { this._isViewportWrapping = this._context.configuration.editor.wrappingInfo.isViewportWrapping; } - if (e.viewInfo.revealHorizontalRightPadding) { + if (e.viewInfo) { this._revealHorizontalRightPadding = this._context.configuration.editor.viewInfo.revealHorizontalRightPadding; } - if (e.viewInfo.canUseTranslate3d) { - this._canUseTranslate3d = this._context.configuration.editor.viewInfo.canUseTranslate3d; + if (e.canUseTranslate3d) { + this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; } if (e.fontInfo) { Configuration.applyFontInfo(this.domNode, this._context.configuration.editor.fontInfo); @@ -180,13 +177,13 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, return this._visibleLines.onLinesInserted(e); } public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - let newScrollTop = this._computeScrollTopToRevealRange(this._viewLayout.getCurrentViewport(), e.range, e.verticalType); + let newScrollTop = this._computeScrollTopToRevealRange(this._context.viewLayout.getCurrentViewport(), e.range, e.verticalType); if (e.revealHorizontal) { this._lastCursorRevealRangeHorizontallyEvent = e; } - this._viewLayout.setScrollPosition({ + this._context.viewLayout.setScrollPosition({ // TODO@Alex: scrolling vertically can be moved to the view model scrollTop: newScrollTop }); @@ -408,17 +405,14 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, throw new Error('Not supported'); } - public renderText(viewportData: ViewportData, onAfterLinesRendered: () => void): void { + public renderText(viewportData: ViewportData): void { // (1) render lines - ensures lines are in the DOM this._visibleLines.renderLines(viewportData); this._lastRenderedData.setCurrentVisibleRange(viewportData.visibleRange); - this.domNode.setWidth(this._viewLayout.getScrollWidth()); - this.domNode.setHeight(Math.min(this._viewLayout.getScrollHeight(), 1000000)); + this.domNode.setWidth(this._context.viewLayout.getScrollWidth()); + this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1000000)); - // (2) execute DOM writing that forces sync layout (e.g. textArea manipulation) - onAfterLinesRendered(); - - // (3) compute horizontal scroll position: + // (2) compute horizontal scroll position: // - this must happen after the lines are in the DOM since it might need a line that rendered just now // - it might change `scrollWidth` and `scrollLeft` if (this._lastCursorRevealRangeHorizontallyEvent) { @@ -438,22 +432,22 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, } // set `scrollLeft` - this._viewLayout.setScrollPosition({ + this._context.viewLayout.setScrollPosition({ scrollLeft: newScrollLeft.scrollLeft }); } - // (4) handle scrolling - const adjustedScrollTop = this._viewLayout.getScrollTop() - viewportData.bigNumbersDelta; + // (3) handle scrolling + const adjustedScrollTop = this._context.viewLayout.getScrollTop() - viewportData.bigNumbersDelta; if (this._canUseTranslate3d) { - let transform = 'translate3d(' + -this._viewLayout.getScrollLeft() + 'px, ' + -adjustedScrollTop + 'px, 0px)'; + let transform = 'translate3d(' + -this._context.viewLayout.getScrollLeft() + 'px, ' + -adjustedScrollTop + 'px, 0px)'; this._linesContent.setTransform(transform); this._linesContent.setTop(0); this._linesContent.setLeft(0); } else { this._linesContent.setTransform(''); this._linesContent.setTop(-adjustedScrollTop); - this._linesContent.setLeft(-this._viewLayout.getScrollLeft()); + this._linesContent.setLeft(-this._context.viewLayout.getScrollLeft()); } // Update max line width (not so important, it is just so the horizontal scrollbar doesn't get too small) @@ -466,11 +460,11 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, let iLineWidth = Math.ceil(lineWidth); if (this._maxLineWidth < iLineWidth) { this._maxLineWidth = iLineWidth; - this._viewLayout.onMaxLineWidthChanged(this._maxLineWidth); + this._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth); } } - private _computeScrollTopToRevealRange(viewport: Viewport, range: Range, verticalType: VerticalRevealType): number { + private _computeScrollTopToRevealRange(viewport: Viewport, range: Range, verticalType: viewEvents.VerticalRevealType): number { let viewportStartY = viewport.top; let viewportHeight = viewport.height; let viewportEndY = viewportStartY + viewportHeight; @@ -478,17 +472,17 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, let boxEndY: number; // Have a box that includes one extra line height (for the horizontal scrollbar) - boxStartY = this._viewLayout.getVerticalOffsetForLineNumber(range.startLineNumber); - boxEndY = this._viewLayout.getVerticalOffsetForLineNumber(range.endLineNumber) + this._lineHeight; - if (verticalType === VerticalRevealType.Simple || verticalType === VerticalRevealType.Bottom) { + boxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.startLineNumber); + boxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.endLineNumber) + this._lineHeight; + if (verticalType === viewEvents.VerticalRevealType.Simple || verticalType === viewEvents.VerticalRevealType.Bottom) { // Reveal one line more when the last line would be covered by the scrollbar - arrow down case or revealing a line explicitly at bottom boxEndY += this._lineHeight; } let newScrollTop: number; - if (verticalType === VerticalRevealType.Center || verticalType === VerticalRevealType.CenterIfOutsideViewport) { - if (verticalType === VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { + if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) { + if (verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { // Box is already in the viewport... do nothing newScrollTop = viewportStartY; } else { @@ -497,7 +491,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, newScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2); } } else { - newScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === VerticalRevealType.Top, verticalType === VerticalRevealType.Bottom); + newScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === viewEvents.VerticalRevealType.Top, verticalType === viewEvents.VerticalRevealType.Bottom); } return newScrollTop; @@ -515,7 +509,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, }; } - let viewport = this._viewLayout.getCurrentViewport(); + let viewport = this._context.viewLayout.getCurrentViewport(); let viewportStartX = viewport.left; let viewportEndX = viewportStartX + viewport.width; diff --git a/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts b/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts index a5e31040b9d..d9492ecd0fc 100644 --- a/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts +++ b/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts @@ -44,12 +44,6 @@ export class LinesDecorationsOverlay extends DedupOverlay { } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - return false; - } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { return true; } @@ -65,9 +59,6 @@ export class LinesDecorationsOverlay extends DedupOverlay { public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { return true; } - public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return e.scrollTopChanged; } diff --git a/src/vs/editor/browser/viewParts/margin/margin.ts b/src/vs/editor/browser/viewParts/margin/margin.ts index fb3de087cbf..35fcf1563b9 100644 --- a/src/vs/editor/browser/viewParts/margin/margin.ts +++ b/src/vs/editor/browser/viewParts/margin/margin.ts @@ -24,7 +24,7 @@ export class Margin extends ViewPart { constructor(context: ViewContext) { super(context); - this._canUseTranslate3d = this._context.configuration.editor.viewInfo.canUseTranslate3d; + this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; this._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft; this._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth; @@ -42,7 +42,7 @@ export class Margin extends ViewPart { private _createDomNode(): FastDomNode { let domNode = createFastDomNode(document.createElement('div')); - domNode.setClassName('margin' + ' monaco-editor-background'); + domNode.setClassName('margin'); domNode.setPosition('absolute'); domNode.setAttribute('role', 'presentation'); domNode.setAttribute('aria-hidden', 'true'); @@ -57,8 +57,8 @@ export class Margin extends ViewPart { // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.viewInfo.canUseTranslate3d) { - this._canUseTranslate3d = this._context.configuration.editor.viewInfo.canUseTranslate3d; + if (e.canUseTranslate3d) { + this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; } if (e.layoutInfo) { diff --git a/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts b/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts index 07a6ea88659..e1880451dd7 100644 --- a/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts +++ b/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts @@ -34,12 +34,6 @@ export class MarginViewLineDecorationsOverlay extends DedupOverlay { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - return false; - } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { return true; } @@ -55,9 +49,6 @@ export class MarginViewLineDecorationsOverlay extends DedupOverlay { public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { return true; } - public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return e.scrollTopChanged; } diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.css b/src/vs/editor/browser/viewParts/minimap/minimap.css index 636eee6a6c6..692577e87bd 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.css +++ b/src/vs/editor/browser/viewParts/minimap/minimap.css @@ -13,35 +13,6 @@ .monaco-editor .minimap-slider.active { opacity: 1; } - -.monaco-editor.vs .minimap-slider { - background: rgba(100, 100, 100, .4); -} -.monaco-editor.vs-dark .minimap-slider { - background: rgba(121, 121, 121, .4); -} -.monaco-editor.hc-black .minimap-slider { - background: rgba(111, 195, 223, .6); -} - -.monaco-editor.vs .minimap-slider:hover, -.monaco-editor.vs-dark .minimap-slider:hover { - background: rgba(100, 100, 100, .7); -} -.monaco-editor.hc-black .minimap-slider:hover { - background: rgba(111, 195, 223, .8); -} - -.monaco-editor.vs .minimap-slider.active { - background: rgba(0, 0, 0, .6); -} -.monaco-editor.vs-dark .minimap-slider.active { - background: rgba(191, 191, 191, .4); -} -.monaco-editor.hc-black .minimap-slider.active { - background: rgba(111, 195, 223, 1); -} - .monaco-editor .minimap-shadow-hidden { position: absolute; width: 0; @@ -50,9 +21,4 @@ position: absolute; left: -6px; width: 6px; - box-shadow: #DDD -6px 0 6px -6px inset; -} - -.monaco-editor.vs-dark .minimap-shadow-visible { - box-shadow: #000 -6px 0 6px -6px inset; } diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index a3c3dbae71d..46d8dde55d5 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -10,12 +10,11 @@ import { ViewPart, PartFingerprint, PartFingerprints } from 'vs/editor/browser/v import { ViewContext } from 'vs/editor/common/view/viewContext'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import { getOrCreateMinimapCharRenderer } from 'vs/editor/common/view/runtimeMinimapCharRenderer'; -import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import { MinimapCharRenderer, MinimapTokensColorTracker, Constants } from 'vs/editor/common/view/minimapCharRenderer'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { CharCode } from 'vs/base/common/charCode'; -import { IViewLayout, ViewLineData } from 'vs/editor/common/viewModel/viewModel'; +import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import { ColorId } from 'vs/editor/common/modes'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; import { IDisposable } from 'vs/base/common/lifecycle'; @@ -26,7 +25,8 @@ import { RGBA } from 'vs/base/common/color'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor'; import * as platform from 'vs/base/common/platform'; -import { VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; const enum RenderMinimap { None = 0, @@ -105,7 +105,7 @@ class MinimapOptions { public readonly canvasOuterHeight: number; constructor(configuration: editorCommon.IConfiguration) { - const pixelRatio = browser.getPixelRatio(); + const pixelRatio = configuration.editor.pixelRatio; const layoutInfo = configuration.editor.layoutInfo; this.renderMinimap = layoutInfo.renderMinimap | 0; @@ -413,7 +413,6 @@ class MinimapBuffers { export class Minimap extends ViewPart { - private readonly _viewLayout: IViewLayout; private readonly _editorScrollbar: EditorScrollbar; private readonly _domNode: FastDomNode; @@ -431,9 +430,8 @@ export class Minimap extends ViewPart { private _lastRenderData: RenderData; private _buffers: MinimapBuffers; - constructor(context: ViewContext, viewLayout: IViewLayout, editorScrollbar: EditorScrollbar) { + constructor(context: ViewContext, editorScrollbar: EditorScrollbar) { super(context); - this._viewLayout = viewLayout; this._editorScrollbar = editorScrollbar; this._options = new MinimapOptions(this._context.configuration); @@ -444,6 +442,8 @@ export class Minimap extends ViewPart { PartFingerprints.write(this._domNode, PartFingerprint.Minimap); this._domNode.setClassName('minimap'); this._domNode.setPosition('absolute'); + this._domNode.setAttribute('role', 'presentation'); + this._domNode.setAttribute('aria-hidden', 'true'); this._domNode.setRight(this._context.configuration.editor.layoutInfo.verticalScrollbarWidth); this._shadow = createFastDomNode(document.createElement('div')); @@ -485,7 +485,7 @@ export class Minimap extends ViewPart { this._context.privateViewEventBus.emit(new viewEvents.ViewRevealRangeRequestEvent( new Range(lineNumber, 1, lineNumber, 1), - VerticalRevealType.Center, + viewEvents.VerticalRevealType.Center, false )); }); @@ -497,7 +497,7 @@ export class Minimap extends ViewPart { if (e.leftButton) { const initialMouseOrthogonalPosition = e.posx; - const initialScrollTop = this._viewLayout.getScrollTop(); + const initialScrollTop = this._context.viewLayout.getScrollTop(); const initialSliderCenter = (this._slider.getTop() + this._slider.getHeight() / 2); const draggingDeltaCenter = e.posy - initialSliderCenter; this._slider.toggleClassName('active', true); @@ -509,7 +509,7 @@ export class Minimap extends ViewPart { const mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); if (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { // The mouse has wondered away from the slider => reset dragging - this._viewLayout.setScrollPosition({ + this._context.viewLayout.setScrollPosition({ scrollTop: initialScrollTop }); } else { @@ -523,13 +523,13 @@ export class Minimap extends ViewPart { if (this._context.configuration.editor.viewInfo.scrollBeyondLastLine) { discountScrollHeight = this._canvas.getHeight() - this._context.configuration.editor.lineHeight; } - const scrollHeight = this._viewLayout.getScrollHeight() - discountScrollHeight; + const scrollHeight = this._context.viewLayout.getScrollHeight() - discountScrollHeight; const desiredSliderCenter = mouseMoveData.posy - draggingDeltaCenter; const desiredScrollCenter = desiredSliderCenter * (scrollHeight / representableHeight); const desiredScrollTop = desiredScrollCenter - this._canvas.getHeight() / 2; - this._viewLayout.setScrollPosition({ + this._context.viewLayout.setScrollPosition({ scrollTop: desiredScrollTop }); } @@ -799,7 +799,7 @@ export class Minimap extends ViewPart { private static _renderLine( target: ImageData, backgroundColor: RGBA, - useLighterFont, + useLighterFont: boolean, renderMinimap: RenderMinimap, colorTracker: MinimapTokensColorTracker, minimapCharRenderer: MinimapCharRenderer, @@ -854,3 +854,22 @@ export class Minimap extends ViewPart { } } } + +registerThemingParticipant((theme, collector) => { + let sliderBackground = theme.getColor(scrollbarSliderBackground); + if (sliderBackground) { + collector.addRule(`.monaco-editor .minimap-slider { background: ${sliderBackground}; }`); + } + let sliderHoverBackground = theme.getColor(scrollbarSliderHoverBackground); + if (sliderHoverBackground) { + collector.addRule(`.monaco-editor .minimap-slider:hover { background: ${sliderHoverBackground}; }`); + } + let sliderActiveBackground = theme.getColor(scrollbarSliderActiveBackground); + if (sliderActiveBackground) { + collector.addRule(`.monaco-editor .minimap-slider.active { background: ${sliderActiveBackground}; }`); + } + let shadow = theme.getColor(scrollbarShadow); + if (shadow) { + collector.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${shadow} -6px 0 6px -6px inset; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts index 37eaae0f2b7..46c6d71d941 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import * as themes from 'vs/platform/theme/common/themes'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ViewPart } from 'vs/editor/browser/view/viewPart'; import { OverviewRulerImpl } from 'vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl'; @@ -15,32 +14,21 @@ import { TokenizationRegistry } from 'vs/editor/common/modes'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; - -function getThemeType(themeId: string): editorCommon.ThemeType { - if (themes.isHighContrastTheme(themeId)) { - return editorCommon.ThemeType.HighContrast; - } - if (themes.isLightTheme(themeId)) { - return editorCommon.ThemeType.Light; - } - return editorCommon.ThemeType.Dark; -} +import { editorOverviewRulerBorder, editorCursor } from 'vs/editor/common/view/editorColorRegistry'; +import { Color } from 'vs/base/common/color'; export class DecorationsOverviewRuler extends ViewPart { static MIN_DECORATION_HEIGHT = 6; static MAX_DECORATION_HEIGHT = 60; - private static _CURSOR_COLOR = 'rgba(0, 0, 102, 0.8)'; - private static _CURSOR_COLOR_DARK = 'rgba(152, 152, 152, 0.8)'; - - private static _BORDER_COLOR = 'rgba(127,127,127,0.3)'; - private readonly _tokensColorTrackerListener: IDisposable; private _overviewRuler: OverviewRulerImpl; private _renderBorder: boolean; + private _borderColor: string; + private _cursorColor: string; private _shouldUpdateDecorations: boolean; private _shouldUpdateCursorPosition: boolean; @@ -51,25 +39,26 @@ export class DecorationsOverviewRuler extends ViewPart { private _zonesFromDecorations: OverviewRulerZone[]; private _zonesFromCursors: OverviewRulerZone[]; - constructor(context: ViewContext, scrollHeight: number, getVerticalOffsetForLine: (lineNumber: number) => number) { + constructor(context: ViewContext) { super(context); this._overviewRuler = new OverviewRulerImpl( 1, 'decorationsOverviewRuler', - scrollHeight, + this._context.viewLayout.getScrollHeight(), this._context.configuration.editor.lineHeight, - this._context.configuration.editor.viewInfo.canUseTranslate3d, + this._context.configuration.editor.canUseTranslate3d, + this._context.configuration.editor.pixelRatio, DecorationsOverviewRuler.MIN_DECORATION_HEIGHT, DecorationsOverviewRuler.MAX_DECORATION_HEIGHT, - getVerticalOffsetForLine + (lineNumber: number) => this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber) ); this._overviewRuler.setLanesCount(this._context.configuration.editor.viewInfo.overviewRulerLanes, false); - let theme = this._context.configuration.editor.viewInfo.theme; - this._overviewRuler.setThemeType(getThemeType(theme), false); this._overviewRuler.setLayout(this._context.configuration.editor.layoutInfo.overviewRuler, false); this._renderBorder = this._context.configuration.editor.viewInfo.overviewRulerBorder; + this._updateColors(); + this._updateBackground(false); this._tokensColorTrackerListener = TokenizationRegistry.onDidChange((e) => { if (e.changedColorMap) { @@ -104,57 +93,42 @@ export class DecorationsOverviewRuler extends ViewPart { let prevLanesCount = this._overviewRuler.getLanesCount(); let newLanesCount = this._context.configuration.editor.viewInfo.overviewRulerLanes; - let shouldRender = false; + if (prevLanesCount !== newLanesCount) { + this._overviewRuler.setLanesCount(newLanesCount, false); + } if (e.lineHeight) { this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, false); - shouldRender = true; } - if (e.viewInfo.canUseTranslate3d) { - this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.viewInfo.canUseTranslate3d, false); - shouldRender = true; + if (e.canUseTranslate3d) { + this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, false); } - if (prevLanesCount !== newLanesCount) { - this._overviewRuler.setLanesCount(newLanesCount, false); - shouldRender = true; + if (e.pixelRatio) { + this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, false); } - if (e.viewInfo.overviewRulerBorder) { + if (e.viewInfo) { this._renderBorder = this._context.configuration.editor.viewInfo.overviewRulerBorder; - shouldRender = true; - } - - if (e.viewInfo.hideCursorInOverviewRuler) { this._hideCursor = this._context.configuration.editor.viewInfo.hideCursorInOverviewRuler; this._shouldUpdateCursorPosition = true; - shouldRender = true; - } - - if (e.viewInfo.theme) { - let theme = this._context.configuration.editor.viewInfo.theme; - this._overviewRuler.setThemeType(getThemeType(theme), false); - shouldRender = true; - } - - if (e.viewInfo.minimap) { this._updateBackground(false); - shouldRender = true; } if (e.layoutInfo) { this._overviewRuler.setLayout(this._context.configuration.editor.layoutInfo.overviewRuler, false); - shouldRender = true; } - return shouldRender; + return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { this._shouldUpdateCursorPosition = true; - this._cursorPositions = [e.position]; - this._cursorPositions = this._cursorPositions.concat(e.secondaryPositions); + this._cursorPositions = []; + for (let i = 0, len = e.selections.length; i < len; i++) { + this._cursorPositions[i] = e.selections[i].getPosition(); + } return true; } @@ -178,12 +152,29 @@ export class DecorationsOverviewRuler extends ViewPart { return true; } + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + this._updateColors(); + this._shouldUpdateDecorations = true; + this._shouldUpdateCursorPosition = true; + return true; + } + // ---- end view event handlers public getDomNode(): HTMLElement { return this._overviewRuler.getDomNode(); } + private _updateColors() { + let borderColor = this._context.theme.getColor(editorOverviewRulerBorder); + this._borderColor = borderColor ? borderColor.toString() : null; + + let cursorColor = this._context.theme.getColor(editorCursor); + this._cursorColor = cursorColor ? cursorColor.transparent(0.7).toString() : null; + + this._overviewRuler.setThemeType(this._context.theme.type, false); + } + private _createZonesFromDecorations(): OverviewRulerZone[] { let decorations = this._context.model.getAllOverviewRulerDecorations(); let zones: OverviewRulerZone[] = []; @@ -196,15 +187,23 @@ export class DecorationsOverviewRuler extends ViewPart { dec.range.endLineNumber, overviewRuler.position, 0, - overviewRuler.color, - overviewRuler.darkColor, - overviewRuler.hcColor + this.resolveRulerColor(overviewRuler.color), + this.resolveRulerColor(overviewRuler.darkColor), + this.resolveRulerColor(overviewRuler.hcColor) )); } return zones; } + private resolveRulerColor(color: string | editorCommon.ThemeColor): string { + if (editorCommon.isThemeColor(color)) { + let c = this._context.theme.getColor(color.id) || Color.transparent; + return c.toString(); + } + return color; + } + private _createZonesFromCursors(): OverviewRulerZone[] { let zones: OverviewRulerZone[] = []; @@ -216,9 +215,9 @@ export class DecorationsOverviewRuler extends ViewPart { cursor.lineNumber, editorCommon.OverviewRulerLane.Full, 2, - DecorationsOverviewRuler._CURSOR_COLOR, - DecorationsOverviewRuler._CURSOR_COLOR_DARK, - DecorationsOverviewRuler._CURSOR_COLOR_DARK + this._cursorColor, + this._cursorColor, + this._cursorColor )); } @@ -255,11 +254,11 @@ export class DecorationsOverviewRuler extends ViewPart { let hasRendered = this._overviewRuler.render(false); - if (hasRendered && this._renderBorder && this._overviewRuler.getLanesCount() > 0 && (this._zonesFromDecorations.length > 0 || this._zonesFromCursors.length > 0)) { + if (hasRendered && this._renderBorder && this._borderColor && this._overviewRuler.getLanesCount() > 0 && (this._zonesFromDecorations.length > 0 || this._zonesFromCursors.length > 0)) { let ctx2 = this._overviewRuler.getDomNode().getContext('2d'); ctx2.beginPath(); ctx2.lineWidth = 1; - ctx2.strokeStyle = DecorationsOverviewRuler._BORDER_COLOR; + ctx2.strokeStyle = this._borderColor; ctx2.moveTo(0, 0); ctx2.lineTo(0, this._overviewRuler.getPixelHeight()); ctx2.stroke(); diff --git a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts index b3d8613c2d3..65c793de876 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts @@ -17,11 +17,20 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { private _context: ViewContext; private _overviewRuler: OverviewRulerImpl; - constructor(context: ViewContext, cssClassName: string, scrollHeight: number, minimumHeight: number, maximumHeight: number, getVerticalOffsetForLine: (lineNumber: number) => number) { + constructor(context: ViewContext, cssClassName: string, minimumHeight: number, maximumHeight: number) { super(); this._context = context; - this._overviewRuler = new OverviewRulerImpl(0, cssClassName, scrollHeight, this._context.configuration.editor.lineHeight, - this._context.configuration.editor.viewInfo.canUseTranslate3d, minimumHeight, maximumHeight, getVerticalOffsetForLine); + this._overviewRuler = new OverviewRulerImpl( + 0, + cssClassName, + this._context.viewLayout.getScrollHeight(), + this._context.configuration.editor.lineHeight, + this._context.configuration.editor.canUseTranslate3d, + this._context.configuration.editor.pixelRatio, + minimumHeight, + maximumHeight, + (lineNumber: number) => this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber) + ); this._context.addEventHandler(this); } @@ -37,15 +46,17 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { if (e.lineHeight) { this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, true); - return true; } - if (e.viewInfo.canUseTranslate3d) { - this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.viewInfo.canUseTranslate3d, true); - return true; + if (e.canUseTranslate3d) { + this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, true); } - return false; + if (e.pixelRatio) { + this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, true); + } + + return true; } public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { diff --git a/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts b/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts index 3cce58aa44c..617a850a1d7 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts @@ -5,12 +5,11 @@ 'use strict'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { OverviewRulerLane, ThemeType } from 'vs/editor/common/editorCommon'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import * as browser from 'vs/base/browser/browser'; +import { OverviewRulerLane } from 'vs/editor/common/editorCommon'; import { OverviewZoneManager, ColorZone, OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; import { Color } from 'vs/base/common/color'; import { OverviewRulerPosition } from 'vs/editor/common/config/editorOptions'; +import { ThemeType, LIGHT } from 'vs/platform/theme/common/themeService'; export class OverviewRulerImpl { @@ -21,9 +20,11 @@ export class OverviewRulerImpl { private _canUseTranslate3d: boolean; private _background: Color; - private _zoomListener: IDisposable; - - constructor(canvasLeftOffset: number, cssClassName: string, scrollHeight: number, lineHeight: number, canUseTranslate3d: boolean, minimumHeight: number, maximumHeight: number, getVerticalOffsetForLine: (lineNumber: number) => number) { + constructor( + canvasLeftOffset: number, cssClassName: string, scrollHeight: number, lineHeight: number, + canUseTranslate3d: boolean, pixelRatio: number, minimumHeight: number, maximumHeight: number, + getVerticalOffsetForLine: (lineNumber: number) => number + ) { this._canvasLeftOffset = canvasLeftOffset; this._domNode = createFastDomNode(document.createElement('canvas')); @@ -39,25 +40,16 @@ export class OverviewRulerImpl { this._zoneManager = new OverviewZoneManager(getVerticalOffsetForLine); this._zoneManager.setMinimumHeight(minimumHeight); this._zoneManager.setMaximumHeight(maximumHeight); - this._zoneManager.setThemeType(ThemeType.Light); + this._zoneManager.setThemeType(LIGHT); this._zoneManager.setDOMWidth(0); this._zoneManager.setDOMHeight(0); this._zoneManager.setOuterHeight(scrollHeight); this._zoneManager.setLineHeight(lineHeight); - this._zoomListener = browser.onDidChangeZoomLevel(() => { - this._zoneManager.setPixelRatio(browser.getPixelRatio()); - this._domNode.setWidth(this._zoneManager.getDOMWidth()); - this._domNode.setHeight(this._zoneManager.getDOMHeight()); - this._domNode.domNode.width = this._zoneManager.getCanvasWidth(); - this._domNode.domNode.height = this._zoneManager.getCanvasHeight(); - this.render(true); - }); - this._zoneManager.setPixelRatio(browser.getPixelRatio()); + this._zoneManager.setPixelRatio(pixelRatio); } public dispose(): void { - this._zoomListener.dispose(); this._zoneManager = null; } @@ -142,6 +134,17 @@ export class OverviewRulerImpl { } } + public setPixelRatio(pixelRatio: number, render: boolean): void { + this._zoneManager.setPixelRatio(pixelRatio); + this._domNode.setWidth(this._zoneManager.getDOMWidth()); + this._domNode.setHeight(this._zoneManager.getDOMHeight()); + this._domNode.domNode.width = this._zoneManager.getCanvasWidth(); + this._domNode.domNode.height = this._zoneManager.getCanvasHeight(); + if (render) { + this.render(true); + } + } + public setZones(zones: OverviewRulerZone[], render: boolean): void { this._zoneManager.setZones(zones); if (render) { diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.css b/src/vs/editor/browser/viewParts/rulers/rulers.css index c2e819de649..3012d205f67 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.css +++ b/src/vs/editor/browser/viewParts/rulers/rulers.css @@ -7,8 +7,4 @@ position: absolute; width: 1px; top: 0; - background: lightgrey; -} -.monaco-editor.vs-dark .view-ruler { - background: #5A5A5A; } \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 6d4f6247bff..852eb07fb2c 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -11,6 +11,8 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorRuler } from 'vs/editor/common/view/editorColorRegistry'; export class Rulers extends ViewPart { @@ -23,6 +25,8 @@ export class Rulers extends ViewPart { constructor(context: ViewContext) { super(context); this.domNode = createFastDomNode(document.createElement('div')); + this.domNode.setAttribute('role', 'presentation'); + this.domNode.setAttribute('aria-hidden', 'true'); this.domNode.setClassName('view-rulers'); this._renderedRulers = []; this._rulers = this._context.configuration.editor.viewInfo.rulers; @@ -37,7 +41,7 @@ export class Rulers extends ViewPart { // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.viewInfo.rulers || e.layoutInfo || e.fontInfo) { + if (e.viewInfo || e.layoutInfo || e.fontInfo) { this._rulers = this._context.configuration.editor.viewInfo.rulers; this._height = this._context.configuration.editor.layoutInfo.contentHeight; this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth; @@ -46,7 +50,7 @@ export class Rulers extends ViewPart { return false; } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { - return super.onScrollChanged(e) || e.scrollHeightChanged; + return e.scrollHeightChanged; } // --- end event handlers @@ -97,3 +101,10 @@ export class Rulers extends ViewPart { } } } + +registerThemingParticipant((theme, collector) => { + let rulerColor = theme.getColor(editorRuler); + if (rulerColor) { + collector.addRule(`.monaco-editor .view-ruler { background-color: ${rulerColor}; }`); + } +}); diff --git a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css index 1950c6abc4d..1eabd692f83 100644 --- a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css +++ b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css @@ -8,13 +8,4 @@ top: 0; left: 0; height: 6px; - box-shadow: #DDD 0 6px 6px -6px inset; -} - -.monaco-editor.vs-dark .scroll-decoration { - box-shadow: #000 0 6px 6px -6px inset; -} - -.monaco-editor.hc-black .scroll-decoration { - box-shadow: none; } \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts index b0dd4ccee28..e4086a1e00a 100644 --- a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts +++ b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts @@ -11,6 +11,8 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; export class ScrollDecorationViewPart extends ViewPart { @@ -29,6 +31,8 @@ export class ScrollDecorationViewPart extends ViewPart { this._shouldShow = false; this._useShadows = this._context.configuration.editor.viewInfo.scrollbar.useShadows; this._domNode = createFastDomNode(document.createElement('div')); + this._domNode.setAttribute('role', 'presentation'); + this._domNode.setAttribute('aria-hidden', 'true'); } public dispose(): void { @@ -62,7 +66,7 @@ export class ScrollDecorationViewPart extends ViewPart { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { let shouldRender = false; - if (e.viewInfo.scrollbar) { + if (e.viewInfo) { this._useShadows = this._context.configuration.editor.viewInfo.scrollbar.useShadows; } if (e.layoutInfo) { @@ -86,3 +90,10 @@ export class ScrollDecorationViewPart extends ViewPart { this._domNode.setClassName(this._shouldShow ? 'scroll-decoration' : ''); } } + +registerThemingParticipant((theme, collector) => { + let shadow = theme.getColor(scrollbarShadow); + if (shadow) { + collector.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${shadow} 0 6px 6px -6px inset; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/selections/selections.ts b/src/vs/editor/browser/viewParts/selections/selections.ts index 38ee5869922..9d8e0168f25 100644 --- a/src/vs/editor/browser/viewParts/selections/selections.ts +++ b/src/vs/editor/browser/viewParts/selections/selections.ts @@ -105,17 +105,13 @@ export class SelectionsOverlay extends DynamicViewOverlay { if (e.lineHeight) { this._lineHeight = this._context.configuration.editor.lineHeight; } - if (e.viewInfo.roundedSelection) { + if (e.viewInfo) { this._roundedSelection = this._context.configuration.editor.viewInfo.roundedSelection; } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - this._selections = [e.selection]; - this._selections = this._selections.concat(e.secondarySelections); + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { + this._selections = e.selections.slice(0); return true; } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { @@ -134,9 +130,6 @@ export class SelectionsOverlay extends DynamicViewOverlay { public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { return true; } - public onRevealRangeRequest(e: viewEvents.ViewRevealRangeRequestEvent): boolean { - return false; - } public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return e.scrollTopChanged; } @@ -403,11 +396,11 @@ export class SelectionsOverlay extends DynamicViewOverlay { registerThemingParticipant((theme, collector) => { let editorSelectionColor = theme.getColor(editorSelection); if (editorSelectionColor) { - collector.addRule(`.monaco-editor.${theme.selector} .focused .selected-text { background-color: ${editorSelectionColor}; }`); + collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`); } let editorInactiveSelectionColor = theme.getColor(editorInactiveSelection); if (editorInactiveSelectionColor) { - collector.addRule(`.monaco-editor.${theme.selector} .selected-text { background-color: ${editorInactiveSelectionColor}; }`); + collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`); } // IE/Edge specific rules let outline = theme.getColor(activeContrastBorder); diff --git a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts index b89689b8a8a..babe35b4178 100644 --- a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts +++ b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts @@ -72,8 +72,6 @@ export class ViewCursor { this._domNode.setHeight(this._lineHeight); this._domNode.setTop(0); this._domNode.setLeft(0); - this._domNode.setAttribute('role', 'presentation'); - this._domNode.setAttribute('aria-hidden', 'true'); Configuration.applyFontInfo(this._domNode, this._context.configuration.editor.fontInfo); this._domNode.setDisplay('none'); @@ -114,7 +112,7 @@ export class ViewCursor { if (e.lineHeight) { this._lineHeight = this._context.configuration.editor.lineHeight; } - if (e.viewInfo.cursorStyle) { + if (e.viewInfo) { this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle; } if (e.fontInfo) { @@ -130,12 +128,6 @@ export class ViewCursor { return true; } - public onFlushed(): boolean { - this.updatePosition(new Position(1, 1)); - this._isInEditableRange = true; - return true; - } - private _prepareRender(ctx: RenderingContext): ViewCursorRenderData { if (this._cursorStyle === TextEditorCursorStyle.Line || this._cursorStyle === TextEditorCursorStyle.LineThin) { const visibleRange = ctx.visibleRangeForPosition(this._position); diff --git a/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts b/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts index e9c9ea9fe78..a5362a124b8 100644 --- a/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts +++ b/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts @@ -54,6 +54,8 @@ export class ViewCursors extends ViewPart { this._renderData = []; this._domNode = createFastDomNode(document.createElement('div')); + this._domNode.setAttribute('role', 'presentation'); + this._domNode.setAttribute('aria-hidden', 'true'); this._updateDomClassName(); this._domNode.appendChild(this._primaryCursor.getDomNode()); @@ -84,16 +86,14 @@ export class ViewCursors extends ViewPart { if (e.readOnly) { this._readOnly = this._context.configuration.editor.readOnly; } - if (e.viewInfo.cursorBlinking) { + if (e.viewInfo) { this._cursorBlinking = this._context.configuration.editor.viewInfo.cursorBlinking; - } - if (e.viewInfo.cursorStyle) { this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle; } this._primaryCursor.onConfigurationChanged(e); this._updateBlinking(); - if (e.viewInfo.cursorStyle || e.viewInfo.cursorBlinking) { + if (e.viewInfo) { this._updateDomClassName(); } for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { @@ -101,51 +101,53 @@ export class ViewCursors extends ViewPart { } return true; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - this._primaryCursor.onCursorPositionChanged(e.position, e.isInEditableRange); + private _onCursorPositionChanged(position: Position, secondaryPositions: Position[], isInEditableRange: boolean): void { + this._primaryCursor.onCursorPositionChanged(position, isInEditableRange); this._updateBlinking(); - if (this._secondaryCursors.length < e.secondaryPositions.length) { + if (this._secondaryCursors.length < secondaryPositions.length) { // Create new cursors - let addCnt = e.secondaryPositions.length - this._secondaryCursors.length; + let addCnt = secondaryPositions.length - this._secondaryCursors.length; for (let i = 0; i < addCnt; i++) { let newCursor = new ViewCursor(this._context, true); this._domNode.domNode.insertBefore(newCursor.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling); this._secondaryCursors.push(newCursor); } - } else if (this._secondaryCursors.length > e.secondaryPositions.length) { + } else if (this._secondaryCursors.length > secondaryPositions.length) { // Remove some cursors - let removeCnt = this._secondaryCursors.length - e.secondaryPositions.length; + let removeCnt = this._secondaryCursors.length - secondaryPositions.length; for (let i = 0; i < removeCnt; i++) { this._domNode.removeChild(this._secondaryCursors[0].getDomNode()); this._secondaryCursors.splice(0, 1); } } - for (let i = 0; i < e.secondaryPositions.length; i++) { - this._secondaryCursors[i].onCursorPositionChanged(e.secondaryPositions[i], e.isInEditableRange); + for (let i = 0; i < secondaryPositions.length; i++) { + this._secondaryCursors[i].onCursorPositionChanged(secondaryPositions[i], isInEditableRange); } - return true; } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { - let selectionIsEmpty = e.selection.isEmpty(); + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { + let positions: Position[] = []; + for (let i = 0, len = e.selections.length; i < len; i++) { + positions[i] = e.selections[i].getPosition(); + } + this._onCursorPositionChanged(positions[0], positions.slice(1), e.isInEditableRange); + + const selectionIsEmpty = e.selections[0].isEmpty(); if (this._selectionIsEmpty !== selectionIsEmpty) { this._selectionIsEmpty = selectionIsEmpty; this._updateDomClassName(); } - return false; + + return true; } + public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { // true for inline decorations that can end up relayouting text - return true;//e.inlineDecorationsChanged; + return true; } public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { - this._primaryCursor.onFlushed(); - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - this._domNode.removeChild(this._secondaryCursors[i].getDomNode()); - } - this._secondaryCursors = []; return true; } public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean { @@ -347,9 +349,9 @@ registerThemingParticipant((theme, collector) => { let caret = theme.getColor(editorCursor); if (caret) { let oppositeCaret = caret.opposite(); - collector.addRule(`.monaco-editor.${theme.selector} .cursor { background-color: ${caret}; border-color: ${caret}; color: ${oppositeCaret}; }`); + collector.addRule(`.monaco-editor .cursor { background-color: ${caret}; border-color: ${caret}; color: ${oppositeCaret}; }`); if (theme.type === 'hc') { - collector.addRule(`.monaco-editor.${theme.selector} .cursors-layer.has-selection .cursor { border-left: 1px solid ${oppositeCaret}; border-right: 1px solid ${oppositeCaret}; }`); + collector.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${oppositeCaret}; border-right: 1px solid ${oppositeCaret}; }`); } } diff --git a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts index a56f4457cf4..d91430803b3 100644 --- a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts +++ b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts @@ -11,7 +11,7 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { Position } from 'vs/editor/common/core/position'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; -import { IViewLayout, IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel'; +import { IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; export interface IMyViewZone { @@ -33,7 +33,6 @@ interface IComputedViewZoneProps { export class ViewZones extends ViewPart { - private _viewLayout: IViewLayout; private _zones: { [id: string]: IMyViewZone; }; private _lineHeight: number; private _contentWidth: number; @@ -43,12 +42,11 @@ export class ViewZones extends ViewPart { public marginDomNode: FastDomNode; - constructor(context: ViewContext, viewLayout: IViewLayout) { + constructor(context: ViewContext) { super(context); this._lineHeight = this._context.configuration.editor.lineHeight; this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth; this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; - this._viewLayout = viewLayout; this.domNode = createFastDomNode(document.createElement('div')); this.domNode.setClassName('view-zones'); @@ -67,7 +65,6 @@ export class ViewZones extends ViewPart { public dispose(): void { super.dispose(); - this._viewLayout = null; this._zones = {}; } @@ -81,7 +78,7 @@ export class ViewZones extends ViewPart { let id = keys[i]; let zone = this._zones[id]; let props = this._computeWhitespaceProps(zone.delegate); - if (this._viewLayout.changeWhitespace(parseInt(id, 10), props.afterViewLineNumber, props.heightInPx)) { + if (this._context.viewLayout.changeWhitespace(parseInt(id, 10), props.afterViewLineNumber, props.heightInPx)) { this._safeCallOnComputedHeight(zone.delegate, props.heightInPx); hadAChange = true; } @@ -186,7 +183,7 @@ export class ViewZones extends ViewPart { public addZone(zone: IViewZone): number { let props = this._computeWhitespaceProps(zone); - let whitespaceId = this._viewLayout.addWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx); + let whitespaceId = this._context.viewLayout.addWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx); let myZone: IMyViewZone = { whitespaceId: whitespaceId, @@ -224,7 +221,7 @@ export class ViewZones extends ViewPart { if (this._zones.hasOwnProperty(id.toString())) { let zone = this._zones[id.toString()]; delete this._zones[id.toString()]; - this._viewLayout.removeWhitespace(zone.whitespaceId); + this._context.viewLayout.removeWhitespace(zone.whitespaceId); zone.domNode.removeAttribute('monaco-visible-view-zone'); zone.domNode.removeAttribute('monaco-view-zone'); @@ -249,7 +246,7 @@ export class ViewZones extends ViewPart { let zone = this._zones[id.toString()]; let props = this._computeWhitespaceProps(zone.delegate); // let newOrdinal = this._getZoneOrdinal(zone.delegate); - changed = this._viewLayout.changeWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx) || changed; + changed = this._context.viewLayout.changeWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx) || changed; // TODO@Alex: change `newOrdinal` too if (changed) { @@ -303,7 +300,7 @@ export class ViewZones extends ViewPart { } public render(ctx: RestrictedRenderingContext): void { - let visibleWhitespaces = this._viewLayout.getWhitespaceViewportData(); + let visibleWhitespaces = this._context.viewLayout.getWhitespaceViewportData(); let visibleZones: { [id: string]: IViewWhitespaceViewportData; } = {}; let hasVisibleZone = false; diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index f1bb44263e4..0749b9d9171 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -5,11 +5,9 @@ 'use strict'; import 'vs/css!./media/editor'; -import 'vs/editor/common/view/editorColorRegistry'; // initialze editor theming partcicpants import 'vs/css!./media/tokens'; import { onUnexpectedError } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ICommandService } from 'vs/platform/commands/common/commands'; @@ -32,6 +30,9 @@ import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IPosition } from 'vs/editor/common/core/position'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; import { CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; +import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { Color } from 'vs/base/common/color'; export abstract class CodeEditorWidget extends CommonCodeEditor implements editorBrowser.ICodeEditor { @@ -70,6 +71,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito private _codeEditorService: ICodeEditorService; private _commandService: ICommandService; + private _themeService: IThemeService; protected domElement: HTMLElement; private _focusTracker: CodeEditorWidgetFocusTracker; @@ -87,11 +89,13 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IContextKeyService contextKeyService: IContextKeyService + @IContextKeyService contextKeyService: IContextKeyService, + @IThemeService themeService: IThemeService ) { super(domElement, options, instantiationService, contextKeyService); this._codeEditorService = codeEditorService; this._commandService = commandService; + this._themeService = themeService; this._focusTracker = new CodeEditorWidgetFocusTracker(domElement); this._focusTracker.onChage(() => { @@ -154,16 +158,6 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito super.dispose(); } - public updateOptions(newOptions: IEditorOptions): void { - let oldTheme = this._configuration.editor.viewInfo.theme; - super.updateOptions(newOptions); - let newTheme = this._configuration.editor.viewInfo.theme; - - if (oldTheme !== newTheme) { - this.render(); - } - } - public colorizeModelLine(lineNumber: number, model: editorCommon.IModel = this.model): string { if (!model) { return ''; @@ -187,94 +181,14 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito return this._view.domNode.domNode; } - public getCenteredRangeInViewport(): Range { - if (!this.hasView) { - return null; - } - return this.viewModel.getCenteredRangeInViewport(); - } - - protected _getCompletelyVisibleViewRange(): Range { - if (!this.hasView) { - return null; - } - return this._view.getCompletelyVisibleViewRange(); - } - - protected _getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range { - if (!this.hasView) { - return null; - } - return this._view.getCompletelyVisibleViewRangeAtScrollTop(scrollTop); - } - - protected _getVerticalOffsetForViewLineNumber(viewLineNumber: number): number { - if (!this.hasView) { - return 0; - } - return this._view.getVerticalOffsetForViewLineNumber(viewLineNumber); - } - public getCompletelyVisibleLinesRangeInViewport(): Range { - const viewRange = this._getCompletelyVisibleViewRange(); + if (!this.hasView) { + return null; + } + const viewRange = this.viewModel.getCompletelyVisibleViewRange(); return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange); } - public getScrollWidth(): number { - if (!this.hasView) { - return -1; - } - return this._view.getScrollWidth(); - } - public getScrollLeft(): number { - if (!this.hasView) { - return -1; - } - return this._view.getScrollLeft(); - } - - public getScrollHeight(): number { - if (!this.hasView) { - return -1; - } - return this._view.getScrollHeight(); - } - public getScrollTop(): number { - if (!this.hasView) { - return -1; - } - return this._view.getScrollTop(); - } - - public setScrollLeft(newScrollLeft: number): void { - if (!this.hasView) { - return; - } - if (typeof newScrollLeft !== 'number') { - throw new Error('Invalid arguments'); - } - this._view.setScrollPosition({ - scrollLeft: newScrollLeft - }); - } - public setScrollTop(newScrollTop: number): void { - if (!this.hasView) { - return; - } - if (typeof newScrollTop !== 'number') { - throw new Error('Invalid arguments'); - } - this._view.setScrollPosition({ - scrollTop: newScrollTop - }); - } - public setScrollPosition(position: editorCommon.INewScrollPosition): void { - if (!this.hasView) { - return; - } - this._view.setScrollPosition(position); - } - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { if (!this.hasView) { return; @@ -282,57 +196,6 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito this._view.delegateVerticalScrollbarMouseDown(browserEvent); } - public saveViewState(): editorCommon.ICodeEditorViewState { - if (!this.cursor || !this.hasView) { - return null; - } - let contributionsState: { [key: string]: any } = {}; - - let keys = Object.keys(this._contributions); - for (let i = 0, len = keys.length; i < len; i++) { - let id = keys[i]; - let contribution = this._contributions[id]; - if (typeof contribution.saveViewState === 'function') { - contributionsState[id] = contribution.saveViewState(); - } - } - - let cursorState = this.cursor.saveState(); - let viewState = this._view.saveState(); - return { - cursorState: cursorState, - viewState: viewState, - contributionsState: contributionsState - }; - } - - public restoreViewState(s: editorCommon.ICodeEditorViewState): void { - if (!this.cursor || !this.hasView) { - return; - } - if (s && s.cursorState && s.viewState) { - let codeEditorState = s; - let cursorState = codeEditorState.cursorState; - if (Array.isArray(cursorState)) { - this.cursor.restoreState(cursorState); - } else { - // Backwards compatibility - this.cursor.restoreState([cursorState]); - } - this._view.restoreState(codeEditorState.viewState); - - let contributionsState = s.contributionsState || {}; - let keys = Object.keys(this._contributions); - for (let i = 0, len = keys.length; i < len; i++) { - let id = keys[i]; - let contribution = this._contributions[id]; - if (typeof contribution.restoreViewState === 'function') { - contribution.restoreViewState(contributionsState[id]); - } - } - } - } - public layout(dimension?: editorCommon.IDimension): void { this._configuration.observeReferenceElement(dimension); this.render(); @@ -445,7 +308,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito if (!this.hasView) { return []; } - return this._view.getWhitespaces(); + return this.viewModel.viewLayout.getWhitespaces(); } private _getVerticalOffsetForPosition(modelLineNumber: number, modelColumn: number): number { @@ -454,7 +317,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito column: modelColumn }); let viewPosition = this.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition); - return this._view.getVerticalOffsetForViewLineNumber(viewPosition.lineNumber); + return this.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber); } public getTopForLineNumber(lineNumber: number): number { @@ -486,8 +349,8 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito let position = this.model.validatePosition(rawPosition); let layoutInfo = this._configuration.editor.layoutInfo; - let top = this._getVerticalOffsetForPosition(position.lineNumber, position.column) - this._view.getScrollTop(); - let left = this._view.getOffsetForColumn(position.lineNumber, position.column) + layoutInfo.glyphMarginWidth + layoutInfo.lineNumbersWidth + layoutInfo.decorationsWidth - this._view.getScrollLeft(); + let top = this._getVerticalOffsetForPosition(position.lineNumber, position.column) - this.getScrollTop(); + let left = this._view.getOffsetForColumn(position.lineNumber, position.column) + layoutInfo.glyphMarginWidth + layoutInfo.lineNumbersWidth + layoutInfo.decorationsWidth - this.getScrollLeft(); return { top: top, @@ -552,15 +415,13 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito } } - protected _enableEmptySelectionClipboard(): boolean { - return browser.enableEmptySelectionClipboard; - } - protected _createView(): void { this._view = new View( this._commandService, this._configuration, + this._themeService, this.viewModel, + this.cursor, (editorCommand: CoreEditorCommand, args: any) => { if (!this.cursor) { return; @@ -685,3 +546,30 @@ class CodeEditorWidgetFocusTracker extends Disposable { return this._hasFocus; } } + +const squigglyStart = encodeURIComponent(``); + +function getSquigglySVGData(color: Color) { + return squigglyStart + encodeURIComponent(color.toString()) + squigglyEnd; +} + +registerThemingParticipant((theme, collector) => { + let errorBorderColor = theme.getColor(editorErrorBorder); + if (errorBorderColor) { + collector.addRule(`.monaco-editor .redsquiggly { border-bottom: 4px double ${errorBorderColor}; }`); + } + let errorForeground = theme.getColor(editorErrorForeground); + if (errorForeground) { + collector.addRule(`.monaco-editor .redsquiggly { background: url("data:image/svg+xml,${getSquigglySVGData(errorForeground)}") repeat-x bottom left; }`); + } + + let warningBorderColor = theme.getColor(editorWarningBorder); + if (warningBorderColor) { + collector.addRule(`.monaco-editor .greensquiggly { border-bottom: 4px double ${warningBorderColor}; }`); + } + let warningForeground = theme.getColor(editorWarningForeground); + if (warningForeground) { + collector.addRule(`.monaco-editor .greensquiggly { background: url("data:image/svg+xml;utf8,${getSquigglySVGData(warningForeground)}") repeat-x bottom left; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 10a24f7f8cc..556c843ce15 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -6,7 +6,6 @@ 'use strict'; import 'vs/css!./media/diffEditor'; -import * as nls from 'vs/nls'; import { RunOnceScheduler } from 'vs/base/common/async'; import { Disposable } from 'vs/base/common/lifecycle'; import * as objects from 'vs/base/common/objects'; @@ -16,7 +15,6 @@ import { ISashEvent, IVerticalSashLayoutProvider, Sash } from 'vs/base/browser/u import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; @@ -33,11 +31,12 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { ColorId, MetadataConsts, FontStyle } from 'vs/editor/common/modes'; import Event, { Emitter } from 'vs/base/common/event'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; -import { registerThemingParticipant, IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { Color, RGBA } from 'vs/base/common/color'; +import { registerThemingParticipant, IThemeService, ITheme, getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; +import { scrollbarShadow, diffInserted, diffRemoved, defaultInsertColor, defaultRemoveColor, diffInsertedOutline, diffRemovedOutline } from 'vs/platform/theme/common/colorRegistry'; +import { Color } from 'vs/base/common/color'; import { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; interface IEditorDiffDecorations { decorations: editorCommon.IModelDeltaDecoration[]; @@ -48,11 +47,6 @@ interface IEditorDiffDecorationsWithZones extends IEditorDiffDecorations { zones: editorBrowser.IViewZone[]; } -interface IEditorsDiffDecorations { - original: IEditorDiffDecorations; - modified: IEditorDiffDecorations; -} - interface IEditorsDiffDecorationsWithZones { original: IEditorDiffDecorationsWithZones; modified: IEditorDiffDecorationsWithZones; @@ -149,7 +143,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE private readonly id: number; - private _theme: string; private _domElement: HTMLElement; protected readonly _containerDomElement: HTMLElement; private readonly _overviewDomElement: HTMLElement; @@ -214,7 +207,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._domElement = domElement; options = options || {}; - this._theme = options.theme || DefaultConfig.editor.theme; // renderSideBySide this._renderSideBySide = true; if (typeof options.renderSideBySide !== 'undefined') { @@ -241,7 +233,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._updateDecorationsRunner = this._register(new RunOnceScheduler(() => this._updateDecorations(), 0)); this._containerDomElement = document.createElement('div'); - this._containerDomElement.className = DiffEditorWidget._getClassName(this._theme, this._renderSideBySide); + this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide); this._containerDomElement.style.position = 'relative'; this._containerDomElement.style.height = '100%'; this._domElement.appendChild(this._containerDomElement); @@ -306,11 +298,12 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._codeEditorService.addDiffEditor(this); - themeService.onThemeChange(t => { + this._register(themeService.onThemeChange(t => { if (this._strategy && this._strategy.applyColors(t)) { this._updateDecorationsRunner.schedule(); } - }); + this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide); + })); } public get ignoreTrimWhitespace(): boolean { @@ -325,12 +318,12 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE return this._renderIndicators; } - private static _getClassName(theme: string, renderSideBySide: boolean): string { + private static _getClassName(theme: ITheme, renderSideBySide: boolean): string { let result = 'monaco-diff-editor monaco-editor-background '; if (renderSideBySide) { result += 'side-by-side '; } - result += theme; + result += getThemeTypeSelector(theme.type); return result; } @@ -375,7 +368,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE if (this._isHandlingScrollEvent) { return; } - if (!e.scrollTopChanged && !e.scrollLeftChanged) { + if (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) { return; } this._isHandlingScrollEvent = true; @@ -406,7 +399,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE if (this._isHandlingScrollEvent) { return; } - if (!e.scrollTopChanged && !e.scrollLeftChanged) { + if (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) { return; } this._isHandlingScrollEvent = true; @@ -487,8 +480,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE } public updateOptions(newOptions: editorOptions.IDiffEditorOptions): void { - // Handle new theme - this._theme = newOptions && newOptions.theme ? newOptions.theme : this._theme; // Handle side by side let renderSideBySideChanged = false; @@ -524,9 +515,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._originalIsEditable = Boolean(newOptions.originalEditable); } - // Update class name - this._containerDomElement.className = DiffEditorWidget._getClassName(this._theme, this._renderSideBySide); - this.modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(newOptions)); this.originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(newOptions, this._originalIsEditable)); @@ -543,6 +531,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE } else { this._setStrategy(new DiffEdtorWidgetInline(this._createDataSource(), this._enableSplitViewResizing)); } + // Update class name + this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide); } } @@ -778,18 +768,18 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE let freeSpace = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * DiffEditorWidget.ONE_OVERVIEW_WIDTH; let layoutInfo = this.modifiedEditor.getLayoutInfo(); if (layoutInfo) { - this._originalOverviewRuler.setLayout(new editorOptions.OverviewRulerPosition({ + this._originalOverviewRuler.setLayout({ top: 0, width: DiffEditorWidget.ONE_OVERVIEW_WIDTH, right: freeSpace + DiffEditorWidget.ONE_OVERVIEW_WIDTH, height: this._height - })); - this._modifiedOverviewRuler.setLayout(new editorOptions.OverviewRulerPosition({ + }); + this._modifiedOverviewRuler.setLayout({ top: 0, right: 0, width: DiffEditorWidget.ONE_OVERVIEW_WIDTH, height: this._height - })); + }); } } @@ -893,15 +883,15 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE let result = this._adjustOptionsForSubEditor(options); result.readOnly = !isEditable; result.overviewRulerLanes = 1; - result.theme = this._theme + ' original-in-monaco-diff-editor'; + result.extraEditorClassName = 'original-in-monaco-diff-editor'; return result; } private _adjustOptionsForRightHandSide(options: editorOptions.IDiffEditorOptions): editorOptions.IEditorOptions { let result = this._adjustOptionsForSubEditor(options); - result.revealHorizontalRightPadding = DefaultConfig.editor.revealHorizontalRightPadding + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH; + result.revealHorizontalRightPadding = editorOptions.EDITOR_DEFAULTS.viewInfo.revealHorizontalRightPadding + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH; result.scrollbar.verticalHasArrows = false; - result.theme = this._theme + ' modified-in-monaco-diff-editor'; + result.extraEditorClassName = 'modified-in-monaco-diff-editor'; return result; } @@ -1384,6 +1374,61 @@ abstract class ViewZonesComputer { protected abstract _produceModifiedFromDiff(lineChange: editorCommon.ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone; } +function createDecoration(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, options: ModelDecorationOptions) { + return { + range: new Range(startLineNumber, startColumn, endLineNumber, endColumn), + options: options + }; +} + +const DECORATIONS = { + + charDelete: ModelDecorationOptions.register({ + className: 'char-delete' + }), + charDeleteWholeLine: ModelDecorationOptions.register({ + className: 'char-delete', + isWholeLine: true + }), + + charInsert: ModelDecorationOptions.register({ + className: 'char-insert' + }), + charInsertWholeLine: ModelDecorationOptions.register({ + className: 'char-insert', + isWholeLine: true + }), + + lineInsert: ModelDecorationOptions.register({ + className: 'line-insert', + marginClassName: 'line-insert', + isWholeLine: true + }), + lineInsertWithSign: ModelDecorationOptions.register({ + className: 'line-insert', + linesDecorationsClassName: 'insert-sign', + marginClassName: 'line-insert', + isWholeLine: true + }), + + lineDelete: ModelDecorationOptions.register({ + className: 'line-delete', + marginClassName: 'line-delete', + isWholeLine: true + }), + lineDeleteWithSign: ModelDecorationOptions.register({ + className: 'line-delete', + linesDecorationsClassName: 'delete-sign', + marginClassName: 'line-delete', + isWholeLine: true + + }), + lineDeleteMargin: ModelDecorationOptions.register({ + marginClassName: 'line-delete', + }) + +}; + class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEditorWidgetStyle, IVerticalSashLayoutProvider { static MINIMUM_EDITOR_WIDTH = 100; @@ -1514,15 +1559,10 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd if (isChangeOrDelete(lineChange)) { result.decorations.push({ range: new Range(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Number.MAX_VALUE), - options: { - className: 'line-delete', - linesDecorationsClassName: renderIndicators ? 'delete-sign' : undefined, - marginClassName: 'line-delete', - isWholeLine: true - } + options: (renderIndicators ? DECORATIONS.lineDeleteWithSign : DECORATIONS.lineDelete) }); if (!isChangeOrInsert(lineChange) || !lineChange.charChanges) { - result.decorations.push(createDecoration(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Number.MAX_VALUE, 'char-delete', true)); + result.decorations.push(createDecoration(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Number.MAX_VALUE, DECORATIONS.charDeleteWholeLine)); } let color = this._removeColor.toString(); @@ -1555,10 +1595,10 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd } else { endColumn = originalModel.getLineLastNonWhitespaceColumn(lineNumber); } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, 'char-delete', false)); + result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charDelete)); } } else { - result.decorations.push(createDecoration(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn, 'char-delete', false)); + result.decorations.push(createDecoration(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn, DECORATIONS.charDelete)); } } } @@ -1585,15 +1625,10 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd result.decorations.push({ range: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE), - options: { - className: 'line-insert', - linesDecorationsClassName: renderIndicators ? 'insert-sign' : undefined, - marginClassName: 'line-insert', - isWholeLine: true - } + options: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert) }); if (!isChangeOrDelete(lineChange) || !lineChange.charChanges) { - result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE, 'char-insert', true)); + result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE, DECORATIONS.charInsertWholeLine)); } let color = this._insertColor.toString(); result.overviewZones.push(new OverviewRulerZone( @@ -1624,10 +1659,10 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd } else { endColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber); } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, 'char-insert', false)); + result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert)); } } else { - result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, 'char-insert', false)); + result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert)); } } } @@ -1711,9 +1746,7 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor if (isChangeOrDelete(lineChange)) { result.decorations.push({ range: new Range(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, Number.MAX_VALUE), - options: { - marginClassName: 'line-delete', - } + options: DECORATIONS.lineDeleteMargin }); let color = this._removeColor.toString(); @@ -1748,12 +1781,7 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor if (isChangeOrInsert(lineChange)) { result.decorations.push({ range: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE), - options: { - className: 'line-insert', - linesDecorationsClassName: renderIndicators ? 'insert-sign' : undefined, - marginClassName: 'line-insert', - isWholeLine: true - } + options: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert) }); let color = this._insertColor.toString(); @@ -1785,15 +1813,15 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor } else { endColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber); } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, 'char-insert', false)); + result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert)); } } else { - result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, 'char-insert', false)); + result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert)); } } } } else { - result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE, 'char-insert', true)); + result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, Number.MAX_VALUE, DECORATIONS.charInsertWholeLine)); } } } @@ -1935,31 +1963,12 @@ function isChangeOrDelete(lineChange: editorCommon.IChange): boolean { return lineChange.originalEndLineNumber > 0; } -function createDecoration(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, className: string, isWholeLine: boolean) { - return { - range: new Range(startLineNumber, startColumn, endLineNumber, endColumn), - options: { - className: className, - isWholeLine: isWholeLine - } - }; -} - function createFakeLinesDiv(): HTMLElement { let r = document.createElement('div'); r.className = 'diagonal-fill'; return r; } -const defaultInsertColor = Color.fromRGBA(new RGBA(155, 185, 85, 255 * 0.2)); -const defaultRemoveColor = Color.fromRGBA(new RGBA(255, 0, 0, 255 * 0.2)); - -export const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: defaultInsertColor, light: defaultInsertColor, hc: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted.')); -export const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hc: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed.')); -export const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hc: '#33ff2eff' }, nls.localize('diffEditorInsertedOutline', 'Outline color for the text that got inserted.')); -export const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hc: '#FF008F' }, nls.localize('diffEditorRemovedOutline', 'Outline color for text that got removed.')); - - registerThemingParticipant((theme, collector) => { let added = theme.getColor(diffInserted); if (added) { @@ -1979,4 +1988,8 @@ registerThemingParticipant((theme, collector) => { if (removedOutline) { collector.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px dashed ${removedOutline}; }`); } + let shadow = theme.getColor(scrollbarShadow); + if (shadow) { + collector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${shadow}; }`); + } }); \ No newline at end of file diff --git a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts index 0956a3e7d81..185f3537c51 100644 --- a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts +++ b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts @@ -12,6 +12,7 @@ import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService' import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { CodeEditor } from 'vs/editor/browser/codeEditor'; import { IConfigurationChangedEvent, IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; export class EmbeddedCodeEditorWidget extends CodeEditor { @@ -25,9 +26,10 @@ export class EmbeddedCodeEditorWidget extends CodeEditor { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IContextKeyService contextKeyService: IContextKeyService + @IContextKeyService contextKeyService: IContextKeyService, + @IThemeService themeService: IThemeService ) { - super(domElement, parentEditor.getRawConfiguration(), instantiationService, codeEditorService, commandService, contextKeyService); + super(domElement, parentEditor.getRawConfiguration(), instantiationService, codeEditorService, commandService, contextKeyService, themeService); this._parentEditor = parentEditor; this._overwriteOptions = options; diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index 0c1bb226785..76d1969cddc 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -31,9 +31,6 @@ .modified-in-monaco-diff-editor .slider.active { background: rgba(171, 171, 171, .4); } .modified-in-monaco-diff-editor.hc-black .slider.active { background: none; } -.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px #DDD; } -.monaco-diff-editor.side-by-side.vs-dark .editor.modified { box-shadow: -6px 0 5px -5px black; } - /* ---------- Diff ---------- */ .monaco-editor .insert-sign, .monaco-editor .delete-sign { diff --git a/src/vs/editor/browser/widget/media/editor.css b/src/vs/editor/browser/widget/media/editor.css index 90a691620e8..ca070ab9a21 100644 --- a/src/vs/editor/browser/widget/media/editor.css +++ b/src/vs/editor/browser/widget/media/editor.css @@ -15,7 +15,7 @@ color: inherit; } -/* -------------------- Editor, inputarea and background -------------------- */ +/* -------------------- Editor -------------------- */ .monaco-editor { position: relative; @@ -29,69 +29,6 @@ -webkit-font-feature-settings: "liga" on, "calt" on; font-feature-settings: "liga" on, "calt" on; } -.monaco-editor .inputarea { - /*Chrome cannot handle typing in a 0x0 textarea*/ - width: 1px; - height: 1px; - min-width: 0; - min-height: 0; - margin: 0; - padding: 0; - position: absolute; - outline: none !important; - resize: none; - border: none; - overflow: hidden; -} -/*.monaco-editor .inputarea { - position: fixed !important; - width: 800px !important; - height: 200px !important; - top: initial !important; - left: initial !important; - bottom: 0 !important; - right: 0 !important; -}*/ -.monaco-editor.ff .inputarea, -.monaco-editor.ie .inputarea { - width: 0; - height: 0; -} -.monaco-editor.ime-input .inputarea { - z-index: 10; -} - -.monaco-editor, -.monaco-editor .inputarea { - color: #333; - /* - * WORKAROUND: - * Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254 - * we are *not* using the color white (or #ffffff, rgba(255,255,255)) but something very close to white. - */ - background: #fffffe; -} -.monaco-editor.ime-input .inputarea { - background: rgba(255, 255, 255, 0.85); -} - -.monaco-editor.vs-dark, -.monaco-editor.vs-dark .inputarea, -.monaco-editor.vs-dark .zone-widget .monaco-editor { - color: #BBB; - background: #1E1E1E; -} -.monaco-editor.vs-dark.ime-input .inputarea { - background: rgba(0, 0, 0, 0.65); -} - -.monaco-editor.hc-black, -.monaco-editor.hc-black .inputarea, -.monaco-editor.hc-black .zone-widget .monaco-editor { - color: #fff; - background: #000; -} - /* -------------------- Misc -------------------- */ @@ -103,14 +40,4 @@ .monaco-editor .view-overlays { position: absolute; top: 0; -} - -/* -------------------- Squigglies -------------------- */ - -.monaco-editor.vs .redsquiggly, -.monaco-editor.vs-dark .redsquiggly { background: url("red-squiggly.svg") repeat-x bottom left; } -.monaco-editor.hc-black .redsquiggly { border-bottom: 4px double #E47777; opacity: 0.8; } - -.monaco-editor.vs .greensquiggly, -.monaco-editor.vs-dark .greensquiggly { background: url("green-squiggly.svg") repeat-x bottom left; } -.monaco-editor.hc-black .greensquiggly { border-bottom: 4px double #71B771; opacity: 0.8; } +} \ No newline at end of file diff --git a/src/vs/editor/browser/widget/media/green-squiggly.svg b/src/vs/editor/browser/widget/media/green-squiggly.svg deleted file mode 100644 index 8fc5c6f099b..00000000000 --- a/src/vs/editor/browser/widget/media/green-squiggly.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/browser/widget/media/red-squiggly.svg b/src/vs/editor/browser/widget/media/red-squiggly.svg deleted file mode 100644 index 690406efa15..00000000000 --- a/src/vs/editor/browser/widget/media/red-squiggly.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/browser/widget/media/tokens.css b/src/vs/editor/browser/widget/media/tokens.css index b94b6851a06..5050a535870 100644 --- a/src/vs/editor/browser/widget/media/tokens.css +++ b/src/vs/editor/browser/widget/media/tokens.css @@ -9,6 +9,3 @@ .monaco-editor.hc-black .view-line { mix-blend-mode: difference; } -.monaco-editor.vs .vs-whitespace { color: rgba(51, 51, 51, 0.2); } -.monaco-editor.vs-dark .vs-whitespace { color: rgba(227, 228, 226, 0.16); } -.monaco-editor.hc-black .vs-whitespace { color: rgba(227, 228, 226, 0.16); } diff --git a/src/vs/editor/common/commands/replaceCommand.ts b/src/vs/editor/common/commands/replaceCommand.ts index c3c2c765bc4..1083964b0ff 100644 --- a/src/vs/editor/common/commands/replaceCommand.ts +++ b/src/vs/editor/common/commands/replaceCommand.ts @@ -10,12 +10,14 @@ import { Range } from 'vs/editor/common/core/range'; export class ReplaceCommand implements editorCommon.ICommand { - private _range: Range; - private _text: string; + private readonly _range: Range; + private readonly _text: string; + public readonly insertsAutoWhitespace: boolean; - constructor(range: Range, text: string) { + constructor(range: Range, text: string, insertsAutoWhitespace: boolean = false) { this._range = range; this._text = text; + this.insertsAutoWhitespace = insertsAutoWhitespace; } public getEditOperations(model: editorCommon.ITokenizedModel, builder: editorCommon.IEditOperationBuilder): void { @@ -36,12 +38,14 @@ export class ReplaceCommand implements editorCommon.ICommand { export class ReplaceCommandWithoutChangingPosition implements editorCommon.ICommand { - private _range: Range; - private _text: string; + private readonly _range: Range; + private readonly _text: string; + public readonly insertsAutoWhitespace: boolean; - constructor(range: Range, text: string) { + constructor(range: Range, text: string, insertsAutoWhitespace: boolean = false) { this._range = range; this._text = text; + this.insertsAutoWhitespace = insertsAutoWhitespace; } public getEditOperations(model: editorCommon.ITokenizedModel, builder: editorCommon.IEditOperationBuilder): void { @@ -62,16 +66,18 @@ export class ReplaceCommandWithoutChangingPosition implements editorCommon.IComm export class ReplaceCommandWithOffsetCursorState implements editorCommon.ICommand { - private _range: Range; - private _text: string; - private _columnDeltaOffset: number; - private _lineNumberDeltaOffset: number; + private readonly _range: Range; + private readonly _text: string; + private readonly _columnDeltaOffset: number; + private readonly _lineNumberDeltaOffset: number; + public readonly insertsAutoWhitespace: boolean; - constructor(range: Range, text: string, lineNumberDeltaOffset: number, columnDeltaOffset: number) { + constructor(range: Range, text: string, lineNumberDeltaOffset: number, columnDeltaOffset: number, insertsAutoWhitespace: boolean = false) { this._range = range; this._text = text; this._columnDeltaOffset = columnDeltaOffset; this._lineNumberDeltaOffset = lineNumberDeltaOffset; + this.insertsAutoWhitespace = insertsAutoWhitespace; } public getEditOperations(model: editorCommon.ITokenizedModel, builder: editorCommon.IEditOperationBuilder): void { diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index c21b629a895..c5285a83724 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -12,15 +12,12 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IContextKey, IContextKeyServiceTarget, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { CommonEditorConfiguration } from 'vs/editor/common/config/commonEditorConfig'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; -import { Cursor } from 'vs/editor/common/controller/cursor'; -import { CursorColumns, IViewModelHelper, ICursors } from 'vs/editor/common/controller/cursorCommon'; +import { Cursor, CursorStateChangedEvent } from 'vs/editor/common/controller/cursor'; +import { CursorColumns, ICursors, CursorConfiguration } from 'vs/editor/common/controller/cursorCommon'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { Range, IRange } from 'vs/editor/common/core/range'; import { Selection, ISelection } from 'vs/editor/common/core/selection'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper'; -import { SplitLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection'; import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; import { hash } from 'vs/base/common/hash'; import { EditorModeContext } from 'vs/editor/common/modes/editorModeContext'; @@ -29,8 +26,10 @@ import { IModelLanguageChangedEvent, IModelOptionsChangedEvent, TextModelEventType } from 'vs/editor/common/model/textModelEvents'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; -import { CursorEventType, ICursorPositionChangedEvent, VerticalRevealType, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; let EDITOR_ID = 0; @@ -126,9 +125,6 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo this._decorationTypeSubtypes = {}; options = options || {}; - if (typeof options.ariaLabel === 'undefined') { - options.ariaLabel = DefaultConfig.editor.ariaLabel; - } this._configuration = this._register(this._createConfiguration(options)); this._register(this._configuration.onDidChange((e) => { this._onDidChangeConfiguration.fire(e); @@ -191,7 +187,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo } public getConfiguration(): editorOptions.InternalEditorOptions { - return this._configuration.editorClone; + return this._configuration.editor; } public getRawConfiguration(): editorOptions.IEditorOptions { @@ -240,11 +236,12 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo this._postDetachModelCleanup(detachedModel); } - public abstract getCenteredRangeInViewport(): Range; - - protected abstract _getCompletelyVisibleViewRange(): Range; - protected abstract _getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range; - protected abstract _getVerticalOffsetForViewLineNumber(viewLineNumber: number): number; + public getCenteredRangeInViewport(): Range { + if (!this.hasView) { + return null; + } + return this.viewModel.getCenteredRangeInViewport(); + } public getVisibleColumnFromPosition(rawPosition: IPosition): number { if (!this.model) { @@ -282,16 +279,17 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo } } - private _sendRevealRange(range: Range, verticalType: VerticalRevealType, revealHorizontal: boolean): void { + private _sendRevealRange(modelRange: Range, verticalType: VerticalRevealType, revealHorizontal: boolean): void { if (!this.model || !this.cursor) { return; } - if (!Range.isIRange(range)) { + if (!Range.isIRange(modelRange)) { throw new Error('Invalid arguments'); } - let validatedRange = this.model.validateRange(range); + const validatedModelRange = this.model.validateRange(modelRange); + const viewRange = this.viewModel.coordinatesConverter.convertModelRangeToViewRange(validatedModelRange); - this.cursor.emitCursorRevealRange(validatedRange, null, verticalType, revealHorizontal); + this.cursor.emitCursorRevealRange(viewRange, verticalType, revealHorizontal); } public revealLine(lineNumber: number): void { @@ -505,18 +503,111 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo this.cursor.setSelections('api', ranges); } - public abstract getScrollWidth(): number; - public abstract getScrollLeft(): number; + public getScrollWidth(): number { + if (!this.hasView) { + return -1; + } + return this.viewModel.viewLayout.getScrollWidth(); + } + public getScrollLeft(): number { + if (!this.hasView) { + return -1; + } + return this.viewModel.viewLayout.getScrollLeft(); + } - public abstract getScrollHeight(): number; - public abstract getScrollTop(): number; + public getScrollHeight(): number { + if (!this.hasView) { + return -1; + } + return this.viewModel.viewLayout.getScrollHeight(); + } + public getScrollTop(): number { + if (!this.hasView) { + return -1; + } + return this.viewModel.viewLayout.getScrollTop(); + } - public abstract setScrollLeft(newScrollLeft: number): void; - public abstract setScrollTop(newScrollTop: number): void; - public abstract setScrollPosition(position: editorCommon.INewScrollPosition): void; + public setScrollLeft(newScrollLeft: number): void { + if (!this.hasView) { + return; + } + if (typeof newScrollLeft !== 'number') { + throw new Error('Invalid arguments'); + } + this.viewModel.viewLayout.setScrollPosition({ + scrollLeft: newScrollLeft + }); + } + public setScrollTop(newScrollTop: number): void { + if (!this.hasView) { + return; + } + if (typeof newScrollTop !== 'number') { + throw new Error('Invalid arguments'); + } + this.viewModel.viewLayout.setScrollPosition({ + scrollTop: newScrollTop + }); + } + public setScrollPosition(position: editorCommon.INewScrollPosition): void { + if (!this.hasView) { + return; + } + this.viewModel.viewLayout.setScrollPosition(position); + } - public abstract saveViewState(): editorCommon.ICodeEditorViewState; - public abstract restoreViewState(state: editorCommon.IEditorViewState): void; + public saveViewState(): editorCommon.ICodeEditorViewState { + if (!this.cursor || !this.hasView) { + return null; + } + let contributionsState: { [key: string]: any } = {}; + + let keys = Object.keys(this._contributions); + for (let i = 0, len = keys.length; i < len; i++) { + let id = keys[i]; + let contribution = this._contributions[id]; + if (typeof contribution.saveViewState === 'function') { + contributionsState[id] = contribution.saveViewState(); + } + } + + let cursorState = this.cursor.saveState(); + let viewState = this.viewModel.viewLayout.saveState(); + return { + cursorState: cursorState, + viewState: viewState, + contributionsState: contributionsState + }; + } + + public restoreViewState(s: editorCommon.ICodeEditorViewState): void { + if (!this.cursor || !this.hasView) { + return; + } + if (s && s.cursorState && s.viewState) { + let codeEditorState = s; + let cursorState = codeEditorState.cursorState; + if (Array.isArray(cursorState)) { + this.cursor.restoreState(cursorState); + } else { + // Backwards compatibility + this.cursor.restoreState([cursorState]); + } + this.viewModel.viewLayout.restoreState(codeEditorState.viewState); + + let contributionsState = s.contributionsState || {}; + let keys = Object.keys(this._contributions); + for (let i = 0, len = keys.length; i < len; i++) { + let id = keys[i]; + let contribution = this._contributions[id]; + if (typeof contribution.restoreViewState === 'function') { + contribution.restoreViewState(contributionsState[id]); + } + } + } + } public onVisible(): void { } @@ -577,6 +668,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo return; } + // Special case for pasting if (handlerId === editorCommon.Handler.Paste) { if (!this.cursor || typeof payload.text !== 'string' || payload.text.length === 0) { // nothing to do @@ -593,31 +685,37 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo return; } - let candidate = this.getAction(handlerId); - if (candidate !== null) { - TPromise.as(candidate.run()).done(null, onUnexpectedError); - } else { - if (!this.cursor) { - return; - } - this.cursor.trigger(source, handlerId, payload); + const action = this.getAction(handlerId); + if (action) { + TPromise.as(action.run()).done(null, onUnexpectedError); + return; } + + if (!this.cursor) { + return; + } + + const command = CommonEditorRegistry.getEditorCommand(handlerId); + if (command) { + payload = payload || {}; + payload.source = source; + TPromise.as(command.runEditorCommand(null, this, payload)).done(null, onUnexpectedError); + return; + } + + this.cursor.trigger(source, handlerId, payload); } public _getCursors(): ICursors { return this.cursor; } - public executeCommand(source: string, command: editorCommon.ICommand): void { - if (!this.cursor) { - return; - } - this.cursor.trigger(source, editorCommon.Handler.ExecuteCommand, command); + public _getCursorConfiguration(): CursorConfiguration { + return this.cursor.context.config; } public pushUndoStop(): boolean { - if (!this.cursor) { - // no view, no cursor + if (!this.model) { return false; } if (this._configuration.editor.readOnly) { @@ -649,6 +747,13 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo return true; } + public executeCommand(source: string, command: editorCommon.ICommand): void { + if (!this.cursor) { + return; + } + this.cursor.trigger(source, editorCommon.Handler.ExecuteCommand, command); + } + public executeCommands(source: string, commands: editorCommon.ICommand[]): void { if (!this.cursor) { return; @@ -756,44 +861,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo this.model.onBeforeAttached(); - let hardWrappingLineMapperFactory = new CharacterHardWrappingLineMapperFactory( - this._configuration.editor.wrappingInfo.wordWrapBreakBeforeCharacters, - this._configuration.editor.wrappingInfo.wordWrapBreakAfterCharacters, - this._configuration.editor.wrappingInfo.wordWrapBreakObtrusiveCharacters - ); - - let linesCollection = new SplitLinesCollection( - this.model, - hardWrappingLineMapperFactory, - this.model.getOptions().tabSize, - this._configuration.editor.wrappingInfo.wrappingColumn, - this._configuration.editor.fontInfo.typicalFullwidthCharacterWidth / this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth, - this._configuration.editor.wrappingInfo.wrappingIndent - ); - - this.viewModel = new ViewModel( - linesCollection, - this.id, - this._configuration, - this.model - ); - - let viewModelHelper: IViewModelHelper = { - viewModel: this.viewModel, - coordinatesConverter: this.viewModel.coordinatesConverter, - getScrollTop: (): number => { - return this.getScrollTop(); - }, - getCompletelyVisibleViewRange: (): Range => { - return this._getCompletelyVisibleViewRange(); - }, - getCompletelyVisibleViewRangeAtScrollTop: (scrollTop: number): Range => { - return this._getCompletelyVisibleViewRangeAtScrollTop(scrollTop); - }, - getVerticalOffsetForViewLineNumber: (viewLineNumber: number): number => { - return this._getVerticalOffsetForViewLineNumber(viewLineNumber); - } - }; + this.viewModel = new ViewModel(this.id, this._configuration, this.model); this.listenersToRemove.push(this.model.addBulkListener((events) => { for (let i = 0, len = events.length; i < len; i++) { @@ -832,40 +900,40 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo this.cursor = new Cursor( this._configuration, this.model, - viewModelHelper, - this._enableEmptySelectionClipboard() + this.viewModel ); - this.viewModel.addEventSource(this.cursor); - this._createView(); - this.listenersToRemove.push(this.cursor.addBulkListener((events) => { - for (let i = 0, len = events.length; i < len; i++) { - let eventType = events[i].type; - let e = events[i].data; + this.listenersToRemove.push(this.cursor.onDidChange((e: CursorStateChangedEvent) => { - switch (eventType) { - case CursorEventType.CursorPositionChanged: - this._onDidChangeCursorPosition.fire(e); - break; - - case CursorEventType.CursorSelectionChanged: - this._onDidChangeCursorSelection.fire(e); - break; - - default: - // console.warn("Unhandled cursor event: ", e); - } + let positions: Position[] = []; + for (let i = 0, len = e.selections.length; i < len; i++) { + positions[i] = e.selections[i].getPosition(); } + + const e1: ICursorPositionChangedEvent = { + position: positions[0], + secondaryPositions: positions.slice(1), + reason: e.reason, + source: e.source + }; + this._onDidChangeCursorPosition.fire(e1); + + const e2: ICursorSelectionChangedEvent = { + selection: e.selections[0], + secondarySelections: e.selections.slice(1), + source: e.source, + reason: e.reason + }; + this._onDidChangeCursorSelection.fire(e2); })); + } else { this.hasView = false; } } - protected abstract _enableEmptySelectionClipboard(): boolean; - protected abstract _createView(): void; protected _postDetachModelCleanup(detachedModel: editorCommon.IModel): void { diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index c8655516e9f..bf24f6608be 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -11,14 +11,13 @@ import * as objects from 'vs/base/common/objects'; import * as platform from 'vs/base/common/platform'; import { Extensions, IConfigurationRegistry, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry'; import { Registry } from 'vs/platform/platform'; -import { DefaultConfig, DEFAULT_INDENTATION, DEFAULT_TRIM_AUTO_WHITESPACE } from 'vs/editor/common/config/defaultConfig'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { EditorLayoutProvider } from 'vs/editor/common/viewLayout/editorLayoutProvider'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; -import { Constants } from 'vs/editor/common/core/uint'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; +import EDITOR_DEFAULTS = editorOptions.EDITOR_DEFAULTS; +import EDITOR_FONT_DEFAULTS = editorOptions.EDITOR_FONT_DEFAULTS; +import EDITOR_MODEL_DEFAULTS = editorOptions.EDITOR_MODEL_DEFAULTS; /** * Control what pressing Tab does. @@ -52,470 +51,37 @@ export const TabFocus: ITabFocus = new class { } }; -/** - * Experimental screen reader support toggle - */ -export class GlobalScreenReaderNVDA { - - private static _value = false; - private static _onChange = new Emitter(); - public static onChange: Event = GlobalScreenReaderNVDA._onChange.event; - - public static getValue(): boolean { - return this._value; - } - - public static setValue(value: boolean): void { - if (this._value === value) { - return; - } - this._value = value; - this._onChange.fire(this._value); - } -} - -export class ConfigurationWithDefaults { - - private _editor: editorOptions.IEditorOptions; - - constructor(options: editorOptions.IEditorOptions) { - this._editor = objects.clone(DefaultConfig.editor); - - this._mergeOptionsIn(options); - } - - public getEditorOptions(): editorOptions.IEditorOptions { - return this._editor; - } - - private _mergeOptionsIn(newOptions: editorOptions.IEditorOptions): void { - this._editor = objects.mixin(this._editor, newOptions || {}); - } - - public updateOptions(newOptions: editorOptions.IEditorOptions): void { - // Apply new options - this._mergeOptionsIn(newOptions); - } -} - -class InternalEditorOptionsHelper { - - constructor() { - } - - public static createInternalEditorOptions( - outerWidth: number, - outerHeight: number, - opts: editorOptions.IEditorOptions, - fontInfo: FontInfo, - editorClassName: string, - isDominatedByLongLines: boolean, - lineNumbersDigitCount: number, - canUseTranslate3d: boolean, - pixelRatio: number - ): editorOptions.InternalEditorOptions { - - let stopRenderingLineAfter: number; - if (typeof opts.stopRenderingLineAfter !== 'undefined') { - stopRenderingLineAfter = toInteger(opts.stopRenderingLineAfter, -1); - } else { - stopRenderingLineAfter = 10000; - } - - let scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, toFloat(opts.mouseWheelScrollSensitivity, 1)); - let minimap = this._sanitizeMinimapOpts(opts.minimap); - - let glyphMargin = toBoolean(opts.glyphMargin); - let lineNumbersMinChars = toInteger(opts.lineNumbersMinChars, 1); - - let lineDecorationsWidth: number; - if (typeof opts.lineDecorationsWidth === 'string' && /^\d+(\.\d+)?ch$/.test(opts.lineDecorationsWidth)) { - let multiple = parseFloat(opts.lineDecorationsWidth.substr(0, opts.lineDecorationsWidth.length - 2)); - lineDecorationsWidth = multiple * fontInfo.typicalHalfwidthCharacterWidth; - } else { - lineDecorationsWidth = toInteger(opts.lineDecorationsWidth, 0); - } - if (opts.folding) { - lineDecorationsWidth += 16; - } - - let renderLineNumbers: boolean; - let renderCustomLineNumbers: (lineNumber: number) => string; - let renderRelativeLineNumbers: boolean; - { - let lineNumbers = opts.lineNumbers; - // Compatibility with old true or false values - if (lineNumbers === true) { - lineNumbers = 'on'; - } else if (lineNumbers === false) { - lineNumbers = 'off'; - } - - if (typeof lineNumbers === 'function') { - renderLineNumbers = true; - renderCustomLineNumbers = lineNumbers; - renderRelativeLineNumbers = false; - } else if (lineNumbers === 'relative') { - renderLineNumbers = true; - renderCustomLineNumbers = null; - renderRelativeLineNumbers = true; - } else if (lineNumbers === 'on') { - renderLineNumbers = true; - renderCustomLineNumbers = null; - renderRelativeLineNumbers = false; - } else { - renderLineNumbers = false; - renderCustomLineNumbers = null; - renderRelativeLineNumbers = false; - } - } - - let layoutInfo = EditorLayoutProvider.compute({ - outerWidth: outerWidth, - outerHeight: outerHeight, - showGlyphMargin: glyphMargin, - lineHeight: fontInfo.lineHeight, - showLineNumbers: renderLineNumbers, - lineNumbersMinChars: lineNumbersMinChars, - lineNumbersDigitCount: lineNumbersDigitCount, - lineDecorationsWidth: lineDecorationsWidth, - typicalHalfwidthCharacterWidth: fontInfo.typicalHalfwidthCharacterWidth, - maxDigitWidth: fontInfo.maxDigitWidth, - verticalScrollbarWidth: scrollbar.verticalScrollbarSize, - horizontalScrollbarHeight: scrollbar.horizontalScrollbarSize, - scrollbarArrowSize: scrollbar.arrowSize, - verticalScrollbarHasArrows: scrollbar.verticalHasArrows, - minimap: minimap.enabled, - minimapRenderCharacters: minimap.renderCharacters, - minimapMaxColumn: minimap.maxColumn, - pixelRatio: pixelRatio - }); - - let bareWrappingInfo: { isWordWrapMinified: boolean; isViewportWrapping: boolean; wrappingColumn: number; } = null; - { - let wordWrap = opts.wordWrap; - let wordWrapColumn = toInteger(opts.wordWrapColumn, 1); - let wordWrapMinified = toBoolean(opts.wordWrapMinified); - - // Compatibility with old true or false values - if (wordWrap === true) { - wordWrap = 'on'; - } else if (wordWrap === false) { - wordWrap = 'off'; - } - - if (wordWrapMinified && isDominatedByLongLines) { - // Force viewport width wrapping if model is dominated by long lines - bareWrappingInfo = { - isWordWrapMinified: true, - isViewportWrapping: true, - wrappingColumn: Math.max(1, layoutInfo.viewportColumn) - }; - } else if (wordWrap === 'on') { - bareWrappingInfo = { - isWordWrapMinified: false, - isViewportWrapping: true, - wrappingColumn: Math.max(1, layoutInfo.viewportColumn) - }; - } else if (wordWrap === 'bounded') { - bareWrappingInfo = { - isWordWrapMinified: false, - isViewportWrapping: true, - wrappingColumn: Math.min(Math.max(1, layoutInfo.viewportColumn), wordWrapColumn) - }; - } else if (wordWrap === 'wordWrapColumn') { - bareWrappingInfo = { - isWordWrapMinified: false, - isViewportWrapping: false, - wrappingColumn: wordWrapColumn - }; - } else { - bareWrappingInfo = { - isWordWrapMinified: false, - isViewportWrapping: false, - wrappingColumn: -1 - }; - } - } - - let wrappingInfo = new editorOptions.EditorWrappingInfo({ - inDiffEditor: Boolean(opts.inDiffEditor), - isDominatedByLongLines: isDominatedByLongLines, - isWordWrapMinified: bareWrappingInfo.isWordWrapMinified, - isViewportWrapping: bareWrappingInfo.isViewportWrapping, - wrappingColumn: bareWrappingInfo.wrappingColumn, - wrappingIndent: wrappingIndentFromString(opts.wrappingIndent), - wordWrapBreakBeforeCharacters: String(opts.wordWrapBreakBeforeCharacters), - wordWrapBreakAfterCharacters: String(opts.wordWrapBreakAfterCharacters), - wordWrapBreakObtrusiveCharacters: String(opts.wordWrapBreakObtrusiveCharacters), - }); - - let readOnly = toBoolean(opts.readOnly); - - let tabFocusMode = TabFocus.getTabFocusMode(); - if (readOnly) { - tabFocusMode = true; - } - - - let renderWhitespace = opts.renderWhitespace; - // Compatibility with old true or false values - if (renderWhitespace === true) { - renderWhitespace = 'boundary'; - } else if (renderWhitespace === false) { - renderWhitespace = 'none'; - } - - let renderLineHighlight = opts.renderLineHighlight; - // Compatibility with old true or false values - if (renderLineHighlight === true) { - renderLineHighlight = 'line'; - } else if (renderLineHighlight === false) { - renderLineHighlight = 'none'; - } - - let viewInfo = new editorOptions.InternalEditorViewOptions({ - theme: opts.theme, - canUseTranslate3d: canUseTranslate3d, - disableMonospaceOptimizations: (toBoolean(opts.disableMonospaceOptimizations) || toBoolean(opts.fontLigatures)), - experimentalScreenReader: toBoolean(opts.experimentalScreenReader), - rulers: toSortedIntegerArray(opts.rulers), - ariaLabel: String(opts.ariaLabel), - renderLineNumbers: renderLineNumbers, - renderCustomLineNumbers: renderCustomLineNumbers, - renderRelativeLineNumbers: renderRelativeLineNumbers, - selectOnLineNumbers: toBoolean(opts.selectOnLineNumbers), - glyphMargin: glyphMargin, - revealHorizontalRightPadding: toInteger(opts.revealHorizontalRightPadding, 0), - roundedSelection: toBoolean(opts.roundedSelection), - overviewRulerLanes: toInteger(opts.overviewRulerLanes, 0, 3), - overviewRulerBorder: toBoolean(opts.overviewRulerBorder), - cursorBlinking: cursorBlinkingStyleFromString(opts.cursorBlinking), - mouseWheelZoom: toBoolean(opts.mouseWheelZoom), - cursorStyle: cursorStyleFromString(opts.cursorStyle), - hideCursorInOverviewRuler: toBoolean(opts.hideCursorInOverviewRuler), - scrollBeyondLastLine: toBoolean(opts.scrollBeyondLastLine), - editorClassName: editorClassName, - stopRenderingLineAfter: stopRenderingLineAfter, - renderWhitespace: renderWhitespace, - renderControlCharacters: toBoolean(opts.renderControlCharacters), - fontLigatures: toBoolean(opts.fontLigatures), - renderIndentGuides: toBoolean(opts.renderIndentGuides), - renderLineHighlight: renderLineHighlight, - scrollbar: scrollbar, - minimap: minimap, - fixedOverflowWidgets: toBoolean(opts.fixedOverflowWidgets) - }); - - let contribInfo = new editorOptions.EditorContribOptions({ - selectionClipboard: toBoolean(opts.selectionClipboard), - hover: toBoolean(opts.hover), - contextmenu: toBoolean(opts.contextmenu), - quickSuggestions: typeof opts.quickSuggestions === 'object' ? { other: true, ...opts.quickSuggestions } : toBoolean(opts.quickSuggestions), - quickSuggestionsDelay: toInteger(opts.quickSuggestionsDelay), - parameterHints: toBoolean(opts.parameterHints), - iconsInSuggestions: toBoolean(opts.iconsInSuggestions), - formatOnType: toBoolean(opts.formatOnType), - formatOnPaste: toBoolean(opts.formatOnPaste), - suggestOnTriggerCharacters: toBoolean(opts.suggestOnTriggerCharacters), - acceptSuggestionOnEnter: toBoolean(opts.acceptSuggestionOnEnter), - acceptSuggestionOnCommitCharacter: toBoolean(opts.acceptSuggestionOnCommitCharacter), - snippetSuggestions: opts.snippetSuggestions, - emptySelectionClipboard: opts.emptySelectionClipboard, - wordBasedSuggestions: opts.wordBasedSuggestions, - suggestFontSize: opts.suggestFontSize, - suggestLineHeight: opts.suggestLineHeight, - selectionHighlight: toBoolean(opts.selectionHighlight), - occurrencesHighlight: toBoolean(opts.occurrencesHighlight), - codeLens: opts.referenceInfos && opts.codeLens, - folding: toBoolean(opts.folding), - matchBrackets: toBoolean(opts.matchBrackets), - }); - - return new editorOptions.InternalEditorOptions({ - lineHeight: fontInfo.lineHeight, // todo -> duplicated in styling - readOnly: readOnly, - wordSeparators: String(opts.wordSeparators), - autoClosingBrackets: toBoolean(opts.autoClosingBrackets), - useTabStops: toBoolean(opts.useTabStops), - tabFocusMode: tabFocusMode, - dragAndDrop: toBoolean(opts.dragAndDrop), - layoutInfo: layoutInfo, - fontInfo: fontInfo, - viewInfo: viewInfo, - wrappingInfo: wrappingInfo, - contribInfo: contribInfo, - }); - } - - private static _sanitizeScrollbarOpts(raw: editorOptions.IEditorScrollbarOptions, mouseWheelScrollSensitivity: number): editorOptions.InternalEditorScrollbarOptions { - - let visibilityFromString = (visibility: string) => { - switch (visibility) { - case 'hidden': - return ScrollbarVisibility.Hidden; - case 'visible': - return ScrollbarVisibility.Visible; - default: - return ScrollbarVisibility.Auto; - } - }; - - let horizontalScrollbarSize = toIntegerWithDefault(raw.horizontalScrollbarSize, 10); - let verticalScrollbarSize = toIntegerWithDefault(raw.verticalScrollbarSize, 14); - return new editorOptions.InternalEditorScrollbarOptions({ - vertical: visibilityFromString(raw.vertical), - horizontal: visibilityFromString(raw.horizontal), - - arrowSize: toIntegerWithDefault(raw.arrowSize, 11), - useShadows: toBooleanWithDefault(raw.useShadows, true), - - verticalHasArrows: toBooleanWithDefault(raw.verticalHasArrows, false), - horizontalHasArrows: toBooleanWithDefault(raw.horizontalHasArrows, false), - - horizontalScrollbarSize: horizontalScrollbarSize, - horizontalSliderSize: toIntegerWithDefault(raw.horizontalSliderSize, horizontalScrollbarSize), - - verticalScrollbarSize: verticalScrollbarSize, - verticalSliderSize: toIntegerWithDefault(raw.verticalSliderSize, verticalScrollbarSize), - - handleMouseWheel: toBooleanWithDefault(raw.handleMouseWheel, true), - mouseWheelScrollSensitivity: mouseWheelScrollSensitivity - }); - } - - private static _sanitizeMinimapOpts(raw: editorOptions.IEditorMinimapOptions): editorOptions.InternalEditorMinimapOptions { - let maxColumn = toIntegerWithDefault(raw.maxColumn, DefaultConfig.editor.minimap.maxColumn); - if (maxColumn < 1) { - maxColumn = 1; - } - return new editorOptions.InternalEditorMinimapOptions({ - enabled: toBooleanWithDefault(raw.enabled, DefaultConfig.editor.minimap.enabled), - renderCharacters: toBooleanWithDefault(raw.renderCharacters, DefaultConfig.editor.minimap.renderCharacters), - maxColumn: maxColumn, - }); - } -} - -function toBoolean(value: any): boolean { - return value === 'false' ? false : Boolean(value); -} - -function toBooleanWithDefault(value: any, defaultValue: boolean): boolean { - if (typeof value === 'undefined') { - return defaultValue; - } - return toBoolean(value); -} - -function toFloat(source: any, defaultValue: number): number { - let r = parseFloat(source); - if (isNaN(r)) { - r = defaultValue; - } - return r; -} - -function toInteger(source: any, minimum: number = Constants.MIN_SAFE_SMALL_INTEGER, maximum: number = Constants.MAX_SAFE_SMALL_INTEGER): number { - let r = parseInt(source, 10); - if (isNaN(r)) { - r = 0; - } - r = Math.max(minimum, r); - r = Math.min(maximum, r); - return r | 0; -} - -function toSortedIntegerArray(source: any): number[] { - if (!Array.isArray(source)) { - return []; - } - let arrSource = source; - let r = arrSource.map(el => toInteger(el)); - r.sort(); - return r; -} - -function wrappingIndentFromString(wrappingIndent: string): editorOptions.WrappingIndent { - if (wrappingIndent === 'indent') { - return editorOptions.WrappingIndent.Indent; - } else if (wrappingIndent === 'same') { - return editorOptions.WrappingIndent.Same; - } else { - return editorOptions.WrappingIndent.None; - } -} - -function cursorStyleFromString(cursorStyle: string): editorOptions.TextEditorCursorStyle { - if (cursorStyle === 'line') { - return editorOptions.TextEditorCursorStyle.Line; - } else if (cursorStyle === 'block') { - return editorOptions.TextEditorCursorStyle.Block; - } else if (cursorStyle === 'underline') { - return editorOptions.TextEditorCursorStyle.Underline; - } else if (cursorStyle === 'line-thin') { - return editorOptions.TextEditorCursorStyle.LineThin; - } else if (cursorStyle === 'block-outline') { - return editorOptions.TextEditorCursorStyle.BlockOutline; - } else if (cursorStyle === 'underline-thin') { - return editorOptions.TextEditorCursorStyle.UnderlineThin; - } - return editorOptions.TextEditorCursorStyle.Line; -} - -function cursorBlinkingStyleFromString(cursorBlinkingStyle: string): editorOptions.TextEditorCursorBlinkingStyle { - switch (cursorBlinkingStyle) { - case 'blink': - return editorOptions.TextEditorCursorBlinkingStyle.Blink; - case 'smooth': - return editorOptions.TextEditorCursorBlinkingStyle.Smooth; - case 'phase': - return editorOptions.TextEditorCursorBlinkingStyle.Phase; - case 'expand': - return editorOptions.TextEditorCursorBlinkingStyle.Expand; - case 'visible': // maintain compatibility - case 'solid': - return editorOptions.TextEditorCursorBlinkingStyle.Solid; - } - return editorOptions.TextEditorCursorBlinkingStyle.Blink; -} - -function toIntegerWithDefault(source: any, defaultValue: number): number { - if (typeof source === 'undefined') { - return defaultValue; - } - return toInteger(source); -} - -export interface IElementSizeObserver { - startObserving(): void; - observe(dimension?: editorCommon.IDimension): void; - dispose(): void; - getWidth(): number; - getHeight(): number; +export interface IEnvConfiguration { + extraEditorClassName: string; + outerWidth: number; + outerHeight: number; + canUseTranslate3d: boolean; + emptySelectionClipboard: boolean; + pixelRatio: number; + zoomLevel: number; + accessibilitySupport: platform.AccessibilitySupport; } export abstract class CommonEditorConfiguration extends Disposable implements editorCommon.IConfiguration { + protected _rawOptions: editorOptions.IEditorOptions; + protected _validatedOptions: editorOptions.IValidatedEditorOptions; public editor: editorOptions.InternalEditorOptions; - public editorClone: editorOptions.InternalEditorOptions; - - protected _configWithDefaults: ConfigurationWithDefaults; - protected _elementSizeObserver: IElementSizeObserver; private _isDominatedByLongLines: boolean; private _lineNumbersDigitCount: number; private _onDidChange = this._register(new Emitter()); public onDidChange: Event = this._onDidChange.event; - constructor(options: editorOptions.IEditorOptions, elementSizeObserver: IElementSizeObserver = null) { + constructor(options: editorOptions.IEditorOptions) { super(); - this._configWithDefaults = new ConfigurationWithDefaults(options); - this._elementSizeObserver = elementSizeObserver; + + this._rawOptions = objects.mixin({}, options || {}); + this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS); + this.editor = null; this._isDominatedByLongLines = false; this._lineNumbersDigitCount = 1; - this.editor = this._computeInternalOptions(); - this.editorClone = this.editor.clone(); + this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions())); this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions())); } @@ -525,52 +91,47 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed } protected _recomputeOptions(): void { - this._setOptions(this._computeInternalOptions()); - } + const oldOptions = this.editor; + const newOptions = this._computeInternalOptions(); - private _setOptions(newOptions: editorOptions.InternalEditorOptions): void { - if (this.editor && this.editor.equals(newOptions)) { + if (oldOptions && oldOptions.equals(newOptions)) { return; } - let changeEvent = this.editor.createChangeEvent(newOptions); this.editor = newOptions; - this.editorClone = this.editor.clone(); - this._onDidChange.fire(changeEvent); + + if (oldOptions) { + this._onDidChange.fire(oldOptions.createChangeEvent(newOptions)); + } } public getRawOptions(): editorOptions.IEditorOptions { - return this._configWithDefaults.getEditorOptions(); + return this._rawOptions; } private _computeInternalOptions(): editorOptions.InternalEditorOptions { - let opts = this._configWithDefaults.getEditorOptions(); - - let editorClassName = this._getEditorClassName(opts.theme, toBoolean(opts.fontLigatures), opts.mouseStyle); - - let disableTranslate3d = toBoolean(opts.disableTranslate3d); - let canUseTranslate3d = this._getCanUseTranslate3d(); - if (disableTranslate3d) { - canUseTranslate3d = false; - } - - let bareFontInfo = BareFontInfo.createFromRawSettings(opts, this.getZoomLevel()); - - return InternalEditorOptionsHelper.createInternalEditorOptions( - this.getOuterWidth(), - this.getOuterHeight(), - opts, - this.readConfiguration(bareFontInfo), - editorClassName, - this._isDominatedByLongLines, - this._lineNumbersDigitCount, - canUseTranslate3d, - this._getPixelRatio() - ); + const opts = this._validatedOptions; + const partialEnv = this._getEnvConfiguration(); + const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel); + const env: editorOptions.IEnvironmentalOptions = { + outerWidth: partialEnv.outerWidth, + outerHeight: partialEnv.outerHeight, + fontInfo: this.readConfiguration(bareFontInfo), + extraEditorClassName: partialEnv.extraEditorClassName, + isDominatedByLongLines: this._isDominatedByLongLines, + lineNumbersDigitCount: this._lineNumbersDigitCount, + canUseTranslate3d: partialEnv.canUseTranslate3d, + emptySelectionClipboard: partialEnv.emptySelectionClipboard, + pixelRatio: partialEnv.pixelRatio, + tabFocusMode: TabFocus.getTabFocusMode(), + accessibilitySupport: partialEnv.accessibilitySupport + }; + return editorOptions.InternalEditorOptionsFactory.createInternalEditorOptions(env, opts); } public updateOptions(newOptions: editorOptions.IEditorOptions): void { - this._configWithDefaults.updateOptions(newOptions); + this._rawOptions = objects.mixin(this._rawOptions, newOptions || {}); + this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS); this._recomputeOptions(); } @@ -580,7 +141,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed } public setMaxLineNumber(maxLineNumber: number): void { - let digitCount = CommonEditorConfiguration.digitCount(maxLineNumber); + let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber); if (this._lineNumbersDigitCount === digitCount) { return; } @@ -588,7 +149,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed this._recomputeOptions(); } - private static digitCount(n: number): number { + private static _digitCount(n: number): number { var r = 0; while (n) { n = Math.floor(n / 10); @@ -596,20 +157,10 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed } return r ? r : 1; } - - protected abstract _getEditorClassName(theme: string, fontLigatures: boolean, mouseDrag: 'text' | 'default' | 'copy'): string; - - protected abstract getOuterWidth(): number; - - protected abstract getOuterHeight(): number; - - protected abstract _getCanUseTranslate3d(): boolean; - - protected abstract _getPixelRatio(): number; + protected abstract _getEnvConfiguration(): IEnvConfiguration; protected abstract readConfiguration(styling: BareFontInfo): FontInfo; - protected abstract getZoomLevel(): number; } const configurationRegistry = Registry.as(Extensions.Configuration); @@ -622,29 +173,34 @@ const editorConfiguration: IConfigurationNode = { 'properties': { 'editor.fontFamily': { 'type': 'string', - 'default': DefaultConfig.editor.fontFamily, + 'default': EDITOR_FONT_DEFAULTS.fontFamily, 'description': nls.localize('fontFamily', "Controls the font family.") }, 'editor.fontWeight': { 'type': 'string', 'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'], - 'default': DefaultConfig.editor.fontWeight, + 'default': EDITOR_FONT_DEFAULTS.fontWeight, 'description': nls.localize('fontWeight', "Controls the font weight.") }, 'editor.fontSize': { 'type': 'number', - 'default': DefaultConfig.editor.fontSize, + 'default': EDITOR_FONT_DEFAULTS.fontSize, 'description': nls.localize('fontSize', "Controls the font size in pixels.") }, 'editor.lineHeight': { 'type': 'number', - 'default': DefaultConfig.editor.lineHeight, + 'default': EDITOR_FONT_DEFAULTS.lineHeight, 'description': nls.localize('lineHeight', "Controls the line height. Use 0 to compute the lineHeight from the fontSize.") }, + 'editor.letterSpacing': { + 'type': 'number', + 'default': EDITOR_FONT_DEFAULTS.letterSpacing, + 'description': nls.localize('letterSpacing', "Controls the letter spacing in pixels.") + }, 'editor.lineNumbers': { 'type': 'string', 'enum': ['off', 'on', 'relative'], - 'default': DefaultConfig.editor.lineNumbers, + 'default': 'on', 'description': nls.localize('lineNumbers', "Controls the display of line numbers. Possible values are 'on', 'off', and 'relative'. 'relative' shows the line count from the current cursor position.") }, 'editor.rulers': { @@ -652,57 +208,67 @@ const editorConfiguration: IConfigurationNode = { 'items': { 'type': 'number' }, - 'default': DefaultConfig.editor.rulers, + 'default': EDITOR_DEFAULTS.viewInfo.rulers, 'description': nls.localize('rulers', "Columns at which to show vertical rulers") }, 'editor.wordSeparators': { 'type': 'string', - 'default': DefaultConfig.editor.wordSeparators, + 'default': EDITOR_DEFAULTS.wordSeparators, 'description': nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations") }, 'editor.tabSize': { 'type': 'number', - 'default': DEFAULT_INDENTATION.tabSize, + 'default': EDITOR_MODEL_DEFAULTS.tabSize, 'minimum': 1, 'description': nls.localize('tabSize', "The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on."), 'errorMessage': nls.localize('tabSize.errorMessage', "Expected 'number'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.") }, 'editor.insertSpaces': { 'type': 'boolean', - 'default': DEFAULT_INDENTATION.insertSpaces, + 'default': EDITOR_MODEL_DEFAULTS.insertSpaces, 'description': nls.localize('insertSpaces', "Insert spaces when pressing Tab. This setting is overriden based on the file contents when `editor.detectIndentation` is on."), 'errorMessage': nls.localize('insertSpaces.errorMessage', "Expected 'boolean'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.") }, 'editor.detectIndentation': { 'type': 'boolean', - 'default': DEFAULT_INDENTATION.detectIndentation, + 'default': EDITOR_MODEL_DEFAULTS.detectIndentation, 'description': nls.localize('detectIndentation', "When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.") }, 'editor.roundedSelection': { 'type': 'boolean', - 'default': DefaultConfig.editor.roundedSelection, + 'default': EDITOR_DEFAULTS.viewInfo.roundedSelection, 'description': nls.localize('roundedSelection', "Controls if selections have rounded corners") }, 'editor.scrollBeyondLastLine': { 'type': 'boolean', - 'default': DefaultConfig.editor.scrollBeyondLastLine, + 'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine, 'description': nls.localize('scrollBeyondLastLine', "Controls if the editor will scroll beyond the last line") }, 'editor.minimap.enabled': { 'type': 'boolean', - 'default': DefaultConfig.editor.minimap.enabled, + 'default': EDITOR_DEFAULTS.viewInfo.minimap.enabled, 'description': nls.localize('minimap.enabled', "Controls if the minimap is shown") }, 'editor.minimap.renderCharacters': { 'type': 'boolean', - 'default': DefaultConfig.editor.minimap.renderCharacters, + 'default': EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters, 'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line (as opposed to color blocks)") }, 'editor.minimap.maxColumn': { 'type': 'number', - 'default': DefaultConfig.editor.minimap.maxColumn, + 'default': EDITOR_DEFAULTS.viewInfo.minimap.maxColumn, 'description': nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns") }, + 'editor.find.seedSearchStringFromSelection': { + 'type': 'boolean', + 'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection, + 'description': nls.localize('find.seedSearchStringFromSelection', "Controls if we seed the search string in Find Widget from editor selection") + }, + 'editor.find.autoFindInSelection': { + 'type': 'boolean', + 'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection, + 'description': nls.localize('find.autoFindInSelection', "Controls if Find in Selection flag is turned on when multiple characters or lines of text are selected in the editor") + }, 'editor.wordWrap': { 'type': 'string', 'enum': ['off', 'on', 'wordWrapColumn', 'bounded'], @@ -723,7 +289,7 @@ const editorConfiguration: IConfigurationNode = { ] }, "Lines will wrap at the minimum of viewport and `editor.wordWrapColumn`."), ], - 'default': DefaultConfig.editor.wordWrap, + 'default': EDITOR_DEFAULTS.wordWrap, 'description': nls.localize({ key: 'wordWrap', comment: [ @@ -734,7 +300,7 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.wordWrapColumn': { 'type': 'integer', - 'default': DefaultConfig.editor.wordWrapColumn, + 'default': EDITOR_DEFAULTS.wordWrapColumn, 'minimum': 1, 'description': nls.localize({ key: 'wordWrapColumn', @@ -747,14 +313,20 @@ const editorConfiguration: IConfigurationNode = { 'editor.wrappingIndent': { 'type': 'string', 'enum': ['none', 'same', 'indent'], - 'default': DefaultConfig.editor.wrappingIndent, + 'default': 'same', 'description': nls.localize('wrappingIndent', "Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.") }, 'editor.mouseWheelScrollSensitivity': { 'type': 'number', - 'default': DefaultConfig.editor.mouseWheelScrollSensitivity, + 'default': EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity, 'description': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events") }, + 'editor.multicursorModifier': { + 'type': 'string', + 'enum': (platform.isMacintosh ? ['cmd', 'alt'] : ['ctrl', 'alt']), + 'default': 'alt', + 'description': nls.localize('multicursorModifier', "The modifier to be used to add multiple cursors with the mouse.") + }, 'editor.quickSuggestions': { 'anyOf': [ { @@ -781,64 +353,65 @@ const editorConfiguration: IConfigurationNode = { } } ], - 'default': DefaultConfig.editor.quickSuggestions, + 'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions, 'description': nls.localize('quickSuggestions', "Controls if suggestions should automatically show up while typing") }, 'editor.quickSuggestionsDelay': { 'type': 'integer', - 'default': DefaultConfig.editor.quickSuggestionsDelay, + 'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay, 'minimum': 0, 'description': nls.localize('quickSuggestionsDelay', "Controls the delay in ms after which quick suggestions will show up") }, 'editor.parameterHints': { 'type': 'boolean', - 'default': DefaultConfig.editor.parameterHints, + 'default': EDITOR_DEFAULTS.contribInfo.parameterHints, 'description': nls.localize('parameterHints', "Enables parameter hints") }, 'editor.autoClosingBrackets': { 'type': 'boolean', - 'default': DefaultConfig.editor.autoClosingBrackets, + 'default': EDITOR_DEFAULTS.autoClosingBrackets, 'description': nls.localize('autoClosingBrackets', "Controls if the editor should automatically close brackets after opening them") }, 'editor.formatOnType': { 'type': 'boolean', - 'default': DefaultConfig.editor.formatOnType, + 'default': EDITOR_DEFAULTS.contribInfo.formatOnType, 'description': nls.localize('formatOnType', "Controls if the editor should automatically format the line after typing") }, 'editor.formatOnPaste': { 'type': 'boolean', - 'default': DefaultConfig.editor.formatOnPaste, + 'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste, 'description': nls.localize('formatOnPaste', "Controls if the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.") }, 'editor.suggestOnTriggerCharacters': { 'type': 'boolean', - 'default': DefaultConfig.editor.suggestOnTriggerCharacters, + 'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters, 'description': nls.localize('suggestOnTriggerCharacters', "Controls if suggestions should automatically show up when typing trigger characters") }, 'editor.acceptSuggestionOnEnter': { - 'type': 'boolean', - 'default': DefaultConfig.editor.acceptSuggestionOnEnter, - 'description': nls.localize('acceptSuggestionOnEnter', "Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.") + 'type': 'string', + 'enum': ['on', 'smart', 'off'], + 'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter, + 'description': nls.localize('acceptSuggestionOnEnter', "Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change") }, 'editor.acceptSuggestionOnCommitCharacter': { 'type': 'boolean', - 'default': DefaultConfig.editor.acceptSuggestionOnCommitCharacter, + 'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter, 'description': nls.localize('acceptSuggestionOnCommitCharacter', "Controls if suggestions should be accepted on commit characters. For instance in JavaScript the semi-colon (';') can be a commit character that accepts a suggestion and types that character.") }, 'editor.snippetSuggestions': { 'type': 'string', 'enum': ['top', 'bottom', 'inline', 'none'], - 'default': DefaultConfig.editor.snippetSuggestions, + 'default': EDITOR_DEFAULTS.contribInfo.snippetSuggestions, 'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.") }, 'editor.emptySelectionClipboard': { 'type': 'boolean', - 'default': DefaultConfig.editor.emptySelectionClipboard, + 'default': EDITOR_DEFAULTS.emptySelectionClipboard, 'description': nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.") }, 'editor.wordBasedSuggestions': { 'type': 'boolean', - 'default': DefaultConfig.editor.wordBasedSuggestions, + 'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions, 'description': nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.") }, 'editor.suggestFontSize': { @@ -855,12 +428,12 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.selectionHighlight': { 'type': 'boolean', - 'default': DefaultConfig.editor.selectionHighlight, + 'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight, 'description': nls.localize('selectionHighlight', "Controls whether the editor should highlight similar matches to the selection") }, 'editor.occurrencesHighlight': { 'type': 'boolean', - 'default': DefaultConfig.editor.occurrencesHighlight, + 'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight, 'description': nls.localize('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences") }, 'editor.overviewRulerLanes': { @@ -870,86 +443,92 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.overviewRulerBorder': { 'type': 'boolean', - 'default': DefaultConfig.editor.overviewRulerBorder, + 'default': EDITOR_DEFAULTS.viewInfo.overviewRulerBorder, 'description': nls.localize('overviewRulerBorder', "Controls if a border should be drawn around the overview ruler.") }, 'editor.cursorBlinking': { 'type': 'string', 'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'], - 'default': DefaultConfig.editor.cursorBlinking, + 'default': editorOptions.blinkingStyleToString(EDITOR_DEFAULTS.viewInfo.cursorBlinking), 'description': nls.localize('cursorBlinking', "Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'") }, 'editor.mouseWheelZoom': { 'type': 'boolean', - 'default': DefaultConfig.editor.mouseWheelZoom, + 'default': EDITOR_DEFAULTS.viewInfo.mouseWheelZoom, 'description': nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding Ctrl") }, 'editor.cursorStyle': { 'type': 'string', 'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'], - 'default': DefaultConfig.editor.cursorStyle, + 'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle), 'description': nls.localize('cursorStyle', "Controls the cursor style, accepted values are 'block', 'block-outline', 'line', 'line-thin', 'underline' and 'underline-thin'") }, 'editor.fontLigatures': { 'type': 'boolean', - 'default': DefaultConfig.editor.fontLigatures, + 'default': EDITOR_DEFAULTS.viewInfo.fontLigatures, 'description': nls.localize('fontLigatures', "Enables font ligatures") }, 'editor.hideCursorInOverviewRuler': { 'type': 'boolean', - 'default': DefaultConfig.editor.hideCursorInOverviewRuler, + 'default': EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler, 'description': nls.localize('hideCursorInOverviewRuler', "Controls if the cursor should be hidden in the overview ruler.") }, 'editor.renderWhitespace': { 'type': 'string', 'enum': ['none', 'boundary', 'all'], - default: DefaultConfig.editor.renderWhitespace, + default: EDITOR_DEFAULTS.viewInfo.renderWhitespace, description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters, possibilities are 'none', 'boundary', and 'all'. The 'boundary' option does not render single spaces between words.") }, 'editor.renderControlCharacters': { 'type': 'boolean', - default: DefaultConfig.editor.renderControlCharacters, + default: EDITOR_DEFAULTS.viewInfo.renderControlCharacters, description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters") }, 'editor.renderIndentGuides': { 'type': 'boolean', - default: DefaultConfig.editor.renderIndentGuides, + default: EDITOR_DEFAULTS.viewInfo.renderIndentGuides, description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides") }, 'editor.renderLineHighlight': { 'type': 'string', 'enum': ['none', 'gutter', 'line', 'all'], - default: DefaultConfig.editor.renderLineHighlight, + default: EDITOR_DEFAULTS.viewInfo.renderLineHighlight, description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight, possibilities are 'none', 'gutter', 'line', and 'all'.") }, 'editor.codeLens': { 'type': 'boolean', - 'default': DefaultConfig.editor.codeLens, + 'default': EDITOR_DEFAULTS.contribInfo.codeLens, 'description': nls.localize('codeLens', "Controls if the editor shows code lenses") }, 'editor.folding': { 'type': 'boolean', - 'default': DefaultConfig.editor.folding, + 'default': EDITOR_DEFAULTS.contribInfo.folding, 'description': nls.localize('folding', "Controls whether the editor has code folding enabled") }, + 'editor.showFoldingControls': { + 'type': 'string', + 'enum': ['always', 'mouseover'], + 'default': EDITOR_DEFAULTS.contribInfo.showFoldingControls, + 'description': nls.localize('showFoldingControls', "Controls whether the fold controls on the gutter are automatically hidden.") + }, 'editor.matchBrackets': { 'type': 'boolean', - 'default': DefaultConfig.editor.matchBrackets, + 'default': EDITOR_DEFAULTS.contribInfo.matchBrackets, 'description': nls.localize('matchBrackets', "Highlight matching brackets when one of them is selected.") }, 'editor.glyphMargin': { 'type': 'boolean', - 'default': DefaultConfig.editor.glyphMargin, + 'default': EDITOR_DEFAULTS.viewInfo.glyphMargin, 'description': nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.") }, 'editor.useTabStops': { 'type': 'boolean', - 'default': DefaultConfig.editor.useTabStops, + 'default': EDITOR_DEFAULTS.useTabStops, 'description': nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops") }, 'editor.trimAutoWhitespace': { 'type': 'boolean', - 'default': DEFAULT_TRIM_AUTO_WHITESPACE, + 'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, 'description': nls.localize('trimAutoWhitespace', "Remove trailing auto inserted whitespace") }, 'editor.stablePeek': { @@ -959,7 +538,7 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.dragAndDrop': { 'type': 'boolean', - 'default': DefaultConfig.editor.dragAndDrop, + 'default': EDITOR_DEFAULTS.dragAndDrop, 'description': nls.localize('dragAndDrop', "Controls if the editor should allow to move selections via drag and drop.") }, 'diffEditor.renderSideBySide': { @@ -983,7 +562,7 @@ const editorConfiguration: IConfigurationNode = { if (platform.isLinux) { editorConfiguration['properties']['editor.selectionClipboard'] = { 'type': 'boolean', - 'default': DefaultConfig.editor.selectionClipboard, + 'default': EDITOR_DEFAULTS.contribInfo.selectionClipboard, 'description': nls.localize('selectionClipboard', "Controls if the Linux primary clipboard should be supported.") }; } diff --git a/src/vs/editor/common/config/config.ts b/src/vs/editor/common/config/config.ts deleted file mode 100644 index 543f74bf91a..00000000000 --- a/src/vs/editor/common/config/config.ts +++ /dev/null @@ -1,172 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { IEditorService } from 'vs/platform/editor/common/editor'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ICommandAndKeybindingRule, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { ICodeEditorService, getCodeEditor } from 'vs/editor/common/services/codeEditorService'; -import { CommandsRegistry, ICommandHandler, ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; -import H = editorCommon.Handler; - -export interface ICommandKeybindingsOptions extends IKeybindings { - kbExpr?: ContextKeyExpr; - weight?: number; -} - -export interface ICommandOptions { - id: string; - precondition: ContextKeyExpr; - kbOpts?: ICommandKeybindingsOptions; - description?: ICommandHandlerDescription; -} - -export abstract class Command { - public id: string; - public precondition: ContextKeyExpr; - private kbOpts: ICommandKeybindingsOptions; - private description: ICommandHandlerDescription; - - constructor(opts: ICommandOptions) { - this.id = opts.id; - this.precondition = opts.precondition; - this.kbOpts = opts.kbOpts; - this.description = opts.description; - } - - public abstract runCommand(accessor: ServicesAccessor, args: any): void | TPromise; - - public toCommandAndKeybindingRule(defaultWeight: number): ICommandAndKeybindingRule { - const kbOpts = this.kbOpts || { primary: 0 }; - - let kbWhen = kbOpts.kbExpr; - if (this.precondition) { - if (kbWhen) { - kbWhen = ContextKeyExpr.and(kbWhen, this.precondition); - } else { - kbWhen = this.precondition; - } - } - - const weight = (typeof kbOpts.weight === 'number' ? kbOpts.weight : defaultWeight); - - return { - id: this.id, - handler: (accessor, args) => this.runCommand(accessor, args), - weight: weight, - when: kbWhen, - primary: kbOpts.primary, - secondary: kbOpts.secondary, - win: kbOpts.win, - linux: kbOpts.linux, - mac: kbOpts.mac, - description: this.description - }; - } -} - -export interface EditorControllerCommand { - new (opts: IContributionCommandOptions): EditorCommand; -} - -export interface IContributionCommandOptions extends ICommandOptions { - handler: (controller: T) => void; -} - -export abstract class EditorCommand extends Command { - - public static bindToContribution(controllerGetter: (editor: editorCommon.ICommonCodeEditor) => T): EditorControllerCommand { - - return class EditorControllerCommandImpl extends EditorCommand { - private _callback: (controller: T) => void; - - constructor(opts: IContributionCommandOptions) { - super(opts); - - this._callback = opts.handler; - } - - public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { - let controller = controllerGetter(editor); - if (controller) { - this._callback(controllerGetter(editor)); - } - } - }; - } - - constructor(opts: ICommandOptions) { - super(opts); - } - - public runCommand(accessor: ServicesAccessor, args: any): void | TPromise { - let editor = findFocusedEditor(accessor); - if (!editor) { - editor = getActiveEditorWidget(accessor); - } - if (!editor) { - // well, at least we tried... - return; - } - return editor.invokeWithinContext((editorAccessor) => { - const kbService = editorAccessor.get(IContextKeyService); - if (!kbService.contextMatchesRules(this.precondition)) { - // precondition does not hold - return; - } - - return this.runEditorCommand(editorAccessor, editor, args); - }); - } - - public abstract runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void | TPromise; -} - -function findFocusedEditor(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { - return accessor.get(ICodeEditorService).getFocusedCodeEditor(); -} - -function withCodeEditorFromCommandHandler(accessor: ServicesAccessor, callback: (editor: editorCommon.ICommonCodeEditor) => void): void { - let editor = findFocusedEditor(accessor); - if (editor) { - callback(editor); - } -} - -function getActiveEditorWidget(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { - const editorService = accessor.get(IEditorService); - let activeEditor = (editorService).getActiveEditor && (editorService).getActiveEditor(); - return getCodeEditor(activeEditor); -} - -function triggerEditorHandler(handlerId: string, accessor: ServicesAccessor, args: any): void { - withCodeEditorFromCommandHandler(accessor, (editor) => { - editor.trigger('keyboard', handlerId, args); - }); -} - -class CoreCommand extends Command { - public runCommand(accessor: ServicesAccessor, args: any): void { - triggerEditorHandler(this.id, accessor, args); - } -} - -function registerOverwritableCommand(handlerId: string, handler: ICommandHandler): void { - CommandsRegistry.registerCommand(handlerId, handler); - CommandsRegistry.registerCommand('default:' + handlerId, handler); -} - -function registerCoreDispatchCommand(handlerId: string): void { - registerOverwritableCommand(handlerId, triggerEditorHandler.bind(null, handlerId)); -} -registerCoreDispatchCommand(H.Type); -registerCoreDispatchCommand(H.ReplacePreviousChar); -registerCoreDispatchCommand(H.CompositionStart); -registerCoreDispatchCommand(H.CompositionEnd); -registerCoreDispatchCommand(H.Paste); -registerCoreDispatchCommand(H.Cut); diff --git a/src/vs/editor/common/config/defaultConfig.ts b/src/vs/editor/common/config/defaultConfig.ts deleted file mode 100644 index 7bd8bc3ea12..00000000000 --- a/src/vs/editor/common/config/defaultConfig.ts +++ /dev/null @@ -1,129 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 nls from 'vs/nls'; -import * as platform from 'vs/base/common/platform'; -import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; - -export interface IConfiguration { - editor: IEditorOptions; -} - -export const DEFAULT_INDENTATION = { - tabSize: 4, - insertSpaces: true, - detectIndentation: true -}; -export const DEFAULT_TRIM_AUTO_WHITESPACE = true; - -const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace'; -const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace'; -const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'Courier New\', monospace, \'Droid Sans Fallback\''; - -/** - * Determined from empirical observations. - */ -export const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35; - -class ConfigClass implements IConfiguration { - - public editor: IEditorOptions; - - constructor() { - this.editor = { - experimentalScreenReader: true, - rulers: [], - wordSeparators: USUAL_WORD_SEPARATORS, - selectionClipboard: true, - ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"), - lineNumbers: 'on', - selectOnLineNumbers: true, - lineNumbersMinChars: 5, - glyphMargin: true, - lineDecorationsWidth: 10, - revealHorizontalRightPadding: 30, - roundedSelection: true, - theme: 'vs', - readOnly: false, - scrollbar: { - verticalScrollbarSize: 14, - horizontal: 'auto', - useShadows: true, - verticalHasArrows: false, - horizontalHasArrows: false - }, - minimap: { - enabled: false, - renderCharacters: true, - maxColumn: 120 - }, - fixedOverflowWidgets: false, - overviewRulerLanes: 2, - overviewRulerBorder: true, - cursorBlinking: 'blink', - mouseWheelZoom: false, - cursorStyle: 'line', - mouseStyle: 'text', - fontLigatures: false, - disableTranslate3d: false, - disableMonospaceOptimizations: false, - hideCursorInOverviewRuler: false, - scrollBeyondLastLine: true, - automaticLayout: false, - wordWrap: 'off', - wordWrapColumn: 80, - wordWrapMinified: true, - wrappingIndent: 'same', - wordWrapBreakBeforeCharacters: '([{‘“〈《「『ã€ã€”([{「£¥$£¥++', - wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃ã€ã€‚。、¢,.:;?ï¼ï¼…・・ã‚ゞヽヾーァィゥェォッャュョヮヵヶããƒã…ã‡ã‰ã£ã‚ƒã‚…ょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’â€ã€‰ã€‹ã€ã€ã€‘〕)]ï½ï½£', - wordWrapBreakObtrusiveCharacters: '.', - - // Features - hover: true, - contextmenu: true, - mouseWheelScrollSensitivity: 1, - quickSuggestions: { other: true, comments: false, strings: false }, - quickSuggestionsDelay: 10, - parameterHints: true, - iconsInSuggestions: true, - autoClosingBrackets: true, - formatOnType: false, - formatOnPaste: false, - suggestOnTriggerCharacters: true, - acceptSuggestionOnEnter: true, - acceptSuggestionOnCommitCharacter: true, - snippetSuggestions: 'bottom', - emptySelectionClipboard: true, - wordBasedSuggestions: true, - suggestFontSize: 0, - suggestLineHeight: 0, - selectionHighlight: true, - occurrencesHighlight: true, - codeLens: true, - referenceInfos: true, - folding: true, - renderWhitespace: 'none', - renderControlCharacters: false, - renderIndentGuides: false, - renderLineHighlight: 'line', - useTabStops: true, - matchBrackets: true, - dragAndDrop: false, - - fontFamily: ( - platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY) - ), - fontWeight: 'normal', - fontSize: ( - platform.isMacintosh ? 12 : 14 - ), - lineHeight: 0 - }; - } -} - -export const DefaultConfig: IConfiguration = new ConfigClass(); diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index e8bee72579b..c6997e43114 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -4,9 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import * as nls from 'vs/nls'; +import * as platform from 'vs/base/common/platform'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import * as objects from 'vs/base/common/objects'; +import { Constants } from 'vs/editor/common/core/uint'; +import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper'; /** * Configuration options for editor scrollbars @@ -71,6 +74,20 @@ export interface IEditorScrollbarOptions { horizontalSliderSize?: number; } +/** + * Configuration options for editor find widget + */ +export interface IEditorFindOptions { + /** + * Controls if we seed search string in the Find Widget with editor selection. + */ + seedSearchStringFromSelection?: boolean; + /** + * Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor. + */ + autoFindInSelection: boolean; +} + /** * Configuration options for editor minimap */ @@ -92,8 +109,6 @@ export interface IEditorMinimapOptions { maxColumn?: number; } -export type LineNumbersOption = 'on' | 'off' | 'relative' | ((lineNumber: number) => string); - /** * Configuration options for the editor. */ @@ -103,11 +118,6 @@ export interface IEditorOptions { * @internal */ inDiffEditor?: boolean; - /** - * Enable experimental screen reader support. - * Defaults to `true`. - */ - experimentalScreenReader?: boolean; /** * The aria label for the editor's textarea (when it is focused). */ @@ -134,7 +144,7 @@ export interface IEditorOptions { * Otherwise, line numbers will not be rendered. * Defaults to true. */ - lineNumbers?: LineNumbersOption; + lineNumbers?: 'on' | 'off' | 'relative' | ((lineNumber: number) => string); /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -169,11 +179,9 @@ export interface IEditorOptions { */ roundedSelection?: boolean; /** - * Theme to be used for rendering. - * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. - * You can create custom themes via `monaco.editor.defineTheme`. + * Class name to be added to the editor. */ - theme?: string; + extraEditorClassName?: string; /** * Should the editor be read only. * Defaults to false. @@ -187,6 +195,10 @@ export interface IEditorOptions { * Control the behavior and rendering of the minimap. */ minimap?: IEditorMinimapOptions; + /** + * Control the behavior of the find widget. + */ + find?: IEditorFindOptions; /** * Display overflow widgets as `fixed`. * Defaults to `false`. @@ -319,6 +331,11 @@ export interface IEditorOptions { * Defaults to 1. */ mouseWheelScrollSensitivity?: number; + /** + * The modifier to be used to add multiple cursors with the mouse. + * Defaults to 'alt' + */ + multicursorModifier?: 'cmd' | 'ctrl' | 'alt'; /** * Enable quick suggestions (shadow suggestions) * Defaults to true. @@ -365,9 +382,9 @@ export interface IEditorOptions { suggestOnTriggerCharacters?: boolean; /** * Accept suggestions on ENTER. - * Defaults to true. + * Defaults to 'on'. */ - acceptSuggestionOnEnter?: boolean; + acceptSuggestionOnEnter?: 'on' | 'smart' | 'off'; /** * Accept suggestions on provider defined characters. * Defaults to true. @@ -420,6 +437,11 @@ export interface IEditorOptions { * Defaults to true in vscode and to false in monaco-editor. */ folding?: boolean; + /** + * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. + * Defaults to 'mouseover'. + */ + showFoldingControls?: 'always' | 'mouseover'; /** * Enable highlighting of matching brackets. * Defaults to true. @@ -465,6 +487,10 @@ export interface IEditorOptions { * The line height */ lineHeight?: number; + /** + * The letter spacing + */ + letterSpacing?: number; } /** @@ -553,6 +579,24 @@ export enum TextEditorCursorBlinkingStyle { */ Solid = 5 } +/** + * @internal + */ +export function blinkingStyleToString(blinkingStyle: TextEditorCursorBlinkingStyle): string { + if (blinkingStyle === TextEditorCursorBlinkingStyle.Blink) { + return 'blink'; + } else if (blinkingStyle === TextEditorCursorBlinkingStyle.Expand) { + return 'expand'; + } else if (blinkingStyle === TextEditorCursorBlinkingStyle.Phase) { + return 'phase'; + } else if (blinkingStyle === TextEditorCursorBlinkingStyle.Smooth) { + return 'smooth'; + } else if (blinkingStyle === TextEditorCursorBlinkingStyle.Solid) { + return 'solid'; + } else { + throw new Error('blinkingStyleToString: Unknown blinkingStyle'); + } +} /** * The style in which the editor's cursor should be rendered. @@ -605,9 +649,27 @@ export function cursorStyleToString(cursorStyle: TextEditorCursorStyle): string } } -export class InternalEditorScrollbarOptions { - readonly _internalEditorScrollbarOptionsBrand: void; +function _cursorStyleFromString(cursorStyle: string, defaultValue: TextEditorCursorStyle): TextEditorCursorStyle { + if (typeof cursorStyle !== 'string') { + return defaultValue; + } + if (cursorStyle === 'line') { + return TextEditorCursorStyle.Line; + } else if (cursorStyle === 'block') { + return TextEditorCursorStyle.Block; + } else if (cursorStyle === 'underline') { + return TextEditorCursorStyle.Underline; + } else if (cursorStyle === 'line-thin') { + return TextEditorCursorStyle.LineThin; + } else if (cursorStyle === 'block-outline') { + return TextEditorCursorStyle.BlockOutline; + } else if (cursorStyle === 'underline-thin') { + return TextEditorCursorStyle.UnderlineThin; + } + return TextEditorCursorStyle.Line; +} +export interface InternalEditorScrollbarOptions { readonly arrowSize: number; readonly vertical: ScrollbarVisibility; readonly horizontal: ScrollbarVisibility; @@ -620,108 +682,20 @@ export class InternalEditorScrollbarOptions { readonly verticalScrollbarSize: number; readonly verticalSliderSize: number; readonly mouseWheelScrollSensitivity: number; - - /** - * @internal - */ - constructor(source: { - arrowSize: number; - vertical: ScrollbarVisibility; - horizontal: ScrollbarVisibility; - useShadows: boolean; - verticalHasArrows: boolean; - horizontalHasArrows: boolean; - handleMouseWheel: boolean; - horizontalScrollbarSize: number; - horizontalSliderSize: number; - verticalScrollbarSize: number; - verticalSliderSize: number; - mouseWheelScrollSensitivity: number; - }) { - this.arrowSize = source.arrowSize | 0; - this.vertical = source.vertical | 0; - this.horizontal = source.horizontal | 0; - this.useShadows = Boolean(source.useShadows); - this.verticalHasArrows = Boolean(source.verticalHasArrows); - this.horizontalHasArrows = Boolean(source.horizontalHasArrows); - this.handleMouseWheel = Boolean(source.handleMouseWheel); - this.horizontalScrollbarSize = source.horizontalScrollbarSize | 0; - this.horizontalSliderSize = source.horizontalSliderSize | 0; - this.verticalScrollbarSize = source.verticalScrollbarSize | 0; - this.verticalSliderSize = source.verticalSliderSize | 0; - this.mouseWheelScrollSensitivity = Number(source.mouseWheelScrollSensitivity); - } - - /** - * @internal - */ - public equals(other: InternalEditorScrollbarOptions): boolean { - return ( - this.arrowSize === other.arrowSize - && this.vertical === other.vertical - && this.horizontal === other.horizontal - && this.useShadows === other.useShadows - && this.verticalHasArrows === other.verticalHasArrows - && this.horizontalHasArrows === other.horizontalHasArrows - && this.handleMouseWheel === other.handleMouseWheel - && this.horizontalScrollbarSize === other.horizontalScrollbarSize - && this.horizontalSliderSize === other.horizontalSliderSize - && this.verticalScrollbarSize === other.verticalScrollbarSize - && this.verticalSliderSize === other.verticalSliderSize - && this.mouseWheelScrollSensitivity === other.mouseWheelScrollSensitivity - ); - } - - /** - * @internal - */ - public clone(): InternalEditorScrollbarOptions { - return new InternalEditorScrollbarOptions(this); - } } -export class InternalEditorMinimapOptions { - readonly _internalEditorMinimapOptionsBrand: void; - +export interface InternalEditorMinimapOptions { readonly enabled: boolean; readonly renderCharacters: boolean; readonly maxColumn: number; - - /** - * @internal - */ - constructor(source: { - enabled: boolean; - renderCharacters: boolean; - maxColumn: number; - }) { - this.enabled = Boolean(source.enabled); - this.renderCharacters = Boolean(source.renderCharacters); - this.maxColumn = source.maxColumn | 0; - } - - /** - * @internal - */ - public equals(other: InternalEditorMinimapOptions): boolean { - return ( - this.enabled === other.enabled - && this.renderCharacters === other.renderCharacters - && this.maxColumn === other.maxColumn - ); - } - - /** - * @internal - */ - public clone(): InternalEditorMinimapOptions { - return new InternalEditorMinimapOptions(this); - } } -export class EditorWrappingInfo { - readonly _editorWrappingInfoBrand: void; +export interface InternalEditorFindOptions { + readonly seedSearchStringFromSelection: boolean; + readonly autoFindInSelection: boolean; +} +export interface EditorWrappingInfo { readonly inDiffEditor: boolean; readonly isDominatedByLongLines: boolean; readonly isWordWrapMinified: boolean; @@ -731,64 +705,11 @@ export class EditorWrappingInfo { readonly wordWrapBreakBeforeCharacters: string; readonly wordWrapBreakAfterCharacters: string; readonly wordWrapBreakObtrusiveCharacters: string; - - /** - * @internal - */ - constructor(source: { - inDiffEditor: boolean; - isDominatedByLongLines: boolean; - isWordWrapMinified: boolean; - isViewportWrapping: boolean; - wrappingColumn: number; - wrappingIndent: WrappingIndent; - wordWrapBreakBeforeCharacters: string; - wordWrapBreakAfterCharacters: string; - wordWrapBreakObtrusiveCharacters: string; - }) { - this.inDiffEditor = Boolean(source.inDiffEditor); - this.isDominatedByLongLines = Boolean(source.isDominatedByLongLines); - this.isWordWrapMinified = Boolean(source.isWordWrapMinified); - this.isViewportWrapping = Boolean(source.isViewportWrapping); - this.wrappingColumn = source.wrappingColumn | 0; - this.wrappingIndent = source.wrappingIndent | 0; - this.wordWrapBreakBeforeCharacters = String(source.wordWrapBreakBeforeCharacters); - this.wordWrapBreakAfterCharacters = String(source.wordWrapBreakAfterCharacters); - this.wordWrapBreakObtrusiveCharacters = String(source.wordWrapBreakObtrusiveCharacters); - } - - /** - * @internal - */ - public equals(other: EditorWrappingInfo): boolean { - return ( - this.inDiffEditor === other.inDiffEditor - && this.isDominatedByLongLines === other.isDominatedByLongLines - && this.isWordWrapMinified === other.isWordWrapMinified - && this.isViewportWrapping === other.isViewportWrapping - && this.wrappingColumn === other.wrappingColumn - && this.wrappingIndent === other.wrappingIndent - && this.wordWrapBreakBeforeCharacters === other.wordWrapBreakBeforeCharacters - && this.wordWrapBreakAfterCharacters === other.wordWrapBreakAfterCharacters - && this.wordWrapBreakObtrusiveCharacters === other.wordWrapBreakObtrusiveCharacters - ); - } - - /** - * @internal - */ - public clone(): EditorWrappingInfo { - return new EditorWrappingInfo(this); - } } -export class InternalEditorViewOptions { - readonly _internalEditorViewOptionsBrand: void; - - readonly theme: string; - readonly canUseTranslate3d: boolean; +export interface InternalEditorViewOptions { + readonly extraEditorClassName: string; readonly disableMonospaceOptimizations: boolean; - readonly experimentalScreenReader: boolean; readonly rulers: number[]; readonly ariaLabel: string; readonly renderLineNumbers: boolean; @@ -805,7 +726,6 @@ export class InternalEditorViewOptions { readonly cursorStyle: TextEditorCursorStyle; readonly hideCursorInOverviewRuler: boolean; readonly scrollBeyondLastLine: boolean; - readonly editorClassName: string; readonly stopRenderingLineAfter: number; readonly renderWhitespace: 'none' | 'boundary' | 'all'; readonly renderControlCharacters: boolean; @@ -815,91 +735,299 @@ export class InternalEditorViewOptions { readonly scrollbar: InternalEditorScrollbarOptions; readonly minimap: InternalEditorMinimapOptions; readonly fixedOverflowWidgets: boolean; +} + +export interface EditorContribOptions { + readonly selectionClipboard: boolean; + readonly hover: boolean; + readonly contextmenu: boolean; + readonly quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean }; + readonly quickSuggestionsDelay: number; + readonly parameterHints: boolean; + readonly iconsInSuggestions: boolean; + readonly formatOnType: boolean; + readonly formatOnPaste: boolean; + readonly suggestOnTriggerCharacters: boolean; + readonly acceptSuggestionOnEnter: 'on' | 'smart' | 'off'; + readonly acceptSuggestionOnCommitCharacter: boolean; + readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none'; + readonly wordBasedSuggestions: boolean; + readonly suggestFontSize: number; + readonly suggestLineHeight: number; + readonly selectionHighlight: boolean; + readonly occurrencesHighlight: boolean; + readonly codeLens: boolean; + readonly folding: boolean; + readonly showFoldingControls: 'always' | 'mouseover'; + readonly matchBrackets: boolean; + readonly find: InternalEditorFindOptions; +} + +/** + * Validated configuration options for the editor. + * This is a 1 to 1 validated/parsed version of IEditorOptions merged on top of the defaults. + * @internal + */ +export interface IValidatedEditorOptions { + readonly inDiffEditor: boolean; + readonly wordSeparators: string; + readonly lineNumbersMinChars: number; + readonly lineDecorationsWidth: number | string; + readonly readOnly: boolean; + readonly mouseStyle: 'text' | 'default' | 'copy'; + readonly disableTranslate3d: boolean; + readonly automaticLayout: boolean; + readonly wordWrap: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; + readonly wordWrapColumn: number; + readonly wordWrapMinified: boolean; + readonly wrappingIndent: WrappingIndent; + readonly wordWrapBreakBeforeCharacters: string; + readonly wordWrapBreakAfterCharacters: string; + readonly wordWrapBreakObtrusiveCharacters: string; + readonly autoClosingBrackets: boolean; + readonly dragAndDrop: boolean; + readonly emptySelectionClipboard: boolean; + readonly useTabStops: boolean; + readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + + readonly viewInfo: InternalEditorViewOptions; + readonly contribInfo: EditorContribOptions; +} + +/** + * Internal configuration options (transformed or computed) for the editor. + */ +export class InternalEditorOptions { + readonly _internalEditorOptionsBrand: void; + + readonly canUseTranslate3d: boolean; + readonly pixelRatio: number; + readonly editorClassName: string; + readonly lineHeight: number; + readonly readOnly: boolean; + /** + * @internal + */ + readonly accessibilitySupport: platform.AccessibilitySupport; + readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + + // ---- cursor options + readonly wordSeparators: string; + readonly autoClosingBrackets: boolean; + readonly useTabStops: boolean; + readonly tabFocusMode: boolean; + readonly dragAndDrop: boolean; + readonly emptySelectionClipboard: boolean; + + // ---- grouped options + readonly layoutInfo: EditorLayoutInfo; + readonly fontInfo: FontInfo; + readonly viewInfo: InternalEditorViewOptions; + readonly wrappingInfo: EditorWrappingInfo; + readonly contribInfo: EditorContribOptions; /** * @internal */ constructor(source: { - theme: string; canUseTranslate3d: boolean; - disableMonospaceOptimizations: boolean; - experimentalScreenReader: boolean; - rulers: number[]; - ariaLabel: string; - renderLineNumbers: boolean; - renderCustomLineNumbers: (lineNumber: number) => string; - renderRelativeLineNumbers: boolean; - selectOnLineNumbers: boolean; - glyphMargin: boolean; - revealHorizontalRightPadding: number; - roundedSelection: boolean; - overviewRulerLanes: number; - overviewRulerBorder: boolean; - cursorBlinking: TextEditorCursorBlinkingStyle; - mouseWheelZoom: boolean; - cursorStyle: TextEditorCursorStyle; - hideCursorInOverviewRuler: boolean; - scrollBeyondLastLine: boolean; + pixelRatio: number; editorClassName: string; - stopRenderingLineAfter: number; - renderWhitespace: 'none' | 'boundary' | 'all'; - renderControlCharacters: boolean; - fontLigatures: boolean; - renderIndentGuides: boolean; - renderLineHighlight: 'none' | 'gutter' | 'line' | 'all'; - scrollbar: InternalEditorScrollbarOptions; - minimap: InternalEditorMinimapOptions; - fixedOverflowWidgets: boolean; + lineHeight: number; + readOnly: boolean; + accessibilitySupport: platform.AccessibilitySupport; + multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + wordSeparators: string; + autoClosingBrackets: boolean; + useTabStops: boolean; + tabFocusMode: boolean; + dragAndDrop: boolean; + emptySelectionClipboard: boolean; + layoutInfo: EditorLayoutInfo; + fontInfo: FontInfo; + viewInfo: InternalEditorViewOptions; + wrappingInfo: EditorWrappingInfo; + contribInfo: EditorContribOptions; }) { - this.theme = String(source.theme); - this.canUseTranslate3d = Boolean(source.canUseTranslate3d); - this.disableMonospaceOptimizations = Boolean(source.disableMonospaceOptimizations); - this.experimentalScreenReader = Boolean(source.experimentalScreenReader); - this.rulers = InternalEditorViewOptions._toSortedIntegerArray(source.rulers); - this.ariaLabel = String(source.ariaLabel); - this.renderLineNumbers = Boolean(source.renderLineNumbers); - this.renderCustomLineNumbers = source.renderCustomLineNumbers; - this.renderRelativeLineNumbers = Boolean(source.renderRelativeLineNumbers); - this.selectOnLineNumbers = Boolean(source.selectOnLineNumbers); - this.glyphMargin = Boolean(source.glyphMargin); - this.revealHorizontalRightPadding = source.revealHorizontalRightPadding | 0; - this.roundedSelection = Boolean(source.roundedSelection); - this.overviewRulerLanes = source.overviewRulerLanes | 0; - this.overviewRulerBorder = Boolean(source.overviewRulerBorder); - this.cursorBlinking = source.cursorBlinking | 0; - this.mouseWheelZoom = Boolean(source.mouseWheelZoom); - this.cursorStyle = source.cursorStyle | 0; - this.hideCursorInOverviewRuler = Boolean(source.hideCursorInOverviewRuler); - this.scrollBeyondLastLine = Boolean(source.scrollBeyondLastLine); - this.editorClassName = String(source.editorClassName); - this.stopRenderingLineAfter = source.stopRenderingLineAfter | 0; - this.renderWhitespace = source.renderWhitespace; - this.renderControlCharacters = Boolean(source.renderControlCharacters); - this.fontLigatures = Boolean(source.fontLigatures); - this.renderIndentGuides = Boolean(source.renderIndentGuides); - this.renderLineHighlight = source.renderLineHighlight; - this.scrollbar = source.scrollbar.clone(); - this.minimap = source.minimap.clone(); - this.fixedOverflowWidgets = Boolean(source.fixedOverflowWidgets); + this.canUseTranslate3d = source.canUseTranslate3d; + this.pixelRatio = source.pixelRatio; + this.editorClassName = source.editorClassName; + this.lineHeight = source.lineHeight | 0; + this.readOnly = source.readOnly; + this.accessibilitySupport = source.accessibilitySupport; + this.multicursorModifier = source.multicursorModifier; + this.wordSeparators = source.wordSeparators; + this.autoClosingBrackets = source.autoClosingBrackets; + this.useTabStops = source.useTabStops; + this.tabFocusMode = source.tabFocusMode; + this.dragAndDrop = source.dragAndDrop; + this.emptySelectionClipboard = source.emptySelectionClipboard; + this.layoutInfo = source.layoutInfo; + this.fontInfo = source.fontInfo; + this.viewInfo = source.viewInfo; + this.wrappingInfo = source.wrappingInfo; + this.contribInfo = source.contribInfo; } - private static _toSortedIntegerArray(source: any): number[] { - if (!Array.isArray(source)) { - return []; - } - let arrSource = source; - let result = arrSource.map(el => { - let r = parseInt(el, 10); - if (isNaN(r)) { - return 0; - } - return r; - }); - result.sort(); - return result; + /** + * @internal + */ + public equals(other: InternalEditorOptions): boolean { + return ( + this.canUseTranslate3d === other.canUseTranslate3d + && this.pixelRatio === other.pixelRatio + && this.editorClassName === other.editorClassName + && this.lineHeight === other.lineHeight + && this.readOnly === other.readOnly + && this.accessibilitySupport === other.accessibilitySupport + && this.multicursorModifier === other.multicursorModifier + && this.wordSeparators === other.wordSeparators + && this.autoClosingBrackets === other.autoClosingBrackets + && this.useTabStops === other.useTabStops + && this.tabFocusMode === other.tabFocusMode + && this.dragAndDrop === other.dragAndDrop + && this.emptySelectionClipboard === other.emptySelectionClipboard + && InternalEditorOptions._equalsLayoutInfo(this.layoutInfo, other.layoutInfo) + && this.fontInfo.equals(other.fontInfo) + && InternalEditorOptions._equalsViewOptions(this.viewInfo, other.viewInfo) + && InternalEditorOptions._equalsWrappingInfo(this.wrappingInfo, other.wrappingInfo) + && InternalEditorOptions._equalsContribOptions(this.contribInfo, other.contribInfo) + ); } - private static _numberArraysEqual(a: number[], b: number[]): boolean { + /** + * @internal + */ + public createChangeEvent(newOpts: InternalEditorOptions): IConfigurationChangedEvent { + return { + canUseTranslate3d: (this.canUseTranslate3d !== newOpts.canUseTranslate3d), + pixelRatio: (this.pixelRatio !== newOpts.pixelRatio), + editorClassName: (this.editorClassName !== newOpts.editorClassName), + lineHeight: (this.lineHeight !== newOpts.lineHeight), + readOnly: (this.readOnly !== newOpts.readOnly), + accessibilitySupport: (this.accessibilitySupport !== newOpts.accessibilitySupport), + multicursorModifier: (this.multicursorModifier !== newOpts.multicursorModifier), + wordSeparators: (this.wordSeparators !== newOpts.wordSeparators), + autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets), + useTabStops: (this.useTabStops !== newOpts.useTabStops), + tabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode), + dragAndDrop: (this.dragAndDrop !== newOpts.dragAndDrop), + emptySelectionClipboard: (this.emptySelectionClipboard !== newOpts.emptySelectionClipboard), + layoutInfo: (!InternalEditorOptions._equalsLayoutInfo(this.layoutInfo, newOpts.layoutInfo)), + fontInfo: (!this.fontInfo.equals(newOpts.fontInfo)), + viewInfo: (!InternalEditorOptions._equalsViewOptions(this.viewInfo, newOpts.viewInfo)), + wrappingInfo: (!InternalEditorOptions._equalsWrappingInfo(this.wrappingInfo, newOpts.wrappingInfo)), + contribInfo: (!InternalEditorOptions._equalsContribOptions(this.contribInfo, newOpts.contribInfo)), + }; + } + + /** + * @internal + */ + private static _equalsLayoutInfo(a: EditorLayoutInfo, b: EditorLayoutInfo): boolean { + return ( + a.width === b.width + && a.height === b.height + && a.glyphMarginLeft === b.glyphMarginLeft + && a.glyphMarginWidth === b.glyphMarginWidth + && a.glyphMarginHeight === b.glyphMarginHeight + && a.lineNumbersLeft === b.lineNumbersLeft + && a.lineNumbersWidth === b.lineNumbersWidth + && a.lineNumbersHeight === b.lineNumbersHeight + && a.decorationsLeft === b.decorationsLeft + && a.decorationsWidth === b.decorationsWidth + && a.decorationsHeight === b.decorationsHeight + && a.contentLeft === b.contentLeft + && a.contentWidth === b.contentWidth + && a.contentHeight === b.contentHeight + && a.renderMinimap === b.renderMinimap + && a.minimapWidth === b.minimapWidth + && a.viewportColumn === b.viewportColumn + && a.verticalScrollbarWidth === b.verticalScrollbarWidth + && a.horizontalScrollbarHeight === b.horizontalScrollbarHeight + && this._equalsOverviewRuler(a.overviewRuler, b.overviewRuler) + ); + } + + /** + * @internal + */ + private static _equalsOverviewRuler(a: OverviewRulerPosition, b: OverviewRulerPosition): boolean { + return ( + a.width === b.width + && a.height === b.height + && a.top === b.top + && a.right === b.right + ); + } + + /** + * @internal + */ + private static _equalsViewOptions(a: InternalEditorViewOptions, b: InternalEditorViewOptions): boolean { + return ( + a.extraEditorClassName === b.extraEditorClassName + && a.disableMonospaceOptimizations === b.disableMonospaceOptimizations + && this._equalsNumberArrays(a.rulers, b.rulers) + && a.ariaLabel === b.ariaLabel + && a.renderLineNumbers === b.renderLineNumbers + && a.renderCustomLineNumbers === b.renderCustomLineNumbers + && a.renderRelativeLineNumbers === b.renderRelativeLineNumbers + && a.selectOnLineNumbers === b.selectOnLineNumbers + && a.glyphMargin === b.glyphMargin + && a.revealHorizontalRightPadding === b.revealHorizontalRightPadding + && a.roundedSelection === b.roundedSelection + && a.overviewRulerLanes === b.overviewRulerLanes + && a.overviewRulerBorder === b.overviewRulerBorder + && a.cursorBlinking === b.cursorBlinking + && a.mouseWheelZoom === b.mouseWheelZoom + && a.cursorStyle === b.cursorStyle + && a.hideCursorInOverviewRuler === b.hideCursorInOverviewRuler + && a.scrollBeyondLastLine === b.scrollBeyondLastLine + && a.stopRenderingLineAfter === b.stopRenderingLineAfter + && a.renderWhitespace === b.renderWhitespace + && a.renderControlCharacters === b.renderControlCharacters + && a.fontLigatures === b.fontLigatures + && a.renderIndentGuides === b.renderIndentGuides + && a.renderLineHighlight === b.renderLineHighlight + && this._equalsScrollbarOptions(a.scrollbar, b.scrollbar) + && this._equalsMinimapOptions(a.minimap, b.minimap) + && a.fixedOverflowWidgets === b.fixedOverflowWidgets + ); + } + + /** + * @internal + */ + private static _equalsScrollbarOptions(a: InternalEditorScrollbarOptions, b: InternalEditorScrollbarOptions): boolean { + return ( + a.arrowSize === b.arrowSize + && a.vertical === b.vertical + && a.horizontal === b.horizontal + && a.useShadows === b.useShadows + && a.verticalHasArrows === b.verticalHasArrows + && a.horizontalHasArrows === b.horizontalHasArrows + && a.handleMouseWheel === b.handleMouseWheel + && a.horizontalScrollbarSize === b.horizontalScrollbarSize + && a.horizontalSliderSize === b.horizontalSliderSize + && a.verticalScrollbarSize === b.verticalScrollbarSize + && a.verticalSliderSize === b.verticalSliderSize + && a.mouseWheelScrollSensitivity === b.mouseWheelScrollSensitivity + ); + } + + /** + * @internal + */ + private static _equalsMinimapOptions(a: InternalEditorMinimapOptions, b: InternalEditorMinimapOptions): boolean { + return ( + a.enabled === b.enabled + && a.renderCharacters === b.renderCharacters + && a.maxColumn === b.maxColumn + ); + } + + private static _equalsNumberArrays(a: number[], b: number[]): boolean { if (a.length !== b.length) { return false; } @@ -914,307 +1042,84 @@ export class InternalEditorViewOptions { /** * @internal */ - public equals(other: InternalEditorViewOptions): boolean { + + private static _equalFindOptions(a: InternalEditorFindOptions, b: InternalEditorFindOptions): boolean { return ( - this.theme === other.theme - && this.canUseTranslate3d === other.canUseTranslate3d - && this.disableMonospaceOptimizations === other.disableMonospaceOptimizations - && this.experimentalScreenReader === other.experimentalScreenReader - && InternalEditorViewOptions._numberArraysEqual(this.rulers, other.rulers) - && this.ariaLabel === other.ariaLabel - && this.renderLineNumbers === other.renderLineNumbers - && this.renderCustomLineNumbers === other.renderCustomLineNumbers - && this.renderRelativeLineNumbers === other.renderRelativeLineNumbers - && this.selectOnLineNumbers === other.selectOnLineNumbers - && this.glyphMargin === other.glyphMargin - && this.revealHorizontalRightPadding === other.revealHorizontalRightPadding - && this.roundedSelection === other.roundedSelection - && this.overviewRulerLanes === other.overviewRulerLanes - && this.overviewRulerBorder === other.overviewRulerBorder - && this.cursorBlinking === other.cursorBlinking - && this.mouseWheelZoom === other.mouseWheelZoom - && this.cursorStyle === other.cursorStyle - && this.hideCursorInOverviewRuler === other.hideCursorInOverviewRuler - && this.scrollBeyondLastLine === other.scrollBeyondLastLine - && this.editorClassName === other.editorClassName - && this.stopRenderingLineAfter === other.stopRenderingLineAfter - && this.renderWhitespace === other.renderWhitespace - && this.renderControlCharacters === other.renderControlCharacters - && this.fontLigatures === other.fontLigatures - && this.renderIndentGuides === other.renderIndentGuides - && this.renderLineHighlight === other.renderLineHighlight - && this.scrollbar.equals(other.scrollbar) - && this.minimap.equals(other.minimap) - && this.fixedOverflowWidgets === other.fixedOverflowWidgets + a.seedSearchStringFromSelection === b.seedSearchStringFromSelection + && a.autoFindInSelection === b.autoFindInSelection ); } /** * @internal */ - public createChangeEvent(newOpts: InternalEditorViewOptions): IViewConfigurationChangedEvent { - return { - theme: this.theme !== newOpts.theme, - canUseTranslate3d: this.canUseTranslate3d !== newOpts.canUseTranslate3d, - disableMonospaceOptimizations: this.disableMonospaceOptimizations !== newOpts.disableMonospaceOptimizations, - experimentalScreenReader: this.experimentalScreenReader !== newOpts.experimentalScreenReader, - rulers: (!InternalEditorViewOptions._numberArraysEqual(this.rulers, newOpts.rulers)), - ariaLabel: this.ariaLabel !== newOpts.ariaLabel, - renderLineNumbers: this.renderLineNumbers !== newOpts.renderLineNumbers, - renderCustomLineNumbers: this.renderCustomLineNumbers !== newOpts.renderCustomLineNumbers, - renderRelativeLineNumbers: this.renderRelativeLineNumbers !== newOpts.renderRelativeLineNumbers, - selectOnLineNumbers: this.selectOnLineNumbers !== newOpts.selectOnLineNumbers, - glyphMargin: this.glyphMargin !== newOpts.glyphMargin, - revealHorizontalRightPadding: this.revealHorizontalRightPadding !== newOpts.revealHorizontalRightPadding, - roundedSelection: this.roundedSelection !== newOpts.roundedSelection, - overviewRulerLanes: this.overviewRulerLanes !== newOpts.overviewRulerLanes, - overviewRulerBorder: this.overviewRulerBorder !== newOpts.overviewRulerBorder, - cursorBlinking: this.cursorBlinking !== newOpts.cursorBlinking, - mouseWheelZoom: this.mouseWheelZoom !== newOpts.mouseWheelZoom, - cursorStyle: this.cursorStyle !== newOpts.cursorStyle, - hideCursorInOverviewRuler: this.hideCursorInOverviewRuler !== newOpts.hideCursorInOverviewRuler, - scrollBeyondLastLine: this.scrollBeyondLastLine !== newOpts.scrollBeyondLastLine, - editorClassName: this.editorClassName !== newOpts.editorClassName, - stopRenderingLineAfter: this.stopRenderingLineAfter !== newOpts.stopRenderingLineAfter, - renderWhitespace: this.renderWhitespace !== newOpts.renderWhitespace, - renderControlCharacters: this.renderControlCharacters !== newOpts.renderControlCharacters, - fontLigatures: this.fontLigatures !== newOpts.fontLigatures, - renderIndentGuides: this.renderIndentGuides !== newOpts.renderIndentGuides, - renderLineHighlight: this.renderLineHighlight !== newOpts.renderLineHighlight, - scrollbar: (!this.scrollbar.equals(newOpts.scrollbar)), - minimap: (!this.minimap.equals(newOpts.minimap)), - fixedOverflowWidgets: this.fixedOverflowWidgets !== newOpts.fixedOverflowWidgets - }; - } - - /** - * @internal - */ - public clone(): InternalEditorViewOptions { - return new InternalEditorViewOptions(this); - } -} - -export class EditorContribOptions { - readonly selectionClipboard: boolean; - readonly hover: boolean; - readonly contextmenu: boolean; - readonly quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean }; - readonly quickSuggestionsDelay: number; - readonly parameterHints: boolean; - readonly iconsInSuggestions: boolean; - readonly formatOnType: boolean; - readonly formatOnPaste: boolean; - readonly suggestOnTriggerCharacters: boolean; - readonly acceptSuggestionOnEnter: boolean; - readonly acceptSuggestionOnCommitCharacter: boolean; - readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none'; - readonly emptySelectionClipboard: boolean; - readonly wordBasedSuggestions: boolean; - readonly suggestFontSize: number; - readonly suggestLineHeight: number; - readonly selectionHighlight: boolean; - readonly occurrencesHighlight: boolean; - readonly codeLens: boolean; - readonly folding: boolean; - readonly matchBrackets: boolean; - - /** - * @internal - */ - constructor(source: { - selectionClipboard: boolean; - hover: boolean; - contextmenu: boolean; - quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean }; - quickSuggestionsDelay: number; - parameterHints: boolean; - iconsInSuggestions: boolean; - formatOnType: boolean; - formatOnPaste: boolean; - suggestOnTriggerCharacters: boolean; - acceptSuggestionOnEnter: boolean; - acceptSuggestionOnCommitCharacter: boolean; - snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none'; - emptySelectionClipboard: boolean; - wordBasedSuggestions: boolean; - suggestFontSize: number; - suggestLineHeight: number; - selectionHighlight: boolean; - occurrencesHighlight: boolean; - codeLens: boolean; - folding: boolean; - matchBrackets: boolean; - }) { - this.selectionClipboard = Boolean(source.selectionClipboard); - this.hover = Boolean(source.hover); - this.contextmenu = Boolean(source.contextmenu); - this.quickSuggestions = source.quickSuggestions; - this.quickSuggestionsDelay = source.quickSuggestionsDelay || 0; - this.parameterHints = Boolean(source.parameterHints); - this.iconsInSuggestions = Boolean(source.iconsInSuggestions); - this.formatOnType = Boolean(source.formatOnType); - this.formatOnPaste = Boolean(source.formatOnPaste); - this.suggestOnTriggerCharacters = Boolean(source.suggestOnTriggerCharacters); - this.acceptSuggestionOnEnter = Boolean(source.acceptSuggestionOnEnter); - this.acceptSuggestionOnCommitCharacter = Boolean(source.acceptSuggestionOnCommitCharacter); - this.snippetSuggestions = source.snippetSuggestions; - this.emptySelectionClipboard = source.emptySelectionClipboard; - this.wordBasedSuggestions = source.wordBasedSuggestions; - this.suggestFontSize = source.suggestFontSize; - this.suggestLineHeight = source.suggestLineHeight; - this.selectionHighlight = Boolean(source.selectionHighlight); - this.occurrencesHighlight = Boolean(source.occurrencesHighlight); - this.codeLens = Boolean(source.codeLens); - this.folding = Boolean(source.folding); - this.matchBrackets = Boolean(source.matchBrackets); - } - - /** - * @internal - */ - public equals(other: EditorContribOptions): boolean { + private static _equalsWrappingInfo(a: EditorWrappingInfo, b: EditorWrappingInfo): boolean { return ( - this.selectionClipboard === other.selectionClipboard - && this.hover === other.hover - && this.contextmenu === other.contextmenu - && objects.equals(this.quickSuggestions, other.quickSuggestions) - && this.quickSuggestionsDelay === other.quickSuggestionsDelay - && this.parameterHints === other.parameterHints - && this.iconsInSuggestions === other.iconsInSuggestions - && this.formatOnType === other.formatOnType - && this.formatOnPaste === other.formatOnPaste - && this.suggestOnTriggerCharacters === other.suggestOnTriggerCharacters - && this.acceptSuggestionOnEnter === other.acceptSuggestionOnEnter - && this.acceptSuggestionOnCommitCharacter === other.acceptSuggestionOnCommitCharacter - && this.snippetSuggestions === other.snippetSuggestions - && this.emptySelectionClipboard === other.emptySelectionClipboard - && objects.equals(this.wordBasedSuggestions, other.wordBasedSuggestions) - && this.suggestFontSize === other.suggestFontSize - && this.suggestLineHeight === other.suggestLineHeight - && this.selectionHighlight === other.selectionHighlight - && this.occurrencesHighlight === other.occurrencesHighlight - && this.codeLens === other.codeLens - && this.folding === other.folding - && this.matchBrackets === other.matchBrackets + a.inDiffEditor === b.inDiffEditor + && a.isDominatedByLongLines === b.isDominatedByLongLines + && a.isWordWrapMinified === b.isWordWrapMinified + && a.isViewportWrapping === b.isViewportWrapping + && a.wrappingColumn === b.wrappingColumn + && a.wrappingIndent === b.wrappingIndent + && a.wordWrapBreakBeforeCharacters === b.wordWrapBreakBeforeCharacters + && a.wordWrapBreakAfterCharacters === b.wordWrapBreakAfterCharacters + && a.wordWrapBreakObtrusiveCharacters === b.wordWrapBreakObtrusiveCharacters ); } /** * @internal */ - public clone(): EditorContribOptions { - return new EditorContribOptions(this); - } -} - -/** - * Internal configuration options (transformed or computed) for the editor. - */ -export class InternalEditorOptions { - readonly _internalEditorOptionsBrand: void; - - readonly lineHeight: number; // todo: move to fontInfo - - readonly readOnly: boolean; - // ---- cursor options - readonly wordSeparators: string; - readonly autoClosingBrackets: boolean; - readonly useTabStops: boolean; - readonly tabFocusMode: boolean; - readonly dragAndDrop: boolean; - // ---- grouped options - readonly layoutInfo: EditorLayoutInfo; - readonly fontInfo: FontInfo; - readonly viewInfo: InternalEditorViewOptions; - readonly wrappingInfo: EditorWrappingInfo; - readonly contribInfo: EditorContribOptions; - - /** - * @internal - */ - constructor(source: { - lineHeight: number; - readOnly: boolean; - wordSeparators: string; - autoClosingBrackets: boolean; - useTabStops: boolean; - tabFocusMode: boolean; - dragAndDrop: boolean; - layoutInfo: EditorLayoutInfo; - fontInfo: FontInfo; - viewInfo: InternalEditorViewOptions; - wrappingInfo: EditorWrappingInfo; - contribInfo: EditorContribOptions; - }) { - this.lineHeight = source.lineHeight | 0; - this.readOnly = Boolean(source.readOnly); - this.wordSeparators = String(source.wordSeparators); - this.autoClosingBrackets = Boolean(source.autoClosingBrackets); - this.useTabStops = Boolean(source.useTabStops); - this.tabFocusMode = Boolean(source.tabFocusMode); - this.dragAndDrop = Boolean(source.dragAndDrop); - this.layoutInfo = source.layoutInfo.clone(); - this.fontInfo = source.fontInfo.clone(); - this.viewInfo = source.viewInfo.clone(); - this.wrappingInfo = source.wrappingInfo.clone(); - this.contribInfo = source.contribInfo.clone(); - } - - /** - * @internal - */ - public equals(other: InternalEditorOptions): boolean { + private static _equalsContribOptions(a: EditorContribOptions, b: EditorContribOptions): boolean { return ( - this.lineHeight === other.lineHeight - && this.readOnly === other.readOnly - && this.wordSeparators === other.wordSeparators - && this.autoClosingBrackets === other.autoClosingBrackets - && this.useTabStops === other.useTabStops - && this.tabFocusMode === other.tabFocusMode - && this.dragAndDrop === other.dragAndDrop - && this.layoutInfo.equals(other.layoutInfo) - && this.fontInfo.equals(other.fontInfo) - && this.viewInfo.equals(other.viewInfo) - && this.wrappingInfo.equals(other.wrappingInfo) - && this.contribInfo.equals(other.contribInfo) + a.selectionClipboard === b.selectionClipboard + && a.hover === b.hover + && a.contextmenu === b.contextmenu + && InternalEditorOptions._equalsQuickSuggestions(a.quickSuggestions, b.quickSuggestions) + && a.quickSuggestionsDelay === b.quickSuggestionsDelay + && a.parameterHints === b.parameterHints + && a.iconsInSuggestions === b.iconsInSuggestions + && a.formatOnType === b.formatOnType + && a.formatOnPaste === b.formatOnPaste + && a.suggestOnTriggerCharacters === b.suggestOnTriggerCharacters + && a.acceptSuggestionOnEnter === b.acceptSuggestionOnEnter + && a.acceptSuggestionOnCommitCharacter === b.acceptSuggestionOnCommitCharacter + && a.snippetSuggestions === b.snippetSuggestions + && a.wordBasedSuggestions === b.wordBasedSuggestions + && a.suggestFontSize === b.suggestFontSize + && a.suggestLineHeight === b.suggestLineHeight + && a.selectionHighlight === b.selectionHighlight + && a.occurrencesHighlight === b.occurrencesHighlight + && a.codeLens === b.codeLens + && a.folding === b.folding + && a.showFoldingControls === b.showFoldingControls + && a.matchBrackets === b.matchBrackets + && this._equalFindOptions(a.find, b.find) ); } - /** - * @internal - */ - public createChangeEvent(newOpts: InternalEditorOptions): IConfigurationChangedEvent { - return { - lineHeight: (this.lineHeight !== newOpts.lineHeight), - readOnly: (this.readOnly !== newOpts.readOnly), - wordSeparators: (this.wordSeparators !== newOpts.wordSeparators), - autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets), - useTabStops: (this.useTabStops !== newOpts.useTabStops), - tabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode), - dragAndDrop: (this.dragAndDrop !== newOpts.dragAndDrop), - layoutInfo: (!this.layoutInfo.equals(newOpts.layoutInfo)), - fontInfo: (!this.fontInfo.equals(newOpts.fontInfo)), - viewInfo: this.viewInfo.createChangeEvent(newOpts.viewInfo), - wrappingInfo: (!this.wrappingInfo.equals(newOpts.wrappingInfo)), - contribInfo: (!this.contribInfo.equals(newOpts.contribInfo)), - }; - } - - /** - * @internal - */ - public clone(): InternalEditorOptions { - return new InternalEditorOptions(this); + private static _equalsQuickSuggestions(a: boolean | { other: boolean, comments: boolean, strings: boolean }, b: boolean | { other: boolean, comments: boolean, strings: boolean }): boolean { + if (typeof a === 'boolean') { + if (typeof b !== 'boolean') { + return false; + } + return a === b; + } + if (typeof b === 'boolean') { + return false; + } + return ( + a.comments === b.comments + && a.other === b.other + && a.strings === b.strings + ); } } /** * A description for the overview ruler position. */ -export class OverviewRulerPosition { - readonly _overviewRulerPositionBrand: void; - +export interface OverviewRulerPosition { /** * Width of the overview ruler */ @@ -1231,47 +1136,12 @@ export class OverviewRulerPosition { * Right position for the overview ruler */ readonly right: number; - - /** - * @internal - */ - constructor(source: { - width: number; - height: number; - top: number; - right: number; - }) { - this.width = source.width | 0; - this.height = source.height | 0; - this.top = source.top | 0; - this.right = source.right | 0; - } - - /** - * @internal - */ - public equals(other: OverviewRulerPosition): boolean { - return ( - this.width === other.width - && this.height === other.height - && this.top === other.top - && this.right === other.right - ); - } - - /** - * @internal - */ - public clone(): OverviewRulerPosition { - return new OverviewRulerPosition(this); - } } /** * The internal layout details of the editor. */ -export class EditorLayoutInfo { - readonly _editorLayoutInfoBrand: void; +export interface EditorLayoutInfo { /** * Full editor width. @@ -1362,137 +1232,905 @@ export class EditorLayoutInfo { * The position of the overview ruler. */ readonly overviewRuler: OverviewRulerPosition; - - /** - * @internal - */ - constructor(source: { - width: number; - height: number; - glyphMarginLeft: number; - glyphMarginWidth: number; - glyphMarginHeight: number; - lineNumbersLeft: number; - lineNumbersWidth: number; - lineNumbersHeight: number; - decorationsLeft: number; - decorationsWidth: number; - decorationsHeight: number; - contentLeft: number; - contentWidth: number; - contentHeight: number; - renderMinimap: RenderMinimap; - minimapWidth: number; - viewportColumn: number; - verticalScrollbarWidth: number; - horizontalScrollbarHeight: number; - overviewRuler: OverviewRulerPosition; - }) { - this.width = source.width | 0; - this.height = source.height | 0; - this.glyphMarginLeft = source.glyphMarginLeft | 0; - this.glyphMarginWidth = source.glyphMarginWidth | 0; - this.glyphMarginHeight = source.glyphMarginHeight | 0; - this.lineNumbersLeft = source.lineNumbersLeft | 0; - this.lineNumbersWidth = source.lineNumbersWidth | 0; - this.lineNumbersHeight = source.lineNumbersHeight | 0; - this.decorationsLeft = source.decorationsLeft | 0; - this.decorationsWidth = source.decorationsWidth | 0; - this.decorationsHeight = source.decorationsHeight | 0; - this.contentLeft = source.contentLeft | 0; - this.contentWidth = source.contentWidth | 0; - this.contentHeight = source.contentHeight | 0; - this.renderMinimap = source.renderMinimap | 0; - this.minimapWidth = source.minimapWidth | 0; - this.viewportColumn = source.viewportColumn | 0; - this.verticalScrollbarWidth = source.verticalScrollbarWidth | 0; - this.horizontalScrollbarHeight = source.horizontalScrollbarHeight | 0; - this.overviewRuler = source.overviewRuler.clone(); - } - - /** - * @internal - */ - public equals(other: EditorLayoutInfo): boolean { - return ( - this.width === other.width - && this.height === other.height - && this.glyphMarginLeft === other.glyphMarginLeft - && this.glyphMarginWidth === other.glyphMarginWidth - && this.glyphMarginHeight === other.glyphMarginHeight - && this.lineNumbersLeft === other.lineNumbersLeft - && this.lineNumbersWidth === other.lineNumbersWidth - && this.lineNumbersHeight === other.lineNumbersHeight - && this.decorationsLeft === other.decorationsLeft - && this.decorationsWidth === other.decorationsWidth - && this.decorationsHeight === other.decorationsHeight - && this.contentLeft === other.contentLeft - && this.contentWidth === other.contentWidth - && this.contentHeight === other.contentHeight - && this.renderMinimap === other.renderMinimap - && this.minimapWidth === other.minimapWidth - && this.viewportColumn === other.viewportColumn - && this.verticalScrollbarWidth === other.verticalScrollbarWidth - && this.horizontalScrollbarHeight === other.horizontalScrollbarHeight - && this.overviewRuler.equals(other.overviewRuler) - ); - } - - /** - * @internal - */ - public clone(): EditorLayoutInfo { - return new EditorLayoutInfo(this); - } -} - -export interface IViewConfigurationChangedEvent { - readonly theme: boolean; - readonly canUseTranslate3d: boolean; - readonly disableMonospaceOptimizations: boolean; - readonly experimentalScreenReader: boolean; - readonly rulers: boolean; - readonly ariaLabel: boolean; - readonly renderLineNumbers: boolean; - readonly renderCustomLineNumbers: boolean; - readonly renderRelativeLineNumbers: boolean; - readonly selectOnLineNumbers: boolean; - readonly glyphMargin: boolean; - readonly revealHorizontalRightPadding: boolean; - readonly roundedSelection: boolean; - readonly overviewRulerLanes: boolean; - readonly overviewRulerBorder: boolean; - readonly cursorBlinking: boolean; - readonly mouseWheelZoom: boolean; - readonly cursorStyle: boolean; - readonly hideCursorInOverviewRuler: boolean; - readonly scrollBeyondLastLine: boolean; - readonly editorClassName: boolean; - readonly stopRenderingLineAfter: boolean; - readonly renderWhitespace: boolean; - readonly renderControlCharacters: boolean; - readonly fontLigatures: boolean; - readonly renderIndentGuides: boolean; - readonly renderLineHighlight: boolean; - readonly scrollbar: boolean; - readonly minimap: boolean; - readonly fixedOverflowWidgets: boolean; } /** * An event describing that the configuration of the editor has changed. */ export interface IConfigurationChangedEvent { + readonly canUseTranslate3d: boolean; + readonly pixelRatio: boolean; + readonly editorClassName: boolean; readonly lineHeight: boolean; readonly readOnly: boolean; + readonly accessibilitySupport: boolean; + readonly multicursorModifier: boolean; readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; + readonly emptySelectionClipboard: boolean; readonly layoutInfo: boolean; readonly fontInfo: boolean; - readonly viewInfo: IViewConfigurationChangedEvent; + readonly viewInfo: boolean; readonly wrappingInfo: boolean; readonly contribInfo: boolean; } + +/** + * @internal + */ +export interface IEnvironmentalOptions { + readonly outerWidth: number; + readonly outerHeight: number; + readonly fontInfo: FontInfo; + readonly extraEditorClassName: string; + readonly isDominatedByLongLines: boolean; + readonly lineNumbersDigitCount: number; + readonly canUseTranslate3d: boolean; + readonly emptySelectionClipboard: boolean; + readonly pixelRatio: number; + readonly tabFocusMode: boolean; + readonly accessibilitySupport: platform.AccessibilitySupport; +} + +function _boolean(value: any, defaultValue: T): boolean | T { + if (typeof value === 'undefined') { + return defaultValue; + } + if (value === 'false') { + // treat the string 'false' as false + return false; + } + return Boolean(value); +} + +function _string(value: any, defaultValue: string): string { + if (typeof value !== 'string') { + return defaultValue; + } + return value; +} + +function _stringSet(value: any, defaultValue: T, allowedValues: string[]): T { + if (typeof value !== 'string') { + return defaultValue; + } + if (allowedValues.indexOf(value) === -1) { + return defaultValue; + } + return value; +} + +function _clampedInt(value: any, defaultValue: number, minimum: number, maximum: number): number { + let r: number; + if (typeof value === 'undefined') { + r = defaultValue; + } else { + r = parseInt(value, 10); + if (isNaN(r)) { + r = defaultValue; + } + } + r = Math.max(minimum, r); + r = Math.min(maximum, r); + return r | 0; +} + +function _float(value: any, defaultValue: number): number { + let r = parseFloat(value); + if (isNaN(r)) { + r = defaultValue; + } + return r; +} + +function _wrappingIndentFromString(wrappingIndent: string, defaultValue: WrappingIndent): WrappingIndent { + if (typeof wrappingIndent !== 'string') { + return defaultValue; + } + if (wrappingIndent === 'indent') { + return WrappingIndent.Indent; + } else if (wrappingIndent === 'same') { + return WrappingIndent.Same; + } else { + return WrappingIndent.None; + } +} + +function _cursorBlinkingStyleFromString(cursorBlinkingStyle: string, defaultValue: TextEditorCursorBlinkingStyle): TextEditorCursorBlinkingStyle { + if (typeof cursorBlinkingStyle !== 'string') { + return defaultValue; + } + switch (cursorBlinkingStyle) { + case 'blink': + return TextEditorCursorBlinkingStyle.Blink; + case 'smooth': + return TextEditorCursorBlinkingStyle.Smooth; + case 'phase': + return TextEditorCursorBlinkingStyle.Phase; + case 'expand': + return TextEditorCursorBlinkingStyle.Expand; + case 'visible': // maintain compatibility + case 'solid': + return TextEditorCursorBlinkingStyle.Solid; + } + return TextEditorCursorBlinkingStyle.Blink; +} + +function _scrollbarVisibilityFromString(visibility: string, defaultValue: ScrollbarVisibility): ScrollbarVisibility { + if (typeof visibility !== 'string') { + return defaultValue; + } + switch (visibility) { + case 'hidden': + return ScrollbarVisibility.Hidden; + case 'visible': + return ScrollbarVisibility.Visible; + default: + return ScrollbarVisibility.Auto; + } +} + +/** + * @internal + */ +export class EditorOptionsValidator { + + /** + * Validate raw editor options. + * i.e. since they can be defined by the user, they might be invalid. + */ + public static validate(opts: IEditorOptions, defaults: IValidatedEditorOptions): IValidatedEditorOptions { + let wordWrap = opts.wordWrap; + { + // Compatibility with old true or false values + if (wordWrap === true) { + wordWrap = 'on'; + } else if (wordWrap === false) { + wordWrap = 'off'; + } + + wordWrap = _stringSet<'off' | 'on' | 'wordWrapColumn' | 'bounded'>(wordWrap, defaults.wordWrap, ['off', 'on', 'wordWrapColumn', 'bounded']); + } + + const viewInfo = this._sanitizeViewInfo(opts, defaults.viewInfo); + const contribInfo = this._sanitizeContribInfo(opts, defaults.contribInfo); + + let configuredMulticursorModifier: 'altKey' | 'metaKey' | 'ctrlKey'; + if (typeof opts.multicursorModifier === 'string') { + if (platform.isMacintosh) { + if (opts.multicursorModifier === 'cmd') { + configuredMulticursorModifier = 'metaKey'; + } else { + configuredMulticursorModifier = 'altKey'; + } + } else { + if (opts.multicursorModifier === 'ctrl') { + configuredMulticursorModifier = 'ctrlKey'; + } else { + configuredMulticursorModifier = 'altKey'; + } + } + } + const multicursorModifier = _stringSet<'altKey' | 'metaKey' | 'ctrlKey'>(configuredMulticursorModifier, defaults.multicursorModifier, ['altKey', 'metaKey', 'ctrlKey']); + + return { + inDiffEditor: _boolean(opts.inDiffEditor, defaults.inDiffEditor), + wordSeparators: _string(opts.wordSeparators, defaults.wordSeparators), + lineNumbersMinChars: _clampedInt(opts.lineNumbersMinChars, defaults.lineNumbersMinChars, 1, 10), + lineDecorationsWidth: (typeof opts.lineDecorationsWidth === 'undefined' ? defaults.lineDecorationsWidth : opts.lineDecorationsWidth), + readOnly: _boolean(opts.readOnly, defaults.readOnly), + mouseStyle: _stringSet<'text' | 'default' | 'copy'>(opts.mouseStyle, defaults.mouseStyle, ['text', 'default', 'copy']), + disableTranslate3d: _boolean(opts.disableTranslate3d, defaults.disableTranslate3d), + automaticLayout: _boolean(opts.automaticLayout, defaults.automaticLayout), + wordWrap: wordWrap, + wordWrapColumn: _clampedInt(opts.wordWrapColumn, defaults.wordWrapColumn, 1, Constants.MAX_SAFE_SMALL_INTEGER), + wordWrapMinified: _boolean(opts.wordWrapMinified, defaults.wordWrapMinified), + wrappingIndent: _wrappingIndentFromString(opts.wrappingIndent, defaults.wrappingIndent), + wordWrapBreakBeforeCharacters: _string(opts.wordWrapBreakBeforeCharacters, defaults.wordWrapBreakBeforeCharacters), + wordWrapBreakAfterCharacters: _string(opts.wordWrapBreakAfterCharacters, defaults.wordWrapBreakAfterCharacters), + wordWrapBreakObtrusiveCharacters: _string(opts.wordWrapBreakObtrusiveCharacters, defaults.wordWrapBreakObtrusiveCharacters), + autoClosingBrackets: _boolean(opts.autoClosingBrackets, defaults.autoClosingBrackets), + dragAndDrop: _boolean(opts.dragAndDrop, defaults.dragAndDrop), + emptySelectionClipboard: _boolean(opts.emptySelectionClipboard, defaults.emptySelectionClipboard), + useTabStops: _boolean(opts.useTabStops, defaults.useTabStops), + multicursorModifier: multicursorModifier, + viewInfo: viewInfo, + contribInfo: contribInfo, + }; + } + + private static _sanitizeScrollbarOpts(opts: IEditorScrollbarOptions, defaults: InternalEditorScrollbarOptions, mouseWheelScrollSensitivity: number): InternalEditorScrollbarOptions { + if (typeof opts !== 'object') { + return defaults; + } + const horizontalScrollbarSize = _clampedInt(opts.horizontalScrollbarSize, defaults.horizontalScrollbarSize, 0, 1000); + const verticalScrollbarSize = _clampedInt(opts.verticalScrollbarSize, defaults.verticalScrollbarSize, 0, 1000); + return { + vertical: _scrollbarVisibilityFromString(opts.vertical, defaults.vertical), + horizontal: _scrollbarVisibilityFromString(opts.horizontal, defaults.horizontal), + + arrowSize: _clampedInt(opts.arrowSize, defaults.arrowSize, 0, 1000), + useShadows: _boolean(opts.useShadows, defaults.useShadows), + + verticalHasArrows: _boolean(opts.verticalHasArrows, defaults.verticalHasArrows), + horizontalHasArrows: _boolean(opts.horizontalHasArrows, defaults.horizontalHasArrows), + + horizontalScrollbarSize: horizontalScrollbarSize, + horizontalSliderSize: _clampedInt(opts.horizontalSliderSize, horizontalScrollbarSize, 0, 1000), + + verticalScrollbarSize: verticalScrollbarSize, + verticalSliderSize: _clampedInt(opts.verticalSliderSize, verticalScrollbarSize, 0, 1000), + + handleMouseWheel: _boolean(opts.handleMouseWheel, defaults.handleMouseWheel), + mouseWheelScrollSensitivity: mouseWheelScrollSensitivity + }; + } + + private static _sanitizeMinimapOpts(opts: IEditorMinimapOptions, defaults: InternalEditorMinimapOptions): InternalEditorMinimapOptions { + if (typeof opts !== 'object') { + return defaults; + } + return { + enabled: _boolean(opts.enabled, defaults.enabled), + renderCharacters: _boolean(opts.renderCharacters, defaults.renderCharacters), + maxColumn: _clampedInt(opts.maxColumn, defaults.maxColumn, 1, 10000), + }; + } + + private static _santizeFindOpts(opts: IEditorFindOptions, defaults: InternalEditorFindOptions): InternalEditorFindOptions { + if (typeof opts !== 'object') { + return defaults; + } + + return { + seedSearchStringFromSelection: _boolean(opts.seedSearchStringFromSelection, defaults.seedSearchStringFromSelection), + autoFindInSelection: _boolean(opts.autoFindInSelection, defaults.autoFindInSelection) + }; + } + + private static _sanitizeViewInfo(opts: IEditorOptions, defaults: InternalEditorViewOptions): InternalEditorViewOptions { + + let rulers: number[] = []; + if (Array.isArray(opts.rulers)) { + for (let i = 0, len = opts.rulers.length; i < len; i++) { + rulers.push(_clampedInt(opts.rulers[i], 0, 0, 10000)); + } + rulers.sort(); + } + + let renderLineNumbers: boolean = defaults.renderLineNumbers; + let renderCustomLineNumbers: (lineNumber: number) => string = defaults.renderCustomLineNumbers; + let renderRelativeLineNumbers: boolean = defaults.renderRelativeLineNumbers; + + if (typeof opts.lineNumbers !== 'undefined') { + let lineNumbers = opts.lineNumbers; + + // Compatibility with old true or false values + if (lineNumbers === true) { + lineNumbers = 'on'; + } else if (lineNumbers === false) { + lineNumbers = 'off'; + } + + if (typeof lineNumbers === 'function') { + renderLineNumbers = true; + renderCustomLineNumbers = lineNumbers; + renderRelativeLineNumbers = false; + } else if (lineNumbers === 'relative') { + renderLineNumbers = true; + renderCustomLineNumbers = null; + renderRelativeLineNumbers = true; + } else if (lineNumbers === 'on') { + renderLineNumbers = true; + renderCustomLineNumbers = null; + renderRelativeLineNumbers = false; + } else { + renderLineNumbers = false; + renderCustomLineNumbers = null; + renderRelativeLineNumbers = false; + } + } + + const fontLigatures = _boolean(opts.fontLigatures, defaults.fontLigatures); + const disableMonospaceOptimizations = _boolean(opts.disableMonospaceOptimizations, defaults.disableMonospaceOptimizations) || fontLigatures; + + let renderWhitespace = opts.renderWhitespace; + { + // Compatibility with old true or false values + if (renderWhitespace === true) { + renderWhitespace = 'boundary'; + } else if (renderWhitespace === false) { + renderWhitespace = 'none'; + } + renderWhitespace = _stringSet<'none' | 'boundary' | 'all'>(opts.renderWhitespace, defaults.renderWhitespace, ['none', 'boundary', 'all']); + } + + let renderLineHighlight = opts.renderLineHighlight; + { + // Compatibility with old true or false values + if (renderLineHighlight === true) { + renderLineHighlight = 'line'; + } else if (renderLineHighlight === false) { + renderLineHighlight = 'none'; + } + renderLineHighlight = _stringSet<'none' | 'gutter' | 'line' | 'all'>(opts.renderLineHighlight, defaults.renderLineHighlight, ['none', 'gutter', 'line', 'all']); + } + + const mouseWheelScrollSensitivity = _float(opts.mouseWheelScrollSensitivity, defaults.scrollbar.mouseWheelScrollSensitivity); + const scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity); + const minimap = this._sanitizeMinimapOpts(opts.minimap, defaults.minimap); + + return { + extraEditorClassName: _string(opts.extraEditorClassName, defaults.extraEditorClassName), + disableMonospaceOptimizations: disableMonospaceOptimizations, + rulers: rulers, + ariaLabel: _string(opts.ariaLabel, defaults.ariaLabel), + renderLineNumbers: renderLineNumbers, + renderCustomLineNumbers: renderCustomLineNumbers, + renderRelativeLineNumbers: renderRelativeLineNumbers, + selectOnLineNumbers: _boolean(opts.selectOnLineNumbers, defaults.selectOnLineNumbers), + glyphMargin: _boolean(opts.glyphMargin, defaults.glyphMargin), + revealHorizontalRightPadding: _clampedInt(opts.revealHorizontalRightPadding, defaults.revealHorizontalRightPadding, 0, 1000), + roundedSelection: _boolean(opts.roundedSelection, defaults.roundedSelection), + overviewRulerLanes: _clampedInt(opts.overviewRulerLanes, defaults.overviewRulerLanes, 0, 3), + overviewRulerBorder: _boolean(opts.overviewRulerBorder, defaults.overviewRulerBorder), + cursorBlinking: _cursorBlinkingStyleFromString(opts.cursorBlinking, defaults.cursorBlinking), + mouseWheelZoom: _boolean(opts.mouseWheelZoom, defaults.mouseWheelZoom), + cursorStyle: _cursorStyleFromString(opts.cursorStyle, defaults.cursorStyle), + hideCursorInOverviewRuler: _boolean(opts.hideCursorInOverviewRuler, defaults.hideCursorInOverviewRuler), + scrollBeyondLastLine: _boolean(opts.scrollBeyondLastLine, defaults.scrollBeyondLastLine), + stopRenderingLineAfter: _clampedInt(opts.stopRenderingLineAfter, defaults.stopRenderingLineAfter, -1, Constants.MAX_SAFE_SMALL_INTEGER), + renderWhitespace: renderWhitespace, + renderControlCharacters: _boolean(opts.renderControlCharacters, defaults.renderControlCharacters), + fontLigatures: fontLigatures, + renderIndentGuides: _boolean(opts.renderIndentGuides, defaults.renderIndentGuides), + renderLineHighlight: renderLineHighlight, + scrollbar: scrollbar, + minimap: minimap, + fixedOverflowWidgets: _boolean(opts.fixedOverflowWidgets, defaults.fixedOverflowWidgets), + }; + } + + private static _sanitizeContribInfo(opts: IEditorOptions, defaults: EditorContribOptions): EditorContribOptions { + let quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean }; + if (typeof opts.quickSuggestions === 'object') { + quickSuggestions = { other: true, ...opts.quickSuggestions }; + } else { + quickSuggestions = _boolean(opts.quickSuggestions, defaults.quickSuggestions); + } + const find = this._santizeFindOpts(opts.find, defaults.find); + return { + selectionClipboard: _boolean(opts.selectionClipboard, defaults.selectionClipboard), + hover: _boolean(opts.hover, defaults.hover), + contextmenu: _boolean(opts.contextmenu, defaults.contextmenu), + quickSuggestions: quickSuggestions, + quickSuggestionsDelay: _clampedInt(opts.quickSuggestionsDelay, defaults.quickSuggestionsDelay, Constants.MIN_SAFE_SMALL_INTEGER, Constants.MAX_SAFE_SMALL_INTEGER), + parameterHints: _boolean(opts.parameterHints, defaults.parameterHints), + iconsInSuggestions: _boolean(opts.iconsInSuggestions, defaults.iconsInSuggestions), + formatOnType: _boolean(opts.formatOnType, defaults.formatOnType), + formatOnPaste: _boolean(opts.formatOnPaste, defaults.formatOnPaste), + suggestOnTriggerCharacters: _boolean(opts.suggestOnTriggerCharacters, defaults.suggestOnTriggerCharacters), + acceptSuggestionOnEnter: _stringSet<'on' | 'smart' | 'off'>(opts.acceptSuggestionOnEnter, defaults.acceptSuggestionOnEnter, ['on', 'smart', 'off']), + acceptSuggestionOnCommitCharacter: _boolean(opts.acceptSuggestionOnCommitCharacter, defaults.acceptSuggestionOnCommitCharacter), + snippetSuggestions: _stringSet<'top' | 'bottom' | 'inline' | 'none'>(opts.snippetSuggestions, defaults.snippetSuggestions, ['top', 'bottom', 'inline', 'none']), + wordBasedSuggestions: _boolean(opts.wordBasedSuggestions, defaults.wordBasedSuggestions), + suggestFontSize: _clampedInt(opts.suggestFontSize, defaults.suggestFontSize, 0, 1000), + suggestLineHeight: _clampedInt(opts.suggestLineHeight, defaults.suggestLineHeight, 0, 1000), + selectionHighlight: _boolean(opts.selectionHighlight, defaults.selectionHighlight), + occurrencesHighlight: _boolean(opts.occurrencesHighlight, defaults.occurrencesHighlight), + codeLens: _boolean(opts.codeLens, defaults.codeLens) && _boolean(opts.referenceInfos, true), + folding: _boolean(opts.folding, defaults.folding), + showFoldingControls: _stringSet<'always' | 'mouseover'>(opts.showFoldingControls, defaults.showFoldingControls, ['always', 'mouseover']), + matchBrackets: _boolean(opts.matchBrackets, defaults.matchBrackets), + find: find + }; + } +} + +/** + * @internal + */ +export class InternalEditorOptionsFactory { + + private static _handlePerformanceCritical(opts: IValidatedEditorOptions, performanceCritical: boolean): IValidatedEditorOptions { + if (!performanceCritical) { + return opts; + } + + return { + inDiffEditor: opts.inDiffEditor, + wordSeparators: opts.wordSeparators, + lineNumbersMinChars: opts.lineNumbersMinChars, + lineDecorationsWidth: opts.lineDecorationsWidth, + readOnly: opts.readOnly, + mouseStyle: opts.mouseStyle, + disableTranslate3d: opts.disableTranslate3d, + automaticLayout: opts.automaticLayout, + wordWrap: opts.wordWrap, + wordWrapColumn: opts.wordWrapColumn, + wordWrapMinified: opts.wordWrapMinified, + wrappingIndent: opts.wrappingIndent, + wordWrapBreakBeforeCharacters: opts.wordWrapBreakBeforeCharacters, + wordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters, + wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters, + autoClosingBrackets: opts.autoClosingBrackets, + dragAndDrop: opts.dragAndDrop, + emptySelectionClipboard: opts.emptySelectionClipboard, + useTabStops: opts.useTabStops, + multicursorModifier: opts.multicursorModifier, + + viewInfo: { + extraEditorClassName: opts.viewInfo.extraEditorClassName, + disableMonospaceOptimizations: opts.viewInfo.disableMonospaceOptimizations, + rulers: opts.viewInfo.rulers, + ariaLabel: opts.viewInfo.ariaLabel, + renderLineNumbers: opts.viewInfo.renderLineNumbers, + renderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers, + renderRelativeLineNumbers: opts.viewInfo.renderRelativeLineNumbers, + selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers, + glyphMargin: opts.viewInfo.glyphMargin, + revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding, + roundedSelection: false, // DISABLED + overviewRulerLanes: opts.viewInfo.overviewRulerLanes, + overviewRulerBorder: opts.viewInfo.overviewRulerBorder, + cursorBlinking: opts.viewInfo.cursorBlinking, + mouseWheelZoom: opts.viewInfo.mouseWheelZoom, + cursorStyle: opts.viewInfo.cursorStyle, + hideCursorInOverviewRuler: opts.viewInfo.hideCursorInOverviewRuler, + scrollBeyondLastLine: opts.viewInfo.scrollBeyondLastLine, + stopRenderingLineAfter: opts.viewInfo.stopRenderingLineAfter, + renderWhitespace: 'none', // DISABLED + renderControlCharacters: false, // DISABLED + fontLigatures: false, // DISABLED + renderIndentGuides: false, // DISABLED + renderLineHighlight: 'none', // DISABLED + scrollbar: opts.viewInfo.scrollbar, + minimap: { + enabled: false, // DISABLED + renderCharacters: opts.viewInfo.minimap.renderCharacters, + maxColumn: opts.viewInfo.minimap.maxColumn + }, + fixedOverflowWidgets: opts.viewInfo.fixedOverflowWidgets + }, + + contribInfo: { + selectionClipboard: opts.contribInfo.selectionClipboard, + hover: opts.contribInfo.hover, + contextmenu: opts.contribInfo.contextmenu, + quickSuggestions: opts.contribInfo.quickSuggestions, + quickSuggestionsDelay: opts.contribInfo.quickSuggestionsDelay, + parameterHints: opts.contribInfo.parameterHints, + iconsInSuggestions: opts.contribInfo.iconsInSuggestions, + formatOnType: opts.contribInfo.formatOnType, + formatOnPaste: opts.contribInfo.formatOnPaste, + suggestOnTriggerCharacters: opts.contribInfo.suggestOnTriggerCharacters, + acceptSuggestionOnEnter: opts.contribInfo.acceptSuggestionOnEnter, + acceptSuggestionOnCommitCharacter: opts.contribInfo.acceptSuggestionOnCommitCharacter, + snippetSuggestions: opts.contribInfo.snippetSuggestions, + wordBasedSuggestions: opts.contribInfo.wordBasedSuggestions, + suggestFontSize: opts.contribInfo.suggestFontSize, + suggestLineHeight: opts.contribInfo.suggestLineHeight, + selectionHighlight: false, // DISABLED + occurrencesHighlight: false, // DISABLED + codeLens: false, // DISABLED + folding: false, // DISABLED + showFoldingControls: opts.contribInfo.showFoldingControls, + matchBrackets: false, // DISABLED + find: opts.contribInfo.find + } + }; + } + + public static createInternalEditorOptions(env: IEnvironmentalOptions, _opts: IValidatedEditorOptions) { + + // Disable some non critical features to get as best performance as possible + // See https://github.com/Microsoft/vscode/issues/26730 + const opts = this._handlePerformanceCritical(_opts, (env.accessibilitySupport === platform.AccessibilitySupport.Enabled)); + + let lineDecorationsWidth: number; + if (typeof opts.lineDecorationsWidth === 'string' && /^\d+(\.\d+)?ch$/.test(opts.lineDecorationsWidth)) { + const multiple = parseFloat(opts.lineDecorationsWidth.substr(0, opts.lineDecorationsWidth.length - 2)); + lineDecorationsWidth = multiple * env.fontInfo.typicalHalfwidthCharacterWidth; + } else { + lineDecorationsWidth = _clampedInt(opts.lineDecorationsWidth, 0, 0, 1000); + } + if (opts.contribInfo.folding) { + lineDecorationsWidth += 16; + } + + const layoutInfo = EditorLayoutProvider.compute({ + outerWidth: env.outerWidth, + outerHeight: env.outerHeight, + showGlyphMargin: opts.viewInfo.glyphMargin, + lineHeight: env.fontInfo.lineHeight, + showLineNumbers: opts.viewInfo.renderLineNumbers, + lineNumbersMinChars: opts.lineNumbersMinChars, + lineNumbersDigitCount: env.lineNumbersDigitCount, + lineDecorationsWidth: lineDecorationsWidth, + typicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth, + maxDigitWidth: env.fontInfo.maxDigitWidth, + verticalScrollbarWidth: opts.viewInfo.scrollbar.verticalScrollbarSize, + horizontalScrollbarHeight: opts.viewInfo.scrollbar.horizontalScrollbarSize, + scrollbarArrowSize: opts.viewInfo.scrollbar.arrowSize, + verticalScrollbarHasArrows: opts.viewInfo.scrollbar.verticalHasArrows, + minimap: opts.viewInfo.minimap.enabled, + minimapRenderCharacters: opts.viewInfo.minimap.renderCharacters, + minimapMaxColumn: opts.viewInfo.minimap.maxColumn, + pixelRatio: env.pixelRatio + }); + + let bareWrappingInfo: { isWordWrapMinified: boolean; isViewportWrapping: boolean; wrappingColumn: number; } = null; + { + const wordWrap = opts.wordWrap; + const wordWrapColumn = opts.wordWrapColumn; + const wordWrapMinified = opts.wordWrapMinified; + + if (wordWrapMinified && env.isDominatedByLongLines) { + // Force viewport width wrapping if model is dominated by long lines + bareWrappingInfo = { + isWordWrapMinified: true, + isViewportWrapping: true, + wrappingColumn: Math.max(1, layoutInfo.viewportColumn) + }; + } else if (wordWrap === 'on') { + bareWrappingInfo = { + isWordWrapMinified: false, + isViewportWrapping: true, + wrappingColumn: Math.max(1, layoutInfo.viewportColumn) + }; + } else if (wordWrap === 'bounded') { + bareWrappingInfo = { + isWordWrapMinified: false, + isViewportWrapping: true, + wrappingColumn: Math.min(Math.max(1, layoutInfo.viewportColumn), wordWrapColumn) + }; + } else if (wordWrap === 'wordWrapColumn') { + bareWrappingInfo = { + isWordWrapMinified: false, + isViewportWrapping: false, + wrappingColumn: wordWrapColumn + }; + } else { + bareWrappingInfo = { + isWordWrapMinified: false, + isViewportWrapping: false, + wrappingColumn: -1 + }; + } + } + + const wrappingInfo: EditorWrappingInfo = { + inDiffEditor: opts.inDiffEditor, + isDominatedByLongLines: env.isDominatedByLongLines, + isWordWrapMinified: bareWrappingInfo.isWordWrapMinified, + isViewportWrapping: bareWrappingInfo.isViewportWrapping, + wrappingColumn: bareWrappingInfo.wrappingColumn, + wrappingIndent: opts.wrappingIndent, + wordWrapBreakBeforeCharacters: opts.wordWrapBreakBeforeCharacters, + wordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters, + wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters, + }; + + let className = 'monaco-editor'; + if (opts.viewInfo.extraEditorClassName) { + className += ' ' + opts.viewInfo.extraEditorClassName; + } + if (env.extraEditorClassName) { + className += ' ' + env.extraEditorClassName; + } + if (opts.viewInfo.fontLigatures) { + className += ' enable-ligatures'; + } + if (opts.mouseStyle === 'default') { + className += ' mouse-default'; + } else if (opts.mouseStyle === 'copy') { + className += ' mouse-copy'; + } + + return new InternalEditorOptions({ + canUseTranslate3d: opts.disableTranslate3d ? false : env.canUseTranslate3d, + pixelRatio: env.pixelRatio, + editorClassName: className, + lineHeight: env.fontInfo.lineHeight, + readOnly: opts.readOnly, + accessibilitySupport: env.accessibilitySupport, + multicursorModifier: opts.multicursorModifier, + wordSeparators: opts.wordSeparators, + autoClosingBrackets: opts.autoClosingBrackets, + useTabStops: opts.useTabStops, + tabFocusMode: opts.readOnly ? true : env.tabFocusMode, + dragAndDrop: opts.dragAndDrop, + emptySelectionClipboard: opts.emptySelectionClipboard && env.emptySelectionClipboard, + layoutInfo: layoutInfo, + fontInfo: env.fontInfo, + viewInfo: opts.viewInfo, + wrappingInfo: wrappingInfo, + contribInfo: opts.contribInfo + }); + } +} + +/** + * @internal + */ +export interface IEditorLayoutProviderOpts { + outerWidth: number; + outerHeight: number; + + showGlyphMargin: boolean; + lineHeight: number; + + showLineNumbers: boolean; + lineNumbersMinChars: number; + lineNumbersDigitCount: number; + + lineDecorationsWidth: number; + + typicalHalfwidthCharacterWidth: number; + maxDigitWidth: number; + + verticalScrollbarWidth: number; + verticalScrollbarHasArrows: boolean; + scrollbarArrowSize: number; + horizontalScrollbarHeight: number; + + minimap: boolean; + minimapRenderCharacters: boolean; + minimapMaxColumn: number; + pixelRatio: number; +} + +/** + * @internal + */ +export class EditorLayoutProvider { + public static compute(_opts: IEditorLayoutProviderOpts): EditorLayoutInfo { + const outerWidth = _opts.outerWidth | 0; + const outerHeight = _opts.outerHeight | 0; + const showGlyphMargin = _opts.showGlyphMargin; + const lineHeight = _opts.lineHeight | 0; + const showLineNumbers = _opts.showLineNumbers; + const lineNumbersMinChars = _opts.lineNumbersMinChars | 0; + const lineNumbersDigitCount = _opts.lineNumbersDigitCount | 0; + const lineDecorationsWidth = _opts.lineDecorationsWidth | 0; + const typicalHalfwidthCharacterWidth = _opts.typicalHalfwidthCharacterWidth; + const maxDigitWidth = _opts.maxDigitWidth; + const verticalScrollbarWidth = _opts.verticalScrollbarWidth | 0; + const verticalScrollbarHasArrows = _opts.verticalScrollbarHasArrows; + const scrollbarArrowSize = _opts.scrollbarArrowSize | 0; + const horizontalScrollbarHeight = _opts.horizontalScrollbarHeight | 0; + const minimap = _opts.minimap; + const minimapRenderCharacters = _opts.minimapRenderCharacters; + const minimapMaxColumn = _opts.minimapMaxColumn | 0; + const pixelRatio = _opts.pixelRatio; + + let lineNumbersWidth = 0; + if (showLineNumbers) { + const digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars); + lineNumbersWidth = Math.round(digitCount * maxDigitWidth); + } + + let glyphMarginWidth = 0; + if (showGlyphMargin) { + glyphMarginWidth = lineHeight; + } + + const glyphMarginLeft = 0; + const lineNumbersLeft = glyphMarginLeft + glyphMarginWidth; + const decorationsLeft = lineNumbersLeft + lineNumbersWidth; + const contentLeft = decorationsLeft + lineDecorationsWidth; + + const remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth; + + let renderMinimap: RenderMinimap; + let minimapWidth: number; + let contentWidth: number; + if (!minimap) { + minimapWidth = 0; + renderMinimap = RenderMinimap.None; + contentWidth = remainingWidth; + } else { + let minimapCharWidth: number; + if (pixelRatio >= 2) { + renderMinimap = minimapRenderCharacters ? RenderMinimap.Large : RenderMinimap.LargeBlocks; + minimapCharWidth = 2 / pixelRatio; + } else { + renderMinimap = minimapRenderCharacters ? RenderMinimap.Small : RenderMinimap.SmallBlocks; + minimapCharWidth = 1 / pixelRatio; + } + + // Given: + // viewportColumn = (contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth + // minimapWidth = viewportColumn * minimapCharWidth + // contentWidth = remainingWidth - minimapWidth + // What are good values for contentWidth and minimapWidth ? + + // minimapWidth = ((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth) * minimapCharWidth + // typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth) * minimapCharWidth + // typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth) * minimapCharWidth + // (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth) * minimapCharWidth + // minimapWidth = ((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth) + + minimapWidth = Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))); + let minimapColumns = minimapWidth / minimapCharWidth; + if (minimapColumns > minimapMaxColumn) { + minimapWidth = Math.floor(minimapMaxColumn * minimapCharWidth); + } + contentWidth = remainingWidth - minimapWidth; + } + + const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth)); + + const verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0); + + return { + width: outerWidth, + height: outerHeight, + + glyphMarginLeft: glyphMarginLeft, + glyphMarginWidth: glyphMarginWidth, + glyphMarginHeight: outerHeight, + + lineNumbersLeft: lineNumbersLeft, + lineNumbersWidth: lineNumbersWidth, + lineNumbersHeight: outerHeight, + + decorationsLeft: decorationsLeft, + decorationsWidth: lineDecorationsWidth, + decorationsHeight: outerHeight, + + contentLeft: contentLeft, + contentWidth: contentWidth, + contentHeight: outerHeight, + + renderMinimap: renderMinimap, + minimapWidth: minimapWidth, + + viewportColumn: viewportColumn, + + verticalScrollbarWidth: verticalScrollbarWidth, + horizontalScrollbarHeight: horizontalScrollbarHeight, + + overviewRuler: { + top: verticalArrowSize, + width: verticalScrollbarWidth, + height: (outerHeight - 2 * verticalArrowSize), + right: 0 + } + }; + } +} + +const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace'; +const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace'; +const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'Courier New\', monospace, \'Droid Sans Fallback\''; + +/** + * @internal + */ +export const EDITOR_FONT_DEFAULTS = { + fontFamily: ( + platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY) + ), + fontWeight: 'normal', + fontSize: ( + platform.isMacintosh ? 12 : 14 + ), + lineHeight: 0, + letterSpacing: 0, +}; + +/** + * @internal + */ +export const EDITOR_MODEL_DEFAULTS = { + tabSize: 4, + insertSpaces: true, + detectIndentation: true, + trimAutoWhitespace: true +}; + +/** + * @internal + */ +export const EDITOR_DEFAULTS: IValidatedEditorOptions = { + inDiffEditor: false, + wordSeparators: USUAL_WORD_SEPARATORS, + lineNumbersMinChars: 5, + lineDecorationsWidth: 10, + readOnly: false, + mouseStyle: 'text', + disableTranslate3d: false, + automaticLayout: false, + wordWrap: 'off', + wordWrapColumn: 80, + wordWrapMinified: true, + wrappingIndent: WrappingIndent.Same, + wordWrapBreakBeforeCharacters: '([{‘“〈《「『ã€ã€”([{「£¥$£¥++', + wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃ã€ã€‚。、¢,.:;?ï¼ï¼…・・ã‚ゞヽヾーァィゥェォッャュョヮヵヶããƒã…ã‡ã‰ã£ã‚ƒã‚…ょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’â€ã€‰ã€‹ã€ã€ã€‘〕)]ï½ï½£', + wordWrapBreakObtrusiveCharacters: '.', + autoClosingBrackets: true, + dragAndDrop: true, + emptySelectionClipboard: true, + useTabStops: true, + multicursorModifier: 'altKey', + + viewInfo: { + extraEditorClassName: '', + disableMonospaceOptimizations: false, + rulers: [], + ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"), + renderLineNumbers: true, + renderCustomLineNumbers: null, + renderRelativeLineNumbers: false, + selectOnLineNumbers: true, + glyphMargin: true, + revealHorizontalRightPadding: 30, + roundedSelection: true, + overviewRulerLanes: 2, + overviewRulerBorder: true, + cursorBlinking: TextEditorCursorBlinkingStyle.Blink, + mouseWheelZoom: false, + cursorStyle: TextEditorCursorStyle.Line, + hideCursorInOverviewRuler: false, + scrollBeyondLastLine: true, + stopRenderingLineAfter: 10000, + renderWhitespace: 'none', + renderControlCharacters: false, + fontLigatures: false, + renderIndentGuides: true, + renderLineHighlight: 'line', + scrollbar: { + vertical: ScrollbarVisibility.Auto, + horizontal: ScrollbarVisibility.Auto, + arrowSize: 11, + useShadows: true, + verticalHasArrows: false, + horizontalHasArrows: false, + horizontalScrollbarSize: 10, + horizontalSliderSize: 10, + verticalScrollbarSize: 14, + verticalSliderSize: 14, + handleMouseWheel: true, + mouseWheelScrollSensitivity: 1, + }, + minimap: { + enabled: true, + renderCharacters: true, + maxColumn: 120 + }, + fixedOverflowWidgets: false, + }, + + contribInfo: { + selectionClipboard: true, + hover: true, + contextmenu: true, + quickSuggestions: { other: true, comments: false, strings: false }, + quickSuggestionsDelay: 10, + parameterHints: true, + iconsInSuggestions: true, + formatOnType: false, + formatOnPaste: true, + suggestOnTriggerCharacters: true, + acceptSuggestionOnEnter: 'on', + acceptSuggestionOnCommitCharacter: true, + snippetSuggestions: 'inline', + wordBasedSuggestions: true, + suggestFontSize: 0, + suggestLineHeight: 0, + selectionHighlight: true, + occurrencesHighlight: true, + codeLens: true, + folding: true, + showFoldingControls: 'mouseover', + matchBrackets: true, + find: { + seedSearchStringFromSelection: true, + autoFindInSelection: false + } + }, +}; diff --git a/src/vs/editor/common/config/fontInfo.ts b/src/vs/editor/common/config/fontInfo.ts index 1c291d02cf6..9ab9a11d2a9 100644 --- a/src/vs/editor/common/config/fontInfo.ts +++ b/src/vs/editor/common/config/fontInfo.ts @@ -4,8 +4,15 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { DefaultConfig, GOLDEN_LINE_HEIGHT_RATIO } from 'vs/editor/common/config/defaultConfig'; +import * as platform from 'vs/base/common/platform'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; + +/** + * Determined from empirical observations. + * @internal + */ +const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35; function safeParseFloat(n: number | string, defaultValue: number): number { if (typeof n === 'number') { @@ -39,6 +46,13 @@ function clamp(n: number, min: number, max: number): number { return n; } +function _string(value: any, defaultValue: string): string { + if (typeof value !== 'string') { + return defaultValue; + } + return value; +} + export class BareFontInfo { readonly _bareFontInfoBrand: void; @@ -50,23 +64,31 @@ export class BareFontInfo { fontWeight?: string; fontSize?: number | string; lineHeight?: number | string; + letterSpacing?: number | string; }, zoomLevel: number): BareFontInfo { - let fontFamily = String(opts.fontFamily) || DefaultConfig.editor.fontFamily; - let fontWeight = String(opts.fontWeight) || DefaultConfig.editor.fontWeight; + let fontFamily = _string(opts.fontFamily, EDITOR_FONT_DEFAULTS.fontFamily); + let fontWeight = _string(opts.fontWeight, EDITOR_FONT_DEFAULTS.fontWeight); - let fontSize = safeParseFloat(opts.fontSize, DefaultConfig.editor.fontSize); + let fontSize = safeParseFloat(opts.fontSize, EDITOR_FONT_DEFAULTS.fontSize); fontSize = clamp(fontSize, 0, 100); if (fontSize === 0) { - fontSize = DefaultConfig.editor.fontSize; + fontSize = EDITOR_FONT_DEFAULTS.fontSize; + } else if (fontSize < 8) { + fontSize = 8; } let lineHeight = safeParseInt(opts.lineHeight, 0); lineHeight = clamp(lineHeight, 0, 150); if (lineHeight === 0) { lineHeight = Math.round(GOLDEN_LINE_HEIGHT_RATIO * fontSize); + } else if (lineHeight < 8) { + lineHeight = 8; } + let letterSpacing = safeParseFloat(opts.letterSpacing, 0);; + letterSpacing = clamp(letterSpacing, -20, 20); + let editorZoomLevelMultiplier = 1 + (EditorZoom.getZoomLevel() * 0.1); fontSize *= editorZoomLevelMultiplier; lineHeight *= editorZoomLevelMultiplier; @@ -76,7 +98,8 @@ export class BareFontInfo { fontFamily: fontFamily, fontWeight: fontWeight, fontSize: fontSize, - lineHeight: lineHeight + lineHeight: lineHeight, + letterSpacing: letterSpacing }); } @@ -85,6 +108,7 @@ export class BareFontInfo { readonly fontWeight: string; readonly fontSize: number; readonly lineHeight: number; + readonly letterSpacing: number; /** * @internal @@ -95,19 +119,21 @@ export class BareFontInfo { fontWeight: string; fontSize: number; lineHeight: number; + letterSpacing: number; }) { this.zoomLevel = opts.zoomLevel; this.fontFamily = String(opts.fontFamily); this.fontWeight = String(opts.fontWeight); this.fontSize = opts.fontSize; this.lineHeight = opts.lineHeight | 0; + this.letterSpacing = opts.letterSpacing; } /** * @internal */ public getId(): string { - return this.zoomLevel + '-' + this.fontFamily + '-' + this.fontWeight + '-' + this.fontSize + '-' + this.lineHeight; + return this.zoomLevel + '-' + this.fontFamily + '-' + this.fontWeight + '-' + this.fontSize + '-' + this.lineHeight + '-' + this.letterSpacing; } } @@ -130,6 +156,7 @@ export class FontInfo extends BareFontInfo { fontWeight: string; fontSize: number; lineHeight: number; + letterSpacing: number; isMonospace: boolean; typicalHalfwidthCharacterWidth: number; typicalFullwidthCharacterWidth: number; @@ -154,17 +181,11 @@ export class FontInfo extends BareFontInfo { && this.fontWeight === other.fontWeight && this.fontSize === other.fontSize && this.lineHeight === other.lineHeight + && this.letterSpacing === other.letterSpacing && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth && this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth && this.spaceWidth === other.spaceWidth && this.maxDigitWidth === other.maxDigitWidth ); } - - /** - * @internal - */ - public clone(): FontInfo { - return new FontInfo(this, this.isTrusted); - } -} \ No newline at end of file +} diff --git a/src/vs/editor/common/controller/accGenerator.ts b/src/vs/editor/common/controller/accGenerator.ts new file mode 100644 index 00000000000..ca556f79d2d --- /dev/null +++ b/src/vs/editor/common/controller/accGenerator.ts @@ -0,0 +1,194 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { Position } from 'vs/editor/common/core/position'; +import * as nls from 'vs/nls'; +import { Range } from 'vs/editor/common/core/range'; +import { IModel } from 'vs/editor/common/editorCommon'; +import { Selection } from 'vs/editor/common/core/selection'; + +export class ScreenReaderMessageGenerator { + + public static xSelected(x: string): string { + return nls.localize( + { + key: 'x.selected', + comment: ['A piece of text was added to the selection (this should be a message suitable for a Screen Reader).'] + }, + "{0}\nSelected", + x + ); + } + + public static xUnselected(x: string): string { + return nls.localize( + { + key: 'x.unselected', + comment: ['A piece of text was removed from the selection (this should be a message suitable for a Screen Reader).'] + }, + "{0}\nUnselected", + x + ); + } + + public static xCharsSelected(x: number): string { + return nls.localize( + { + key: 'x.chars.selected', + comment: ['A large number of characters were added to the selection (this should be a message suitable for a Screen Reader).'] + }, + "{0}\nCharacters selected", + x + ); + } + + public static xCharsUnselected(x: number): string { + return nls.localize( + { + key: 'x.chars.unselected', + comment: ['A large number of characters were removed from the selection (this should be a message suitable for a Screen Reader).'] + }, + "{0}\nCharacters unselected", + x + ); + } + + public static generateMessage(source: string, model: IModel, oldModelId: number, oldSelection: Selection, newModelId: number, newSelection: Selection): string { + if (oldModelId === newModelId) { + return this._cursorChangeMessage(source, model, oldSelection, newSelection); + } + return 'TODO'; + } + + private static _cursorChangeMessage(source: string, model: IModel, oldSelection: Selection, newSelection: Selection): string { + if (oldSelection.equalsRange(newSelection)) { + return ''; + } + + if (oldSelection.isEmpty()) { + + if (newSelection.isEmpty()) { + // ...[]... => ...[]... + return this._cursorMoveMessage(source, model, oldSelection.getPosition(), newSelection.getPosition()); + } + + // ...[]... => ...[x]...: + return this._cursorSelectedMessage(model, newSelection); + } + + if (newSelection.isEmpty()) { + if (oldSelection.containsPosition(newSelection.getPosition())) { + // ...a[xy]b... => ...a[]xyb... or ...ax[]yb... or ...axy[]b... + return this._cursorUnselectedMessage(model, oldSelection); + } + + // moved away from the old selection and collapsed it + return this._cursorMoveMessage(source, model, oldSelection.getPosition(), newSelection.getPosition()) + '\n' + this._cursorUnselectedMessage(model, oldSelection); + } + + // ...[x]... => ...[y]... + + if (newSelection.getStartPosition().equals(oldSelection.getStartPosition())) { + + // ...a[x]... => ...a[y]... + + if (newSelection.getEndPosition().isBefore(oldSelection.getEndPosition())) { + // ...a[xy]... => ...a[x]y... + return this._cursorUnselectedMessage(model, new Range(newSelection.endLineNumber, newSelection.endColumn, oldSelection.endLineNumber, oldSelection.endColumn)); + + } + + // ...a[x]y... => ...a[xy]... + return this._cursorSelectedMessage(model, new Range(oldSelection.endLineNumber, oldSelection.endColumn, newSelection.endLineNumber, newSelection.endColumn)); + + } + + if (newSelection.getEndPosition().equals(oldSelection.getEndPosition())) { + + // ...[x]a... => ...[y]a... + + if (newSelection.getStartPosition().isBefore(oldSelection.getStartPosition())) { + // ...y[x]a... => ...[yx]a... + return this._cursorSelectedMessage(model, new Range(newSelection.startLineNumber, newSelection.startColumn, oldSelection.startLineNumber, oldSelection.startColumn)); + } + + // ...[yx]a... => ...y[x]a... + return this._cursorUnselectedMessage(model, new Range(oldSelection.startLineNumber, oldSelection.startColumn, newSelection.startLineNumber, newSelection.startColumn)); + + } + + // weird jump + return this._cursorSelectedMessage(model, newSelection) + '\n' + this._cursorUnselectedMessage(model, oldSelection); + + } + + private static _cursorMoveMessage(source: string, model: IModel, oldPosition: Position, newPosition: Position): string { + + if (source === 'moveWordCommand') { + return model.getValueInRange(new Range(oldPosition.lineNumber, oldPosition.column, newPosition.lineNumber, newPosition.column)); + } + + const oldLineNumber = oldPosition.lineNumber; + const oldColumn = oldPosition.column; + const newLineNumber = newPosition.lineNumber; + const newColumn = newPosition.column; + + // check going down via right arrow + if (newLineNumber === oldLineNumber + 1 && newColumn === 1 && oldColumn === model.getLineMaxColumn(oldLineNumber)) { + return this._cursorCharMessage(model, newPosition); + } + + // check going up via up arrow + if (newLineNumber === oldLineNumber - 1 && newColumn === model.getLineMaxColumn(newLineNumber) && oldColumn === 1) { + return this._cursorCharMessage(model, newPosition); + } + + const lineCount = model.getLineCount(); + if (oldLineNumber !== newLineNumber) { + if (newLineNumber === lineCount) { + // Last line does not have an EOL + return model.getLineContent(newLineNumber); + } + return model.getLineContent(newLineNumber) + model.getEOL(); + } + + return this._cursorCharMessage(model, newPosition); + } + + private static _cursorCharMessage(model: IModel, position: Position): string { + const lineNumber = position.lineNumber; + const column = position.column; + + const maxLineColumn = model.getLineMaxColumn(lineNumber); + if (column === maxLineColumn) { + const lineCount = model.getLineCount(); + if (lineNumber === lineCount) { + // At the end of the file + return ''; + } + return model.getEOL(); + } + return model.getLineContent(lineNumber).charAt(column - 1); + } + + private static _cursorSelectedMessage(model: IModel, range: Range): string { + const valueLength = model.getValueLengthInRange(range); + if (valueLength > 512) { + return this.xCharsSelected(valueLength); + } + return this.xSelected(model.getValueInRange(range)); + } + + private static _cursorUnselectedMessage(model: IModel, range: Range): string { + const valueLength = model.getValueLengthInRange(range); + if (valueLength > 512) { + return this.xCharsUnselected(valueLength); + } + return this.xUnselected(model.getValueInRange(range)); + } + +} diff --git a/src/vs/editor/common/controller/coreCommands.ts b/src/vs/editor/common/controller/coreCommands.ts index 004c19921ec..3794e7ace13 100644 --- a/src/vs/editor/common/controller/coreCommands.ts +++ b/src/vs/editor/common/controller/coreCommands.ts @@ -9,11 +9,10 @@ import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { CursorState, ICursors, RevealTarget, IColumnSelectData, CursorContext } from 'vs/editor/common/controller/cursorCommon'; -import { CursorChangeReason, VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; +import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; import { CursorMoveCommands, CursorMove as CursorMove_ } from 'vs/editor/common/controller/cursorMoveCommands'; -import { EditorCommand, ICommandOptions, Command } from 'vs/editor/common/config/config'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { registerEditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorCommand, ICommandOptions, EditorCommand, Command } from 'vs/editor/common/editorCommonExtensions'; import { IColumnSelectResult, ColumnSelection } from 'vs/editor/common/controller/cursorColumnSelection'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; @@ -24,6 +23,9 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import * as types from 'vs/base/common/types'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { IEditorService } from 'vs/platform/editor/common/editor'; +import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; +import { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations'; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; const CORE_WEIGHT = KeybindingsRegistry.WEIGHT.editorCore(); @@ -37,7 +39,7 @@ export abstract class CoreEditorCommand extends EditorCommand { export namespace EditorScroll_ { - const isEditorScrollArgs = function (arg): boolean { + const isEditorScrollArgs = function (arg: any): boolean { if (!types.isObject(arg)) { return false; } @@ -181,7 +183,7 @@ export namespace EditorScroll_ { export namespace RevealLine_ { - const isRevealLineArgs = function (arg): boolean { + const isRevealLineArgs = function (arg: any): boolean { if (!types.isObject(arg)) { return false; } @@ -234,7 +236,7 @@ export namespace RevealLine_ { }; } -export namespace CoreCommands { +export namespace CoreNavigationCommands { class BaseMoveToCommand extends CoreEditorCommand { @@ -710,14 +712,45 @@ export namespace CoreCommands { newState = CursorMoveCommands.moveTo(context, cursors.getPrimaryCursor(), false, args.position, args.viewPosition); } - let newStates = cursors.getAll().slice(0); - newStates.push(newState); + const states = cursors.getAll(); + + // Check if we should remove a cursor (sort of like a toggle) + if (states.length > 1) { + const newModelPosition = (newState.modelState ? newState.modelState.position : null); + const newViewPosition = (newState.viewState ? newState.viewState.position : null); + + for (let i = 0, len = states.length; i < len; i++) { + const state = states[i]; + + if (newModelPosition && !state.modelState.selection.containsPosition(newModelPosition)) { + continue; + } + + if (newViewPosition && !state.viewState.selection.containsPosition(newViewPosition)) { + continue; + } + + // => Remove the cursor + states.splice(i, 1); + + cursors.context.model.pushStackElement(); + cursors.setStates( + args.source, + CursorChangeReason.Explicit, + states + ); + return; + } + } + + // => Add the new cursor + states.push(newState); cursors.context.model.pushStackElement(); cursors.setStates( args.source, CursorChangeReason.Explicit, - newStates + states ); } }); @@ -782,7 +815,7 @@ export namespace CoreCommands { weight: CORE_WEIGHT, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.Home, - mac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow, KeyMod.WinCtrl | KeyCode.KEY_A] } + mac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow] } } })); @@ -798,6 +831,44 @@ export namespace CoreCommands { } })); + export const CursorLineStart: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: 'cursorLineStart', + precondition: null, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: 0, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_A } + } + }); + } + + public runCoreEditorCommand(cursors: ICursors, args: any): void { + cursors.context.model.pushStackElement(); + cursors.setStates( + args.source, + CursorChangeReason.Explicit, + CursorState.ensureInEditableRange( + cursors.context, + this._exec(cursors.context, cursors.getAll()) + ) + ); + cursors.reveal(true, RevealTarget.Primary); + } + + private _exec(context: CursorContext, cursors: CursorState[]): CursorState[] { + let result: CursorState[] = []; + for (let i = 0, len = cursors.length; i < len; i++) { + const cursor = cursors[i]; + const lineNumber = cursor.modelState.position.lineNumber; + result[i] = CursorState.fromModelState(cursor.modelState.move(false, lineNumber, 1, 0)); + } + return result; + } + }); + class EndCommand extends CoreEditorCommand { private readonly _inSelectionMode: boolean; @@ -829,7 +900,7 @@ export namespace CoreCommands { weight: CORE_WEIGHT, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.End, - mac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow, KeyMod.WinCtrl | KeyCode.KEY_E] } + mac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow] } } })); @@ -845,6 +916,45 @@ export namespace CoreCommands { } })); + export const CursorLineEnd: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: 'cursorLineEnd', + precondition: null, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: 0, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_E } + } + }); + } + + public runCoreEditorCommand(cursors: ICursors, args: any): void { + cursors.context.model.pushStackElement(); + cursors.setStates( + args.source, + CursorChangeReason.Explicit, + CursorState.ensureInEditableRange( + cursors.context, + this._exec(cursors.context, cursors.getAll()) + ) + ); + cursors.reveal(true, RevealTarget.Primary); + } + + private _exec(context: CursorContext, cursors: CursorState[]): CursorState[] { + let result: CursorState[] = []; + for (let i = 0, len = cursors.length; i < len; i++) { + const cursor = cursors[i]; + const lineNumber = cursor.modelState.position.lineNumber; + const maxColumn = context.model.getLineMaxColumn(lineNumber); + result[i] = CursorState.fromModelState(cursor.modelState.move(false, lineNumber, maxColumn, 0)); + } + return result; + } + }); + class TopCommand extends CoreEditorCommand { private readonly _inSelectionMode: boolean; @@ -1372,7 +1482,9 @@ export namespace CoreCommands { } } - cursors.revealRange(false, range, null, revealAt); + const viewRange = cursors.context.convertModelRangeToViewRange(range); + + cursors.revealRange(false, viewRange, revealAt); } }); @@ -1395,7 +1507,124 @@ export namespace CoreCommands { ); } }); -}; +} + +export namespace CoreEditingCommands { + + export const LineBreakInsert: EditorCommand = registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: 'lineBreakInsert', + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: null, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_O } + } + }); + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.lineBreakInsert(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + } + }); + + export const Outdent: EditorCommand = registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: 'outdent', + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: ContextKeyExpr.and( + EditorContextKeys.textFocus, + EditorContextKeys.tabDoesNotMoveFocus + ), + primary: KeyMod.Shift | KeyCode.Tab + } + }); + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.outdent(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + editor.pushUndoStop(); + } + }); + + export const Tab: EditorCommand = registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: 'tab', + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: ContextKeyExpr.and( + EditorContextKeys.textFocus, + EditorContextKeys.tabDoesNotMoveFocus + ), + primary: KeyCode.Tab + } + }); + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.tab(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + editor.pushUndoStop(); + } + }); + + export const DeleteLeft: EditorCommand = registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: 'deleteLeft', + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: KeyCode.Backspace, + secondary: [KeyMod.Shift | KeyCode.Backspace], + mac: { primary: KeyCode.Backspace, secondary: [KeyMod.Shift | KeyCode.Backspace, KeyMod.WinCtrl | KeyCode.KEY_H, KeyMod.WinCtrl | KeyCode.Backspace] } + } + }); + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + const [shouldPushStackElementBefore, commands] = DeleteOperations.deleteLeft(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections()); + if (shouldPushStackElementBefore) { + editor.pushUndoStop(); + } + editor.executeCommands(this.id, commands); + } + }); + + export const DeleteRight: EditorCommand = registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: 'deleteRight', + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: KeyCode.Delete, + mac: { primary: KeyCode.Delete, secondary: [KeyMod.WinCtrl | KeyCode.KEY_D, KeyMod.WinCtrl | KeyCode.Delete] } + } + }); + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + const [shouldPushStackElementBefore, commands] = DeleteOperations.deleteRight(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections()); + if (shouldPushStackElementBefore) { + editor.pushUndoStop(); + } + editor.executeCommands(this.id, commands); + } + }); + +} namespace Config { @@ -1403,95 +1632,23 @@ namespace Config { return accessor.get(ICodeEditorService).getFocusedCodeEditor(); } - function getActiveEditorWidget(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { + function getWorkbenchActiveEditor(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { const editorService = accessor.get(IEditorService); let activeEditor = (editorService).getActiveEditor && (editorService).getActiveEditor(); return getCodeEditor(activeEditor); } - function withCodeEditorFromCommandHandler(accessor: ServicesAccessor, callback: (editor: editorCommon.ICommonCodeEditor) => void): void { - let editor = findFocusedEditor(accessor); - if (editor) { - callback(editor); - } - } - - function triggerEditorHandler(handlerId: string, accessor: ServicesAccessor, args: any): void { - withCodeEditorFromCommandHandler(accessor, (editor) => { - editor.trigger('keyboard', handlerId, args); - }); - } - - class CoreCommand extends Command { - public runCommand(accessor: ServicesAccessor, args: any): void { - triggerEditorHandler(this.id, accessor, args); - } - } - function registerCommand(command: Command) { KeybindingsRegistry.registerCommandAndKeybindingRule(command.toCommandAndKeybindingRule(CORE_WEIGHT)); } - registerCommand(new CoreCommand({ - id: H.Tab, - precondition: EditorContextKeys.writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: ContextKeyExpr.and( - EditorContextKeys.textFocus, - EditorContextKeys.tabDoesNotMoveFocus - ), - primary: KeyCode.Tab - } - })); - registerCommand(new CoreCommand({ - id: H.Outdent, - precondition: EditorContextKeys.writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: ContextKeyExpr.and( - EditorContextKeys.textFocus, - EditorContextKeys.tabDoesNotMoveFocus - ), - primary: KeyMod.Shift | KeyCode.Tab - } - })); - - registerCommand(new CoreCommand({ - id: H.DeleteLeft, - precondition: EditorContextKeys.writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: EditorContextKeys.textFocus, - primary: KeyCode.Backspace, - secondary: [KeyMod.Shift | KeyCode.Backspace], - mac: { primary: KeyCode.Backspace, secondary: [KeyMod.Shift | KeyCode.Backspace, KeyMod.WinCtrl | KeyCode.KEY_H, KeyMod.WinCtrl | KeyCode.Backspace] } - } - })); - registerCommand(new CoreCommand({ - id: H.DeleteRight, - precondition: EditorContextKeys.writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: EditorContextKeys.textFocus, - primary: KeyCode.Delete, - mac: { primary: KeyCode.Delete, secondary: [KeyMod.WinCtrl | KeyCode.KEY_D, KeyMod.WinCtrl | KeyCode.Delete] } - } - })); - - registerCommand(new CoreCommand({ - id: H.LineBreakInsert, - precondition: EditorContextKeys.writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: EditorContextKeys.textFocus, - primary: null, - mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_O } - } - })); - - - class BaseTextInputAwareCommand extends Command { + /** + * A command that will: + * 1. invoke a command on the focused editor. + * 2. otherwise, invoke a browser built-in command on the `activeElement`. + * 3. otherwise, invoke a command on the workbench active editor. + */ + class EditorOrNativeTextInputCommand extends Command { private readonly _editorHandler: string | EditorCommand; private readonly _inputHandler: string; @@ -1518,7 +1675,7 @@ namespace Config { } // Redirecting to last active editor - let activeEditor = getActiveEditorWidget(accessor); + let activeEditor = getWorkbenchActiveEditor(accessor); if (activeEditor) { activeEditor.focus(); return this._runEditorHandler(activeEditor, args); @@ -1537,8 +1694,8 @@ namespace Config { } } - registerCommand(new BaseTextInputAwareCommand({ - editorHandler: CoreCommands.SelectAll, + registerCommand(new EditorOrNativeTextInputCommand({ + editorHandler: CoreNavigationCommands.SelectAll, inputHandler: 'selectAll', id: 'editor.action.selectAll', precondition: null, @@ -1549,7 +1706,7 @@ namespace Config { } })); - registerCommand(new BaseTextInputAwareCommand({ + registerCommand(new EditorOrNativeTextInputCommand({ editorHandler: H.Undo, inputHandler: 'undo', id: H.Undo, @@ -1561,7 +1718,7 @@ namespace Config { } })); - registerCommand(new BaseTextInputAwareCommand({ + registerCommand(new EditorOrNativeTextInputCommand({ editorHandler: H.Redo, inputHandler: 'redo', id: H.Redo, @@ -1575,4 +1732,41 @@ namespace Config { } })); + /** + * A command that will invoke a command on the focused editor. + */ + class EditorHandlerCommand extends Command { + + private readonly _handlerId: string; + + constructor(id: string, handlerId: string) { + super({ + id: id, + precondition: null + }); + this._handlerId = handlerId; + } + + public runCommand(accessor: ServicesAccessor, args: any): void { + const editor = findFocusedEditor(accessor); + if (!editor) { + return; + } + + editor.trigger('keyboard', this._handlerId, args); + } + } + + function registerOverwritableCommand(handlerId: string): void { + registerCommand(new EditorHandlerCommand('default:' + handlerId, handlerId)); + registerCommand(new EditorHandlerCommand(handlerId, handlerId)); + } + + registerOverwritableCommand(H.Type); + registerOverwritableCommand(H.ReplacePreviousChar); + registerOverwritableCommand(H.CompositionStart); + registerOverwritableCommand(H.CompositionEnd); + registerOverwritableCommand(H.Paste); + registerOverwritableCommand(H.Cut); + } diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index b8a95cf04ae..0c203347cce 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -7,115 +7,113 @@ import * as nls from 'vs/nls'; import * as strings from 'vs/base/common/strings'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { EventEmitter, BulkListenerCallback } from 'vs/base/common/eventEmitter'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { CursorCollection } from 'vs/editor/common/controller/cursorCollection'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection, SelectionDirection, ISelection } from 'vs/editor/common/core/selection'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CursorColumns, CursorConfiguration, EditOperationResult, SingleCursorState, IViewModelHelper, CursorContext, CursorState, RevealTarget, IColumnSelectData, ICursors } from 'vs/editor/common/controller/cursorCommon'; +import { CursorColumns, CursorConfiguration, EditOperationResult, CursorContext, CursorState, RevealTarget, IColumnSelectData, ICursors } from 'vs/editor/common/controller/cursorCommon'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations'; import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; import { TextModelEventType, ModelRawContentChangedEvent, RawContentChangedType } from 'vs/editor/common/model/textModelEvents'; -import { CursorEventType, CursorChangeReason, ICursorPositionChangedEvent, VerticalRevealType, ICursorSelectionChangedEvent, ICursorRevealRangeEvent, CursorScrollRequest } from 'vs/editor/common/controller/cursorEvents'; -import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import { CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; +import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; +import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; +import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import Event, { Emitter } from 'vs/base/common/event'; +// import { ScreenReaderMessageGenerator } from "vs/editor/common/controller/accGenerator"; -interface IMultipleCursorOperationContext { - cursorPositionChangeReason: CursorChangeReason; - shouldReveal: boolean; - shouldPushStackElementBefore: boolean; - shouldPushStackElementAfter: boolean; - eventSource: string; - eventData: any; - executeCommands: editorCommon.ICommand[]; - isAutoWhitespaceCommand: boolean[]; -} - -interface IExecContext { - selectionStartMarkers: string[]; - positionMarkers: string[]; -} - -interface ICommandData { - operations: editorCommon.IIdentifiedSingleEditOperation[]; - hadTrackedRange: boolean; - hadTrackedEditOperation: boolean; -} - -interface ICommandsData { - operations: editorCommon.IIdentifiedSingleEditOperation[]; - hadTrackedRanges: boolean[]; - anyoneHadTrackedRange: boolean; - anyoneHadTrackedEditOperation: boolean; -} - -export class Cursor extends Disposable implements ICursors { - - public onDidChangePosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable { - return this._eventEmitter.addListener(CursorEventType.CursorPositionChanged, listener); +function containsLineMappingChanged(events: viewEvents.ViewEvent[]): boolean { + for (let i = 0, len = events.length; i < len; i++) { + if (events[i].type === viewEvents.ViewEventType.ViewLineMappingChanged) { + return true; + } } - public onDidChangeSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable { - return this._eventEmitter.addListener(CursorEventType.CursorSelectionChanged, listener); + return false; +} + +export class CursorStateChangedEvent { + /** + * The new selections. + * The primary selection is always at index 0. + */ + readonly selections: Selection[]; + /** + * Source of the call that caused the event. + */ + readonly source: string; + /** + * Reason. + */ + readonly reason: CursorChangeReason; + + constructor(selections: Selection[], source: string, reason: CursorChangeReason) { + this.selections = selections; + this.source = source; + this.reason = reason; + } +} + +/** + * A snapshot of the cursor and the model state + */ +export class CursorModelState { + + public readonly modelVersionId: number; + public readonly cursorState: CursorState[]; + + constructor(model: editorCommon.IModel, cursor: Cursor) { + this.modelVersionId = model.getVersionId(); + this.cursorState = cursor.getAll(); } - private configuration: editorCommon.IConfiguration; + public equals(other: CursorModelState): boolean { + if (!other) { + return false; + } + if (this.modelVersionId !== other.modelVersionId) { + return false; + } + if (this.cursorState.length !== other.cursorState.length) { + return false; + } + for (let i = 0, len = this.cursorState.length; i < len; i++) { + if (!this.cursorState[i].equals(other.cursorState[i])) { + return false; + } + } + return true; + } +} + +export class Cursor extends viewEvents.ViewEventEmitter implements ICursors { + + private readonly _onDidChange: Emitter = this._register(new Emitter()); + public readonly onDidChange: Event = this._onDidChange.event; + + private readonly _configuration: editorCommon.IConfiguration; + private readonly _model: editorCommon.IModel; + private readonly _viewModel: IViewModel; public context: CursorContext; - private model: editorCommon.IModel; - private _eventEmitter: EventEmitter; - - public addBulkListener(listener: BulkListenerCallback): IDisposable { - return this._eventEmitter.addBulkListener(listener); - } - - private cursors: CursorCollection; - private viewModelHelper: IViewModelHelper; + private _cursors: CursorCollection; private _isHandling: boolean; private _isDoingComposition: boolean; private _columnSelectData: IColumnSelectData; - private enableEmptySelectionClipboard: boolean; - - private _handlers: { - [key: string]: (ctx: IMultipleCursorOperationContext) => void; - }; - - constructor(configuration: editorCommon.IConfiguration, model: editorCommon.IModel, viewModelHelper: IViewModelHelper, enableEmptySelectionClipboard: boolean) { + constructor(configuration: editorCommon.IConfiguration, model: editorCommon.IModel, viewModel: IViewModel) { super(); - this._eventEmitter = this._register(new EventEmitter()); - this.configuration = configuration; - this.model = model; - this.viewModelHelper = viewModelHelper; - this.enableEmptySelectionClipboard = enableEmptySelectionClipboard; - - const createCursorContext = () => { - const config = new CursorConfiguration( - this.model.getLanguageIdentifier(), - this.model.getOneIndent(), - this.model.getOptions(), - this.configuration - ); - this.context = new CursorContext( - this.model, - this.viewModelHelper, - config - ); - if (this.cursors) { - this.cursors.updateContext(this.context); - } - }; - createCursorContext(); - - this.cursors = new CursorCollection(this.context); + this._configuration = configuration; + this._model = model; + this._viewModel = viewModel; + this.context = new CursorContext(this._configuration, this._model, this._viewModel); + this._cursors = new CursorCollection(this.context); this._isHandling = false; this._isDoingComposition = false; this._columnSelectData = null; - this._register(this.model.addBulkListener((events) => { + this._register(this._model.addBulkListener((events) => { if (this._isHandling) { return; } @@ -128,14 +126,8 @@ export class Cursor extends Disposable implements ICursors { if (eventType === TextModelEventType.ModelRawContentChanged2) { hadContentChange = true; - const changeEvent = event.data; - - for (let j = 0, lenJ = changeEvent.changes.length; j < lenJ; j++) { - const change = changeEvent.changes[j]; - if (change.changeType === RawContentChangedType.Flush) { - hadFlushEvent = true; - } - } + const rawChangeEvent = event.data; + hadFlushEvent = hadFlushEvent || rawChangeEvent.containsEvent(RawContentChangedType.Flush); } } @@ -146,82 +138,63 @@ export class Cursor extends Disposable implements ICursors { this._onModelContentChanged(hadFlushEvent); })); - this._register(this.model.onDidChangeLanguage((e) => { - createCursorContext(); + this._register(viewModel.addEventListener((events: viewEvents.ViewEvent[]) => { + if (!containsLineMappingChanged(events)) { + return; + } + + // Ensure valid state + this.setStates('viewModel', CursorChangeReason.NotSet, this.getAll()); + })); + + const updateCursorContext = () => { + this.context = new CursorContext(this._configuration, this._model, this._viewModel); + this._cursors.updateContext(this.context); + }; + this._register(this._model.onDidChangeLanguage((e) => { + updateCursorContext(); })); this._register(LanguageConfigurationRegistry.onDidChange(() => { // TODO@Alex: react only if certain supports changed? (and if my model's mode changed) - createCursorContext(); + updateCursorContext(); })); this._register(model.onDidChangeOptions(() => { - createCursorContext(); + updateCursorContext(); })); - this._register(this.configuration.onDidChange((e) => { + this._register(this._configuration.onDidChange((e) => { if (CursorConfiguration.shouldRecreate(e)) { - createCursorContext(); + updateCursorContext(); } })); - - this._handlers = {}; - this._registerHandlers(); } public dispose(): void { - this.model = null; - this.cursors.dispose(); - this.cursors = null; - this.configuration = null; - this.viewModelHelper = null; + this._cursors.dispose(); super.dispose(); } + // ------ some getters/setters + public getPrimaryCursor(): CursorState { - return this.cursors.getPrimaryCursor(); + return this._cursors.getPrimaryCursor(); } public getLastAddedCursorIndex(): number { - return this.cursors.getLastAddedCursorIndex(); + return this._cursors.getLastAddedCursorIndex(); } public getAll(): CursorState[] { - return this.cursors.getAll(); + return this._cursors.getAll(); } public setStates(source: string, reason: CursorChangeReason, states: CursorState[]): void { - const oldSelections = this.cursors.getSelections(); - const oldViewSelections = this.cursors.getViewSelections(); + const oldState = new CursorModelState(this._model, this); - // TODO@Alex - // ensure valid state on all cursors - // this.cursors.ensureValidState(); - - this.cursors.setStates(states); - this.cursors.normalize(); + this._cursors.setStates(states); + this._cursors.normalize(); this._columnSelectData = null; - const newSelections = this.cursors.getSelections(); - const newViewSelections = this.cursors.getViewSelections(); - - let somethingChanged = false; - if (oldSelections.length !== newSelections.length) { - somethingChanged = true; - } else { - for (let i = 0, len = oldSelections.length; !somethingChanged && i < len; i++) { - if (!oldSelections[i].equalsSelection(newSelections[i])) { - somethingChanged = true; - } - } - for (let i = 0, len = oldViewSelections.length; !somethingChanged && i < len; i++) { - if (!oldViewSelections[i].equalsSelection(newViewSelections[i])) { - somethingChanged = true; - } - } - } - - if (somethingChanged) { - this.emitCursorPositionChanged(source, reason); - this.emitCursorSelectionChanged(source, reason); - } + this._emitStateChangedIfNecessary(source, reason, oldState); } public setColumnSelectData(columnSelectData: IColumnSelectData): void { @@ -229,27 +202,26 @@ export class Cursor extends Disposable implements ICursors { } public reveal(horizontal: boolean, target: RevealTarget): void { - this._revealRange(target, VerticalRevealType.Simple, horizontal); + this._revealRange(target, viewEvents.VerticalRevealType.Simple, horizontal); } - public revealRange(revealHorizontal: boolean, modelRange: Range, viewRange: Range, verticalType: VerticalRevealType) { - this.emitCursorRevealRange(modelRange, viewRange, verticalType, revealHorizontal); + public revealRange(revealHorizontal: boolean, viewRange: Range, verticalType: viewEvents.VerticalRevealType) { + this.emitCursorRevealRange(viewRange, verticalType, revealHorizontal); } public scrollTo(desiredScrollTop: number): void { - this._eventEmitter.emit(CursorEventType.CursorScrollRequest, new CursorScrollRequest( - desiredScrollTop - )); + this._viewModel.viewLayout.setScrollPosition({ + scrollTop: desiredScrollTop + }); } public saveState(): editorCommon.ICursorState[] { - var selections = this.cursors.getSelections(), - result: editorCommon.ICursorState[] = [], - selection: Selection; + let result: editorCommon.ICursorState[] = []; - for (var i = 0; i < selections.length; i++) { - selection = selections[i]; + const selections = this._cursors.getSelections(); + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; result.push({ inSelectionMode: !selection.isEmpty(), @@ -269,13 +241,13 @@ export class Cursor extends Disposable implements ICursors { public restoreState(states: editorCommon.ICursorState[]): void { - var desiredSelections: ISelection[] = [], - state: editorCommon.ICursorState; + let desiredSelections: ISelection[] = []; - for (var i = 0; i < states.length; i++) { - state = states[i]; + for (let i = 0, len = states.length; i < len; i++) { + const state = states[i]; - var positionLineNumber = 1, positionColumn = 1; + let positionLineNumber = 1; + let positionColumn = 1; // Avoid missing properties on the literal if (state.position && state.position.lineNumber) { @@ -285,7 +257,8 @@ export class Cursor extends Disposable implements ICursors { positionColumn = state.position.column; } - var selectionStartLineNumber = positionLineNumber, selectionStartColumn = positionColumn; + let selectionStartLineNumber = positionLineNumber; + let selectionStartColumn = positionColumn; // Avoid missing properties on the literal if (state.selectionStart && state.selectionStart.lineNumber) { @@ -303,150 +276,77 @@ export class Cursor extends Disposable implements ICursors { }); } - this._onHandler('restoreState', (ctx: IMultipleCursorOperationContext) => { - this.cursors.setSelections(desiredSelections); - return false; - }, 'restoreState', null); + this.setStates('restoreState', CursorChangeReason.NotSet, CursorState.fromModelSelections(desiredSelections)); + this.reveal(true, RevealTarget.Primary); } private _onModelContentChanged(hadFlushEvent: boolean): void { if (hadFlushEvent) { // a model.setValue() was called - this.cursors.dispose(); + this._cursors.dispose(); + this._cursors = new CursorCollection(this.context); - this.cursors = new CursorCollection(this.context); - - this.emitCursorPositionChanged('model', CursorChangeReason.ContentFlush); - this.emitCursorSelectionChanged('model', CursorChangeReason.ContentFlush); + this._emitStateChangedIfNecessary('model', CursorChangeReason.ContentFlush, null); } else { - if (!this._isHandling) { - // Read the markers before entering `_onHandler`, since that would validate - // the position and ruin the markers - const selectionsFromMarkers = this.cursors.readSelectionFromMarkers(); - this._onHandler('recoverSelectionFromMarkers', (ctx: IMultipleCursorOperationContext) => { - ctx.cursorPositionChangeReason = CursorChangeReason.RecoverFromMarkers; - ctx.shouldReveal = false; - ctx.shouldPushStackElementBefore = false; - ctx.shouldPushStackElementAfter = false; - this.cursors.setSelections(selectionsFromMarkers); - }, 'modelChange', null); - } + const selectionsFromMarkers = this._cursors.readSelectionFromMarkers(); + this.setStates('modelChange', CursorChangeReason.RecoverFromMarkers, CursorState.fromModelSelections(selectionsFromMarkers)); } } - // ------ some getters/setters - public getSelection(): Selection { - return this.cursors.getPrimaryCursor().modelState.selection; + return this._cursors.getPrimaryCursor().modelState.selection; + } + + public getColumnSelectData(): IColumnSelectData { + if (this._columnSelectData) { + return this._columnSelectData; + } + const primaryCursor = this._cursors.getPrimaryCursor(); + const primaryPos = primaryCursor.viewState.position; + return { + toViewLineNumber: primaryPos.lineNumber, + toViewVisualColumn: CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, primaryPos) + }; } public getSelections(): Selection[] { - return this.cursors.getSelections(); + return this._cursors.getSelections(); } public getPosition(): Position { - return this.cursors.getPrimaryCursor().modelState.position; + return this._cursors.getPrimaryCursor().modelState.position; } public setSelections(source: string, selections: ISelection[]): void { - this._onHandler('setSelections', (ctx: IMultipleCursorOperationContext) => { - ctx.shouldReveal = false; - this.cursors.setSelections(selections); - return false; - }, source, null); + this.setStates(source, CursorChangeReason.NotSet, CursorState.fromModelSelections(selections)); } // ------ auxiliary handling logic - private _createAndInterpretHandlerCtx(eventSource: string, eventData: any, callback: (currentHandlerCtx: IMultipleCursorOperationContext) => void): void { + private _executeEditOperation(opResult: EditOperationResult): void { - var ctx: IMultipleCursorOperationContext = { - cursorPositionChangeReason: CursorChangeReason.NotSet, - shouldReveal: true, - eventSource: eventSource, - eventData: eventData, - executeCommands: [], - isAutoWhitespaceCommand: [], - shouldPushStackElementBefore: false, - shouldPushStackElementAfter: false - }; - - callback(ctx); - - this._interpretHandlerContext(ctx); - this.cursors.normalize(); - } - - private _onHandler(command: string, handler: (ctx: IMultipleCursorOperationContext) => void, source: string, data: any): void { - - this._isHandling = true; - - try { - const oldSelections = this.cursors.getSelections(); - const oldViewSelections = this.cursors.getViewSelections(); - - // ensure valid state on all cursors - this.cursors.ensureValidState(); - - let cursorPositionChangeReason: CursorChangeReason; - let shouldReveal: boolean; - - this._createAndInterpretHandlerCtx(source, data, (currentHandlerCtx: IMultipleCursorOperationContext) => { - handler(currentHandlerCtx); - - cursorPositionChangeReason = currentHandlerCtx.cursorPositionChangeReason; - shouldReveal = currentHandlerCtx.shouldReveal; - }); - - const newSelections = this.cursors.getSelections(); - const newViewSelections = this.cursors.getViewSelections(); - - let somethingChanged = false; - if (oldSelections.length !== newSelections.length) { - somethingChanged = true; - } else { - for (let i = 0, len = oldSelections.length; !somethingChanged && i < len; i++) { - if (!oldSelections[i].equalsSelection(newSelections[i])) { - somethingChanged = true; - } - } - for (let i = 0, len = oldViewSelections.length; !somethingChanged && i < len; i++) { - if (!oldViewSelections[i].equalsSelection(newViewSelections[i])) { - somethingChanged = true; - } - } - } - - if (somethingChanged) { - this.emitCursorPositionChanged(source, cursorPositionChangeReason); - - if (shouldReveal) { - this._revealRange(RevealTarget.Primary, VerticalRevealType.Simple, true); - } - this.emitCursorSelectionChanged(source, cursorPositionChangeReason); - } - - } catch (err) { - onUnexpectedError(err); + if (!opResult) { + // Nothing to execute + return; } - this._isHandling = false; - } - - private _interpretHandlerContext(ctx: IMultipleCursorOperationContext): void { - if (ctx.shouldPushStackElementBefore) { - this.model.pushStackElement(); - ctx.shouldPushStackElementBefore = false; + if (this._configuration.editor.readOnly) { + // Cannot execute when read only + return; } - this._columnSelectData = null; + if (opResult.shouldPushStackElementBefore) { + this._model.pushStackElement(); + } - this._internalExecuteCommands(ctx.executeCommands, ctx.isAutoWhitespaceCommand); - ctx.executeCommands = []; + const result = CommandExecutor.executeCommands(this._model, this._cursors.getSelections(), opResult.commands); + if (result) { + // The commands were applied correctly + this._interpretCommandResult(result); + } - if (ctx.shouldPushStackElementAfter) { - this.model.pushStackElement(); - ctx.shouldPushStackElementAfter = false; + if (opResult.shouldPushStackElementAfter) { + this._model.pushStackElement(); } } @@ -455,16 +355,384 @@ export class Cursor extends Disposable implements ICursors { return; } - this.cursors.setSelections(cursorState); + this._columnSelectData = null; + this._cursors.setSelections(cursorState); + this._cursors.normalize(); } - private _getEditOperationsFromCommand(ctx: IExecContext, majorIdentifier: number, command: editorCommon.ICommand, isAutoWhitespaceCommand: boolean): ICommandData { + // ----------------------------------------------------------------------------------------------------------- + // ----- emitting events + + private _emitStateChangedIfNecessary(source: string, reason: CursorChangeReason, oldState: CursorModelState): boolean { + const newState = new CursorModelState(this._model, this); + if (newState.equals(oldState)) { + return false; + } + + + let isInEditableRange: boolean = true; + if (this._model.hasEditableRange()) { + const editableRange = this._model.getEditableRange(); + if (!editableRange.containsPosition(newState.cursorState[0].modelState.position)) { + isInEditableRange = false; + } + } + + const selections = this._cursors.getSelections(); + const viewSelections = this._cursors.getViewSelections(); + + let screenReaderMessage: string = null; + // if (oldState) { + // screenReaderMessage = ScreenReaderMessageGenerator.generateMessage( + // source, + // this._model, + // oldState.modelVersionId, + // oldState.cursorState[0].modelState.selection, + // newState.modelVersionId, + // newState.cursorState[0].modelState.selection + // ); + // } + + // Let the view get the event first. + this._emit([new viewEvents.ViewCursorStateChangedEvent(viewSelections, isInEditableRange, screenReaderMessage)]); + + // Only after the view has been notified, let the rest of the world know... + this._onDidChange.fire(new CursorStateChangedEvent(selections, source || 'keyboard', reason)); + + return true; + } + + private _revealRange(revealTarget: RevealTarget, verticalType: viewEvents.VerticalRevealType, revealHorizontal: boolean): void { + const viewPositions = this._cursors.getViewPositions(); + + let viewPosition = viewPositions[0]; + + if (revealTarget === RevealTarget.TopMost) { + for (let i = 1; i < viewPositions.length; i++) { + if (viewPositions[i].isBefore(viewPosition)) { + viewPosition = viewPositions[i]; + } + } + } else if (revealTarget === RevealTarget.BottomMost) { + for (let i = 1; i < viewPositions.length; i++) { + if (viewPosition.isBeforeOrEqual(viewPositions[i])) { + viewPosition = viewPositions[i]; + } + } + } else { + if (viewPositions.length > 1) { + // no revealing! + return; + } + } + + const viewRange = new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); + this.emitCursorRevealRange(viewRange, verticalType, revealHorizontal); + } + + public emitCursorRevealRange(viewRange: Range, verticalType: viewEvents.VerticalRevealType, revealHorizontal: boolean) { + this._emit([new viewEvents.ViewRevealRangeRequestEvent(viewRange, verticalType, revealHorizontal)]); + } + + // ----------------------------------------------------------------------------------------------------------- + // ----- handlers beyond this point + + public trigger(source: string, handlerId: string, payload: any): void { + const H = editorCommon.Handler; + + if (handlerId === H.CompositionStart) { + this._isDoingComposition = true; + return; + } + + if (handlerId === H.CompositionEnd) { + this._isDoingComposition = false; + return; + } + + const oldState = new CursorModelState(this._model, this); + let cursorChangeReason = CursorChangeReason.NotSet; + + // ensure valid state on all cursors + this._cursors.ensureValidState(); + + this._isHandling = true; + + try { + switch (handlerId) { + case H.Type: + this._type(source, payload.text); + break; + + case H.ReplacePreviousChar: + this._replacePreviousChar(payload.text, payload.replaceCharCnt); + break; + + case H.Paste: + cursorChangeReason = CursorChangeReason.Paste; + this._paste(payload.text, payload.pasteOnNewLine); + break; + + case H.Cut: + this._cut(); + break; + + case H.Undo: + cursorChangeReason = CursorChangeReason.Undo; + this._interpretCommandResult(this._model.undo()); + break; + + case H.Redo: + cursorChangeReason = CursorChangeReason.Redo; + this._interpretCommandResult(this._model.redo()); + break; + + case H.ExecuteCommand: + this._externalExecuteCommand(payload); + break; + + case H.ExecuteCommands: + this._externalExecuteCommands(payload); + break; + } + } catch (err) { + onUnexpectedError(err); + } + + this._isHandling = false; + + if (this._emitStateChangedIfNecessary(source, cursorChangeReason, oldState)) { + this._revealRange(RevealTarget.Primary, viewEvents.VerticalRevealType.Simple, true); + } + } + + private _type(source: string, text: string): void { + if (!this._isDoingComposition && source === 'keyboard') { + // If this event is coming straight from the keyboard, look for electric characters and enter + + for (let i = 0, len = text.length; i < len; i++) { + let charCode = text.charCodeAt(i); + let chr: string; + if (strings.isHighSurrogate(charCode) && i + 1 < len) { + chr = text.charAt(i) + text.charAt(i + 1); + i++; + } else { + chr = text.charAt(i); + } + + // Here we must interpret each typed character individually, that's why we create a new context + this._executeEditOperation(TypeOperations.typeWithInterceptors(this.context.config, this.context.model, this.getSelections(), chr)); + } + + } else { + this._executeEditOperation(TypeOperations.typeWithoutInterceptors(this.context.config, this.context.model, this.getSelections(), text)); + } + } + + private _replacePreviousChar(text: string, replaceCharCnt: number): void { + this._executeEditOperation(TypeOperations.replacePreviousChar(this.context.config, this.context.model, this.getSelections(), text, replaceCharCnt)); + } + + private _paste(text: string, pasteOnNewLine: boolean): void { + this._executeEditOperation(TypeOperations.paste(this.context.config, this.context.model, this.getSelections(), pasteOnNewLine, text)); + } + + private _cut(): void { + this._executeEditOperation(DeleteOperations.cut(this.context.config, this.context.model, this.getSelections())); + } + + private _externalExecuteCommand(command: editorCommon.ICommand): void { + this._cursors.killSecondaryCursors(); + + this._executeEditOperation(new EditOperationResult([command], { + shouldPushStackElementBefore: false, + shouldPushStackElementAfter: false + })); + } + + private _externalExecuteCommands(commands: editorCommon.ICommand[]): void { + this._executeEditOperation(new EditOperationResult(commands, { + shouldPushStackElementBefore: false, + shouldPushStackElementAfter: false + })); + } +} + +interface IExecContext { + readonly model: editorCommon.IModel; + readonly selectionsBefore: Selection[]; + readonly selectionStartMarkers: string[]; + readonly positionMarkers: string[]; +} + +interface ICommandData { + operations: editorCommon.IIdentifiedSingleEditOperation[]; + hadTrackedEditOperation: boolean; +} + +interface ICommandsData { + operations: editorCommon.IIdentifiedSingleEditOperation[]; + hadTrackedEditOperation: boolean; +} + +class CommandExecutor { + + public static executeCommands(model: editorCommon.IModel, selectionsBefore: Selection[], commands: editorCommon.ICommand[]): Selection[] { + + const ctx: IExecContext = { + model: model, + selectionsBefore: selectionsBefore, + selectionStartMarkers: [], + positionMarkers: [] + }; + + const result = this._innerExecuteCommands(ctx, commands); + + for (let i = 0; i < ctx.selectionStartMarkers.length; i++) { + ctx.model._removeMarker(ctx.selectionStartMarkers[i]); + ctx.model._removeMarker(ctx.positionMarkers[i]); + } + + return result; + } + + private static _innerExecuteCommands(ctx: IExecContext, commands: editorCommon.ICommand[]): Selection[] { + + if (this._arrayIsEmpty(commands)) { + return null; + } + + const commandsData = this._getEditOperations(ctx, commands); + if (commandsData.operations.length === 0) { + return null; + } + + const rawOperations = commandsData.operations; + + const editableRange = ctx.model.getEditableRange(); + const editableRangeStart = editableRange.getStartPosition(); + const editableRangeEnd = editableRange.getEndPosition(); + for (let i = 0, len = rawOperations.length; i < len; i++) { + const operationRange = rawOperations[i].range; + if (!editableRangeStart.isBeforeOrEqual(operationRange.getStartPosition()) || !operationRange.getEndPosition().isBeforeOrEqual(editableRangeEnd)) { + // These commands are outside of the editable range + return null; + } + } + + const loserCursorsMap = this._getLoserCursorMap(rawOperations); + if (loserCursorsMap.hasOwnProperty('0')) { + // These commands are very messed up + console.warn('Ignoring commands'); + return null; + } + + // Remove operations belonging to losing cursors + let filteredOperations: editorCommon.IIdentifiedSingleEditOperation[] = []; + for (let i = 0, len = rawOperations.length; i < len; i++) { + if (!loserCursorsMap.hasOwnProperty(rawOperations[i].identifier.major.toString())) { + filteredOperations.push(rawOperations[i]); + } + } + + // TODO@Alex: find a better way to do this. + // give the hint that edit operations are tracked to the model + if (commandsData.hadTrackedEditOperation && filteredOperations.length > 0) { + filteredOperations[0]._isTracked = true; + } + const selectionsAfter = ctx.model.pushEditOperations(ctx.selectionsBefore, filteredOperations, (inverseEditOperations: editorCommon.IIdentifiedSingleEditOperation[]): Selection[] => { + let groupedInverseEditOperations: editorCommon.IIdentifiedSingleEditOperation[][] = []; + for (let i = 0; i < ctx.selectionsBefore.length; i++) { + groupedInverseEditOperations[i] = []; + } + for (let i = 0; i < inverseEditOperations.length; i++) { + const op = inverseEditOperations[i]; + if (!op.identifier) { + // perhaps auto whitespace trim edits + continue; + } + groupedInverseEditOperations[op.identifier.major].push(op); + } + const minorBasedSorter = (a: editorCommon.IIdentifiedSingleEditOperation, b: editorCommon.IIdentifiedSingleEditOperation) => { + return a.identifier.minor - b.identifier.minor; + }; + let cursorSelections: Selection[] = []; + for (let i = 0; i < ctx.selectionsBefore.length; i++) { + if (groupedInverseEditOperations[i].length > 0) { + groupedInverseEditOperations[i].sort(minorBasedSorter); + cursorSelections[i] = commands[i].computeCursorState(ctx.model, { + getInverseEditOperations: () => { + return groupedInverseEditOperations[i]; + }, + + getTrackedSelection: (id: string) => { + const idx = parseInt(id, 10); + const selectionStartMarker = ctx.model._getMarker(ctx.selectionStartMarkers[idx]); + const positionMarker = ctx.model._getMarker(ctx.positionMarkers[idx]); + return new Selection(selectionStartMarker.lineNumber, selectionStartMarker.column, positionMarker.lineNumber, positionMarker.column); + } + }); + } else { + cursorSelections[i] = ctx.selectionsBefore[i]; + } + } + return cursorSelections; + }); + + // Extract losing cursors + let losingCursors: number[] = []; + for (let losingCursorIndex in loserCursorsMap) { + if (loserCursorsMap.hasOwnProperty(losingCursorIndex)) { + losingCursors.push(parseInt(losingCursorIndex, 10)); + } + } + + // Sort losing cursors descending + losingCursors.sort((a: number, b: number): number => { + return b - a; + }); + + // Remove losing cursors + for (let i = 0; i < losingCursors.length; i++) { + selectionsAfter.splice(losingCursors[i], 1); + } + + return selectionsAfter; + } + + private static _arrayIsEmpty(commands: editorCommon.ICommand[]): boolean { + for (let i = 0, len = commands.length; i < len; i++) { + if (commands[i]) { + return false; + } + } + return true; + } + + private static _getEditOperations(ctx: IExecContext, commands: editorCommon.ICommand[]): ICommandsData { + let operations: editorCommon.IIdentifiedSingleEditOperation[] = []; + let hadTrackedEditOperation: boolean = false; + + for (let i = 0, len = commands.length; i < len; i++) { + if (commands[i]) { + const r = this._getEditOperationsFromCommand(ctx, i, commands[i]); + operations = operations.concat(r.operations); + hadTrackedEditOperation = hadTrackedEditOperation || r.hadTrackedEditOperation; + } + } + return { + operations: operations, + hadTrackedEditOperation: hadTrackedEditOperation + }; + } + + private static _getEditOperationsFromCommand(ctx: IExecContext, majorIdentifier: number, command: editorCommon.ICommand): ICommandData { // This method acts as a transaction, if the command fails // everything it has done is ignored - var operations: editorCommon.IIdentifiedSingleEditOperation[] = [], - operationMinor = 0; + let operations: editorCommon.IIdentifiedSingleEditOperation[] = []; + let operationMinor = 0; - var addEditOperation = (selection: Range, text: string) => { + const addEditOperation = (selection: Range, text: string) => { if (selection.isEmpty() && text === '') { // This command wants to add a no-op => no thank you return; @@ -477,20 +745,19 @@ export class Cursor extends Disposable implements ICursors { range: selection, text: text, forceMoveMarkers: false, - isAutoWhitespaceEdit: isAutoWhitespaceCommand + isAutoWhitespaceEdit: command.insertsAutoWhitespace }); }; - var hadTrackedEditOperation = false; - var addTrackedEditOperation = (selection: Range, text: string) => { + let hadTrackedEditOperation = false; + const addTrackedEditOperation = (selection: Range, text: string) => { hadTrackedEditOperation = true; addEditOperation(selection, text); }; - var hadTrackedRange = false; - var trackSelection = (selection: Selection, trackPreviousOnEmpty?: boolean) => { - var selectionMarkerStickToPreviousCharacter: boolean, - positionMarkerStickToPreviousCharacter: boolean; + const trackSelection = (selection: Selection, trackPreviousOnEmpty?: boolean) => { + let selectionMarkerStickToPreviousCharacter: boolean; + let positionMarkerStickToPreviousCharacter: boolean; if (selection.isEmpty()) { // Try to lock it with surrounding text @@ -498,7 +765,7 @@ export class Cursor extends Disposable implements ICursors { selectionMarkerStickToPreviousCharacter = trackPreviousOnEmpty; positionMarkerStickToPreviousCharacter = trackPreviousOnEmpty; } else { - var maxLineColumn = this.model.getLineMaxColumn(selection.startLineNumber); + const maxLineColumn = ctx.model.getLineMaxColumn(selection.startLineNumber); if (selection.startColumn === maxLineColumn) { selectionMarkerStickToPreviousCharacter = true; positionMarkerStickToPreviousCharacter = true; @@ -517,64 +784,36 @@ export class Cursor extends Disposable implements ICursors { } } - var l = ctx.selectionStartMarkers.length; - ctx.selectionStartMarkers[l] = this.model._addMarker(0, selection.selectionStartLineNumber, selection.selectionStartColumn, selectionMarkerStickToPreviousCharacter); - ctx.positionMarkers[l] = this.model._addMarker(0, selection.positionLineNumber, selection.positionColumn, positionMarkerStickToPreviousCharacter); + const l = ctx.selectionStartMarkers.length; + ctx.selectionStartMarkers[l] = ctx.model._addMarker(0, selection.selectionStartLineNumber, selection.selectionStartColumn, selectionMarkerStickToPreviousCharacter); + ctx.positionMarkers[l] = ctx.model._addMarker(0, selection.positionLineNumber, selection.positionColumn, positionMarkerStickToPreviousCharacter); return l.toString(); }; - var editOperationBuilder: editorCommon.IEditOperationBuilder = { + const editOperationBuilder: editorCommon.IEditOperationBuilder = { addEditOperation: addEditOperation, addTrackedEditOperation: addTrackedEditOperation, trackSelection: trackSelection }; try { - command.getEditOperations(this.model, editOperationBuilder); + command.getEditOperations(ctx.model, editOperationBuilder); } catch (e) { e.friendlyMessage = nls.localize('corrupt.commands', "Unexpected exception while executing command."); onUnexpectedError(e); return { operations: [], - hadTrackedRange: false, hadTrackedEditOperation: false }; } return { operations: operations, - hadTrackedRange: hadTrackedRange, hadTrackedEditOperation: hadTrackedEditOperation }; } - private _getEditOperations(ctx: IExecContext, commands: editorCommon.ICommand[], isAutoWhitespaceCommand: boolean[]): ICommandsData { - var oneResult: ICommandData; - var operations: editorCommon.IIdentifiedSingleEditOperation[] = []; - var hadTrackedRanges: boolean[] = []; - var anyoneHadTrackedEditOperation: boolean = false; - var anyoneHadTrackedRange: boolean; - - for (var i = 0; i < commands.length; i++) { - if (commands[i]) { - oneResult = this._getEditOperationsFromCommand(ctx, i, commands[i], isAutoWhitespaceCommand[i]); - operations = operations.concat(oneResult.operations); - hadTrackedRanges[i] = oneResult.hadTrackedRange; - anyoneHadTrackedRange = anyoneHadTrackedRange || hadTrackedRanges[i]; - anyoneHadTrackedEditOperation = anyoneHadTrackedEditOperation || oneResult.hadTrackedEditOperation; - } else { - hadTrackedRanges[i] = false; - } - } - return { - operations: operations, - hadTrackedRanges: hadTrackedRanges, - anyoneHadTrackedRange: anyoneHadTrackedRange, - anyoneHadTrackedEditOperation: anyoneHadTrackedEditOperation - }; - } - - private _getLoserCursorMap(operations: editorCommon.IIdentifiedSingleEditOperation[]): { [index: string]: boolean; } { + private static _getLoserCursorMap(operations: editorCommon.IIdentifiedSingleEditOperation[]): { [index: string]: boolean; } { // This is destructive on the array operations = operations.slice(0); @@ -585,18 +824,16 @@ export class Cursor extends Disposable implements ICursors { }); // Operations can not overlap! - var loserCursorsMap: { [index: string]: boolean; } = {}; + let loserCursorsMap: { [index: string]: boolean; } = {}; - var previousOp: editorCommon.IIdentifiedSingleEditOperation; - var currentOp: editorCommon.IIdentifiedSingleEditOperation; - var loserMajor: number; - - for (var i = 1; i < operations.length; i++) { - previousOp = operations[i - 1]; - currentOp = operations[i]; + for (let i = 1; i < operations.length; i++) { + const previousOp = operations[i - 1]; + const currentOp = operations[i]; if (previousOp.range.getStartPosition().isBefore(currentOp.range.getEndPosition())) { + let loserMajor: number; + if (previousOp.identifier.major > currentOp.identifier.major) { // previousOp loses the battle loserMajor = previousOp.identifier.major; @@ -606,7 +843,7 @@ export class Cursor extends Disposable implements ICursors { loserCursorsMap[loserMajor.toString()] = true; - for (var j = 0; j < operations.length; j++) { + for (let j = 0; j < operations.length; j++) { if (operations[j].identifier.major === loserMajor) { operations.splice(j, 1); if (j < i) { @@ -624,484 +861,4 @@ export class Cursor extends Disposable implements ICursors { return loserCursorsMap; } - - private _internalExecuteCommands(commands: editorCommon.ICommand[], isAutoWhitespaceCommand: boolean[]): void { - var ctx: IExecContext = { - selectionStartMarkers: [], - positionMarkers: [] - }; - - this._innerExecuteCommands(ctx, commands, isAutoWhitespaceCommand); - for (var i = 0; i < ctx.selectionStartMarkers.length; i++) { - this.model._removeMarker(ctx.selectionStartMarkers[i]); - this.model._removeMarker(ctx.positionMarkers[i]); - } - } - - private _arrayIsEmpty(commands: editorCommon.ICommand[]): boolean { - var i: number, - len: number; - - for (i = 0, len = commands.length; i < len; i++) { - if (commands[i]) { - return false; - } - } - - return true; - } - - private _innerExecuteCommands(ctx: IExecContext, commands: editorCommon.ICommand[], isAutoWhitespaceCommand: boolean[]): void { - - if (this.configuration.editor.readOnly) { - return; - } - - if (this._arrayIsEmpty(commands)) { - return; - } - - var selectionsBefore = this.cursors.getSelections(); - - var commandsData = this._getEditOperations(ctx, commands, isAutoWhitespaceCommand); - if (commandsData.operations.length === 0 && !commandsData.anyoneHadTrackedRange) { - return; - } - - var rawOperations = commandsData.operations; - - var editableRange = this.model.getEditableRange(); - var editableRangeStart = editableRange.getStartPosition(); - var editableRangeEnd = editableRange.getEndPosition(); - for (var i = 0; i < rawOperations.length; i++) { - var operationRange = rawOperations[i].range; - if (!editableRangeStart.isBeforeOrEqual(operationRange.getStartPosition()) || !operationRange.getEndPosition().isBeforeOrEqual(editableRangeEnd)) { - // These commands are outside of the editable range - return; - } - } - - var loserCursorsMap = this._getLoserCursorMap(rawOperations); - if (loserCursorsMap.hasOwnProperty('0')) { - // These commands are very messed up - console.warn('Ignoring commands'); - return; - } - - // Remove operations belonging to losing cursors - var filteredOperations: editorCommon.IIdentifiedSingleEditOperation[] = []; - for (var i = 0; i < rawOperations.length; i++) { - if (!loserCursorsMap.hasOwnProperty(rawOperations[i].identifier.major.toString())) { - filteredOperations.push(rawOperations[i]); - } - } - - // TODO@Alex: find a better way to do this. - // give the hint that edit operations are tracked to the model - if (commandsData.anyoneHadTrackedEditOperation && filteredOperations.length > 0) { - filteredOperations[0]._isTracked = true; - } - var selectionsAfter = this.model.pushEditOperations(selectionsBefore, filteredOperations, (inverseEditOperations: editorCommon.IIdentifiedSingleEditOperation[]): Selection[] => { - var groupedInverseEditOperations: editorCommon.IIdentifiedSingleEditOperation[][] = []; - for (var i = 0; i < selectionsBefore.length; i++) { - groupedInverseEditOperations[i] = []; - } - for (var i = 0; i < inverseEditOperations.length; i++) { - var op = inverseEditOperations[i]; - if (!op.identifier) { - // perhaps auto whitespace trim edits - continue; - } - groupedInverseEditOperations[op.identifier.major].push(op); - } - var minorBasedSorter = (a: editorCommon.IIdentifiedSingleEditOperation, b: editorCommon.IIdentifiedSingleEditOperation) => { - return a.identifier.minor - b.identifier.minor; - }; - var cursorSelections: Selection[] = []; - for (var i = 0; i < selectionsBefore.length; i++) { - if (groupedInverseEditOperations[i].length > 0 || commandsData.hadTrackedRanges[i]) { - groupedInverseEditOperations[i].sort(minorBasedSorter); - cursorSelections[i] = commands[i].computeCursorState(this.model, { - getInverseEditOperations: () => { - return groupedInverseEditOperations[i]; - }, - - getTrackedSelection: (id: string) => { - var idx = parseInt(id, 10); - var selectionStartMarker = this.model._getMarker(ctx.selectionStartMarkers[idx]); - var positionMarker = this.model._getMarker(ctx.positionMarkers[idx]); - return new Selection(selectionStartMarker.lineNumber, selectionStartMarker.column, positionMarker.lineNumber, positionMarker.column); - } - }); - } else { - cursorSelections[i] = selectionsBefore[i]; - } - } - return cursorSelections; - }); - - // Extract losing cursors - var losingCursorIndex: string; - var losingCursors: number[] = []; - for (losingCursorIndex in loserCursorsMap) { - if (loserCursorsMap.hasOwnProperty(losingCursorIndex)) { - losingCursors.push(parseInt(losingCursorIndex, 10)); - } - } - - // Sort losing cursors descending - losingCursors.sort((a: number, b: number): number => { - return b - a; - }); - - // Remove losing cursors - for (var i = 0; i < losingCursors.length; i++) { - selectionsAfter.splice(losingCursors[i], 1); - } - - this._interpretCommandResult(selectionsAfter); - } - - - // ----------------------------------------------------------------------------------------------------------- - // ----- emitting events - - private emitCursorPositionChanged(source: string, reason: CursorChangeReason): void { - var positions = this.cursors.getPositions(); - var primaryPosition = positions[0]; - var secondaryPositions = positions.slice(1); - - var viewPositions = this.cursors.getViewPositions(); - var primaryViewPosition = viewPositions[0]; - var secondaryViewPositions = viewPositions.slice(1); - - var isInEditableRange: boolean = true; - if (this.model.hasEditableRange()) { - var editableRange = this.model.getEditableRange(); - if (!editableRange.containsPosition(primaryPosition)) { - isInEditableRange = false; - } - } - var e: ICursorPositionChangedEvent = { - position: primaryPosition, - viewPosition: primaryViewPosition, - secondaryPositions: secondaryPositions, - secondaryViewPositions: secondaryViewPositions, - reason: reason, - source: source, - isInEditableRange: isInEditableRange - }; - this._eventEmitter.emit(CursorEventType.CursorPositionChanged, e); - } - - private emitCursorSelectionChanged(source: string, reason: CursorChangeReason): void { - let selections = this.cursors.getSelections(); - let primarySelection = selections[0]; - let secondarySelections = selections.slice(1); - - let viewSelections = this.cursors.getViewSelections(); - let primaryViewSelection = viewSelections[0]; - let secondaryViewSelections = viewSelections.slice(1); - - let e: ICursorSelectionChangedEvent = { - selection: primarySelection, - viewSelection: primaryViewSelection, - secondarySelections: secondarySelections, - secondaryViewSelections: secondaryViewSelections, - source: source || 'keyboard', - reason: reason - }; - this._eventEmitter.emit(CursorEventType.CursorSelectionChanged, e); - } - - private _revealRange(revealTarget: RevealTarget, verticalType: VerticalRevealType, revealHorizontal: boolean): void { - var positions = this.cursors.getPositions(); - var viewPositions = this.cursors.getViewPositions(); - - var position = positions[0]; - var viewPosition = viewPositions[0]; - - if (revealTarget === RevealTarget.TopMost) { - for (var i = 1; i < positions.length; i++) { - if (positions[i].isBefore(position)) { - position = positions[i]; - viewPosition = viewPositions[i]; - } - } - } else if (revealTarget === RevealTarget.BottomMost) { - for (var i = 1; i < positions.length; i++) { - if (position.isBeforeOrEqual(positions[i])) { - position = positions[i]; - viewPosition = viewPositions[i]; - } - } - } else { - if (positions.length > 1) { - // no revealing! - return; - } - } - - var range = new Range(position.lineNumber, position.column, position.lineNumber, position.column); - var viewRange = new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); - this.emitCursorRevealRange(range, viewRange, verticalType, revealHorizontal); - } - - public emitCursorRevealRange(range: Range, viewRange: Range, verticalType: VerticalRevealType, revealHorizontal: boolean) { - var e: ICursorRevealRangeEvent = { - range: range, - viewRange: viewRange, - verticalType: verticalType, - revealHorizontal: revealHorizontal - }; - this._eventEmitter.emit(CursorEventType.CursorRevealRange, e); - } - - // ----------------------------------------------------------------------------------------------------------- - // ----- handlers beyond this point - - public trigger(source: string, handlerId: string, payload: any): void { - if (!this._handlers.hasOwnProperty(handlerId)) { - const command = CommonEditorRegistry.getEditorCommand(handlerId); - if (!command || !(command instanceof CoreEditorCommand)) { - return; - } - - payload = payload || {}; - payload.source = source; - command.runCoreEditorCommand(this, payload); - return; - } - let handler = this._handlers[handlerId]; - this._onHandler(handlerId, handler, source, payload); - } - - private _registerHandlers(): void { - let H = editorCommon.Handler; - - this._handlers[H.LineInsertBefore] = (ctx) => this._lineInsertBefore(ctx); - this._handlers[H.LineInsertAfter] = (ctx) => this._lineInsertAfter(ctx); - this._handlers[H.LineBreakInsert] = (ctx) => this._lineBreakInsert(ctx); - - this._handlers[H.Type] = (ctx) => this._type(ctx); - this._handlers[H.ReplacePreviousChar] = (ctx) => this._replacePreviousChar(ctx); - this._handlers[H.CompositionStart] = (ctx) => this._compositionStart(ctx); - this._handlers[H.CompositionEnd] = (ctx) => this._compositionEnd(ctx); - this._handlers[H.Tab] = (ctx) => this._tab(ctx); - this._handlers[H.Indent] = (ctx) => this._indent(ctx); - this._handlers[H.Outdent] = (ctx) => this._outdent(ctx); - this._handlers[H.Paste] = (ctx) => this._paste(ctx); - - this._handlers[H.DeleteLeft] = (ctx) => this._deleteLeft(ctx); - this._handlers[H.DeleteRight] = (ctx) => this._deleteRight(ctx); - - this._handlers[H.Cut] = (ctx) => this._cut(ctx); - - this._handlers[H.Undo] = (ctx) => this._undo(ctx); - this._handlers[H.Redo] = (ctx) => this._redo(ctx); - - this._handlers[H.ExecuteCommand] = (ctx) => this._externalExecuteCommand(ctx); - this._handlers[H.ExecuteCommands] = (ctx) => this._externalExecuteCommands(ctx); - } - - public getColumnSelectData(): IColumnSelectData { - if (this._columnSelectData) { - return this._columnSelectData; - } - const primaryCursor = this.cursors.getPrimaryCursor(); - const primaryPos = primaryCursor.viewState.position; - return { - toViewLineNumber: primaryPos.lineNumber, - toViewVisualColumn: CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, primaryPos) - }; - } - - // -------------------- START editing operations - - private _applyEdits(ctx: IMultipleCursorOperationContext, edits: EditOperationResult): void { - ctx.shouldReveal = true; - ctx.shouldPushStackElementBefore = edits.shouldPushStackElementBefore; - ctx.shouldPushStackElementAfter = edits.shouldPushStackElementAfter; - - const commands = edits.commands; - for (let i = 0, len = commands.length; i < len; i++) { - const command = commands[i]; - ctx.executeCommands[i] = command ? command.command : null; - ctx.isAutoWhitespaceCommand[i] = command ? command.isAutoWhitespaceCommand : false; - } - } - - private _getAllCursorsModelState(sorted: boolean = false): SingleCursorState[] { - let cursors = this.cursors.getAll(); - - if (sorted) { - cursors = cursors.sort((a, b) => { - return Range.compareRangesUsingStarts(a.modelState.selection, b.modelState.selection); - }); - } - - let r: SingleCursorState[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - r[i] = cursors[i].modelState; - } - return r; - } - - private _lineInsertBefore(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.lineInsertBefore(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _lineInsertAfter(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.lineInsertAfter(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _lineBreakInsert(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.lineBreakInsert(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _type(ctx: IMultipleCursorOperationContext): void { - var text = ctx.eventData.text; - - if (!this._isDoingComposition && ctx.eventSource === 'keyboard') { - // If this event is coming straight from the keyboard, look for electric characters and enter - - for (let i = 0, len = text.length; i < len; i++) { - let charCode = text.charCodeAt(i); - let chr: string; - if (strings.isHighSurrogate(charCode) && i + 1 < len) { - chr = text.charAt(i) + text.charAt(i + 1); - i++; - } else { - chr = text.charAt(i); - } - - // Here we must interpret each typed character individually, that's why we create a new context - this._createAndInterpretHandlerCtx(ctx.eventSource, ctx.eventData, (charHandlerCtx: IMultipleCursorOperationContext) => { - - // Decide what all cursors will do up-front - this._applyEdits(charHandlerCtx, TypeOperations.typeWithInterceptors(this.context.config, this.context.model, this._getAllCursorsModelState(), chr)); - - // The last typed character gets to win - ctx.cursorPositionChangeReason = charHandlerCtx.cursorPositionChangeReason; - ctx.shouldReveal = charHandlerCtx.shouldReveal; - }); - - } - } else { - this._applyEdits(ctx, TypeOperations.typeWithoutInterceptors(this.context.config, this.context.model, this._getAllCursorsModelState(), text)); - } - } - - private _replacePreviousChar(ctx: IMultipleCursorOperationContext): void { - let text = ctx.eventData.text; - let replaceCharCnt = ctx.eventData.replaceCharCnt; - this._applyEdits(ctx, TypeOperations.replacePreviousChar(this.context.config, this.context.model, this._getAllCursorsModelState(), text, replaceCharCnt)); - } - - private _compositionStart(ctx: IMultipleCursorOperationContext): void { - this._isDoingComposition = true; - } - - private _compositionEnd(ctx: IMultipleCursorOperationContext): void { - this._isDoingComposition = false; - } - - private _tab(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.tab(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _indent(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.indent(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _outdent(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, TypeOperations.outdent(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _distributePasteToCursors(ctx: IMultipleCursorOperationContext): string[] { - if (ctx.eventData.pasteOnNewLine) { - return null; - } - - var selections = this.cursors.getSelections(); - if (selections.length === 1) { - return null; - } - - for (var i = 0; i < selections.length; i++) { - if (selections[i].startLineNumber !== selections[i].endLineNumber) { - return null; - } - } - - var pastePieces = ctx.eventData.text.split(/\r\n|\r|\n/); - if (pastePieces.length !== selections.length) { - return null; - } - - return pastePieces; - } - - private _paste(ctx: IMultipleCursorOperationContext): void { - var distributedPaste = this._distributePasteToCursors(ctx); - - ctx.cursorPositionChangeReason = CursorChangeReason.Paste; - if (distributedPaste) { - this._applyEdits(ctx, TypeOperations.distributedPaste(this.context.config, this.context.model, this._getAllCursorsModelState(true), distributedPaste)); - } else { - this._applyEdits(ctx, TypeOperations.paste(this.context.config, this.context.model, this._getAllCursorsModelState(), ctx.eventData.text, ctx.eventData.pasteOnNewLine)); - } - } - - private _deleteLeft(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, DeleteOperations.deleteLeft(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _deleteRight(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, DeleteOperations.deleteRight(this.context.config, this.context.model, this._getAllCursorsModelState())); - } - - private _cut(ctx: IMultipleCursorOperationContext): void { - this._applyEdits(ctx, DeleteOperations.cut(this.context.config, this.context.model, this._getAllCursorsModelState(), this.enableEmptySelectionClipboard)); - } - - // -------------------- END editing operations - - private _undo(ctx: IMultipleCursorOperationContext): void { - ctx.cursorPositionChangeReason = CursorChangeReason.Undo; - this._interpretCommandResult(this.model.undo()); - } - - private _redo(ctx: IMultipleCursorOperationContext): void { - ctx.cursorPositionChangeReason = CursorChangeReason.Redo; - this._interpretCommandResult(this.model.redo()); - } - - private _externalExecuteCommand(ctx: IMultipleCursorOperationContext): void { - const command = ctx.eventData; - - this.cursors.killSecondaryCursors(); - - ctx.shouldReveal = true; - - ctx.shouldPushStackElementBefore = true; - ctx.shouldPushStackElementAfter = true; - - ctx.executeCommands[0] = command; - ctx.isAutoWhitespaceCommand[0] = false; - } - - private _externalExecuteCommands(ctx: IMultipleCursorOperationContext): void { - const commands = ctx.eventData; - - ctx.shouldReveal = true; - - ctx.shouldPushStackElementBefore = true; - ctx.shouldPushStackElementAfter = true; - - for (let i = 0; i < commands.length; i++) { - ctx.executeCommands[i] = commands[i]; - ctx.isAutoWhitespaceCommand[i] = false; - } - } } diff --git a/src/vs/editor/common/controller/cursorCollection.ts b/src/vs/editor/common/controller/cursorCollection.ts index 49633b4b90f..9fcae512f2f 100644 --- a/src/vs/editor/common/controller/cursorCollection.ts +++ b/src/vs/editor/common/controller/cursorCollection.ts @@ -51,13 +51,6 @@ export class CursorCollection { return result; } - private _getAll(): OneCursor[] { - var result: OneCursor[] = []; - result.push(this.primaryCursor); - result = result.concat(this.secondaryCursors); - return result; - } - public getAll(): CursorState[] { let result: CursorState[] = []; result[0] = this.primaryCursor.asCursorState(); @@ -67,45 +60,35 @@ export class CursorCollection { return result; } - public getPositions(): Position[] { - var result: Position[] = []; - result.push(this.primaryCursor.modelState.position); - for (var i = 0, len = this.secondaryCursors.length; i < len; i++) { - result.push(this.secondaryCursors[i].modelState.position); - } - return result; - } - public getViewPositions(): Position[] { - var result: Position[] = []; - result.push(this.primaryCursor.viewState.position); - for (var i = 0, len = this.secondaryCursors.length; i < len; i++) { - result.push(this.secondaryCursors[i].viewState.position); + let result: Position[] = []; + result[0] = this.primaryCursor.viewState.position; + for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { + result[i + 1] = this.secondaryCursors[i].viewState.position; } return result; } public getSelections(): Selection[] { - var result: Selection[] = []; - result.push(this.primaryCursor.modelState.selection); - for (var i = 0, len = this.secondaryCursors.length; i < len; i++) { - result.push(this.secondaryCursors[i].modelState.selection); + let result: Selection[] = []; + result[0] = this.primaryCursor.modelState.selection; + for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { + result[i + 1] = this.secondaryCursors[i].modelState.selection; } return result; } public getViewSelections(): Selection[] { - var result: Selection[] = []; - result.push(this.primaryCursor.viewState.selection); - for (var i = 0, len = this.secondaryCursors.length; i < len; i++) { - result.push(this.secondaryCursors[i].viewState.selection); + let result: Selection[] = []; + result[0] = this.primaryCursor.viewState.selection; + for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { + result[i + 1] = this.secondaryCursors[i].viewState.selection; } return result; } public setSelections(selections: ISelection[]): void { - this.primaryCursor.setSelection(this.context, selections[0]); - this._setSecondarySelections(selections.slice(1)); + this.setStates(CursorState.fromModelSelections(selections)); } public getPrimaryCursor(): CursorState { @@ -130,7 +113,7 @@ export class CursorCollection { if (secondaryCursorsLength < secondaryStatesLength) { let createCnt = secondaryStatesLength - secondaryCursorsLength; for (let i = 0; i < createCnt; i++) { - this._addSecondaryCursor(null); + this._addSecondaryCursor(); } } else if (secondaryCursorsLength > secondaryStatesLength) { let removeCnt = secondaryCursorsLength - secondaryStatesLength; @@ -144,20 +127,12 @@ export class CursorCollection { } } - public killSecondaryCursors(): boolean { - return (this._setSecondarySelections([]) > 0); + public killSecondaryCursors(): void { + this._setSecondaryStates([]); } - public normalize(): void { - this._mergeCursorsIfNecessary(); - } - - private _addSecondaryCursor(selection: ISelection): void { - var newCursor = new OneCursor(this.context); - if (selection) { - newCursor.setSelection(this.context, selection); - } - this.secondaryCursors.push(newCursor); + private _addSecondaryCursor(): void { + this.secondaryCursors.push(new OneCursor(this.context)); this.lastAddedCursorIndex = this.secondaryCursors.length; } @@ -168,39 +143,6 @@ export class CursorCollection { return this.lastAddedCursorIndex; } - /** - * Creates or disposes secondary cursors as necessary to match the number of `secondarySelections`. - * Return value: - * - a positive number indicates the number of secondary cursors added - * - a negative number indicates the number of secondary cursors removed - * - 0 indicates that no changes have been done to the secondary cursors list - */ - private _setSecondarySelections(secondarySelections: ISelection[]): number { - var secondaryCursorsLength = this.secondaryCursors.length; - var secondarySelectionsLength = secondarySelections.length; - var returnValue = secondarySelectionsLength - secondaryCursorsLength; - - if (secondaryCursorsLength < secondarySelectionsLength) { - var createCnt = secondarySelectionsLength - secondaryCursorsLength; - for (var i = 0; i < createCnt; i++) { - this._addSecondaryCursor(null); - } - } else if (secondaryCursorsLength > secondarySelectionsLength) { - var removeCnt = secondaryCursorsLength - secondarySelectionsLength; - for (var i = 0; i < removeCnt; i++) { - this._removeSecondaryCursor(this.secondaryCursors.length - 1); - } - } - - for (var i = 0; i < secondarySelectionsLength; i++) { - if (secondarySelections[i]) { - this.secondaryCursors[i].setSelection(this.context, secondarySelections[i]); - } - } - - return returnValue; - } - private _removeSecondaryCursor(removeIndex: number): void { if (this.lastAddedCursorIndex >= removeIndex + 1) { this.lastAddedCursorIndex--; @@ -209,24 +151,34 @@ export class CursorCollection { this.secondaryCursors.splice(removeIndex, 1); } - private _mergeCursorsIfNecessary(): void { + private _getAll(): OneCursor[] { + let result: OneCursor[] = []; + result[0] = this.primaryCursor; + for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { + result[i + 1] = this.secondaryCursors[i]; + } + return result; + } + + public normalize(): void { if (this.secondaryCursors.length === 0) { return; } - var cursors = this._getAll(); - var sortedCursors: { + let cursors = this._getAll(); + + interface SortedCursor { index: number; selection: Selection; viewSelection: Selection; - }[] = []; - for (var i = 0; i < cursors.length; i++) { + } + let sortedCursors: SortedCursor[] = []; + for (let i = 0, len = cursors.length; i < len; i++) { sortedCursors.push({ index: i, selection: cursors[i].modelState.selection, viewSelection: cursors[i].viewState.selection }); } - sortedCursors.sort((a, b) => { if (a.viewSelection.startLineNumber === b.viewSelection.startLineNumber) { return a.viewSelection.startColumn - b.viewSelection.startColumn; @@ -234,30 +186,39 @@ export class CursorCollection { return a.viewSelection.startLineNumber - b.viewSelection.startLineNumber; }); - for (var sortedCursorIndex = 0; sortedCursorIndex < sortedCursors.length - 1; sortedCursorIndex++) { - var current = sortedCursors[sortedCursorIndex]; - var next = sortedCursors[sortedCursorIndex + 1]; + for (let sortedCursorIndex = 0; sortedCursorIndex < sortedCursors.length - 1; sortedCursorIndex++) { + const current = sortedCursors[sortedCursorIndex]; + const next = sortedCursors[sortedCursorIndex + 1]; - var currentViewSelection = current.viewSelection; - var nextViewSelection = next.viewSelection; + const currentViewSelection = current.viewSelection; + const nextViewSelection = next.viewSelection; - if (nextViewSelection.getStartPosition().isBeforeOrEqual(currentViewSelection.getEndPosition())) { - var winnerSortedCursorIndex = current.index < next.index ? sortedCursorIndex : sortedCursorIndex + 1; - var looserSortedCursorIndex = current.index < next.index ? sortedCursorIndex + 1 : sortedCursorIndex; + let shouldMergeCursors: boolean; + if (nextViewSelection.isEmpty() || currentViewSelection.isEmpty()) { + // Merge touching cursors if one of them is collapsed + shouldMergeCursors = nextViewSelection.getStartPosition().isBeforeOrEqual(currentViewSelection.getEndPosition()); + } else { + // Merge only overlapping cursors (i.e. allow touching ranges) + shouldMergeCursors = nextViewSelection.getStartPosition().isBefore(currentViewSelection.getEndPosition()); + } - var looserIndex = sortedCursors[looserSortedCursorIndex].index; - var winnerIndex = sortedCursors[winnerSortedCursorIndex].index; + if (shouldMergeCursors) { + const winnerSortedCursorIndex = current.index < next.index ? sortedCursorIndex : sortedCursorIndex + 1; + const looserSortedCursorIndex = current.index < next.index ? sortedCursorIndex + 1 : sortedCursorIndex; - var looserSelection = sortedCursors[looserSortedCursorIndex].selection; - var winnerSelection = sortedCursors[winnerSortedCursorIndex].selection; + const looserIndex = sortedCursors[looserSortedCursorIndex].index; + const winnerIndex = sortedCursors[winnerSortedCursorIndex].index; + + const looserSelection = sortedCursors[looserSortedCursorIndex].selection; + const winnerSelection = sortedCursors[winnerSortedCursorIndex].selection; if (!looserSelection.equalsSelection(winnerSelection)) { - var resultingRange = looserSelection.plusRange(winnerSelection); - var looserSelectionIsLTR = (looserSelection.selectionStartLineNumber === looserSelection.startLineNumber && looserSelection.selectionStartColumn === looserSelection.startColumn); - var winnerSelectionIsLTR = (winnerSelection.selectionStartLineNumber === winnerSelection.startLineNumber && winnerSelection.selectionStartColumn === winnerSelection.startColumn); + const resultingRange = looserSelection.plusRange(winnerSelection); + const looserSelectionIsLTR = (looserSelection.selectionStartLineNumber === looserSelection.startLineNumber && looserSelection.selectionStartColumn === looserSelection.startColumn); + const winnerSelectionIsLTR = (winnerSelection.selectionStartLineNumber === winnerSelection.startLineNumber && winnerSelection.selectionStartColumn === winnerSelection.startColumn); // Give more importance to the last added cursor (think Ctrl-dragging + hitting another cursor) - var resultingSelectionIsLTR: boolean; + let resultingSelectionIsLTR: boolean; if (looserIndex === this.lastAddedCursorIndex) { resultingSelectionIsLTR = looserSelectionIsLTR; this.lastAddedCursorIndex = winnerIndex; @@ -266,7 +227,7 @@ export class CursorCollection { resultingSelectionIsLTR = winnerSelectionIsLTR; } - var resultingSelection: Selection; + let resultingSelection: Selection; if (resultingSelectionIsLTR) { resultingSelection = new Selection(resultingRange.startLineNumber, resultingRange.startColumn, resultingRange.endLineNumber, resultingRange.endColumn); } else { @@ -274,10 +235,11 @@ export class CursorCollection { } sortedCursors[winnerSortedCursorIndex].selection = resultingSelection; - cursors[winnerIndex].setSelection(this.context, resultingSelection); + const resultingState = CursorState.fromModelSelection(resultingSelection); + cursors[winnerIndex].setState(this.context, resultingState.modelState, resultingState.viewState); } - for (var j = 0; j < sortedCursors.length; j++) { + for (let j = 0; j < sortedCursors.length; j++) { if (sortedCursors[j].index > looserIndex) { sortedCursors[j].index--; } diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts index dd98c3479d4..55e00ad1e43 100644 --- a/src/vs/editor/common/controller/cursorCommon.ts +++ b/src/vs/editor/common/controller/cursorCommon.ts @@ -9,15 +9,16 @@ import { CharCode } from 'vs/base/common/charCode'; import * as strings from 'vs/base/common/strings'; import { ICommand, TextModelResolvedOptions, IConfiguration, IModel } from 'vs/editor/common/editorCommon'; import { TextModel } from 'vs/editor/common/model/textModel'; -import { Selection } from 'vs/editor/common/core/selection'; +import { Selection, ISelection } from 'vs/editor/common/core/selection'; import { Range } from 'vs/editor/common/core/range'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { onUnexpectedError } from 'vs/base/common/errors'; import { LanguageIdentifier } from 'vs/editor/common/modes'; import { IAutoClosingPair } from 'vs/editor/common/modes/languageConfiguration'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { ICoordinatesConverter } from 'vs/editor/common/viewModel/viewModel'; -import { CursorChangeReason, VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; +import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; +import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; export interface IColumnSelectData { toViewLineNumber: number; @@ -41,7 +42,7 @@ export interface ICursors { setStates(source: string, reason: CursorChangeReason, states: CursorState[]): void; reveal(horizontal: boolean, target: RevealTarget): void; - revealRange(revealHorizontal: boolean, modelRange: Range, viewRange: Range, verticalType: VerticalRevealType); + revealRange(revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType): void; scrollTo(desiredScrollTop: number): void; } @@ -61,6 +62,7 @@ export class CursorConfiguration { public readonly lineHeight: number; public readonly useTabStops: boolean; public readonly wordSeparators: string; + public readonly emptySelectionClipboard: boolean; public readonly autoClosingBrackets: boolean; public readonly autoClosingPairsOpen: CharacterMap; public readonly autoClosingPairsClose: CharacterMap; @@ -71,6 +73,7 @@ export class CursorConfiguration { return ( e.layoutInfo || e.wordSeparators + || e.emptySelectionClipboard || e.autoClosingBrackets || e.useTabStops || e.lineHeight @@ -94,6 +97,7 @@ export class CursorConfiguration { this.lineHeight = c.lineHeight; this.useTabStops = c.useTabStops; this.wordSeparators = c.wordSeparators; + this.emptySelectionClipboard = c.emptySelectionClipboard; this.autoClosingBrackets = c.autoClosingBrackets; this.autoClosingPairsOpen = {}; @@ -256,87 +260,72 @@ export class SingleCursorState { } } -export interface IViewModelHelper { - - coordinatesConverter: ICoordinatesConverter; - - viewModel: ICursorSimpleModel; - - getScrollTop(): number; - - getCompletelyVisibleViewRange(): Range; - - getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range; - - getVerticalOffsetForViewLineNumber(viewLineNumber: number): number; -} - export class CursorContext { _cursorContextBrand: void; public readonly model: IModel; - public readonly viewModel: ICursorSimpleModel; + public readonly viewModel: IViewModel; public readonly config: CursorConfiguration; - private readonly _viewModelHelper: IViewModelHelper; - private readonly _coordinatesConverter: ICoordinatesConverter; - - constructor(model: IModel, viewModelHelper: IViewModelHelper, config: CursorConfiguration) { + constructor(configuration: IConfiguration, model: IModel, viewModel: IViewModel) { this.model = model; - this.viewModel = viewModelHelper.viewModel; - this.config = config; - this._viewModelHelper = viewModelHelper; - this._coordinatesConverter = viewModelHelper.coordinatesConverter; + this.viewModel = viewModel; + this.config = new CursorConfiguration( + this.model.getLanguageIdentifier(), + this.model.getOneIndent(), + this.model.getOptions(), + configuration + ); } public validateViewPosition(viewPosition: Position, modelPosition: Position): Position { - return this._coordinatesConverter.validateViewPosition(viewPosition, modelPosition); + return this.viewModel.coordinatesConverter.validateViewPosition(viewPosition, modelPosition); } public validateViewRange(viewRange: Range, expectedModelRange: Range): Range { - return this._coordinatesConverter.validateViewRange(viewRange, expectedModelRange); + return this.viewModel.coordinatesConverter.validateViewRange(viewRange, expectedModelRange); } public convertViewRangeToModelRange(viewRange: Range): Range { - return this._coordinatesConverter.convertViewRangeToModelRange(viewRange); + return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange); } public convertViewPositionToModelPosition(lineNumber: number, column: number): Position { - return this._coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber, column)); + return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber, column)); } public convertModelPositionToViewPosition(modelPosition: Position): Position { - return this._coordinatesConverter.convertModelPositionToViewPosition(modelPosition); + return this.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition); } public convertModelRangeToViewRange(modelRange: Range): Range { - return this._coordinatesConverter.convertModelRangeToViewRange(modelRange); + return this.viewModel.coordinatesConverter.convertModelRangeToViewRange(modelRange); } public getScrollTop(): number { - return this._viewModelHelper.getScrollTop(); + return this.viewModel.viewLayout.getScrollTop(); } public getCompletelyVisibleViewRange(): Range { - return this._viewModelHelper.getCompletelyVisibleViewRange(); + return this.viewModel.getCompletelyVisibleViewRange(); } public getCompletelyVisibleModelRange(): Range { - const viewRange = this._viewModelHelper.getCompletelyVisibleViewRange(); - return this._coordinatesConverter.convertViewRangeToModelRange(viewRange); + const viewRange = this.viewModel.getCompletelyVisibleViewRange(); + return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange); } public getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range { - return this._viewModelHelper.getCompletelyVisibleViewRangeAtScrollTop(scrollTop); + return this.viewModel.getCompletelyVisibleViewRangeAtScrollTop(scrollTop); } public getCompletelyVisibleModelRangeAtScrollTop(scrollTop: number): Range { - const viewRange = this._viewModelHelper.getCompletelyVisibleViewRangeAtScrollTop(scrollTop); - return this._coordinatesConverter.convertViewRangeToModelRange(viewRange); + const viewRange = this.viewModel.getCompletelyVisibleViewRangeAtScrollTop(scrollTop); + return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange); } public getVerticalOffsetForViewLine(viewLineNumber: number): number { - return this._viewModelHelper.getVerticalOffsetForViewLineNumber(viewLineNumber); + return this.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewLineNumber); } } @@ -351,6 +340,26 @@ export class CursorState { return new CursorState(null, viewState); } + public static fromModelSelection(modelSelection: ISelection): CursorState { + const selectionStartLineNumber = modelSelection.selectionStartLineNumber; + const selectionStartColumn = modelSelection.selectionStartColumn; + const positionLineNumber = modelSelection.positionLineNumber; + const positionColumn = modelSelection.positionColumn; + const modelState = new SingleCursorState( + new Range(selectionStartLineNumber, selectionStartColumn, selectionStartLineNumber, selectionStartColumn), 0, + new Position(positionLineNumber, positionColumn), 0 + ); + return CursorState.fromModelState(modelState); + } + + public static fromModelSelections(modelSelections: ISelection[]): CursorState[] { + let states: CursorState[] = []; + for (let i = 0, len = modelSelections.length; i < len; i++) { + states[i] = this.fromModelSelection(modelSelections[i]); + } + return states; + } + public static ensureInEditableRange(context: CursorContext, states: CursorState[]): CursorState[] { const model = context.model; if (!model.hasEditableRange()) { @@ -402,29 +411,21 @@ export class CursorState { this.modelState = modelState; this.viewState = viewState; } -} -export class CommandResult { - _commandResultBrand: void; - - readonly command: ICommand; - readonly isAutoWhitespaceCommand: boolean; - - constructor(command: ICommand, isAutoWhitespaceCommand: boolean) { - this.command = command; - this.isAutoWhitespaceCommand = isAutoWhitespaceCommand; + public equals(other: CursorState): boolean { + return (this.viewState.equals(other.viewState) && this.modelState.equals(other.viewState)); } } export class EditOperationResult { _editOperationResultBrand: void; - readonly commands: CommandResult[]; + readonly commands: ICommand[]; readonly shouldPushStackElementBefore: boolean; readonly shouldPushStackElementAfter: boolean; constructor( - commands: CommandResult[], + commands: ICommand[], opts: { shouldPushStackElementBefore: boolean; shouldPushStackElementAfter: boolean; diff --git a/src/vs/editor/common/controller/cursorDeleteOperations.ts b/src/vs/editor/common/controller/cursorDeleteOperations.ts index ffcfaf8530d..7951ab91b83 100644 --- a/src/vs/editor/common/controller/cursorDeleteOperations.ts +++ b/src/vs/editor/common/controller/cursorDeleteOperations.ts @@ -5,23 +5,25 @@ 'use strict'; import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; -import { SingleCursorState, CursorColumns, CursorConfiguration, ICursorSimpleModel, EditOperationResult, CommandResult } from 'vs/editor/common/controller/cursorCommon'; +import { CursorColumns, CursorConfiguration, ICursorSimpleModel, EditOperationResult } from 'vs/editor/common/controller/cursorCommon'; import { Range } from 'vs/editor/common/core/range'; +import { Selection } from 'vs/editor/common/core/selection'; import { MoveOperations } from 'vs/editor/common/controller/cursorMoveOperations'; import * as strings from 'vs/base/common/strings'; +import { ICommand } from 'vs/editor/common/editorCommon'; export class DeleteOperations { - public static deleteRight(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; + public static deleteRight(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, ICommand[]] { + let commands: ICommand[] = []; let shouldPushStackElementBefore = false; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; - let deleteSelection: Range = cursor.selection; + let deleteSelection: Range = selection; if (deleteSelection.isEmpty()) { - let position = cursor.position; + let position = selection.getPosition(); let rightOfPosition = MoveOperations.right(config, model, position.lineNumber, position.column); deleteSelection = new Range( rightOfPosition.lineNumber, @@ -41,23 +43,19 @@ export class DeleteOperations { shouldPushStackElementBefore = true; } - commands[i] = new CommandResult(new ReplaceCommand(deleteSelection, ''), false); + commands[i] = new ReplaceCommand(deleteSelection, ''); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: shouldPushStackElementBefore, - shouldPushStackElementAfter: false - }); + return [shouldPushStackElementBefore, commands]; } - private static _isAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): boolean { + private static _isAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): boolean { if (!config.autoClosingBrackets) { return false; } - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; - const position = cursor.position; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; + const position = selection.getPosition(); if (!selection.isEmpty()) { return false; @@ -81,40 +79,36 @@ export class DeleteOperations { return true; } - private static _runAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const position = cursor.position; + private static _runAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, ICommand[]] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const position = selections[i].getPosition(); const deleteSelection = new Range( position.lineNumber, position.column - 1, position.lineNumber, position.column + 1 ); - commands[i] = new CommandResult(new ReplaceCommand(deleteSelection, ''), false); + commands[i] = new ReplaceCommand(deleteSelection, ''); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false - }); + return [true, commands]; } - public static deleteLeft(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult { + public static deleteLeft(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, ICommand[]] { - if (this._isAutoClosingPairDelete(config, model, cursors)) { - return this._runAutoClosingPairDelete(config, model, cursors); + if (this._isAutoClosingPairDelete(config, model, selections)) { + return this._runAutoClosingPairDelete(config, model, selections); } - let commands: CommandResult[] = []; + let commands: ICommand[] = []; let shouldPushStackElementBefore = false; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; - let deleteSelection: Range = cursor.selection; + let deleteSelection: Range = selection; if (deleteSelection.isEmpty()) { - let position = cursor.position; + let position = selection.getPosition(); if (config.useTabStops && position.column > 1) { let lineContent = model.getLineContent(position.lineNumber); @@ -155,25 +149,21 @@ export class DeleteOperations { shouldPushStackElementBefore = true; } - commands[i] = new CommandResult(new ReplaceCommand(deleteSelection, ''), false); + commands[i] = new ReplaceCommand(deleteSelection, ''); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: shouldPushStackElementBefore, - shouldPushStackElementAfter: false - }); + return [shouldPushStackElementBefore, commands]; } - public static cut(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[], enableEmptySelectionClipboard: boolean): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let selection = cursor.selection; + public static cut(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; if (selection.isEmpty()) { - if (enableEmptySelectionClipboard) { + if (config.emptySelectionClipboard) { // This is a full line cut - let position = cursor.position; + let position = selection.getPosition(); let startLineNumber: number, startColumn: number, @@ -208,7 +198,7 @@ export class DeleteOperations { ); if (!deleteSelection.isEmpty()) { - commands[i] = new CommandResult(new ReplaceCommand(deleteSelection, ''), false); + commands[i] = new ReplaceCommand(deleteSelection, ''); } else { commands[i] = null; } @@ -217,7 +207,7 @@ export class DeleteOperations { commands[i] = null; } } else { - commands[i] = new CommandResult(new ReplaceCommand(selection, ''), false); + commands[i] = new ReplaceCommand(selection, ''); } } return new EditOperationResult(commands, { @@ -225,5 +215,4 @@ export class DeleteOperations { shouldPushStackElementAfter: true }); } - -} \ No newline at end of file +} diff --git a/src/vs/editor/common/controller/cursorEvents.ts b/src/vs/editor/common/controller/cursorEvents.ts index 5b0992d96f1..9c7b9789445 100644 --- a/src/vs/editor/common/controller/cursorEvents.ts +++ b/src/vs/editor/common/controller/cursorEvents.ts @@ -6,19 +6,8 @@ 'use strict'; import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -/** - * @internal - */ -export const CursorEventType = { - CursorPositionChanged: 'positionChanged', - CursorSelectionChanged: 'selectionChanged', - CursorRevealRange: 'revealRange', - CursorScrollRequest: 'scrollRequest', -}; - /** * Describes the reason the cursor has changed its position. */ @@ -60,18 +49,10 @@ export interface ICursorPositionChangedEvent { * Primary cursor's position. */ readonly position: Position; - /** - * Primary cursor's view position - */ - readonly viewPosition: Position; /** * Secondary cursors' position. */ readonly secondaryPositions: Position[]; - /** - * Secondary cursors' view position. - */ - readonly secondaryViewPositions: Position[]; /** * Reason. */ @@ -80,10 +61,6 @@ export interface ICursorPositionChangedEvent { * Source of the call that caused the event. */ readonly source: string; - /** - * Is the primary cursor in the editable range? - */ - readonly isInEditableRange: boolean; } /** * An event describing that the cursor selection has changed. @@ -93,18 +70,10 @@ export interface ICursorSelectionChangedEvent { * The primary selection. */ readonly selection: Selection; - /** - * The primary selection in view coordinates. - */ - readonly viewSelection: Selection; /** * The secondary selections. */ readonly secondarySelections: Selection[]; - /** - * The secondary selections in view coordinates. - */ - readonly secondaryViewSelections: Selection[]; /** * Source of the call that caused the event. */ @@ -114,46 +83,3 @@ export interface ICursorSelectionChangedEvent { */ readonly reason: CursorChangeReason; } -/** - * @internal - */ -export const enum VerticalRevealType { - Simple = 0, - Center = 1, - CenterIfOutsideViewport = 2, - Top = 3, - Bottom = 4 -} -/** - * An event describing a request to reveal a specific range in the view of the editor. - * @internal - */ -export interface ICursorRevealRangeEvent { - /** - * Range to be reavealed. - */ - readonly range: Range; - /** - * View range to be reavealed. - */ - readonly viewRange: Range; - - readonly verticalType: VerticalRevealType; - /** - * If true: there should be a horizontal & vertical revealing - * If false: there should be just a vertical revealing - */ - readonly revealHorizontal: boolean; -} - -/** - * @internal - */ -export class CursorScrollRequest { - - public readonly desiredScrollTop: number; - - constructor(desiredScrollTop: number) { - this.desiredScrollTop = desiredScrollTop; - } -} diff --git a/src/vs/editor/common/controller/cursorMoveCommands.ts b/src/vs/editor/common/controller/cursorMoveCommands.ts index 37f6197d6ec..97925d92dcc 100644 --- a/src/vs/editor/common/controller/cursorMoveCommands.ts +++ b/src/vs/editor/common/controller/cursorMoveCommands.ts @@ -38,20 +38,78 @@ export class CursorMoveCommands { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; - result[i] = CursorState.fromViewState(MoveOperations.moveToBeginningOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)); + result[i] = this._moveToLineStart(context, cursor, inSelectionMode); } + return result; } + private static _moveToLineStart(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + const currentViewStateColumn = cursor.viewState.position.column; + const currentModelStateColumn = cursor.modelState.position.column; + const isFirstLineOfWrappedLine = currentViewStateColumn === currentModelStateColumn; + + const currentViewStatelineNumber = cursor.viewState.position.lineNumber; + const firstNonBlankColumn = context.viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber); + const isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn; + + if (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) { + return this._moveToLineStartByView(context, cursor, inSelectionMode); + } else { + return this._moveToLineStartByModel(context, cursor, inSelectionMode); + } + } + + private static _moveToLineStartByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromViewState( + MoveOperations.moveToBeginningOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode) + ); + } + + private static _moveToLineStartByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromModelState( + MoveOperations.moveToBeginningOfLine(context.config, context.model, cursor.modelState, inSelectionMode) + ); + } + public static moveToEndOfLine(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean): CursorState[] { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; - result[i] = CursorState.fromViewState(MoveOperations.moveToEndOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)); + result[i] = this._moveToLineEnd(context, cursor, inSelectionMode); } + return result; } + private static _moveToLineEnd(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + const viewStatePosition = cursor.viewState.position; + const viewModelMaxColumn = context.viewModel.getLineMaxColumn(viewStatePosition.lineNumber); + const isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn; + + const modelStatePosition = cursor.modelState.position; + const modelMaxColumn = context.model.getLineMaxColumn(modelStatePosition.lineNumber); + const isEndLineOfWrappedLine = viewModelMaxColumn - viewStatePosition.column === modelMaxColumn - modelStatePosition.column; + + if (isEndOfViewLine || isEndLineOfWrappedLine) { + return this._moveToLineEndByModel(context, cursor, inSelectionMode); + } else { + return this._moveToLineEndByView(context, cursor, inSelectionMode); + } + } + + private static _moveToLineEndByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromViewState( + MoveOperations.moveToEndOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode) + ); + } + + private static _moveToLineEndByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromModelState( + MoveOperations.moveToEndOfLine(context.config, context.model, cursor.modelState, inSelectionMode) + ); + } + public static expandLineSelection(context: CursorContext, cursors: CursorState[]): CursorState[] { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { @@ -498,7 +556,7 @@ export class CursorMoveCommands { export namespace CursorMove { - const isCursorMoveArgs = function (arg): boolean { + const isCursorMoveArgs = function (arg: any): boolean { if (!types.isObject(arg)) { return false; } diff --git a/src/vs/editor/common/controller/cursorTypeOperations.ts b/src/vs/editor/common/controller/cursorTypeOperations.ts index 13b79a281fe..6abac0a543e 100644 --- a/src/vs/editor/common/controller/cursorTypeOperations.ts +++ b/src/vs/editor/common/controller/cursorTypeOperations.ts @@ -6,7 +6,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { ReplaceCommand, ReplaceCommandWithoutChangingPosition, ReplaceCommandWithOffsetCursorState } from 'vs/editor/common/commands/replaceCommand'; -import { SingleCursorState, CursorColumns, CursorConfiguration, ICursorSimpleModel, EditOperationResult, CommandResult } from 'vs/editor/common/controller/cursorCommon'; +import { CursorColumns, CursorConfiguration, ICursorSimpleModel, EditOperationResult } from 'vs/editor/common/controller/cursorCommon'; import { Range } from 'vs/editor/common/core/range'; import { ICommand, ITokenizedModel } from 'vs/editor/common/editorCommon'; import * as strings from 'vs/base/common/strings'; @@ -16,47 +16,34 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand'; import { IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter'; +import { getMapForWordSeparators, WordCharacterClass } from 'vs/editor/common/controller/wordCharacterClassifier'; export class TypeOperations { - public static indent(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - commands[i] = new CommandResult( - new ShiftCommand(cursor.selection, { - isUnshift: false, - tabSize: config.tabSize, - oneIndent: config.oneIndent, - useTabStops: config.useTabStops - }), - false - ); + public static indent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = new ShiftCommand(selections[i], { + isUnshift: false, + tabSize: config.tabSize, + oneIndent: config.oneIndent, + useTabStops: config.useTabStops + }); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); + return commands; } - public static outdent(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - commands[i] = new CommandResult( - new ShiftCommand(cursor.selection, { - isUnshift: true, - tabSize: config.tabSize, - oneIndent: config.oneIndent, - useTabStops: config.useTabStops - }), - false - ); + public static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = new ShiftCommand(selections[i], { + isUnshift: true, + tabSize: config.tabSize, + oneIndent: config.oneIndent, + useTabStops: config.useTabStops + }); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); + return commands; } public static shiftIndent(config: CursorConfiguration, indentation: string, count?: number): string { @@ -81,12 +68,10 @@ export class TypeOperations { return newIndentation; } - public static distributedPaste(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[], text: string[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let selection = cursor.selection; - commands[i] = new CommandResult(new ReplaceCommand(selection, text[i]), false); + private static _distributedPaste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string[]): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = new ReplaceCommand(selections[i], text[i]); } return new EditOperationResult(commands, { shouldPushStackElementBefore: true, @@ -94,12 +79,11 @@ export class TypeOperations { }); } - public static paste(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[], text: string, pasteOnNewLine: boolean): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let position = cursor.position; - let selection = cursor.selection; + private static _simplePaste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; + let position = selection.getPosition(); if (pasteOnNewLine && text.indexOf('\n') !== text.length - 1) { pasteOnNewLine = false; @@ -114,9 +98,9 @@ export class TypeOperations { if (pasteOnNewLine) { // Paste entire line at the beginning of line let typeSelection = new Range(position.lineNumber, 1, position.lineNumber, 1); - commands[i] = new CommandResult(new ReplaceCommand(typeSelection, text), false); + commands[i] = new ReplaceCommand(typeSelection, text); } else { - commands[i] = new CommandResult(new ReplaceCommand(selection, text), false); + commands[i] = new ReplaceCommand(selection, text); } } return new EditOperationResult(commands, { @@ -125,6 +109,40 @@ export class TypeOperations { }); } + private static _distributePasteToCursors(selections: Selection[], pasteOnNewLine: boolean, text: string): string[] { + if (pasteOnNewLine) { + return null; + } + + if (selections.length === 1) { + return null; + } + + for (let i = 0; i < selections.length; i++) { + if (selections[i].startLineNumber !== selections[i].endLineNumber) { + return null; + } + } + + let pastePieces = text.split(/\r\n|\r|\n/); + if (pastePieces.length !== selections.length) { + return null; + } + + return pastePieces; + } + + public static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], pasteOnNewLine: boolean, text: string): EditOperationResult { + const distributedPaste = this._distributePasteToCursors(selections, pasteOnNewLine, text); + + if (distributedPaste) { + selections = selections.sort(Range.compareRangesUsingStarts); + return this._distributedPaste(config, model, selections, distributedPaste); + } else { + return this._simplePaste(config, model, selections, text, pasteOnNewLine); + } + } + private static _goodIndentForLine(config: CursorConfiguration, model: ITokenizedModel, lineNumber: number): string { let expectedIndentAction = LanguageConfigurationRegistry.getGoodIndentActionForLine(model, lineNumber); @@ -156,7 +174,7 @@ export class TypeOperations { return null; } - private static _replaceJumpToNextIndent(config: CursorConfiguration, model: ICursorSimpleModel, selection: Selection): ReplaceCommand { + private static _replaceJumpToNextIndent(config: CursorConfiguration, model: ICursorSimpleModel, selection: Selection, insertsAutoWhitespace: boolean): ReplaceCommand { let typeText = ''; let position = selection.getStartPosition(); @@ -171,14 +189,13 @@ export class TypeOperations { typeText = '\t'; } - return new ReplaceCommand(selection, typeText); + return new ReplaceCommand(selection, typeText, insertsAutoWhitespace); } - public static tab(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let selection = cursor.selection; + public static tab(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; if (selection.isEmpty()) { @@ -189,48 +206,48 @@ export class TypeOperations { goodIndent = goodIndent || '\t'; let possibleTypeText = config.normalizeIndentation(goodIndent); if (!strings.startsWith(lineText, possibleTypeText)) { - let command = new ReplaceCommand(new Range(selection.startLineNumber, 1, selection.startLineNumber, lineText.length + 1), possibleTypeText); - commands[i] = new CommandResult(command, true); + commands[i] = new ReplaceCommand(new Range(selection.startLineNumber, 1, selection.startLineNumber, lineText.length + 1), possibleTypeText, true); continue; } } - commands[i] = new CommandResult(this._replaceJumpToNextIndent(config, model, selection), true); + commands[i] = this._replaceJumpToNextIndent(config, model, selection, true); } else { if (selection.startLineNumber === selection.endLineNumber) { let lineMaxColumn = model.getLineMaxColumn(selection.startLineNumber); if (selection.startColumn !== 1 || selection.endColumn !== lineMaxColumn) { // This is a single line selection that is not the entire line - commands[i] = new CommandResult(this._replaceJumpToNextIndent(config, model, selection), false); + commands[i] = this._replaceJumpToNextIndent(config, model, selection, false); continue; } } - commands[i] = new CommandResult( - new ShiftCommand(selection, { - isUnshift: false, - tabSize: config.tabSize, - oneIndent: config.oneIndent, - useTabStops: config.useTabStops - }), - false - ); + commands[i] = new ShiftCommand(selection, { + isUnshift: false, + tabSize: config.tabSize, + oneIndent: config.oneIndent, + useTabStops: config.useTabStops + }); } } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); + return commands; } - public static replacePreviousChar(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], txt: string, replaceCharCnt: number): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let pos = cursor.position; + public static replacePreviousChar(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], txt: string, replaceCharCnt: number): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; + if (!selection.isEmpty()) { + // looks like https://github.com/Microsoft/vscode/issues/2773 + // where a cursor operation occured before a canceled composition + // => ignore composition + commands[i] = null; + continue; + } + let pos = selection.getPosition(); let startColumn = Math.max(1, pos.column - replaceCharCnt); let range = new Range(pos.lineNumber, startColumn, pos.lineNumber, pos.column); - commands[i] = new CommandResult(new ReplaceCommand(range, txt), false); + commands[i] = new ReplaceCommand(range, txt); } return new EditOperationResult(commands, { shouldPushStackElementBefore: false, @@ -238,15 +255,15 @@ export class TypeOperations { }); } - public static typeCommand(range: Range, text: string, keepPosition: boolean): ICommand { + private static _typeCommand(range: Range, text: string, keepPosition: boolean): ICommand { if (keepPosition) { - return new ReplaceCommandWithoutChangingPosition(range, text); + return new ReplaceCommandWithoutChangingPosition(range, text, true); } else { - return new ReplaceCommand(range, text); + return new ReplaceCommand(range, text, true); } } - private static _enter(config: CursorConfiguration, model: ITokenizedModel, keepPosition: boolean, range: Range): CommandResult { + private static _enter(config: CursorConfiguration, model: ITokenizedModel, keepPosition: boolean, range: Range): ICommand { let r = LanguageConfigurationRegistry.getEnterAction(model, range); let enterAction = r.enterAction; let indentation = r.indentation; @@ -275,14 +292,13 @@ export class TypeOperations { indentation = indentation.substring(0, indentation.length - enterAction.removeText); } - let executeCommand: ICommand; if (enterAction.indentAction === IndentAction.None) { // Nothing special - executeCommand = TypeOperations.typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); + return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); } else if (enterAction.indentAction === IndentAction.Indent) { // Indent once - executeCommand = TypeOperations.typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); + return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); } else if (enterAction.indentAction === IndentAction.IndentOutdent) { // Ultra special @@ -292,32 +308,31 @@ export class TypeOperations { let typeText = beforeText + '\n' + increasedIndent + '\n' + normalIndent; if (keepPosition) { - executeCommand = new ReplaceCommandWithoutChangingPosition(range, typeText); + return new ReplaceCommandWithoutChangingPosition(range, typeText, true); } else { - executeCommand = new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length); + return new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length, true); } } else if (enterAction.indentAction === IndentAction.Outdent) { let actualIndentation = TypeOperations.unshiftIndent(config, indentation); - executeCommand = TypeOperations.typeCommand(range, beforeText + '\n' + config.normalizeIndentation(actualIndentation + enterAction.appendText), keepPosition); + return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(actualIndentation + enterAction.appendText), keepPosition); } - return new CommandResult(executeCommand, true); + return null; } - private static _isAutoClosingCloseCharType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): boolean { + private static _isAutoClosingCloseCharType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): boolean { if (!config.autoClosingBrackets || !config.autoClosingPairsClose.hasOwnProperty(ch)) { return false; } - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; if (!selection.isEmpty()) { return false; } - const position = cursor.position; + const position = selection.getPosition(); const lineText = model.getLineContent(position.lineNumber); const afterCharacter = lineText.charAt(position.column - 1); @@ -329,13 +344,13 @@ export class TypeOperations { return true; } - private static _runAutoClosingCloseCharType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const position = cursor.position; + private static _runAutoClosingCloseCharType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; + const position = selection.getPosition(); const typeSelection = new Range(position.lineNumber, position.column, position.lineNumber, position.column + 1); - commands[i] = new CommandResult(new ReplaceCommand(typeSelection, ch), false); + commands[i] = new ReplaceCommand(typeSelection, ch); } return new EditOperationResult(commands, { shouldPushStackElementBefore: false, @@ -343,24 +358,33 @@ export class TypeOperations { }); } - private static _isAutoClosingOpenCharType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): boolean { + private static _isAutoClosingOpenCharType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): boolean { if (!config.autoClosingBrackets || !config.autoClosingPairsOpen.hasOwnProperty(ch)) { return false; } - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; if (!selection.isEmpty()) { return false; } - const position = cursor.position; + const position = selection.getPosition(); const lineText = model.getLineContent(position.lineNumber); - const afterCharacter = lineText.charAt(position.column - 1); + + // Do not auto-close ' or " after a word character + if ((ch === '\'' || ch === '"') && position.column > 1) { + const wordSeparators = getMapForWordSeparators(config.wordSeparators); + const characterBeforeCode = lineText.charCodeAt(position.column - 2); + const characterBeforeType = wordSeparators.get(characterBeforeCode); + if (characterBeforeType === WordCharacterClass.Regular) { + return false; + } + } // Only consider auto closing the pair if a space follows or if another autoclosed pair follows - if (afterCharacter) { + const characterAfter = lineText.charAt(position.column - 1); + if (characterAfter) { const thisBraceIsSymmetric = (config.autoClosingPairsOpen[ch] === ch); let isBeforeCloseBrace = false; @@ -369,12 +393,12 @@ export class TypeOperations { if (!thisBraceIsSymmetric && otherBraceIsSymmetric) { continue; } - if (afterCharacter === otherCloseBrace) { + if (characterAfter === otherCloseBrace) { isBeforeCloseBrace = true; break; } } - if (!isBeforeCloseBrace && !/\s/.test(afterCharacter)) { + if (!isBeforeCloseBrace && !/\s/.test(characterAfter)) { return false; } } @@ -397,16 +421,12 @@ export class TypeOperations { return true; } - private static _runAutoClosingOpenCharType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; + private static _runAutoClosingOpenCharType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; const closeCharacter = config.autoClosingPairsOpen[ch]; - commands[i] = new CommandResult( - new ReplaceCommandWithOffsetCursorState(selection, ch + closeCharacter, 0, -closeCharacter.length), - false - ); + commands[i] = new ReplaceCommandWithOffsetCursorState(selection, ch + closeCharacter, 0, -closeCharacter.length); } return new EditOperationResult(commands, { shouldPushStackElementBefore: true, @@ -414,14 +434,13 @@ export class TypeOperations { }); } - private static _isSurroundSelectionType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): boolean { + private static _isSurroundSelectionType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): boolean { if (!config.autoClosingBrackets || !config.surroundingPairs.hasOwnProperty(ch)) { return false; } - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; if (selection.isEmpty()) { return false; @@ -449,13 +468,12 @@ export class TypeOperations { return true; } - private static _runSurroundSelectionType(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const selection = cursor.selection; + private static _runSurroundSelectionType(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; const closeCharacter = config.surroundingPairs[ch]; - commands[i] = new CommandResult(new SurroundSelectionCommand(selection, ch, closeCharacter), false); + commands[i] = new SurroundSelectionCommand(selection, ch, closeCharacter); } return new EditOperationResult(commands, { shouldPushStackElementBefore: true, @@ -463,12 +481,12 @@ export class TypeOperations { }); } - private static _typeInterceptorElectricChar(config: CursorConfiguration, model: ITokenizedModel, cursor: SingleCursorState, ch: string): EditOperationResult { - if (!config.electricChars.hasOwnProperty(ch) || !cursor.selection.isEmpty()) { + private static _typeInterceptorElectricChar(config: CursorConfiguration, model: ITokenizedModel, selections: Selection, ch: string): EditOperationResult { + if (!config.electricChars.hasOwnProperty(ch) || !selections.isEmpty()) { return null; } - let position = cursor.position; + let position = selections.getPosition(); model.forceTokenization(position.lineNumber); let lineTokens = model.getLineTokens(position.lineNumber); @@ -484,7 +502,7 @@ export class TypeOperations { } if (electricAction.appendText) { - const command = new CommandResult(new ReplaceCommandWithOffsetCursorState(cursor.selection, ch + electricAction.appendText, 0, -electricAction.appendText.length), false); + const command = new ReplaceCommandWithOffsetCursorState(selections, ch + electricAction.appendText, 0, -electricAction.appendText.length); return new EditOperationResult([command], { shouldPushStackElementBefore: false, shouldPushStackElementAfter: true @@ -515,7 +533,7 @@ export class TypeOperations { let typeSelection = new Range(position.lineNumber, 1, position.lineNumber, position.column); - const command = new CommandResult(new ReplaceCommand(typeSelection, typeText), false); + const command = new ReplaceCommand(typeSelection, typeText); return new EditOperationResult([command], { shouldPushStackElementBefore: false, shouldPushStackElementAfter: true @@ -526,12 +544,12 @@ export class TypeOperations { return null; } - public static typeWithInterceptors(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], ch: string): EditOperationResult { + public static typeWithInterceptors(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], ch: string): EditOperationResult { if (ch === '\n') { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - commands[i] = TypeOperations._enter(config, model, false, cursors[i].selection); + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = TypeOperations._enter(config, model, false, selections[i]); } return new EditOperationResult(commands, { shouldPushStackElementBefore: true, @@ -539,35 +557,34 @@ export class TypeOperations { }); } - if (this._isAutoClosingCloseCharType(config, model, cursors, ch)) { - return this._runAutoClosingCloseCharType(config, model, cursors, ch); + if (this._isAutoClosingCloseCharType(config, model, selections, ch)) { + return this._runAutoClosingCloseCharType(config, model, selections, ch); } - if (this._isAutoClosingOpenCharType(config, model, cursors, ch)) { - return this._runAutoClosingOpenCharType(config, model, cursors, ch); + if (this._isAutoClosingOpenCharType(config, model, selections, ch)) { + return this._runAutoClosingOpenCharType(config, model, selections, ch); } - if (this._isSurroundSelectionType(config, model, cursors, ch)) { - return this._runSurroundSelectionType(config, model, cursors, ch); + if (this._isSurroundSelectionType(config, model, selections, ch)) { + return this._runSurroundSelectionType(config, model, selections, ch); } // Electric characters make sense only when dealing with a single cursor, // as multiple cursors typing brackets for example would interfer with bracket matching - if (cursors.length === 1) { - const r = this._typeInterceptorElectricChar(config, model, cursors[0], ch); + if (selections.length === 1) { + const r = this._typeInterceptorElectricChar(config, model, selections[0], ch); if (r) { return r; } } - return this.typeWithoutInterceptors(config, model, cursors, ch); + return this.typeWithoutInterceptors(config, model, selections, ch); } - public static typeWithoutInterceptors(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[], str: string): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - commands[i] = new CommandResult(new ReplaceCommand(cursor.selection, str), false); + public static typeWithoutInterceptors(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[], str: string): EditOperationResult { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = new ReplaceCommand(selections[i], str); } return new EditOperationResult(commands, { shouldPushStackElementBefore: false, @@ -575,14 +592,13 @@ export class TypeOperations { }); } - public static lineInsertBefore(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let lineNumber = cursor.position.lineNumber; + public static lineInsertBefore(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + let lineNumber = selections[i].positionLineNumber; if (lineNumber === 1) { - commands[i] = new CommandResult(new ReplaceCommandWithoutChangingPosition(new Range(1, 1, 1, 1), '\n'), false); + commands[i] = new ReplaceCommandWithoutChangingPosition(new Range(1, 1, 1, 1), '\n'); } else { lineNumber--; let column = model.getLineMaxColumn(lineNumber); @@ -590,35 +606,24 @@ export class TypeOperations { commands[i] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column)); } } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false, - }); + return commands; } - public static lineInsertAfter(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - let position = cursor.position; - let column = model.getLineMaxColumn(position.lineNumber); - commands[i] = this._enter(config, model, false, new Range(position.lineNumber, column, position.lineNumber, column)); + public static lineInsertAfter(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + const lineNumber = selections[i].positionLineNumber; + let column = model.getLineMaxColumn(lineNumber); + commands[i] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column)); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false, - }); + return commands; } - public static lineBreakInsert(config: CursorConfiguration, model: ITokenizedModel, cursors: SingleCursorState[]): EditOperationResult { - let commands: CommandResult[] = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - commands[i] = this._enter(config, model, true, cursor.selection); + public static lineBreakInsert(config: CursorConfiguration, model: ITokenizedModel, selections: Selection[]): ICommand[] { + let commands: ICommand[] = []; + for (let i = 0, len = selections.length; i < len; i++) { + commands[i] = this._enter(config, model, true, selections[i]); } - return new EditOperationResult(commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false, - }); + return commands; } } diff --git a/src/vs/editor/common/controller/cursorWordOperations.ts b/src/vs/editor/common/controller/cursorWordOperations.ts index d420a29b871..3666961a2a2 100644 --- a/src/vs/editor/common/controller/cursorWordOperations.ts +++ b/src/vs/editor/common/controller/cursorWordOperations.ts @@ -6,8 +6,7 @@ import { SingleCursorState, CursorConfiguration, ICursorSimpleModel } from 'vs/editor/common/controller/cursorCommon'; import { Position } from 'vs/editor/common/core/position'; -import { CharCode } from 'vs/base/common/charCode'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; +import { WordCharacterClassifier, WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; import * as strings from 'vs/base/common/strings'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; @@ -33,46 +32,11 @@ const enum WordType { Separator = 2 } -export const enum WordCharacterClass { - Regular = 0, - Whitespace = 1, - WordSeparator = 2 -} - export const enum WordNavigationType { WordStart = 0, WordEnd = 1 } -export class WordCharacterClassifier extends CharacterClassifier { - - constructor(wordSeparators: string) { - super(WordCharacterClass.Regular); - - for (let i = 0, len = wordSeparators.length; i < len; i++) { - this.set(wordSeparators.charCodeAt(i), WordCharacterClass.WordSeparator); - } - - this.set(CharCode.Space, WordCharacterClass.Whitespace); - this.set(CharCode.Tab, WordCharacterClass.Whitespace); - } - -} - -function once(computeFn: (input: string) => R): (input: string) => R { - let cache: { [key: string]: R; } = {}; // TODO@Alex unbounded cache - return (input: string): R => { - if (!cache.hasOwnProperty(input)) { - cache[input] = computeFn(input); - } - return cache[input]; - }; -} - -export const getMapForWordSeparators = once( - (input) => new WordCharacterClassifier(input) -); - export class WordOperations { private static _createWord(lineContent: string, wordType: WordType, start: number, end: number): IFindWordResult { diff --git a/src/vs/editor/common/controller/oneCursor.ts b/src/vs/editor/common/controller/oneCursor.ts index 6fde100b0b8..ae9c990ec4a 100644 --- a/src/vs/editor/common/controller/oneCursor.ts +++ b/src/vs/editor/common/controller/oneCursor.ts @@ -7,7 +7,7 @@ import { SingleCursorState, CursorContext, CursorState } from 'vs/editor/common/controller/cursorCommon'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { Selection, SelectionDirection, ISelection } from 'vs/editor/common/core/selection'; +import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; export class OneCursor { @@ -49,22 +49,6 @@ export class OneCursor { this._setState(context, this.modelState, this.viewState); } - public setSelection(context: CursorContext, selection: ISelection): void { - const selectionStartLineNumber = selection.selectionStartLineNumber; - const selectionStartColumn = selection.selectionStartColumn; - const positionLineNumber = selection.positionLineNumber; - const positionColumn = selection.positionColumn; - const modelState = new SingleCursorState( - new Range(selectionStartLineNumber, selectionStartColumn, selectionStartLineNumber, selectionStartColumn), 0, - new Position(positionLineNumber, positionColumn), 0 - ); - this._setState( - context, - modelState, - null - ); - } - public setState(context: CursorContext, modelState: SingleCursorState, viewState: SingleCursorState): void { this._setState(context, modelState, viewState); } diff --git a/src/vs/editor/common/controller/textAreaHandler.ts b/src/vs/editor/common/controller/textAreaHandler.ts deleted file mode 100644 index f448f6a6d87..00000000000 --- a/src/vs/editor/common/controller/textAreaHandler.ts +++ /dev/null @@ -1,386 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { RunOnceScheduler } from 'vs/base/common/async'; -import * as strings from 'vs/base/common/strings'; -import Event, { Emitter } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IClipboardEvent, ICompositionEvent, IKeyboardEventWrapper, ISimpleModel, ITextAreaWrapper, ITypeData, TextAreaState, TextAreaStrategy, createTextAreaState } from 'vs/editor/common/controller/textAreaState'; -import { Range } from 'vs/editor/common/core/range'; - -export const CopyOptions = { - forceCopyWithSyntaxHighlighting: false -}; - -const enum ReadFromTextArea { - Type, - Paste -} - -export interface IBrowser { - isIPad: boolean; - isChrome: boolean; - isEdgeOrIE: boolean; - isFirefox: boolean; - enableEmptySelectionClipboard: boolean; -} - -export interface IPasteData { - text: string; - pasteOnNewLine: boolean; -} - -export interface ICompositionStartData { - showAtLineNumber: number; - showAtColumn: number; -} - -// See https://github.com/Microsoft/monaco-editor/issues/320 -const isChromev55_v56 = ( - (navigator.userAgent.indexOf('Chrome/55.') >= 0 || navigator.userAgent.indexOf('Chrome/56.') >= 0) - /* Edge likes to impersonate Chrome sometimes */ - && navigator.userAgent.indexOf('Edge/') === -1 -); - -export class TextAreaHandler extends Disposable { - - private _onKeyDown = this._register(new Emitter()); - public onKeyDown: Event = this._onKeyDown.event; - - private _onKeyUp = this._register(new Emitter()); - public onKeyUp: Event = this._onKeyUp.event; - - private _onCut = this._register(new Emitter()); - public onCut: Event = this._onCut.event; - - private _onPaste = this._register(new Emitter()); - public onPaste: Event = this._onPaste.event; - - private _onType = this._register(new Emitter()); - public onType: Event = this._onType.event; - - private _onCompositionStart = this._register(new Emitter()); - public onCompositionStart: Event = this._onCompositionStart.event; - - private _onCompositionUpdate = this._register(new Emitter()); - public onCompositionUpdate: Event = this._onCompositionUpdate.event; - - private _onCompositionEnd = this._register(new Emitter()); - public onCompositionEnd: Event = this._onCompositionEnd.event; - - private Browser: IBrowser; - private textArea: ITextAreaWrapper; - private model: ISimpleModel; - - private selection: Range; - private selections: Range[]; - private hasFocus: boolean; - - private asyncTriggerCut: RunOnceScheduler; - - private lastCompositionEndTime: number; - - private textAreaState: TextAreaState; - private textareaIsShownAtCursor: boolean; - - private lastCopiedValue: string; - private lastCopiedValueIsFromEmptySelection: boolean; - - private _nextCommand: ReadFromTextArea; - - constructor(Browser: IBrowser, strategy: TextAreaStrategy, textArea: ITextAreaWrapper, model: ISimpleModel) { - super(); - this.Browser = Browser; - this.textArea = textArea; - this.model = model; - this.selection = new Range(1, 1, 1, 1); - this.selections = [new Range(1, 1, 1, 1)]; - this._nextCommand = ReadFromTextArea.Type; - - this.asyncTriggerCut = new RunOnceScheduler(() => this._onCut.fire(), 0); - - this.lastCopiedValue = null; - this.lastCopiedValueIsFromEmptySelection = false; - this.textAreaState = createTextAreaState(strategy); - - this.hasFocus = false; - - this.lastCompositionEndTime = 0; - - this._register(this.textArea.onKeyDown((e) => this._onKeyDownHandler(e))); - this._register(this.textArea.onKeyUp((e) => this._onKeyUp.fire(e))); - this._register(this.textArea.onKeyPress((e) => this._onKeyPressHandler(e))); - - this.textareaIsShownAtCursor = false; - let compositionLocale = null; - - this._register(this.textArea.onCompositionStart((e) => { - - if (this.textareaIsShownAtCursor) { - return; - } - - this.textareaIsShownAtCursor = true; - - // In IE we cannot set .value when handling 'compositionstart' because the entire composition will get canceled. - if (!this.Browser.isEdgeOrIE) { - this.setTextAreaState('compositionstart', this.textAreaState.toEmpty(), false); - } - - this._onCompositionStart.fire({ - showAtLineNumber: this.selection.startLineNumber, - showAtColumn: this.selection.startColumn - }); - })); - - this._register(this.textArea.onCompositionUpdate((e) => { - if (isChromev55_v56) { - // See https://github.com/Microsoft/monaco-editor/issues/320 - // where compositionupdate .data is broken in Chrome v55 and v56 - // See https://bugs.chromium.org/p/chromium/issues/detail?id=677050#c9 - compositionLocale = e.locale; - // The textArea doesn't get the composition update yet, the value of textarea is still obsolete - // so we can't correct e at this moment. - return; - } - - if (Browser.isEdgeOrIE && e.locale === 'ja') { - // https://github.com/Microsoft/monaco-editor/issues/339 - // Multi-part Japanese compositions reset cursor in Edge/IE, Chinese and Korean IME don't have this issue. - // The reason that we can't use this path for all CJK IME is IE and Edge behave differently when handling Korean IME, - // which breaks this path of code. - this.textAreaState = this.textAreaState.fromTextArea(this.textArea); - let typeInput = this.textAreaState.deduceInput(); - this._onType.fire(typeInput); - this._onCompositionUpdate.fire(e); - return; - } - - this.textAreaState = this.textAreaState.fromText(e.data); - let typeInput = this.textAreaState.updateComposition(); - this._onType.fire(typeInput); - this._onCompositionUpdate.fire(e); - })); - - let readFromTextArea = () => { - let tempTextAreaState = this.textAreaState.fromTextArea(this.textArea); - let typeInput = tempTextAreaState.deduceInput(); - if (typeInput.replaceCharCnt === 0 && typeInput.text.length === 1 && strings.isHighSurrogate(typeInput.text.charCodeAt(0))) { - // Ignore invalid input but keep it around for next time - return; - } - - this.textAreaState = tempTextAreaState; - // console.log('==> DEDUCED INPUT: ' + JSON.stringify(typeInput)); - if (this._nextCommand === ReadFromTextArea.Type) { - if (typeInput.text !== '') { - this._onType.fire(typeInput); - } - } else { - this.executePaste(typeInput.text); - this._nextCommand = ReadFromTextArea.Type; - } - }; - - this._register(this.textArea.onCompositionEnd((e) => { - // console.log('onCompositionEnd: ' + e.data); - if (Browser.isEdgeOrIE && e.locale === 'ja') { - // https://github.com/Microsoft/monaco-editor/issues/339 - this.textAreaState = this.textAreaState.fromTextArea(this.textArea); - let typeInput = this.textAreaState.deduceInput(); - this._onType.fire(typeInput); - } - else { - this.textAreaState = this.textAreaState.fromText(e.data); - let typeInput = this.textAreaState.updateComposition(); - this._onType.fire(typeInput); - } - - // Due to isEdgeOrIE (where the textarea was not cleared initially) and isChrome (the textarea is not updated correctly when composition ends) - // we cannot assume the text at the end consists only of the composited text - if (Browser.isEdgeOrIE || Browser.isChrome) { - this.textAreaState = this.textAreaState.fromTextArea(this.textArea); - } - - this.lastCompositionEndTime = (new Date()).getTime(); - if (!this.textareaIsShownAtCursor) { - return; - } - this.textareaIsShownAtCursor = false; - - this._onCompositionEnd.fire(); - })); - - this._register(this.textArea.onInput(() => { - // console.log('onInput: ' + this.textArea.getValue()); - if (this.textareaIsShownAtCursor) { - // See https://github.com/Microsoft/monaco-editor/issues/320 - if (isChromev55_v56) { - let text = this.textArea.getValue(); - this.textAreaState = this.textAreaState.fromText(text); - let typeInput = this.textAreaState.updateComposition(); - this._onType.fire(typeInput); - let e = { - locale: compositionLocale, - data: text - }; - this._onCompositionUpdate.fire(e); - } - // console.log('::ignoring input event because the textarea is shown at cursor: ' + this.textArea.getValue()); - return; - } - - readFromTextArea(); - })); - - // --- Clipboard operations - - this._register(this.textArea.onCut((e) => { - this._ensureClipboardGetsEditorSelection(e); - this.asyncTriggerCut.schedule(); - })); - - this._register(this.textArea.onCopy((e) => { - this._ensureClipboardGetsEditorSelection(e); - })); - - this._register(this.textArea.onPaste((e) => { - if (e.canUseTextData()) { - this.executePaste(e.getTextData()); - } else { - if (this.textArea.getSelectionStart() !== this.textArea.getSelectionEnd()) { - // Clean up the textarea, to get a clean paste - this.setTextAreaState('paste', this.textAreaState.toEmpty(), false); - } - this._nextCommand = ReadFromTextArea.Paste; - } - })); - - this._writePlaceholderAndSelectTextArea('ctor', false); - } - - public dispose(): void { - this.asyncTriggerCut.dispose(); - super.dispose(); - } - - // --- begin event handlers - - public setStrategy(strategy: TextAreaStrategy): void { - this.textAreaState = this.textAreaState.toStrategy(strategy); - } - - public setHasFocus(isFocused: boolean): void { - if (this.hasFocus === isFocused) { - // no change - return; - } - this.hasFocus = isFocused; - if (this.hasFocus) { - this._writePlaceholderAndSelectTextArea('focusgain', false); - } - } - - public setCursorSelections(primary: Range, secondary: Range[]): void { - this.selection = primary; - this.selections = [primary].concat(secondary); - this._writePlaceholderAndSelectTextArea('selection changed', false); - } - - // --- end event handlers - - private setTextAreaState(reason: string, textAreaState: TextAreaState, forceFocus: boolean): void { - if (!this.hasFocus) { - textAreaState = textAreaState.resetSelection(); - } - - textAreaState.applyToTextArea(reason, this.textArea, this.hasFocus || forceFocus); - this.textAreaState = textAreaState; - } - - private _onKeyDownHandler(e: IKeyboardEventWrapper): void { - if (this.textareaIsShownAtCursor && e.equals(KeyCode.KEY_IN_COMPOSITION)) { - // Stop propagation for keyDown events if the IME is processing key input - e.stopPropagation(); - } - - if (e.equals(KeyCode.Escape)) { - // Prevent default always for `Esc`, otherwise it will generate a keypress - // See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx - e.preventDefault(); - } - this._onKeyDown.fire(e); - } - - private _onKeyPressHandler(e: IKeyboardEventWrapper): void { - if (!this.hasFocus) { - // Sometimes, when doing Alt-Tab, in FF, a 'keypress' is sent before a 'focus' - return; - } - } - - // ------------- Operations that are always executed asynchronously - - private executePaste(txt: string): void { - if (txt === '') { - return; - } - - let pasteOnNewLine = false; - if (this.Browser.enableEmptySelectionClipboard) { - pasteOnNewLine = (txt === this.lastCopiedValue && this.lastCopiedValueIsFromEmptySelection); - } - this._onPaste.fire({ - text: txt, - pasteOnNewLine: pasteOnNewLine - }); - } - - public focusTextArea(): void { - this._writePlaceholderAndSelectTextArea('focusTextArea', true); - } - - private _writePlaceholderAndSelectTextArea(reason: string, forceFocus: boolean): void { - if (!this.textareaIsShownAtCursor) { - // Do not write to the textarea if it is visible. - if (this.Browser.isIPad) { - // Do not place anything in the textarea for the iPad - this.setTextAreaState(reason, this.textAreaState.toEmpty(), forceFocus); - } else { - this.setTextAreaState(reason, this.textAreaState.fromEditorSelection(this.model, this.selection), forceFocus); - } - } - } - - // ------------- Clipboard operations - - private _ensureClipboardGetsEditorSelection(e: IClipboardEvent): void { - let whatToCopy = this.model.getPlainTextToCopy(this.selections, this.Browser.enableEmptySelectionClipboard); - if (e.canUseTextData()) { - let whatHTMLToCopy: string = null; - if (!this.Browser.isEdgeOrIE && (whatToCopy.length < 65536 || CopyOptions.forceCopyWithSyntaxHighlighting)) { - whatHTMLToCopy = this.model.getHTMLToCopy(this.selections, this.Browser.enableEmptySelectionClipboard); - } - e.setTextData(whatToCopy, whatHTMLToCopy); - } else { - this.setTextAreaState('copy or cut', this.textAreaState.fromText(whatToCopy), false); - } - - if (this.Browser.enableEmptySelectionClipboard) { - if (this.Browser.isFirefox) { - // When writing "LINE\r\n" to the clipboard and then pasting, - // Firefox pastes "LINE\n", so let's work around this quirk - this.lastCopiedValue = whatToCopy.replace(/\r\n/g, '\n'); - } else { - this.lastCopiedValue = whatToCopy; - } - - let selections = this.selections; - this.lastCopiedValueIsFromEmptySelection = (selections.length === 1 && selections[0].isEmpty()); - } - } -} \ No newline at end of file diff --git a/src/vs/editor/common/controller/textAreaState.ts b/src/vs/editor/common/controller/textAreaState.ts deleted file mode 100644 index 1090e2a10dc..00000000000 --- a/src/vs/editor/common/controller/textAreaState.ts +++ /dev/null @@ -1,508 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 Event from 'vs/base/common/event'; -import { commonPrefixLength, commonSuffixLength } from 'vs/base/common/strings'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; -import { Position } from 'vs/editor/common/core/position'; -import { Constants } from 'vs/editor/common/core/uint'; - -export interface IClipboardEvent { - canUseTextData(): boolean; - setTextData(text: string, richText: string): void; - getTextData(): string; -} - -export interface ICompositionEvent { - data: string; - locale: string; -} - -export interface IKeyboardEventWrapper { - _actual: any; - equals(keybinding: number): boolean; - preventDefault(): void; - stopPropagation(): void; - isDefaultPrevented(): boolean; -} - -export interface ITextAreaWrapper { - onKeyDown: Event; - onKeyUp: Event; - onKeyPress: Event; - onCompositionStart: Event; - onCompositionUpdate: Event; - onCompositionEnd: Event; - onInput: Event; - onCut: Event; - onCopy: Event; - onPaste: Event; - - getValue(): string; - setValue(reason: string, value: string): void; - getSelectionStart(): number; - getSelectionEnd(): number; - - setSelectionRange(selectionStart: number, selectionEnd: number): void; - isInOverwriteMode(): boolean; -} - -export interface ISimpleModel { - getLineMaxColumn(lineNumber: number): number; - getEOL(): string; - getValueInRange(range: Range, eol: EndOfLinePreference): string; - getModelLineContent(lineNumber: number): string; - getLineCount(): number; - getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string; - getHTMLToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string; - - coordinatesConverter: { - convertViewPositionToModelPosition(viewPosition: Position): Position; - }; -} - -export interface ITypeData { - text: string; - replaceCharCnt: number; -} - -export enum TextAreaStrategy { - IENarrator, - NVDA -} - -const USE_NVDA_FULL_TEXT = false; - -export function createTextAreaState(strategy: TextAreaStrategy): TextAreaState { - if (strategy === TextAreaStrategy.IENarrator) { - return IENarratorTextAreaState.EMPTY; - } - if (USE_NVDA_FULL_TEXT) { - return NVDAFullTextAreaState.EMPTY; - } - return NVDAPagedTextAreaState.EMPTY; -} - -export abstract class TextAreaState { - - protected previousState: TextAreaState; - protected value: string; - protected selectionStart: number; - protected selectionEnd: number; - protected isInOverwriteMode: boolean; - - constructor(previousState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean) { - this.previousState = previousState ? previousState.shallowClone() : null; - this.value = value; - this.selectionStart = selectionStart; - this.selectionEnd = selectionEnd; - this.isInOverwriteMode = isInOverwriteMode; - } - - protected abstract shallowClone(): TextAreaState; - - public abstract toEmpty(): TextAreaState; - - public abstract toString(): string; - - public abstract toStrategy(strategy: TextAreaStrategy): TextAreaState; - - public abstract equals(other: TextAreaState): boolean; - - public abstract fromTextArea(textArea: ITextAreaWrapper): TextAreaState; - - public abstract fromEditorSelection(model: ISimpleModel, selection: Range); - - public abstract fromText(text: string): TextAreaState; - - public updateComposition(): ITypeData { - if (!this.previousState) { - // This is the EMPTY state - return { - text: '', - replaceCharCnt: 0 - }; - } - - return { - text: this.value, - replaceCharCnt: this.previousState.selectionEnd - this.previousState.selectionStart - }; - } - - public abstract resetSelection(): TextAreaState; - - public getSelectionStart(): number { - return this.selectionStart; - } - - public getValue(): string { - return this.value; - } - - public applyToTextArea(reason: string, textArea: ITextAreaWrapper, select: boolean): void { - // console.log(Date.now() + ': applyToTextArea ' + reason + ': ' + this.toString()); - if (textArea.getValue() !== this.value) { - textArea.setValue(reason, this.value); - } - if (select) { - textArea.setSelectionRange(this.selectionStart, this.selectionEnd); - } - } - - public deduceInput(): ITypeData { - if (!this.previousState) { - // This is the EMPTY state - return { - text: '', - replaceCharCnt: 0 - }; - } - - // console.log('------------------------deduceInput'); - // console.log('CURRENT STATE: ' + this.toString()); - // console.log('PREVIOUS STATE: ' + this.previousState.toString()); - - let previousValue = this.previousState.value; - let previousSelectionStart = this.previousState.selectionStart; - let previousSelectionEnd = this.previousState.selectionEnd; - let currentValue = this.value; - let currentSelectionStart = this.selectionStart; - let currentSelectionEnd = this.selectionEnd; - - // Strip the previous suffix from the value (without interfering with the current selection) - let previousSuffix = previousValue.substring(previousSelectionEnd); - let currentSuffix = currentValue.substring(currentSelectionEnd); - let suffixLength = commonSuffixLength(previousSuffix, currentSuffix); - currentValue = currentValue.substring(0, currentValue.length - suffixLength); - previousValue = previousValue.substring(0, previousValue.length - suffixLength); - - let previousPrefix = previousValue.substring(0, previousSelectionStart); - let currentPrefix = currentValue.substring(0, currentSelectionStart); - let prefixLength = commonPrefixLength(previousPrefix, currentPrefix); - currentValue = currentValue.substring(prefixLength); - previousValue = previousValue.substring(prefixLength); - currentSelectionStart -= prefixLength; - previousSelectionStart -= prefixLength; - currentSelectionEnd -= prefixLength; - previousSelectionEnd -= prefixLength; - - // console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd); - // console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd); - - if (currentSelectionStart === currentSelectionEnd) { - // composition accept case - // [blahblah] => blahblah| - if ( - previousValue === currentValue - && previousSelectionStart === 0 - && previousSelectionEnd === previousValue.length - && currentSelectionStart === currentValue.length - && currentValue.indexOf('\n') === -1 - ) { - return { - text: '', - replaceCharCnt: 0 - }; - } - - // no current selection - let replacePreviousCharacters = (previousPrefix.length - prefixLength); - // console.log('REMOVE PREVIOUS: ' + (previousPrefix.length - prefixLength) + ' chars'); - - return { - text: currentValue, - replaceCharCnt: replacePreviousCharacters - }; - } - - // there is a current selection => composition case - let replacePreviousCharacters = previousSelectionEnd - previousSelectionStart; - return { - text: currentValue, - replaceCharCnt: replacePreviousCharacters - }; - } -} - -export class IENarratorTextAreaState extends TextAreaState { - public static EMPTY = new IENarratorTextAreaState(null, '', 0, 0, false, 0); - - private selectionToken: number; - - constructor(previousState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean, selectionToken: number) { - super(previousState, value, selectionStart, selectionEnd, isInOverwriteMode); - this.selectionToken = selectionToken; - } - - protected shallowClone(): TextAreaState { - return new IENarratorTextAreaState(null, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode, this.selectionToken); - } - - public toEmpty(): TextAreaState { - return IENarratorTextAreaState.EMPTY; - } - - public toString(): string { - return '[ <' + this.value + '>, selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ', isInOverwriteMode: ' + this.isInOverwriteMode + ', selectionToken: ' + this.selectionToken + ']'; - } - - public toStrategy(strategy: TextAreaStrategy): TextAreaState { - if (strategy === TextAreaStrategy.IENarrator) { - return this; - } - if (USE_NVDA_FULL_TEXT) { - return new NVDAFullTextAreaState(this.previousState, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode); - } - return new NVDAPagedTextAreaState(this.previousState, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode); - } - - public equals(other: TextAreaState): boolean { - if (other instanceof IENarratorTextAreaState) { - return ( - this.value === other.value - && this.selectionStart === other.selectionStart - && this.selectionEnd === other.selectionEnd - && this.isInOverwriteMode === other.isInOverwriteMode - && this.selectionToken === other.selectionToken - ); - } - return false; - } - - public fromTextArea(textArea: ITextAreaWrapper): TextAreaState { - return new IENarratorTextAreaState(this, textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), textArea.isInOverwriteMode(), this.selectionToken); - } - - public fromEditorSelection(model: ISimpleModel, selection: Range): TextAreaState { - let LIMIT_CHARS = 100; - let PADDING_LINES_COUNT = 0; - - let selectionStartLineNumber = selection.startLineNumber, - selectionStartColumn = selection.startColumn, - selectionEndLineNumber = selection.endLineNumber, - selectionEndColumn = selection.endColumn, - selectionEndLineNumberMaxColumn = model.getLineMaxColumn(selectionEndLineNumber); - - // If the selection is empty and we have switched line numbers, expand selection to full line (helps Narrator trigger a full line read) - if (selection.isEmpty() && this.selectionToken !== selectionStartLineNumber) { - selectionStartColumn = 1; - selectionEndColumn = selectionEndLineNumberMaxColumn; - } - - // `pretext` contains the text before the selection - let pretext = ''; - let startLineNumber = Math.max(1, selectionStartLineNumber - PADDING_LINES_COUNT); - if (startLineNumber < selectionStartLineNumber) { - pretext = model.getValueInRange(new Range(startLineNumber, 1, selectionStartLineNumber, 1), EndOfLinePreference.LF); - } - pretext += model.getValueInRange(new Range(selectionStartLineNumber, 1, selectionStartLineNumber, selectionStartColumn), EndOfLinePreference.LF); - if (pretext.length > LIMIT_CHARS) { - pretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length); - } - - - // `posttext` contains the text after the selection - let posttext = ''; - let endLineNumber = Math.min(selectionEndLineNumber + PADDING_LINES_COUNT, model.getLineCount()); - posttext += model.getValueInRange(new Range(selectionEndLineNumber, selectionEndColumn, selectionEndLineNumber, selectionEndLineNumberMaxColumn), EndOfLinePreference.LF); - if (endLineNumber > selectionEndLineNumber) { - posttext = '\n' + model.getValueInRange(new Range(selectionEndLineNumber + 1, 1, endLineNumber, model.getLineMaxColumn(endLineNumber)), EndOfLinePreference.LF); - } - if (posttext.length > LIMIT_CHARS) { - posttext = posttext.substring(0, LIMIT_CHARS); - } - - - // `text` contains the text of the selection - let text = model.getValueInRange(new Range(selectionStartLineNumber, selectionStartColumn, selectionEndLineNumber, selectionEndColumn), EndOfLinePreference.LF); - if (text.length > 2 * LIMIT_CHARS) { - text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); - } - - return new IENarratorTextAreaState(this, pretext + text + posttext, pretext.length, pretext.length + text.length, false, selectionStartLineNumber); - } - - public fromText(text: string): TextAreaState { - return new IENarratorTextAreaState(this, text, 0, text.length, false, 0); - } - - public resetSelection(): TextAreaState { - return new IENarratorTextAreaState(this.previousState, this.value, this.value.length, this.value.length, this.isInOverwriteMode, this.selectionToken); - } -} - -export class NVDAPagedTextAreaState extends TextAreaState { - public static EMPTY = new NVDAPagedTextAreaState(null, '', 0, 0, false); - private static _LINES_PER_PAGE = 10; - - constructor(previousState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean) { - super(previousState, value, selectionStart, selectionEnd, isInOverwriteMode); - } - - protected shallowClone(): TextAreaState { - return new NVDAPagedTextAreaState(null, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode); - } - - public toEmpty(): TextAreaState { - return NVDAPagedTextAreaState.EMPTY; - } - - public toString(): string { - return '[ <' + this.value + '>, selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ', isInOverwriteMode: ' + this.isInOverwriteMode + ']'; - } - - public toStrategy(strategy: TextAreaStrategy): TextAreaState { - if (strategy === TextAreaStrategy.NVDA) { - return this; - } - return new IENarratorTextAreaState(this.previousState, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode, 0); - } - - public equals(other: TextAreaState): boolean { - if (other instanceof NVDAPagedTextAreaState) { - return ( - this.value === other.value - && this.selectionStart === other.selectionStart - && this.selectionEnd === other.selectionEnd - && this.isInOverwriteMode === other.isInOverwriteMode - ); - } - return false; - } - - public fromTextArea(textArea: ITextAreaWrapper): TextAreaState { - return new NVDAPagedTextAreaState(this, textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), textArea.isInOverwriteMode()); - } - - private static _getPageOfLine(lineNumber: number): number { - return Math.floor((lineNumber - 1) / NVDAPagedTextAreaState._LINES_PER_PAGE); - } - - private static _getRangeForPage(page: number): Range { - let offset = page * NVDAPagedTextAreaState._LINES_PER_PAGE; - let startLineNumber = offset + 1; - let endLineNumber = offset + NVDAPagedTextAreaState._LINES_PER_PAGE; - return new Range(startLineNumber, 1, endLineNumber, Constants.MAX_SAFE_SMALL_INTEGER); - } - - public fromEditorSelection(model: ISimpleModel, selection: Range): TextAreaState { - - let selectionStartPage = NVDAPagedTextAreaState._getPageOfLine(selection.startLineNumber); - let selectionStartPageRange = NVDAPagedTextAreaState._getRangeForPage(selectionStartPage); - - let selectionEndPage = NVDAPagedTextAreaState._getPageOfLine(selection.endLineNumber); - let selectionEndPageRange = NVDAPagedTextAreaState._getRangeForPage(selectionEndPage); - - let pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn)); - let pretext = model.getValueInRange(pretextRange, EndOfLinePreference.LF); - - let lastLine = model.getLineCount(); - let lastLineMaxColumn = model.getLineMaxColumn(lastLine); - let posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn)); - let posttext = model.getValueInRange(posttextRange, EndOfLinePreference.LF); - - let text: string = null; - if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { - // take full selection - text = model.getValueInRange(selection, EndOfLinePreference.LF); - } else { - let selectionRange1 = selectionStartPageRange.intersectRanges(selection); - let selectionRange2 = selectionEndPageRange.intersectRanges(selection); - text = ( - model.getValueInRange(selectionRange1, EndOfLinePreference.LF) - + String.fromCharCode(8230) - + model.getValueInRange(selectionRange2, EndOfLinePreference.LF) - ); - } - - // Chromium handles very poorly text even of a few thousand chars - // Cut text to avoid stalling the entire UI - const LIMIT_CHARS = 500; - if (pretext.length > LIMIT_CHARS) { - pretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length); - } - if (posttext.length > LIMIT_CHARS) { - posttext = posttext.substring(0, LIMIT_CHARS); - } - if (text.length > 2 * LIMIT_CHARS) { - text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); - } - - return new NVDAPagedTextAreaState(this, pretext + text + posttext, pretext.length, pretext.length + text.length, false); - } - - public fromText(text: string): TextAreaState { - return new NVDAPagedTextAreaState(this, text, 0, text.length, false); - } - - public resetSelection(): TextAreaState { - return new NVDAPagedTextAreaState(this.previousState, this.value, this.value.length, this.value.length, this.isInOverwriteMode); - } -} - - -export class NVDAFullTextAreaState extends TextAreaState { - public static EMPTY = new NVDAFullTextAreaState(null, '', 0, 0, false); - - constructor(previousState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean) { - super(previousState, value, selectionStart, selectionEnd, isInOverwriteMode); - } - - protected shallowClone(): TextAreaState { - return new NVDAFullTextAreaState(null, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode); - } - - public toEmpty(): TextAreaState { - return NVDAFullTextAreaState.EMPTY; - } - - public toString(): string { - return '[ , selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ', isInOverwriteMode: ' + this.isInOverwriteMode + ']'; - } - - public toStrategy(strategy: TextAreaStrategy): TextAreaState { - if (strategy === TextAreaStrategy.NVDA) { - return this; - } - return new IENarratorTextAreaState(this.previousState, this.value, this.selectionStart, this.selectionEnd, this.isInOverwriteMode, 0); - } - - public equals(other: TextAreaState): boolean { - if (other instanceof NVDAFullTextAreaState) { - return ( - this.value === other.value - && this.selectionStart === other.selectionStart - && this.selectionEnd === other.selectionEnd - && this.isInOverwriteMode === other.isInOverwriteMode - ); - } - return false; - } - - public fromTextArea(textArea: ITextAreaWrapper): TextAreaState { - return new NVDAFullTextAreaState(this, textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), textArea.isInOverwriteMode()); - } - - public fromEditorSelection(model: ISimpleModel, selection: Range): TextAreaState { - let pretext = model.getValueInRange(new Range(1, 1, selection.startLineNumber, selection.startColumn), EndOfLinePreference.LF); - let text = model.getValueInRange(selection, EndOfLinePreference.LF); - let lastLine = model.getLineCount(); - let lastLineMaxColumn = model.getLineMaxColumn(lastLine); - let posttext = model.getValueInRange(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn), EndOfLinePreference.LF); - - return new NVDAFullTextAreaState(this, pretext + text + posttext, pretext.length, pretext.length + text.length, false); - } - - public fromText(text: string): TextAreaState { - return new NVDAFullTextAreaState(this, text, 0, text.length, false); - } - - public resetSelection(): TextAreaState { - return new NVDAFullTextAreaState(this.previousState, this.value, this.value.length, this.value.length, this.isInOverwriteMode); - } -} diff --git a/src/vs/editor/common/controller/wordCharacterClassifier.ts b/src/vs/editor/common/controller/wordCharacterClassifier.ts new file mode 100644 index 00000000000..c8399717727 --- /dev/null +++ b/src/vs/editor/common/controller/wordCharacterClassifier.ts @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { CharCode } from 'vs/base/common/charCode'; +import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; + +export const enum WordCharacterClass { + Regular = 0, + Whitespace = 1, + WordSeparator = 2 +} + +export class WordCharacterClassifier extends CharacterClassifier { + + constructor(wordSeparators: string) { + super(WordCharacterClass.Regular); + + for (let i = 0, len = wordSeparators.length; i < len; i++) { + this.set(wordSeparators.charCodeAt(i), WordCharacterClass.WordSeparator); + } + + this.set(CharCode.Space, WordCharacterClass.Whitespace); + this.set(CharCode.Tab, WordCharacterClass.Whitespace); + } + +} + +function once(computeFn: (input: string) => R): (input: string) => R { + let cache: { [key: string]: R; } = {}; // TODO@Alex unbounded cache + return (input: string): R => { + if (!cache.hasOwnProperty(input)) { + cache[input] = computeFn(input); + } + return cache[input]; + }; +} + +export const getMapForWordSeparators = once( + (input) => new WordCharacterClassifier(input) +); diff --git a/src/vs/editor/common/core/range.ts b/src/vs/editor/common/core/range.ts index e04ac3ef677..06255c480ec 100644 --- a/src/vs/editor/common/core/range.ts +++ b/src/vs/editor/common/core/range.ts @@ -290,6 +290,10 @@ export class Range { // --- + public static fromPositions(start: IPosition, end: IPosition = start): Range { + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + } + /** * Create a `Range` from an `IRange`. */ diff --git a/src/vs/editor/common/core/selection.ts b/src/vs/editor/common/core/selection.ts index e0aa9ecb314..10705ad4fe8 100644 --- a/src/vs/editor/common/core/selection.ts +++ b/src/vs/editor/common/core/selection.ts @@ -5,6 +5,7 @@ 'use strict'; import { Range } from 'vs/editor/common/core/range'; +import { Position, IPosition } from 'vs/editor/common/core/position'; /** * A selection in the editor. @@ -128,6 +129,13 @@ export class Selection extends Range { return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); } + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + public getPosition(): Position { + return new Position(this.positionLineNumber, this.positionColumn); + } + /** * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. */ @@ -140,6 +148,13 @@ export class Selection extends Range { // ---- + /** + * Create a `Selection` from one or two positions + */ + public static fromPositions(start: IPosition, end: IPosition = start): Selection { + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + } + /** * Create a `Selection` from an `ISelection`. */ @@ -192,4 +207,4 @@ export class Selection extends Range { return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); } -} \ No newline at end of file +} diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 036430cf02c..7d437e5736b 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -23,7 +23,7 @@ import { } from 'vs/editor/common/model/textModelEvents'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { ICursors } from 'vs/editor/common/controller/cursorCommon'; +import { ICursors, CursorConfiguration } from 'vs/editor/common/controller/cursorCommon'; /** * Vertical Lane in the overview ruler of the editor. @@ -41,19 +41,19 @@ export enum OverviewRulerLane { export interface IModelDecorationOverviewRulerOptions { /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - color: string; + color: string | ThemeColor; /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - darkColor: string; + darkColor: string | ThemeColor; /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - hcColor?: string; + hcColor?: string | ThemeColor; /** * The position in the overview ruler. */ @@ -86,9 +86,10 @@ export interface IModelDecorationOptions { */ isWholeLine?: boolean; /** - * @deprecated : Use `overviewRuler` instead + * Always render the decoration (even when the range it encompasses is collapsed). + * @internal */ - showInOverviewRuler?: string; + readonly showIfCollapsed?: boolean; /** * If set, render this decoration in the overview ruler. */ @@ -331,12 +332,20 @@ export interface ICursorStateComputerData { * A command that modifies text / cursor state on a model. */ export interface ICommand { + + /** + * Signal that this command is inserting automatic whitespace that should be trimmed if possible. + * @internal + */ + readonly insertsAutoWhitespace?: boolean; + /** * Get the edit operations needed to execute this command. * @param model The model the command will execute on. * @param builder A helper to collect the needed edit operations and to track selections. */ getEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder): void; + /** * Compute the cursor state after the edit operations were applied. * @param model The model the commad has executed on. @@ -698,46 +707,46 @@ export interface ITextModel { * @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if not matches have been found. */ - findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchScope Limit the searching to only search inside this range. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if no matches have been found. */ - findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model for the next match. Loops to the beginning of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the next match is. It is null if no next match has been found. */ - findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): FindMatch; + findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch; /** * Search the model for the previous match. Loops to the end of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the previous match is. It is null if no previous match has been found. */ - findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): FindMatch; + findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch; } export class FindMatch { @@ -1612,20 +1621,31 @@ export interface IEditorContribution { restoreViewState?(state: any): void; } +export interface ThemeColor { + id: string; +} + +/** + * @internal + */ +export function isThemeColor(o): o is ThemeColor { + return o && typeof o.id === 'string'; +} + /** * @internal */ export interface IThemeDecorationRenderOptions { stickiness?: TrackedRangeStickiness; - backgroundColor?: string; + backgroundColor?: string | ThemeColor; outline?: string; - outlineColor?: string; + outlineColor?: string | ThemeColor; outlineStyle?: string; outlineWidth?: string; border?: string; - borderColor?: string; + borderColor?: string | ThemeColor; borderRadius?: string; borderSpacing?: string; borderStyle?: string; @@ -1633,13 +1653,13 @@ export interface IThemeDecorationRenderOptions { textDecoration?: string; cursor?: string; - color?: string; + color?: string | ThemeColor; letterSpacing?: string; gutterIconPath?: string | URI; gutterIconSize?: string; - overviewRulerColor?: string; + overviewRulerColor?: string | ThemeColor; before?: IContentDecorationRenderOptions; after?: IContentDecorationRenderOptions; @@ -1653,9 +1673,10 @@ export interface IContentDecorationRenderOptions { contentIconPath?: string | URI; border?: string; + borderColor?: string | ThemeColor; textDecoration?: string; - color?: string; - backgroundColor?: string; + color?: string | ThemeColor; + backgroundColor?: string | ThemeColor; margin?: string; width?: string; @@ -1817,7 +1838,7 @@ export interface ICommonCodeEditor extends IEditor { getConfiguration(): editorOptions.InternalEditorOptions; /** - * Returns the 'raw' editor's configuration, as it was applied over the defaults, but without any computed members. + * Returns the 'raw' editor's configuration (without any validation or defaults). * @internal */ getRawConfiguration(): editorOptions.IEditorOptions; @@ -1874,6 +1895,7 @@ export interface ICommonCodeEditor extends IEditor { /** * Execute a command on the editor. + * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. * @param source The source of the call. * @param command The command to execute */ @@ -1886,6 +1908,7 @@ export interface ICommonCodeEditor extends IEditor { /** * Execute edits on the editor. + * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. * @param source The source of the call. * @param edits The edits to execute. * @param endCursoState Cursor state after the edits were applied. @@ -1904,6 +1927,11 @@ export interface ICommonCodeEditor extends IEditor { */ _getCursors(): ICursors; + /** + * @internal + */ + _getCursorConfiguration(): CursorConfiguration; + /** * Get all the decorations on a line (filtering out decorations from other editors). */ @@ -2052,28 +2080,8 @@ export var Handler = { CompositionEnd: 'compositionEnd', Paste: 'paste', - Tab: 'tab', - Indent: 'indent', - Outdent: 'outdent', - - DeleteLeft: 'deleteLeft', - DeleteRight: 'deleteRight', - Cut: 'cut', Undo: 'undo', Redo: 'redo', - - LineInsertBefore: 'lineInsertBefore', - LineInsertAfter: 'lineInsertAfter', - LineBreakInsert: 'lineBreakInsert', }; - -/** - * @internal - */ -export const enum ThemeType { - Light = 1, - Dark = 2, - HighContrast = 3 -} diff --git a/src/vs/editor/common/editorCommonExtensions.ts b/src/vs/editor/common/editorCommonExtensions.ts index f9f6e49c970..e991a1a208c 100644 --- a/src/vs/editor/common/editorCommonExtensions.ts +++ b/src/vs/editor/common/editorCommonExtensions.ts @@ -8,22 +8,148 @@ import { illegalArgument } from 'vs/base/common/errors'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { ServicesAccessor, IConstructorSignature1 } from 'vs/platform/instantiation/common/instantiation'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; +import { KeybindingsRegistry, ICommandAndKeybindingRule, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { Registry } from 'vs/platform/platform'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ICommandOptions, Command as ConfigBasicCommand, EditorCommand as ConfigEditorCommand } from 'vs/editor/common/config/config'; import { Position } from 'vs/editor/common/core/position'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { IModelService } from 'vs/editor/common/services/modelService'; import { MenuId, MenuRegistry, IMenuItem } from 'vs/platform/actions/common/actions'; +import { IEditorService } from 'vs/platform/editor/common/editor'; +import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { ICodeEditorService, getCodeEditor } from 'vs/editor/common/services/codeEditorService'; export type ServicesAccessor = ServicesAccessor; -export const Command = ConfigBasicCommand; -export const EditorCommand = ConfigEditorCommand; -export type ICommandOptions = ICommandOptions; export type ICommonEditorContributionCtor = IConstructorSignature1; +// ----- Generic Command + +export interface ICommandKeybindingsOptions extends IKeybindings { + kbExpr?: ContextKeyExpr; + weight?: number; +} +export interface ICommandOptions { + id: string; + precondition: ContextKeyExpr; + kbOpts?: ICommandKeybindingsOptions; + description?: ICommandHandlerDescription; +} +export abstract class Command { + public readonly id: string; + public readonly precondition: ContextKeyExpr; + private readonly _kbOpts: ICommandKeybindingsOptions; + private readonly _description: ICommandHandlerDescription; + + constructor(opts: ICommandOptions) { + this.id = opts.id; + this.precondition = opts.precondition; + this._kbOpts = opts.kbOpts; + this._description = opts.description; + } + + public toCommandAndKeybindingRule(defaultWeight: number): ICommandAndKeybindingRule { + const kbOpts = this._kbOpts || { primary: 0 }; + + let kbWhen = kbOpts.kbExpr; + if (this.precondition) { + if (kbWhen) { + kbWhen = ContextKeyExpr.and(kbWhen, this.precondition); + } else { + kbWhen = this.precondition; + } + } + + const weight = (typeof kbOpts.weight === 'number' ? kbOpts.weight : defaultWeight); + + return { + id: this.id, + handler: (accessor, args) => this.runCommand(accessor, args), + weight: weight, + when: kbWhen, + primary: kbOpts.primary, + secondary: kbOpts.secondary, + win: kbOpts.win, + linux: kbOpts.linux, + mac: kbOpts.mac, + description: this._description + }; + } + + public abstract runCommand(accessor: ServicesAccessor, args: any): void | TPromise; +} + +// ----- Editor Command & Editor Contribution Command + +function findFocusedEditor(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { + return accessor.get(ICodeEditorService).getFocusedCodeEditor(); +} +function getWorkbenchActiveEditor(accessor: ServicesAccessor): editorCommon.ICommonCodeEditor { + const editorService = accessor.get(IEditorService); + let activeEditor = (editorService).getActiveEditor && (editorService).getActiveEditor(); + return getCodeEditor(activeEditor); +} + +export interface IContributionCommandOptions extends ICommandOptions { + handler: (controller: T) => void; +} +export interface EditorControllerCommand { + new (opts: IContributionCommandOptions): EditorCommand; +} +export abstract class EditorCommand extends Command { + + /** + * Create a command class that is bound to a certain editor contribution. + */ + public static bindToContribution(controllerGetter: (editor: editorCommon.ICommonCodeEditor) => T): EditorControllerCommand { + return class EditorControllerCommandImpl extends EditorCommand { + private _callback: (controller: T) => void; + + constructor(opts: IContributionCommandOptions) { + super(opts); + + this._callback = opts.handler; + } + + public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void { + let controller = controllerGetter(editor); + if (controller) { + this._callback(controllerGetter(editor)); + } + } + }; + } + + public runCommand(accessor: ServicesAccessor, args: any): void | TPromise { + // Find the editor with text focus + let editor = findFocusedEditor(accessor); + + if (!editor) { + // Fallback to use what the workbench considers the active editor + editor = getWorkbenchActiveEditor(accessor); + } + + if (!editor) { + // well, at least we tried... + return; + } + + return editor.invokeWithinContext((editorAccessor) => { + const kbService = editorAccessor.get(IContextKeyService); + if (!kbService.contextMatchesRules(this.precondition)) { + // precondition does not hold + return; + } + + return this.runEditorCommand(editorAccessor, editor, args); + }); + } + + public abstract runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void | TPromise; +} + +// ----- Editor Action + export interface IEditorCommandMenuOptions { group?: string; order?: number; @@ -33,7 +159,7 @@ export interface IActionOptions extends ICommandOptions { alias: string; menuOpts?: IEditorCommandMenuOptions; } -export abstract class EditorAction extends ConfigEditorCommand { +export abstract class EditorAction extends EditorCommand { public label: string; public alias: string; @@ -64,7 +190,7 @@ export abstract class EditorAction extends ConfigEditorCommand { public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void | TPromise { this.reportTelemetry(accessor, editor); - return this.run(accessor, editor, args); + return this.run(accessor, editor, args || {}); } protected reportTelemetry(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor) { @@ -74,33 +200,17 @@ export abstract class EditorAction extends ConfigEditorCommand { public abstract run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor, args: any): void | TPromise; } -export interface IHandlerActionOptions extends IActionOptions { - handlerId: string; -} -export abstract class HandlerEditorAction extends EditorAction { - private _handlerId: string; - - constructor(opts: IHandlerActionOptions) { - super(opts); - this._handlerId = opts.handlerId; - } - - public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - editor.trigger(this.id, this._handlerId, null); - } -} - -// --- Editor Actions +// --- Registration of commands and actions export function editorAction(ctor: { new (): EditorAction; }): void { CommonEditorRegistry.registerEditorAction(new ctor()); } -export function editorCommand(ctor: { new (): ConfigEditorCommand }): void { +export function editorCommand(ctor: { new (): EditorCommand }): void { registerEditorCommand(new ctor()); } -export function registerEditorCommand(editorCommand: T): T { +export function registerEditorCommand(editorCommand: T): T { CommonEditorRegistry.registerEditorCommand(editorCommand); return editorCommand; } @@ -119,7 +229,7 @@ export module CommonEditorRegistry { export function getEditorActions(): EditorAction[] { return EditorContributionRegistry.INSTANCE.getEditorActions(); } - export function getEditorCommand(commandId: string): ConfigEditorCommand { + export function getEditorCommand(commandId: string): EditorCommand { return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId); } @@ -135,7 +245,7 @@ export module CommonEditorRegistry { return KeybindingsRegistry.WEIGHT.editorContrib(importance); } - export function registerEditorCommand(editorCommand: ConfigEditorCommand): void { + export function registerEditorCommand(editorCommand: EditorCommand): void { EditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand); } @@ -177,7 +287,7 @@ class EditorContributionRegistry { private editorContributions: ICommonEditorContributionCtor[]; private editorActions: EditorAction[]; - private editorCommands: { [commandId: string]: ConfigEditorCommand; }; + private editorCommands: { [commandId: string]: EditorCommand; }; constructor() { this.editorContributions = []; @@ -209,12 +319,12 @@ class EditorContributionRegistry { return this.editorActions.slice(0); } - public registerEditorCommand(editorCommand: ConfigEditorCommand) { + public registerEditorCommand(editorCommand: EditorCommand) { KeybindingsRegistry.registerCommandAndKeybindingRule(editorCommand.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorContrib())); this.editorCommands[editorCommand.id] = editorCommand; } - public getEditorCommand(commandId: string): ConfigEditorCommand { + public getEditorCommand(commandId: string): EditorCommand { return (this.editorCommands[commandId] || null); } diff --git a/src/vs/editor/common/model/editableTextModel.ts b/src/vs/editor/common/model/editableTextModel.ts index 358a30d6330..265d8486fa9 100644 --- a/src/vs/editor/common/model/editableTextModel.ts +++ b/src/vs/editor/common/model/editableTextModel.ts @@ -8,7 +8,7 @@ import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { EditStack } from 'vs/editor/common/model/editStack'; import { ILineEdit, LineMarker, ModelLine, MarkersTracker } from 'vs/editor/common/model/modelLine'; -import { TextModelWithDecorations } from 'vs/editor/common/model/textModelWithDecorations'; +import { TextModelWithDecorations, ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; import * as strings from 'vs/base/common/strings'; import { Selection } from 'vs/editor/common/core/selection'; import { Position } from 'vs/editor/common/core/position'; @@ -813,13 +813,15 @@ export class EditableTextModel extends TextModelWithDecorations implements edito if (range) { this._hasEditableRange = true; - this._editableRangeId = changeAccessor.addDecoration(range, { - stickiness: editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges - }); + this._editableRangeId = changeAccessor.addDecoration(range, EditableTextModel._DECORATION_OPTION); } }); } + private static _DECORATION_OPTION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges + }); + public hasEditableRange(): boolean { return this._hasEditableRange; } diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 3bc7ddc2490..d15842430f3 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -11,7 +11,7 @@ import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ModelLine } from 'vs/editor/common/model/modelLine'; import { guessIndentation } from 'vs/editor/common/model/indentationGuesser'; -import { DEFAULT_INDENTATION, DEFAULT_TRIM_AUTO_WHITESPACE } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer'; import { IndentRange, computeRanges } from 'vs/editor/common/model/indentRanges'; import { TextModelSearch, SearchParams } from 'vs/editor/common/model/textModelSearch'; @@ -32,11 +32,11 @@ export class TextModel implements editorCommon.ITextModel { private static MODEL_TOKENIZATION_LIMIT = 20 * 1024 * 1024; // 20 MB public static DEFAULT_CREATION_OPTIONS: editorCommon.ITextModelCreationOptions = { - tabSize: DEFAULT_INDENTATION.tabSize, - insertSpaces: DEFAULT_INDENTATION.insertSpaces, + tabSize: EDITOR_MODEL_DEFAULTS.tabSize, + insertSpaces: EDITOR_MODEL_DEFAULTS.insertSpaces, detectIndentation: false, defaultEOL: editorCommon.DefaultEndOfLine.LF, - trimAutoWhitespace: DEFAULT_TRIM_AUTO_WHITESPACE, + trimAutoWhitespace: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, }; public static createFromString(text: string, options: editorCommon.ITextModelCreationOptions = TextModel.DEFAULT_CREATION_OPTIONS): TextModel { @@ -588,7 +588,7 @@ export class TextModel implements editorCommon.ITextModel { this._emitModelRawContentChangedEvent( new textModelEvents.ModelRawContentChangedEvent( [ - new textModelEvents.ModelRawFlush() + new textModelEvents.ModelRawEOLChanged() ], this._versionId, false, @@ -782,7 +782,7 @@ export class TextModel implements editorCommon.ITextModel { throw new Error('Unknown EOL preference'); } - public findMatches(searchString: string, rawSearchScope: any, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean, limitResultCount: number = LIMIT_FIND_COUNT): editorCommon.FindMatch[] { + public findMatches(searchString: string, rawSearchScope: any, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount: number = LIMIT_FIND_COUNT): editorCommon.FindMatch[] { this._assertNotDisposed(); let searchRange: Range; @@ -792,18 +792,18 @@ export class TextModel implements editorCommon.ITextModel { searchRange = this.getFullModelRange(); } - return TextModelSearch.findMatches(this, new SearchParams(searchString, isRegex, matchCase, wholeWord), searchRange, captureMatches, limitResultCount); + return TextModelSearch.findMatches(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchRange, captureMatches, limitResultCount); } - public findNextMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): editorCommon.FindMatch { + public findNextMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): editorCommon.FindMatch { this._assertNotDisposed(); const searchStart = this.validatePosition(rawSearchStart); - return TextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wholeWord), searchStart, captureMatches); + return TextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches); } - public findPreviousMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): editorCommon.FindMatch { + public findPreviousMatch(searchString: string, rawSearchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): editorCommon.FindMatch { this._assertNotDisposed(); const searchStart = this.validatePosition(rawSearchStart); - return TextModelSearch.findPreviousMatch(this, new SearchParams(searchString, isRegex, matchCase, wholeWord), searchStart, captureMatches); + return TextModelSearch.findPreviousMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches); } } diff --git a/src/vs/editor/common/model/textModelEvents.ts b/src/vs/editor/common/model/textModelEvents.ts index 05e0d478f06..890dd25df46 100644 --- a/src/vs/editor/common/model/textModelEvents.ts +++ b/src/vs/editor/common/model/textModelEvents.ts @@ -124,7 +124,8 @@ export const enum RawContentChangedType { Flush = 1, LineChanged = 2, LinesDeleted = 3, - LinesInserted = 4 + LinesInserted = 4, + EOLChanged = 5 } /** @@ -204,9 +205,17 @@ export class ModelRawLinesInserted { } /** + * An event describing that a model has had its EOL changed. * @internal */ -export type ModelRawChange = ModelRawFlush | ModelRawLineChanged | ModelRawLinesDeleted | ModelRawLinesInserted; +export class ModelRawEOLChanged { + public readonly changeType = RawContentChangedType.EOLChanged; +} + +/** + * @internal + */ +export type ModelRawChange = ModelRawFlush | ModelRawLineChanged | ModelRawLinesDeleted | ModelRawLinesInserted | ModelRawEOLChanged; /** * An event describing a change in the text of a model. @@ -234,4 +243,14 @@ export class ModelRawContentChangedEvent { this.isUndoing = isUndoing; this.isRedoing = isRedoing; } + + public containsEvent(type: RawContentChangedType): boolean { + for (let i = 0, len = this.changes.length; i < len; i++) { + const change = this.changes[i]; + if (change.changeType === type) { + return true; + } + } + return false; + } } diff --git a/src/vs/editor/common/model/textModelSearch.ts b/src/vs/editor/common/model/textModelSearch.ts index 4c6bd91c3b2..af265935776 100644 --- a/src/vs/editor/common/model/textModelSearch.ts +++ b/src/vs/editor/common/model/textModelSearch.ts @@ -10,6 +10,7 @@ import { Range } from 'vs/editor/common/core/range'; import { FindMatch, EndOfLinePreference } from 'vs/editor/common/editorCommon'; import { CharCode } from 'vs/base/common/charCode'; import { TextModel } from 'vs/editor/common/model/textModel'; +import { getMapForWordSeparators, WordCharacterClassifier, WordCharacterClass } from 'vs/editor/common/controller/wordCharacterClassifier'; const LIMIT_FIND_COUNT = 999; @@ -17,13 +18,13 @@ export class SearchParams { public readonly searchString: string; public readonly isRegex: boolean; public readonly matchCase: boolean; - public readonly wholeWord: boolean; + public readonly wordSeparators: string; - constructor(searchString: string, isRegex: boolean, matchCase: boolean, wholeWord: boolean) { + constructor(searchString: string, isRegex: boolean, matchCase: boolean, wordSeparators: string) { this.searchString = searchString; this.isRegex = isRegex; this.matchCase = matchCase; - this.wholeWord = wholeWord; + this.wordSeparators = wordSeparators; } private static _isMultilineRegexSource(searchString: string): boolean { @@ -71,8 +72,8 @@ export class SearchParams { try { regex = strings.createRegExp(this.searchString, this.isRegex, { matchCase: this.matchCase, - wholeWord: this.wholeWord, - multiline, + wholeWord: false, + multiline: multiline, global: true }); } catch (err) { @@ -83,13 +84,13 @@ export class SearchParams { return null; } - let canUseSimpleSearch = (!this.isRegex && !this.wholeWord && !multiline); + let canUseSimpleSearch = (!this.isRegex && !multiline); if (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) { // casing might make a difference canUseSimpleSearch = this.matchCase; } - return new SearchData(regex, canUseSimpleSearch ? this.searchString : null); + return new SearchData(regex, this.wordSeparators ? getMapForWordSeparators(this.wordSeparators) : null, canUseSimpleSearch ? this.searchString : null); } } @@ -99,13 +100,18 @@ export class SearchData { * The regex to search for. Always defined. */ public readonly regex: RegExp; + /** + * The word separator classifier. + */ + public readonly wordSeparators: WordCharacterClassifier; /** * The simple string to search for (if possible). */ public readonly simpleSearch: string; - constructor(regex: RegExp, simpleSearch: string) { + constructor(regex: RegExp, wordSeparators: WordCharacterClassifier, simpleSearch: string) { this.regex = regex; + this.wordSeparators = wordSeparators; this.simpleSearch = simpleSearch; } } @@ -130,7 +136,7 @@ export class TextModelSearch { } if (searchData.regex.multiline) { - return this._doFindMatchesMultiline(model, searchRange, searchData.regex, captureMatches, limitResultCount); + return this._doFindMatchesMultiline(model, searchRange, new Searcher(searchData.wordSeparators, searchData.regex), captureMatches, limitResultCount); } return this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount); } @@ -173,7 +179,7 @@ export class TextModelSearch { return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); } - private static _doFindMatchesMultiline(model: TextModel, searchRange: Range, searchRegex: RegExp, captureMatches: boolean, limitResultCount: number): FindMatch[] { + private static _doFindMatchesMultiline(model: TextModel, searchRange: Range, searcher: Searcher, captureMatches: boolean, limitResultCount: number): FindMatch[] { const deltaOffset = model.getOffsetAt(searchRange.getStartPosition()); // We always execute multiline search over the lines joined with \n // This makes it that \n will match the EOL for both CRLF and LF models @@ -181,31 +187,15 @@ export class TextModelSearch { const text = model.getValueInRange(searchRange, EndOfLinePreference.LF); const result: FindMatch[] = []; - let prevStartOffset = 0; - let prevEndOffset = 0; let counter = 0; let m: RegExpExecArray; - while ((m = searchRegex.exec(text))) { - const startOffset = deltaOffset + m.index; - const endOffset = startOffset + m[0].length; - - if (prevStartOffset === startOffset && prevEndOffset === endOffset) { - // Exit early if the regex matches the same range - return result; - } - - result[counter++] = createFindMatch( - this._getMultilineMatchRange(model, deltaOffset, text, m.index, m[0]), - m, - captureMatches - ); + searcher.reset(0); + while ((m = searcher.next(text))) { + result[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, m.index, m[0]), m, captureMatches); if (counter >= limitResultCount) { return result; } - - prevStartOffset = startOffset; - prevEndOffset = endOffset; } return result; @@ -241,41 +231,35 @@ export class TextModelSearch { } private static _findMatchesInLine(searchData: SearchData, text: string, lineNumber: number, deltaOffset: number, resultLen: number, result: FindMatch[], captureMatches: boolean, limitResultCount: number): number { + const wordSeparators = searchData.wordSeparators; if (!captureMatches && searchData.simpleSearch) { const searchString = searchData.simpleSearch; const searchStringLen = searchString.length; + const textLength = text.length; let lastMatchIndex = -searchStringLen; while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { - const range = new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset); - result[resultLen++] = new FindMatch(range, null); - if (resultLen >= limitResultCount) { - return resultLen; + if (!wordSeparators || isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) { + result[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null); + if (resultLen >= limitResultCount) { + return resultLen; + } } } return resultLen; } - const searchRegex = searchData.regex; + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); let m: RegExpExecArray; // Reset regex to search from the beginning - searchRegex.lastIndex = 0; + searcher.reset(0); do { - m = searchRegex.exec(text); + m = searcher.next(text); if (m) { - const range = new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset); - if (result.length > 0 && range.equalsRange(result[result.length - 1].range)) { - // Exit early if the regex matches the same range - return resultLen; - } - result[resultLen++] = createFindMatch(range, m, captureMatches); + result[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches); if (resultLen >= limitResultCount) { return resultLen; } - if (m.index + m[0].length === text.length) { - // Reached the end of the line - return resultLen; - } } } while (m); return resultLen; @@ -287,13 +271,15 @@ export class TextModelSearch { return null; } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + if (searchData.regex.multiline) { - return this._doFindNextMatchMultiline(model, searchStart, searchData.regex, captureMatches); + return this._doFindNextMatchMultiline(model, searchStart, searcher, captureMatches); } - return this._doFindNextMatchLineByLine(model, searchStart, searchData.regex, captureMatches); + return this._doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches); } - private static _doFindNextMatchMultiline(model: TextModel, searchStart: Position, searchRegex: RegExp, captureMatches: boolean): FindMatch { + private static _doFindNextMatchMultiline(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch { const searchTextStart = new Position(searchStart.lineNumber, 1); const deltaOffset = model.getOffsetAt(searchTextStart); const lineCount = model.getLineCount(); @@ -301,8 +287,8 @@ export class TextModelSearch { // This makes it that \n will match the EOL for both CRLF and LF models // We compensate for offset errors in `_getMultilineMatchRange` const text = model.getValueInRange(new Range(searchTextStart.lineNumber, searchTextStart.column, lineCount, model.getLineMaxColumn(lineCount)), EndOfLinePreference.LF); - searchRegex.lastIndex = searchStart.column - 1; - let m = searchRegex.exec(text); + searcher.reset(searchStart.column - 1); + let m = searcher.next(text); if (m) { return createFindMatch( this._getMultilineMatchRange(model, deltaOffset, text, m.index, m[0]), @@ -313,19 +299,19 @@ export class TextModelSearch { if (searchStart.lineNumber !== 1 || searchStart.column !== 1) { // Try again from the top - return this._doFindNextMatchMultiline(model, new Position(1, 1), searchRegex, captureMatches); + return this._doFindNextMatchMultiline(model, new Position(1, 1), searcher, captureMatches); } return null; } - private static _doFindNextMatchLineByLine(model: TextModel, searchStart: Position, searchRegex: RegExp, captureMatches: boolean): FindMatch { + private static _doFindNextMatchLineByLine(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch { const lineCount = model.getLineCount(); const startLineNumber = searchStart.lineNumber; // Look in first line const text = model.getLineContent(startLineNumber); - const r = this._findFirstMatchInLine(searchRegex, text, startLineNumber, searchStart.column, captureMatches); + const r = this._findFirstMatchInLine(searcher, text, startLineNumber, searchStart.column, captureMatches); if (r) { return r; } @@ -333,7 +319,7 @@ export class TextModelSearch { for (let i = 1; i <= lineCount; i++) { const lineIndex = (startLineNumber + i - 1) % lineCount; const text = model.getLineContent(lineIndex + 1); - const r = this._findFirstMatchInLine(searchRegex, text, lineIndex + 1, 1, captureMatches); + const r = this._findFirstMatchInLine(searcher, text, lineIndex + 1, 1, captureMatches); if (r) { return r; } @@ -342,10 +328,10 @@ export class TextModelSearch { return null; } - private static _findFirstMatchInLine(searchRegex: RegExp, text: string, lineNumber: number, fromColumn: number, captureMatches: boolean): FindMatch { + private static _findFirstMatchInLine(searcher: Searcher, text: string, lineNumber: number, fromColumn: number, captureMatches: boolean): FindMatch { // Set regex to search from column - searchRegex.lastIndex = fromColumn - 1; - const m: RegExpExecArray = searchRegex.exec(text); + searcher.reset(fromColumn - 1); + const m: RegExpExecArray = searcher.next(text); if (m) { return createFindMatch( new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), @@ -362,14 +348,16 @@ export class TextModelSearch { return null; } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + if (searchData.regex.multiline) { - return this._doFindPreviousMatchMultiline(model, searchStart, searchData.regex, captureMatches); + return this._doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches); } - return this._doFindPreviousMatchLineByLine(model, searchStart, searchData.regex, captureMatches); + return this._doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches); } - private static _doFindPreviousMatchMultiline(model: TextModel, searchStart: Position, searchRegex: RegExp, captureMatches: boolean): FindMatch { - const matches = this._doFindMatchesMultiline(model, new Range(1, 1, searchStart.lineNumber, searchStart.column), searchRegex, captureMatches, 10 * LIMIT_FIND_COUNT); + private static _doFindPreviousMatchMultiline(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch { + const matches = this._doFindMatchesMultiline(model, new Range(1, 1, searchStart.lineNumber, searchStart.column), searcher, captureMatches, 10 * LIMIT_FIND_COUNT); if (matches.length > 0) { return matches[matches.length - 1]; } @@ -377,19 +365,19 @@ export class TextModelSearch { const lineCount = model.getLineCount(); if (searchStart.lineNumber !== lineCount || searchStart.column !== model.getLineMaxColumn(lineCount)) { // Try again with all content - return this._doFindPreviousMatchMultiline(model, new Position(lineCount, model.getLineMaxColumn(lineCount)), searchRegex, captureMatches); + return this._doFindPreviousMatchMultiline(model, new Position(lineCount, model.getLineMaxColumn(lineCount)), searcher, captureMatches); } return null; } - private static _doFindPreviousMatchLineByLine(model: TextModel, searchStart: Position, searchRegex: RegExp, captureMatches: boolean): FindMatch { + private static _doFindPreviousMatchLineByLine(model: TextModel, searchStart: Position, searcher: Searcher, captureMatches: boolean): FindMatch { const lineCount = model.getLineCount(); const startLineNumber = searchStart.lineNumber; // Look in first line const text = model.getLineContent(startLineNumber).substring(0, searchStart.column - 1); - const r = this._findLastMatchInLine(searchRegex, text, startLineNumber, captureMatches); + const r = this._findLastMatchInLine(searcher, text, startLineNumber, captureMatches); if (r) { return r; } @@ -397,7 +385,7 @@ export class TextModelSearch { for (let i = 1; i <= lineCount; i++) { const lineIndex = (lineCount + startLineNumber - i - 1) % lineCount; const text = model.getLineContent(lineIndex + 1); - const r = this._findLastMatchInLine(searchRegex, text, lineIndex + 1, captureMatches); + const r = this._findLastMatchInLine(searcher, text, lineIndex + 1, captureMatches); if (r) { return r; } @@ -406,20 +394,85 @@ export class TextModelSearch { return null; } - private static _findLastMatchInLine(searchRegex: RegExp, text: string, lineNumber: number, captureMatches: boolean): FindMatch { + private static _findLastMatchInLine(searcher: Searcher, text: string, lineNumber: number, captureMatches: boolean): FindMatch { let bestResult: FindMatch = null; let m: RegExpExecArray; - while ((m = searchRegex.exec(text))) { - const result = new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length); - if (bestResult && result.equalsRange(bestResult.range)) { - break; - } - bestResult = createFindMatch(result, m, captureMatches); - if (m.index + m[0].length === text.length) { - // Reached the end of the line - break; - } + searcher.reset(0); + while ((m = searcher.next(text))) { + bestResult = createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches); } return bestResult; } } + +function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean { + + if (matchStartIndex - 1 >= 0) { + const charBefore = text.charCodeAt(matchStartIndex - 1); + if (wordSeparators.get(charBefore) === WordCharacterClass.Regular) { + return false; + } + } + + if (matchStartIndex + matchLength < textLength) { + const charAfter = text.charCodeAt(matchStartIndex + matchLength); + if (wordSeparators.get(charAfter) === WordCharacterClass.Regular) { + return false; + } + } + + return true; +} + +class Searcher { + private _wordSeparators: WordCharacterClassifier; + private _searchRegex: RegExp; + private _prevMatchStartIndex: number; + private _prevMatchLength: number; + + constructor(wordSeparators: WordCharacterClassifier, searchRegex: RegExp, ) { + this._wordSeparators = wordSeparators; + this._searchRegex = searchRegex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + + public reset(lastIndex: number): void { + this._searchRegex.lastIndex = lastIndex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + + public next(text: string): RegExpExecArray { + const textLength = text.length; + + let m: RegExpExecArray; + do { + if (this._prevMatchStartIndex + this._prevMatchLength === textLength) { + // Reached the end of the line + return null; + } + + m = this._searchRegex.exec(text); + if (!m) { + return null; + } + + const matchStartIndex = m.index; + const matchLength = m[0].length; + if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) { + // Exit early if the regex matches the same range twice + return null; + } + this._prevMatchStartIndex = matchStartIndex; + this._prevMatchLength = matchLength; + + if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) { + return m; + } + + } while (m); + + return null; + } +} diff --git a/src/vs/editor/common/model/textModelWithDecorations.ts b/src/vs/editor/common/model/textModelWithDecorations.ts index 92ca064f41d..84380b69ef3 100644 --- a/src/vs/editor/common/model/textModelWithDecorations.ts +++ b/src/vs/editor/common/model/textModelWithDecorations.ts @@ -839,29 +839,81 @@ function cleanClassName(className: string): string { return className.replace(/[^a-z0-9\-]/gi, ' '); } +export class ModelDecorationOverviewRulerOptions implements editorCommon.IModelDecorationOverviewRulerOptions { + readonly color: string | editorCommon.ThemeColor; + readonly darkColor: string | editorCommon.ThemeColor; + readonly hcColor: string | editorCommon.ThemeColor; + readonly position: editorCommon.OverviewRulerLane; + + constructor(options: editorCommon.IModelDecorationOverviewRulerOptions) { + this.color = strings.empty; + this.darkColor = strings.empty; + this.hcColor = strings.empty; + this.position = editorCommon.OverviewRulerLane.Center; + + if (options && options.color) { + this.color = options.color; + } + if (options && options.darkColor) { + this.darkColor = options.darkColor; + this.hcColor = options.darkColor; + } + if (options && options.hcColor) { + this.hcColor = options.hcColor; + } + if (options && options.hasOwnProperty('position')) { + this.position = options.position; + } + } + + public equals(other: ModelDecorationOverviewRulerOptions): boolean { + return ( + this.color === other.color + && this.darkColor === other.darkColor + && this.hcColor === other.hcColor + && this.position === other.position + ); + } +} + +let lastStaticId = 0; + export class ModelDecorationOptions implements editorCommon.IModelDecorationOptions { - stickiness: editorCommon.TrackedRangeStickiness; - className: string; - hoverMessage: MarkedString | MarkedString[]; - glyphMarginHoverMessage: MarkedString | MarkedString[]; - isWholeLine: boolean; - showInOverviewRuler: string; - overviewRuler: editorCommon.IModelDecorationOverviewRulerOptions; - glyphMarginClassName: string; - linesDecorationsClassName: string; - marginClassName: string; - inlineClassName: string; - beforeContentClassName: string; - afterContentClassName: string; + public static EMPTY: ModelDecorationOptions; - constructor(options: editorCommon.IModelDecorationOptions) { + public static register(options: editorCommon.IModelDecorationOptions): ModelDecorationOptions { + return new ModelDecorationOptions(++lastStaticId, options); + } + + public static createDynamic(options: editorCommon.IModelDecorationOptions): ModelDecorationOptions { + return new ModelDecorationOptions(0, options); + } + + readonly staticId: number; + readonly stickiness: editorCommon.TrackedRangeStickiness; + readonly className: string; + readonly hoverMessage: MarkedString | MarkedString[]; + readonly glyphMarginHoverMessage: MarkedString | MarkedString[]; + readonly isWholeLine: boolean; + readonly showIfCollapsed: boolean; + readonly overviewRuler: ModelDecorationOverviewRulerOptions; + readonly glyphMarginClassName: string; + readonly linesDecorationsClassName: string; + readonly marginClassName: string; + readonly inlineClassName: string; + readonly beforeContentClassName: string; + readonly afterContentClassName: string; + + private constructor(staticId: number, options: editorCommon.IModelDecorationOptions) { + this.staticId = staticId; this.stickiness = options.stickiness || editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges; this.className = options.className ? cleanClassName(options.className) : strings.empty; this.hoverMessage = options.hoverMessage || []; this.glyphMarginHoverMessage = options.glyphMarginHoverMessage || strings.empty; this.isWholeLine = options.isWholeLine || false; - this.overviewRuler = _normalizeOverviewRulerOptions(options.overviewRuler, options.showInOverviewRuler); + this.showIfCollapsed = options.showIfCollapsed || false; + this.overviewRuler = new ModelDecorationOverviewRulerOptions(options.overviewRuler); this.glyphMarginClassName = options.glyphMarginClassName ? cleanClassName(options.glyphMarginClassName) : strings.empty; this.linesDecorationsClassName = options.linesDecorationsClassName ? cleanClassName(options.linesDecorationsClassName) : strings.empty; this.marginClassName = options.marginClassName ? cleanClassName(options.marginClassName) : strings.empty; @@ -870,20 +922,16 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti this.afterContentClassName = options.afterContentClassName ? cleanClassName(options.afterContentClassName) : strings.empty; } - private static _overviewRulerEquals(a: editorCommon.IModelDecorationOverviewRulerOptions, b: editorCommon.IModelDecorationOverviewRulerOptions): boolean { - return ( - a.color === b.color - && a.position === b.position - && a.darkColor === b.darkColor - ); - } - public equals(other: ModelDecorationOptions): boolean { + if (this.staticId > 0 || other.staticId > 0) { + return this.staticId === other.staticId; + } + return ( this.stickiness === other.stickiness && this.className === other.className && this.isWholeLine === other.isWholeLine - && this.showInOverviewRuler === other.showInOverviewRuler + && this.showIfCollapsed === other.showIfCollapsed && this.glyphMarginClassName === other.glyphMarginClassName && this.linesDecorationsClassName === other.linesDecorationsClassName && this.marginClassName === other.marginClassName @@ -892,10 +940,11 @@ export class ModelDecorationOptions implements editorCommon.IModelDecorationOpti && this.afterContentClassName === other.afterContentClassName && markedStringsEquals(this.hoverMessage, other.hoverMessage) && markedStringsEquals(this.glyphMarginHoverMessage, other.glyphMarginHoverMessage) - && ModelDecorationOptions._overviewRulerEquals(this.overviewRuler, other.overviewRuler) + && this.overviewRuler.equals(other.overviewRuler) ); } } +ModelDecorationOptions.EMPTY = ModelDecorationOptions.register({}); class ModelDeltaDecoration implements editorCommon.IModelDeltaDecoration { @@ -911,40 +960,8 @@ class ModelDeltaDecoration implements editorCommon.IModelDeltaDecoration { } function _normalizeOptions(options: editorCommon.IModelDecorationOptions): ModelDecorationOptions { - return new ModelDecorationOptions(options); -} - -class ModelDecorationOverviewRulerOptions implements editorCommon.IModelDecorationOverviewRulerOptions { - color: string; - darkColor: string; - hcColor: string; - position: editorCommon.OverviewRulerLane; - - constructor(options: editorCommon.IModelDecorationOverviewRulerOptions, legacyShowInOverviewRuler: string) { - this.color = strings.empty; - this.darkColor = strings.empty; - this.hcColor = strings.empty; - this.position = editorCommon.OverviewRulerLane.Center; - - if (legacyShowInOverviewRuler) { - this.color = legacyShowInOverviewRuler; - } - if (options && options.color) { - this.color = options.color; - } - if (options && options.darkColor) { - this.darkColor = options.darkColor; - this.hcColor = options.darkColor; - } - if (options && options.hcColor) { - this.hcColor = options.hcColor; - } - if (options && options.hasOwnProperty('position')) { - this.position = options.position; - } + if (options instanceof ModelDecorationOptions) { + return options; } -} - -function _normalizeOverviewRulerOptions(options: editorCommon.IModelDecorationOverviewRulerOptions, legacyShowInOverviewRuler: string = null): editorCommon.IModelDecorationOverviewRulerOptions { - return new ModelDecorationOverviewRulerOptions(options, legacyShowInOverviewRuler); + return ModelDecorationOptions.createDynamic(options); } diff --git a/src/vs/editor/common/modes/languageConfigurationRegistry.ts b/src/vs/editor/common/modes/languageConfigurationRegistry.ts index c4c5ee6a9e1..1563ebc48de 100644 --- a/src/vs/editor/common/modes/languageConfigurationRegistry.ts +++ b/src/vs/editor/common/modes/languageConfigurationRegistry.ts @@ -270,7 +270,7 @@ export class LanguageConfigurationRegistryImpl { let indentation = this.getIndentationAtPosition(model, range.startLineNumber, range.startColumn); let ignoreCurrentLine = false; - let scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber); + let scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn); let onEnterSupport = this._getOnEnterSupport(scopedLineTokens.languageId); if (!onEnterSupport) { return { @@ -288,8 +288,8 @@ export class LanguageConfigurationRegistryImpl { if (range.isEmpty()) { afterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); } else { - let endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber); - afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - endScopedLineTokens.firstCharOffset); + const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); + afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); } let lineNumber = range.startLineNumber; @@ -398,11 +398,11 @@ export class LanguageConfigurationRegistryImpl { return lineText; } - private getScopedLineTokens(model: ITokenizedModel, lineNumber: number) { + private getScopedLineTokens(model: ITokenizedModel, lineNumber: number, columnNumber?: number) { model.forceTokenization(lineNumber); let lineTokens = model.getLineTokens(lineNumber); - let column = model.getLineMaxColumn(lineNumber); - let scopedLineTokens = createScopedLineTokens(lineTokens, column - 1); + let column = isNaN(columnNumber) ? model.getLineMaxColumn(lineNumber) - 1 : columnNumber; + let scopedLineTokens = createScopedLineTokens(lineTokens, column); return scopedLineTokens; } diff --git a/src/vs/editor/common/services/bulkEdit.ts b/src/vs/editor/common/services/bulkEdit.ts index 2f63c6f64a7..e847eafc911 100644 --- a/src/vs/editor/common/services/bulkEdit.ts +++ b/src/vs/editor/common/services/bulkEdit.ts @@ -274,7 +274,7 @@ class BulkEditModel implements IDisposable { return r; } - private applyTask(task): void { + private applyTask(task: EditTask): void { task.apply(); if (this.progress) { this.progress.worked(1); @@ -287,7 +287,7 @@ class BulkEditModel implements IDisposable { } export interface BulkEdit { - progress(progress: IProgressRunner); + progress(progress: IProgressRunner): void; add(edit: IResourceEdit[]): void; finish(): TPromise; ariaMessage(): string; diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 88d5690bd13..5d36b8f6c4b 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -474,7 +474,7 @@ export abstract class BaseEditorSimpleWorker { public loadForeignModule(moduleId: string, createData: any): TPromise { return new TPromise((c, e) => { // Use the global require to be sure to get the global config - (self).require([moduleId], (foreignModule) => { + (self).require([moduleId], (foreignModule: { create: (ctx: IWorkerContext, createData: any) => any; }) => { let ctx: IWorkerContext = { getMirrorModels: (): IMirrorModel[] => { return this._getModels(); diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 9bbb35747dc..5bcb68eba4b 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -21,7 +21,7 @@ import { IMode, LanguageIdentifier } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import * as platform from 'vs/base/common/platform'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { DEFAULT_INDENTATION, DEFAULT_TRIM_AUTO_WHITESPACE } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { PLAINTEXT_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/modesRegistry'; import { IRawTextSource, TextSource, RawTextSource } from 'vs/editor/common/model/textSource'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; @@ -157,6 +157,7 @@ class ModelMarkerHandler { stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className, hoverMessage, + showIfCollapsed: true, overviewRuler: { color, darkColor, @@ -223,7 +224,7 @@ export class ModelServiceImpl implements IModelService { } private static _readModelOptions(config: IRawConfig): editorCommon.ITextModelCreationOptions { - let tabSize = DEFAULT_INDENTATION.tabSize; + let tabSize = EDITOR_MODEL_DEFAULTS.tabSize; if (config.editor && typeof config.editor.tabSize !== 'undefined') { let parsedTabSize = parseInt(config.editor.tabSize, 10); if (!isNaN(parsedTabSize)) { @@ -231,7 +232,7 @@ export class ModelServiceImpl implements IModelService { } } - let insertSpaces = DEFAULT_INDENTATION.insertSpaces; + let insertSpaces = EDITOR_MODEL_DEFAULTS.insertSpaces; if (config.editor && typeof config.editor.insertSpaces !== 'undefined') { insertSpaces = (config.editor.insertSpaces === 'false' ? false : Boolean(config.editor.insertSpaces)); } @@ -244,12 +245,12 @@ export class ModelServiceImpl implements IModelService { newDefaultEOL = editorCommon.DefaultEndOfLine.LF; } - let trimAutoWhitespace = DEFAULT_TRIM_AUTO_WHITESPACE; + let trimAutoWhitespace = EDITOR_MODEL_DEFAULTS.trimAutoWhitespace; if (config.editor && typeof config.editor.trimAutoWhitespace !== 'undefined') { trimAutoWhitespace = (config.editor.trimAutoWhitespace === 'false' ? false : Boolean(config.editor.trimAutoWhitespace)); } - let detectIndentation = DEFAULT_INDENTATION.detectIndentation; + let detectIndentation = EDITOR_MODEL_DEFAULTS.detectIndentation; if (config.editor && typeof config.editor.detectIndentation !== 'undefined') { detectIndentation = (config.editor.detectIndentation === 'false' ? false : Boolean(config.editor.detectIndentation)); } diff --git a/src/vs/editor/common/standalone/standaloneBase.ts b/src/vs/editor/common/standalone/standaloneBase.ts index fcab19ff6e8..695aa77b9bf 100644 --- a/src/vs/editor/common/standalone/standaloneBase.ts +++ b/src/vs/editor/common/standalone/standaloneBase.ts @@ -16,6 +16,7 @@ import URI from 'vs/base/common/uri'; // -------------------------------------------- // This is repeated here so it can be exported +// because TS inlines const enums // -------------------------------------------- export enum Severity { Ignore = 0, @@ -26,6 +27,7 @@ export enum Severity { // -------------------------------------------- // This is repeated here so it can be exported +// because TS inlines const enums // -------------------------------------------- export class KeyMod { public static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd; @@ -40,6 +42,7 @@ export class KeyMod { // -------------------------------------------- // This is repeated here so it can be exported +// because TS inlines const enums // -------------------------------------------- /** * Virtual Key Codes, the value does not hold any inherent meaning. @@ -213,6 +216,8 @@ export enum KeyCode { * Cover all key codes when IME is processing input. */ KEY_IN_COMPOSITION = 109, + ABNT_C1 = 110, + ABNT_C2 = 111, /** * Placed last to cover the length of the enum. * Please do not depend on this value! diff --git a/src/vs/editor/common/standalone/themes.ts b/src/vs/editor/common/standalone/themes.ts index a97a9fab1ee..8093472bba8 100644 --- a/src/vs/editor/common/standalone/themes.ts +++ b/src/vs/editor/common/standalone/themes.ts @@ -6,8 +6,8 @@ 'use strict'; import { IStandaloneThemeData } from 'vs/editor/common/services/standaloneThemeService'; -import { editorBackground, editorForeground, editorSelectionHighlight, editorInactiveSelection } from "vs/platform/theme/common/colorRegistry"; -import { editorIndentGuides } from "vs/editor/common/view/editorColorRegistry"; +import { editorBackground, editorForeground, editorSelectionHighlight, editorInactiveSelection } from 'vs/platform/theme/common/colorRegistry'; +import { editorIndentGuides } from 'vs/editor/common/view/editorColorRegistry'; /* -------------------------------- Begin vs theme -------------------------------- */ export const vs: IStandaloneThemeData = { diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index e6a96f19043..9b72bd4af44 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -18,33 +18,50 @@ export const editorCursor = registerColor('editorCursor.foreground', { dark: '#A export const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hc: '#e3e4e229' }, nls.localize('editorWhitespaces', 'Color of whitespace characters in the editor.')); export const editorIndentGuides = registerColor('editorIndentGuide.background', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, nls.localize('editorIndentGuides', 'Color of the editor indentation guides.')); export const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#5A5A5A', light: '#2B91AF', hc: Color.white }, nls.localize('editorLineNumbers', 'Color of editor line numbers.')); +export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hc: Color.white }, nls.localize('editorRuler', 'Color of the editor rulers.')); +export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#999999', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor code lenses')); + +export const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hc: '#0064001a' }, nls.localize('editorBracketMatchBackground', 'Background color behind matching brackets')); +export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: '#fff' }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes')); + +export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hc: '#7f7f7f4d' }, nls.localize('editorOverviewRulerBorder', 'Color of the overview ruler border.')); + +export const editorGutter = registerColor('editorGutter.background', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.')); + +export const editorErrorForeground = registerColor('editorError.foreground', { dark: '#FF0000', light: '#FF0000', hc: null }, nls.localize('errorForeground', 'Foreground color of error squigglies in the editor.')); +export const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hc: Color.fromHex('#E47777').transparent(0.8) }, nls.localize('errorBorder', 'Border color of error squigglies in the editor.')); + +export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('warningForeground', 'Foreground color of warning squigglies in the editor.')); +export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning squigglies in the editor.')); // contains all color rules that used to defined in editor/browser/widget/editor.css registerThemingParticipant((theme, collector) => { - let background = theme.getColor(editorBackground); if (background) { - collector.addRule(`.monaco-editor.${theme.selector} .monaco-editor-background { background-color: ${background}; }`); + collector.addRule(`.monaco-editor, .monaco-editor .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${background}; }`); } let foreground = theme.getColor(editorForeground); if (foreground) { - collector.addRule(`.monaco-editor.${theme.selector}, .monaco-editor.${theme.selector} .inputarea { color: ${foreground}; }`); + collector.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${foreground}; }`); + } + + let gutter = theme.getColor(editorGutter); + if (gutter) { + collector.addRule(`.monaco-editor .margin { background-color: ${gutter}; }`); } let rangeHighlight = theme.getColor(editorRangeHighlight); if (rangeHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .rangeHighlight { background-color: ${rangeHighlight}; }`); + collector.addRule(`.monaco-editor .rangeHighlight { background-color: ${rangeHighlight}; }`); } let outline = theme.getColor(activeContrastBorder); if (outline) { - collector.addRule(`.monaco-editor.${theme.selector} .rangeHighlight { border: 1px dotted ${outline}; }; }`); + collector.addRule(`.monaco-editor .rangeHighlight { border: 1px dotted ${outline}; }; }`); } let invisibles = theme.getColor(editorWhitespaces); if (invisibles) { collector.addRule(`.vs-whitespace { color: ${invisibles} !important; }`); } -}); - - +}); \ No newline at end of file diff --git a/src/vs/editor/common/view/overviewZoneManager.ts b/src/vs/editor/common/view/overviewZoneManager.ts index 1db950495cc..a13baf1e0d2 100644 --- a/src/vs/editor/common/view/overviewZoneManager.ts +++ b/src/vs/editor/common/view/overviewZoneManager.ts @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { OverviewRulerLane, ThemeType } from 'vs/editor/common/editorCommon'; +import { OverviewRulerLane } from 'vs/editor/common/editorCommon'; +import { ThemeType, DARK, HIGH_CONTRAST, LIGHT } from 'vs/platform/theme/common/themeService'; export class ColorZone { _colorZoneBrand: void; @@ -57,9 +58,9 @@ export class OverviewRulerZone { public getColor(themeType: ThemeType): string { switch (themeType) { - case ThemeType.HighContrast: + case HIGH_CONTRAST: return this._hcColor; - case ThemeType.Dark: + case DARK: return this._darkColor; } return this._color; @@ -125,7 +126,7 @@ export class OverviewZoneManager { private _themeType: ThemeType; private _pixelRatio: number; - private _lastAssignedId; + private _lastAssignedId: number; private _color2Id: { [color: string]: number; }; private _id2Color: string[]; @@ -139,7 +140,7 @@ export class OverviewZoneManager { this._outerHeight = 0; this._maximumHeight = 0; this._minimumHeight = 0; - this._themeType = ThemeType.Light; + this._themeType = LIGHT; this._pixelRatio = 1; this._lastAssignedId = 0; diff --git a/src/vs/editor/common/view/viewContext.ts b/src/vs/editor/common/view/viewContext.ts index c37c88756d9..7aae15aebab 100644 --- a/src/vs/editor/common/view/viewContext.ts +++ b/src/vs/editor/common/view/viewContext.ts @@ -5,23 +5,30 @@ 'use strict'; import { IConfiguration } from 'vs/editor/common/editorCommon'; -import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; +import { IViewModel, IViewLayout } from 'vs/editor/common/viewModel/viewModel'; import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler'; import { ViewEventDispatcher } from 'vs/editor/common/view/viewEventDispatcher'; +import { ITheme } from 'vs/platform/theme/common/themeService'; export class ViewContext { public readonly configuration: IConfiguration; public readonly model: IViewModel; + public readonly viewLayout: IViewLayout; public readonly privateViewEventBus: ViewEventDispatcher; + public theme: ITheme; // will be updated + constructor( configuration: IConfiguration, + theme: ITheme, model: IViewModel, privateViewEventBus: ViewEventDispatcher ) { this.configuration = configuration; + this.theme = theme; this.model = model; + this.viewLayout = model.viewLayout; this.privateViewEventBus = privateViewEventBus; } diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts index 3bb4059a38e..72fc6b41fbe 100644 --- a/src/vs/editor/common/view/viewEvents.ts +++ b/src/vs/editor/common/view/viewEvents.ts @@ -4,46 +4,55 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { ScrollEvent } from 'vs/base/common/scrollable'; -import { IViewConfigurationChangedEvent, IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { VerticalRevealType } from 'vs/editor/common/controller/cursorEvents'; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import * as errors from 'vs/base/common/errors'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; export const enum ViewEventType { ViewConfigurationChanged = 1, - ViewCursorPositionChanged = 2, - ViewCursorSelectionChanged = 3, - ViewDecorationsChanged = 4, - ViewFlushed = 5, - ViewFocusChanged = 6, - ViewLineMappingChanged = 7, - ViewLinesChanged = 8, - ViewLinesDeleted = 9, - ViewLinesInserted = 10, - ViewRevealRangeRequest = 11, - ViewScrollChanged = 12, - ViewScrollRequest = 13, - ViewTokensChanged = 14, - ViewTokensColorsChanged = 15, - ViewZonesChanged = 16, + ViewCursorStateChanged = 2, + ViewDecorationsChanged = 3, + ViewFlushed = 4, + ViewFocusChanged = 5, + ViewLineMappingChanged = 6, + ViewLinesChanged = 7, + ViewLinesDeleted = 8, + ViewLinesInserted = 9, + ViewRevealRangeRequest = 10, + ViewScrollChanged = 11, + ViewTokensChanged = 12, + ViewTokensColorsChanged = 13, + ViewZonesChanged = 14, + ViewThemeChanged = 15 } export class ViewConfigurationChangedEvent { public readonly type = ViewEventType.ViewConfigurationChanged; + public readonly canUseTranslate3d: boolean; + public readonly pixelRatio: boolean; + public readonly editorClassName: boolean; public readonly lineHeight: boolean; public readonly readOnly: boolean; + public readonly accessibilitySupport: boolean; + public readonly emptySelectionClipboard: boolean; public readonly layoutInfo: boolean; public readonly fontInfo: boolean; - public readonly viewInfo: IViewConfigurationChangedEvent; + public readonly viewInfo: boolean; public readonly wrappingInfo: boolean; constructor(source: IConfigurationChangedEvent) { + this.canUseTranslate3d = source.canUseTranslate3d; + this.pixelRatio = source.pixelRatio; + this.editorClassName = source.editorClassName; this.lineHeight = source.lineHeight; this.readOnly = source.readOnly; + this.accessibilitySupport = source.accessibilitySupport; + this.emptySelectionClipboard = source.emptySelectionClipboard; this.layoutInfo = source.layoutInfo; this.fontInfo = source.fontInfo; this.viewInfo = source.viewInfo; @@ -51,46 +60,27 @@ export class ViewConfigurationChangedEvent { } } -export class ViewCursorPositionChangedEvent { +export class ViewCursorStateChangedEvent { - public readonly type = ViewEventType.ViewCursorPositionChanged; + public readonly type = ViewEventType.ViewCursorStateChanged; /** - * Primary cursor's position. + * The primary selection is always at index 0. */ - public readonly position: Position; - /** - * Secondary cursors' position. - */ - public readonly secondaryPositions: Position[]; + public readonly selections: Selection[]; /** * Is the primary cursor in the editable range? */ public readonly isInEditableRange: boolean; + /** + * A message that can be presented to screen readers. + */ + public readonly screenReaderMessage: string; - constructor(position: Position, secondaryPositions: Position[], isInEditableRange: boolean) { - this.position = position; - this.secondaryPositions = secondaryPositions; + constructor(selections: Selection[], isInEditableRange: boolean, screenReaderMessage: string) { + this.selections = selections; this.isInEditableRange = isInEditableRange; - } -} - -export class ViewCursorSelectionChangedEvent { - - public readonly type = ViewEventType.ViewCursorSelectionChanged; - - /** - * The primary selection. - */ - public readonly selection: Selection; - /** - * The secondary selections. - */ - public readonly secondarySelections: Selection[]; - - constructor(selection: Selection, secondarySelections: Selection[]) { - this.selection = selection; - this.secondarySelections = secondarySelections; + this.screenReaderMessage = screenReaderMessage; } } @@ -189,6 +179,14 @@ export class ViewLinesInsertedEvent { } } +export const enum VerticalRevealType { + Simple = 0, + Center = 1, + CenterIfOutsideViewport = 2, + Top = 3, + Bottom = 4 +} + export class ViewRevealRangeRequestEvent { public readonly type = ViewEventType.ViewRevealRangeRequest; @@ -239,17 +237,6 @@ export class ViewScrollChangedEvent { } } -export class ViewScrollRequestEvent { - - public readonly type = ViewEventType.ViewScrollRequest; - - public readonly desiredScrollTop: number; - - constructor(desiredScrollTop: number) { - this.desiredScrollTop = desiredScrollTop; - } -} - export class ViewTokensChangedEvent { public readonly type = ViewEventType.ViewTokensChanged; @@ -270,6 +257,14 @@ export class ViewTokensChangedEvent { } } +export class ViewThemeChangedEvent { + + public readonly type = ViewEventType.ViewThemeChanged; + + constructor() { + } +} + export class ViewTokensColorsChangedEvent { public readonly type = ViewEventType.ViewTokensColorsChanged; @@ -290,8 +285,7 @@ export class ViewZonesChangedEvent { export type ViewEvent = ( ViewConfigurationChangedEvent - | ViewCursorPositionChangedEvent - | ViewCursorSelectionChangedEvent + | ViewCursorStateChangedEvent | ViewDecorationsChangedEvent | ViewFlushedEvent | ViewFocusChangedEvent @@ -301,8 +295,56 @@ export type ViewEvent = ( | ViewLinesInsertedEvent | ViewRevealRangeRequestEvent | ViewScrollChangedEvent - | ViewScrollRequestEvent | ViewTokensChangedEvent | ViewTokensColorsChangedEvent | ViewZonesChangedEvent + | ViewThemeChangedEvent ); + +export interface IViewEventListener { + (events: ViewEvent[]): void; +} + +export class ViewEventEmitter extends Disposable { + private _listeners: IViewEventListener[]; + + constructor() { + super(); + this._listeners = []; + } + + public dispose(): void { + this._listeners = []; + super.dispose(); + } + + protected _emit(events: ViewEvent[]): void { + const listeners = this._listeners.slice(0); + for (let i = 0, len = listeners.length; i < len; i++) { + safeInvokeListener(listeners[i], events); + } + } + + public addEventListener(listener: (events: ViewEvent[]) => void): IDisposable { + this._listeners.push(listener); + return { + dispose: () => { + let listeners = this._listeners; + for (let i = 0, len = listeners.length; i < len; i++) { + if (listeners[i] === listener) { + listeners.splice(i, 1); + break; + } + } + } + }; + } +} + +function safeInvokeListener(listener: IViewEventListener, events: ViewEvent[]): void { + try { + listener(events); + } catch (e) { + errors.onUnexpectedError(e); + } +} diff --git a/src/vs/editor/common/viewLayout/editorLayoutProvider.ts b/src/vs/editor/common/viewLayout/editorLayoutProvider.ts deleted file mode 100644 index daf1522ab92..00000000000 --- a/src/vs/editor/common/viewLayout/editorLayoutProvider.ts +++ /dev/null @@ -1,154 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { RenderMinimap, EditorLayoutInfo, OverviewRulerPosition } from 'vs/editor/common/config/editorOptions'; - -export interface IEditorLayoutProviderOpts { - outerWidth: number; - outerHeight: number; - - showGlyphMargin: boolean; - lineHeight: number; - - showLineNumbers: boolean; - lineNumbersMinChars: number; - lineNumbersDigitCount: number; - - lineDecorationsWidth: number; - - typicalHalfwidthCharacterWidth: number; - maxDigitWidth: number; - - verticalScrollbarWidth: number; - verticalScrollbarHasArrows: boolean; - scrollbarArrowSize: number; - horizontalScrollbarHeight: number; - - minimap: boolean; - minimapRenderCharacters: boolean; - minimapMaxColumn: number; - pixelRatio: number; -} - -export class EditorLayoutProvider { - public static compute(_opts: IEditorLayoutProviderOpts): EditorLayoutInfo { - const outerWidth = _opts.outerWidth | 0; - const outerHeight = _opts.outerHeight | 0; - const showGlyphMargin = Boolean(_opts.showGlyphMargin); - const lineHeight = _opts.lineHeight | 0; - const showLineNumbers = Boolean(_opts.showLineNumbers); - const lineNumbersMinChars = _opts.lineNumbersMinChars | 0; - const lineNumbersDigitCount = _opts.lineNumbersDigitCount | 0; - const lineDecorationsWidth = _opts.lineDecorationsWidth | 0; - const typicalHalfwidthCharacterWidth = Number(_opts.typicalHalfwidthCharacterWidth); - const maxDigitWidth = Number(_opts.maxDigitWidth); - const verticalScrollbarWidth = _opts.verticalScrollbarWidth | 0; - const verticalScrollbarHasArrows = Boolean(_opts.verticalScrollbarHasArrows); - const scrollbarArrowSize = _opts.scrollbarArrowSize | 0; - const horizontalScrollbarHeight = _opts.horizontalScrollbarHeight | 0; - const minimap = Boolean(_opts.minimap); - const minimapRenderCharacters = Boolean(_opts.minimapRenderCharacters); - const minimapMaxColumn = _opts.minimapMaxColumn | 0; - const pixelRatio = Number(_opts.pixelRatio); - - let lineNumbersWidth = 0; - if (showLineNumbers) { - let digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars); - lineNumbersWidth = Math.round(digitCount * maxDigitWidth); - } - - let glyphMarginWidth = 0; - if (showGlyphMargin) { - glyphMarginWidth = lineHeight; - } - - let glyphMarginLeft = 0; - let lineNumbersLeft = glyphMarginLeft + glyphMarginWidth; - let decorationsLeft = lineNumbersLeft + lineNumbersWidth; - let contentLeft = decorationsLeft + lineDecorationsWidth; - - let remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth; - - let renderMinimap: RenderMinimap; - let minimapWidth: number; - let contentWidth: number; - if (!minimap) { - minimapWidth = 0; - renderMinimap = RenderMinimap.None; - contentWidth = remainingWidth; - } else { - let minimapCharWidth: number; - if (pixelRatio >= 2) { - renderMinimap = minimapRenderCharacters ? RenderMinimap.Large : RenderMinimap.LargeBlocks; - minimapCharWidth = 2 / pixelRatio; - } else { - renderMinimap = minimapRenderCharacters ? RenderMinimap.Small : RenderMinimap.SmallBlocks; - minimapCharWidth = 1 / pixelRatio; - } - - // Given: - // viewportColumn = (contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth - // minimapWidth = viewportColumn * minimapCharWidth - // contentWidth = remainingWidth - minimapWidth - // What are good values for contentWidth and minimapWidth ? - - // minimapWidth = ((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth) * minimapCharWidth - // typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth) * minimapCharWidth - // typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth) * minimapCharWidth - // (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth) * minimapCharWidth - // minimapWidth = ((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth) - - minimapWidth = Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))); - let minimapColumns = minimapWidth / minimapCharWidth; - if (minimapColumns > minimapMaxColumn) { - minimapWidth = Math.floor(minimapMaxColumn * minimapCharWidth); - } - contentWidth = remainingWidth - minimapWidth; - } - - let viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth)); - - let verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0); - - return new EditorLayoutInfo({ - width: outerWidth, - height: outerHeight, - - glyphMarginLeft: glyphMarginLeft, - glyphMarginWidth: glyphMarginWidth, - glyphMarginHeight: outerHeight, - - lineNumbersLeft: lineNumbersLeft, - lineNumbersWidth: lineNumbersWidth, - lineNumbersHeight: outerHeight, - - decorationsLeft: decorationsLeft, - decorationsWidth: lineDecorationsWidth, - decorationsHeight: outerHeight, - - contentLeft: contentLeft, - contentWidth: contentWidth, - contentHeight: outerHeight, - - renderMinimap: renderMinimap, - minimapWidth: minimapWidth, - - viewportColumn: viewportColumn, - - verticalScrollbarWidth: verticalScrollbarWidth, - horizontalScrollbarHeight: horizontalScrollbarHeight, - - overviewRuler: new OverviewRulerPosition({ - top: verticalArrowSize, - width: verticalScrollbarWidth, - height: (outerHeight - 2 * verticalArrowSize), - right: 0 - }) - }); - } - - -} diff --git a/src/vs/editor/common/viewLayout/viewLayout.ts b/src/vs/editor/common/viewLayout/viewLayout.ts index dc1daf701f2..4af8cbd5235 100644 --- a/src/vs/editor/common/viewLayout/viewLayout.ts +++ b/src/vs/editor/common/viewLayout/viewLayout.ts @@ -10,34 +10,32 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { LinesLayout } from 'vs/editor/common/viewLayout/linesLayout'; import { IViewLayout, IViewWhitespaceViewportData, Viewport } from 'vs/editor/common/viewModel/viewModel'; import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { ViewEventDispatcher } from 'vs/editor/common/view/viewEventDispatcher'; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; +import Event from 'vs/base/common/event'; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -export class LayoutProvider extends Disposable implements IViewLayout { +export class ViewLayout extends Disposable implements IViewLayout { static LINES_HORIZONTAL_EXTRA_PX = 30; - private _configuration: editorCommon.IConfiguration; - private _privateViewEventBus: ViewEventDispatcher; - private _linesLayout: LinesLayout; - private _scrollable: Scrollable; + private readonly _configuration: editorCommon.IConfiguration; + private readonly _linesLayout: LinesLayout; - constructor(configuration: editorCommon.IConfiguration, lineCount: number, privateViewEventBus: ViewEventDispatcher) { + public readonly scrollable: Scrollable; + public readonly onDidScroll: Event; + + constructor(configuration: editorCommon.IConfiguration, lineCount: number) { super(); this._configuration = configuration; - this._privateViewEventBus = privateViewEventBus; this._linesLayout = new LinesLayout(lineCount, this._configuration.editor.lineHeight); - this._scrollable = this._register(new Scrollable()); - this._scrollable.updateState({ + this.scrollable = this._register(new Scrollable()); + this.scrollable.updateState({ width: configuration.editor.layoutInfo.contentWidth, height: configuration.editor.layoutInfo.contentHeight }); - this._register(this._scrollable.onScroll((e: ScrollEvent) => { - this._privateViewEventBus.emit(new viewEvents.ViewScrollChangedEvent(e)); - })); + this.onDidScroll = this.scrollable.onScroll; this._updateHeight(); } @@ -47,7 +45,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { } public getScrollable(): Scrollable { - return this._scrollable; + return this.scrollable; } public onHeightMaybeChanged(): void { @@ -56,12 +54,12 @@ export class LayoutProvider extends Disposable implements IViewLayout { // ---- begin view event handlers - public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void { + public onConfigurationChanged(e: IConfigurationChangedEvent): void { if (e.lineHeight) { this._linesLayout.setLineHeight(this._configuration.editor.lineHeight); } if (e.layoutInfo) { - this._scrollable.updateState({ + this.scrollable.updateState({ width: this._configuration.editor.layoutInfo.contentWidth, height: this._configuration.editor.layoutInfo.contentHeight }); @@ -72,12 +70,12 @@ export class LayoutProvider extends Disposable implements IViewLayout { this._linesLayout.onFlushed(lineCount); this._updateHeight(); } - public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): void { - this._linesLayout.onLinesDeleted(e.fromLineNumber, e.toLineNumber); + public onLinesDeleted(fromLineNumber: number, toLineNumber: number): void { + this._linesLayout.onLinesDeleted(fromLineNumber, toLineNumber); this._updateHeight(); } - public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): void { - this._linesLayout.onLinesInserted(e.fromLineNumber, e.toLineNumber); + public onLinesInserted(fromLineNumber: number, toLineNumber: number): void { + this._linesLayout.onLinesInserted(fromLineNumber, toLineNumber); this._updateHeight(); } @@ -96,7 +94,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { } private _getTotalHeight(): number { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); let result = this._linesLayout.getLinesTotalHeight(); if (this._configuration.editor.viewInfo.scrollBeyondLastLine) { @@ -109,7 +107,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { } private _updateHeight(): void { - this._scrollable.updateState({ + this.scrollable.updateState({ scrollHeight: this._getTotalHeight() }); } @@ -117,7 +115,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { // ---- Layouting logic public getCurrentViewport(): Viewport { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); return new Viewport( scrollState.scrollTop, scrollState.scrollLeft, @@ -129,14 +127,14 @@ export class LayoutProvider extends Disposable implements IViewLayout { private _computeScrollWidth(maxLineWidth: number, viewportWidth: number): number { let isViewportWrapping = this._configuration.editor.wrappingInfo.isViewportWrapping; if (!isViewportWrapping) { - return Math.max(maxLineWidth + LayoutProvider.LINES_HORIZONTAL_EXTRA_PX, viewportWidth); + return Math.max(maxLineWidth + ViewLayout.LINES_HORIZONTAL_EXTRA_PX, viewportWidth); } return Math.max(maxLineWidth, viewportWidth); } public onMaxLineWidthChanged(maxLineWidth: number): void { let newScrollWidth = this._computeScrollWidth(maxLineWidth, this.getCurrentViewport().width); - this._scrollable.updateState({ + this.scrollable.updateState({ scrollWidth: newScrollWidth }); @@ -147,7 +145,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { // ---- view state public saveState(): editorCommon.IViewState { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); let scrollTop = scrollState.scrollTop; let firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop); let whitespaceAboveFirstLine = this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(firstLineNumberInViewport); @@ -163,7 +161,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { if (typeof state.scrollTopWithoutViewZones === 'number' && !this._linesLayout.hasWhitespace()) { restoreScrollTop = state.scrollTopWithoutViewZones; } - this._scrollable.updateState({ + this.scrollable.updateState({ scrollLeft: state.scrollLeft, scrollTop: restoreScrollTop }); @@ -199,7 +197,7 @@ export class LayoutProvider extends Disposable implements IViewLayout { } public getLinesViewportDataAtScrollTop(scrollTop: number): IPartialViewLinesViewportData { // do some minimal validations on scrollTop - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); if (scrollTop + scrollState.height > scrollState.scrollHeight) { scrollTop = scrollState.scrollHeight - scrollState.height; } @@ -220,23 +218,23 @@ export class LayoutProvider extends Disposable implements IViewLayout { public getScrollWidth(): number { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); return scrollState.scrollWidth; } public getScrollLeft(): number { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); return scrollState.scrollLeft; } public getScrollHeight(): number { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); return scrollState.scrollHeight; } public getScrollTop(): number { - const scrollState = this._scrollable.getState(); + const scrollState = this.scrollable.getState(); return scrollState.scrollTop; } public setScrollPosition(position: editorCommon.INewScrollPosition): void { - this._scrollable.updateState(position); + this.scrollable.updateState(position); } } diff --git a/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts b/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts index 39d5d618325..d301593e8c1 100644 --- a/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts +++ b/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts @@ -162,13 +162,13 @@ export class CharacterHardWrappingLineMapperFactory implements ILineMapperFactor let breakBeforeOffset: number; let restoreVisibleColumnFrom: number; - if (niceBreakOffset !== -1) { + if (niceBreakOffset !== -1 && niceBreakVisibleColumn <= breakingColumn) { // We will break before `niceBreakLastOffset` breakBeforeOffset = niceBreakOffset; restoreVisibleColumnFrom = niceBreakVisibleColumn; - } else if (obtrusiveBreakOffset !== -1) { + } else if (obtrusiveBreakOffset !== -1 && obtrusiveBreakVisibleColumn <= breakingColumn) { // We will break before `obtrusiveBreakLastOffset` breakBeforeOffset = obtrusiveBreakOffset; diff --git a/src/vs/editor/common/viewModel/splitLinesCollection.ts b/src/vs/editor/common/viewModel/splitLinesCollection.ts index 6ac00757566..7c40b262f09 100644 --- a/src/vs/editor/common/viewModel/splitLinesCollection.ts +++ b/src/vs/editor/common/viewModel/splitLinesCollection.ts @@ -9,9 +9,10 @@ import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { LineTokens } from 'vs/editor/common/core/lineTokens'; import { PrefixSumComputerWithCache } from 'vs/editor/common/viewModel/prefixSumComputer'; -import { ViewLineData, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; +import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class OutputPosition { _outputPositionBrand: void; @@ -57,6 +58,510 @@ export interface ISplitLine { getViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number): Position; } +export class SplitLinesCollection { + + private model: editorCommon.IModel; + private _validModelVersionId: number; + + private wrappingColumn: number; + private columnsForFullWidthChar: number; + private wrappingIndent: WrappingIndent; + private tabSize: number; + private lines: ISplitLine[]; + + private prefixSumComputer: PrefixSumComputerWithCache; + + private linePositionMapperFactory: ILineMapperFactory; + + private hiddenAreasIds: string[]; + + constructor(model: editorCommon.IModel, linePositionMapperFactory: ILineMapperFactory, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent) { + this.model = model; + this._validModelVersionId = -1; + this.tabSize = tabSize; + this.wrappingColumn = wrappingColumn; + this.columnsForFullWidthChar = columnsForFullWidthChar; + this.wrappingIndent = wrappingIndent; + this.linePositionMapperFactory = linePositionMapperFactory; + + this._constructLines(true); + } + + public dispose(): void { + this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, []); + } + + private _ensureValidState(): void { + let modelVersion = this.model.getVersionId(); + if (modelVersion !== this._validModelVersionId) { + throw new Error('SplitLinesCollection: attempt to access a \'newer\' model'); + } + } + + private _constructLines(resetHiddenAreas: boolean): void { + this.lines = []; + + if (resetHiddenAreas) { + this.hiddenAreasIds = []; + } + + let linesContent = this.model.getLinesContent(); + let lineCount = linesContent.length; + let values = new Uint32Array(lineCount); + + let hiddenAreas = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(Range.compareRangesUsingStarts); + let hiddenAreaStart = 1, hiddenAreaEnd = 0; + let hiddenAreaIdx = -1; + let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; + + for (let i = 0; i < lineCount; i++) { + let lineNumber = i + 1; + + if (lineNumber === nextLineNumberToUpdateHiddenArea) { + hiddenAreaIdx++; + hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; + hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; + nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; + } + + let isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd); + let line = createSplitLine(this.linePositionMapperFactory, linesContent[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); + values[i] = line.getViewLineCount(); + this.lines[i] = line; + } + + this._validModelVersionId = this.model.getVersionId(); + + this.prefixSumComputer = new PrefixSumComputerWithCache(values); + } + + private getHiddenAreas(): Range[] { + return this.hiddenAreasIds.map((decId) => { + return this.model.getDecorationRange(decId); + }).sort(Range.compareRangesUsingStarts); + } + + private _reduceRanges(_ranges: Range[]): Range[] { + if (_ranges.length === 0) { + return []; + } + let ranges = _ranges.map(r => this.model.validateRange(r)).sort(Range.compareRangesUsingStarts); + + let result: Range[] = []; + let currentRangeStart = ranges[0].startLineNumber; + let currentRangeEnd = ranges[0].endLineNumber; + + for (let i = 1, len = ranges.length; i < len; i++) { + let range = ranges[i]; + + if (range.startLineNumber > currentRangeEnd + 1) { + result.push(new Range(currentRangeStart, 1, currentRangeEnd, 1)); + currentRangeStart = range.startLineNumber; + currentRangeEnd = range.endLineNumber; + } else if (range.endLineNumber > currentRangeEnd) { + currentRangeEnd = range.endLineNumber; + } + } + result.push(new Range(currentRangeStart, 1, currentRangeEnd, 1)); + return result; + } + + public setHiddenAreas(_ranges: Range[]): boolean { + + let newRanges = this._reduceRanges(_ranges); + + // BEGIN TODO@Martin: Please stop calling this method on each model change! + let oldRanges = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(Range.compareRangesUsingStarts); + + if (newRanges.length === oldRanges.length) { + let hasDifference = false; + for (let i = 0; i < newRanges.length; i++) { + if (!newRanges[i].equalsRange(oldRanges[i])) { + hasDifference = true; + break; + } + } + if (!hasDifference) { + return false; + } + } + // END TODO@Martin: Please stop calling this method on each model change! + + let newDecorations: editorCommon.IModelDeltaDecoration[] = []; + for (let i = 0; i < newRanges.length; i++) { + newDecorations.push({ + range: newRanges[i], + options: ModelDecorationOptions.EMPTY + }); + } + + this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, newDecorations); + + let hiddenAreas = newRanges; + let hiddenAreaStart = 1, hiddenAreaEnd = 0; + let hiddenAreaIdx = -1; + let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; + + for (let i = 0; i < this.lines.length; i++) { + let lineNumber = i + 1; + + if (lineNumber === nextLineNumberToUpdateHiddenArea) { + hiddenAreaIdx++; + hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; + hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; + nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; + } + + let lineChanged = false; + if (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd) { + // Line should be hidden + if (this.lines[i].isVisible()) { + this.lines[i] = this.lines[i].setVisible(false); + lineChanged = true; + } + } else { + // Line should be visible + if (!this.lines[i].isVisible()) { + this.lines[i] = this.lines[i].setVisible(true); + lineChanged = true; + } + } + if (lineChanged) { + let newOutputLineCount = this.lines[i].getViewLineCount(); + this.prefixSumComputer.changeValue(i, newOutputLineCount); + } + } + + return true; + } + + public modelPositionIsVisible(modelLineNumber: number, modelColumn: number): boolean { + if (modelLineNumber < 1 || modelLineNumber > this.lines.length) { + // invalid arguments + return false; + } + return this.lines[modelLineNumber - 1].isVisible(); + } + + public setTabSize(newTabSize: number): boolean { + if (this.tabSize === newTabSize) { + return false; + } + this.tabSize = newTabSize; + + this._constructLines(false); + + return true; + } + + public setWrappingSettings(wrappingIndent: WrappingIndent, wrappingColumn: number, columnsForFullWidthChar: number): boolean { + if (this.wrappingIndent === wrappingIndent && this.wrappingColumn === wrappingColumn && this.columnsForFullWidthChar === columnsForFullWidthChar) { + return false; + } + + this.wrappingIndent = wrappingIndent; + this.wrappingColumn = wrappingColumn; + this.columnsForFullWidthChar = columnsForFullWidthChar; + + this._constructLines(false); + + return true; + } + + public onModelFlushed(): void { + this._constructLines(true); + } + + public onModelLinesDeleted(versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent { + if (versionId <= this._validModelVersionId) { + // Here we check for versionId in case the lines were reconstructed in the meantime. + // We don't want to apply stale change events on top of a newer read model state. + return null; + } + + let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); + let outputToLineNumber = this.prefixSumComputer.getAccumulatedValue(toLineNumber - 1); + + this.lines.splice(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); + this.prefixSumComputer.removeValues(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); + + return new viewEvents.ViewLinesDeletedEvent(outputFromLineNumber, outputToLineNumber); + } + + public onModelLinesInserted(versionId: number, fromLineNumber: number, toLineNumber: number, text: string[]): viewEvents.ViewLinesInsertedEvent { + if (versionId <= this._validModelVersionId) { + // Here we check for versionId in case the lines were reconstructed in the meantime. + // We don't want to apply stale change events on top of a newer read model state. + return null; + } + + let hiddenAreas = this.getHiddenAreas(); + let isInHiddenArea = false; + let testPosition = new Position(fromLineNumber, 1); + for (let i = 0; i < hiddenAreas.length; i++) { + if (hiddenAreas[i].containsPosition(testPosition)) { + isInHiddenArea = true; + break; + } + } + + let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); + + let totalOutputLineCount = 0; + let insertLines: ISplitLine[] = []; + let insertPrefixSumValues = new Uint32Array(text.length); + + for (let i = 0, len = text.length; i < len; i++) { + let line = createSplitLine(this.linePositionMapperFactory, text[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); + insertLines.push(line); + + let outputLineCount = line.getViewLineCount(); + totalOutputLineCount += outputLineCount; + insertPrefixSumValues[i] = outputLineCount; + } + + this.lines = this.lines.slice(0, fromLineNumber - 1).concat(insertLines).concat(this.lines.slice(fromLineNumber - 1)); + + this.prefixSumComputer.insertValues(fromLineNumber - 1, insertPrefixSumValues); + + return new viewEvents.ViewLinesInsertedEvent(outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1); + } + + public onModelLineChanged(versionId: number, lineNumber: number, newText: string): [boolean, viewEvents.ViewLinesChangedEvent, viewEvents.ViewLinesInsertedEvent, viewEvents.ViewLinesDeletedEvent] { + if (versionId <= this._validModelVersionId) { + // Here we check for versionId in case the lines were reconstructed in the meantime. + // We don't want to apply stale change events on top of a newer read model state. + return [false, null, null, null]; + } + + let lineIndex = lineNumber - 1; + + let oldOutputLineCount = this.lines[lineIndex].getViewLineCount(); + let isVisible = this.lines[lineIndex].isVisible(); + let line = createSplitLine(this.linePositionMapperFactory, newText, this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, isVisible); + this.lines[lineIndex] = line; + let newOutputLineCount = this.lines[lineIndex].getViewLineCount(); + + let lineMappingChanged = false; + let changeFrom = 0; + let changeTo = -1; + let insertFrom = 0; + let insertTo = -1; + let deleteFrom = 0; + let deleteTo = -1; + + if (oldOutputLineCount > newOutputLineCount) { + changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); + changeTo = changeFrom + newOutputLineCount - 1; + deleteFrom = changeTo + 1; + deleteTo = deleteFrom + (oldOutputLineCount - newOutputLineCount) - 1; + lineMappingChanged = true; + } else if (oldOutputLineCount < newOutputLineCount) { + changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); + changeTo = changeFrom + oldOutputLineCount - 1; + insertFrom = changeTo + 1; + insertTo = insertFrom + (newOutputLineCount - oldOutputLineCount) - 1; + lineMappingChanged = true; + } else { + changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); + changeTo = changeFrom + newOutputLineCount - 1; + } + + this.prefixSumComputer.changeValue(lineIndex, newOutputLineCount); + + const viewLinesChangedEvent = (changeFrom <= changeTo ? new viewEvents.ViewLinesChangedEvent(changeFrom, changeTo) : null); + const viewLinesInsertedEvent = (insertFrom <= insertTo ? new viewEvents.ViewLinesInsertedEvent(insertFrom, insertTo) : null); + const viewLinesDeletedEvent = (deleteFrom <= deleteTo ? new viewEvents.ViewLinesDeletedEvent(deleteFrom, deleteTo) : null); + + return [lineMappingChanged, viewLinesChangedEvent, viewLinesInsertedEvent, viewLinesDeletedEvent]; + } + + public acceptVersionId(versionId: number): void { + this._validModelVersionId = versionId; + } + + public getViewLineCount(): number { + this._ensureValidState(); + return this.prefixSumComputer.getTotalValue(); + } + + private _toValidViewLineNumber(viewLineNumber: number): number { + if (viewLineNumber < 1) { + return 1; + } + let viewLineCount = this.getViewLineCount(); + if (viewLineNumber > viewLineCount) { + return viewLineCount; + } + return viewLineNumber; + } + + /** + * Gives a hint that a lot of requests are about to come in for these line numbers. + */ + public warmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void { + this.prefixSumComputer.warmUpCache(viewStartLineNumber - 1, viewEndLineNumber - 1); + } + + public getViewLineIndentGuide(viewLineNumber: number): number { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + return this.model.getLineIndentGuide(r.index + 1); + } + + public getViewLineContent(viewLineNumber: number): string { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + return this.lines[lineIndex].getViewLineContent(this.model, lineIndex + 1, remainder); + } + + public getViewLineMinColumn(viewLineNumber: number): number { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + return this.lines[lineIndex].getViewLineMinColumn(this.model, lineIndex + 1, remainder); + } + + public getViewLineMaxColumn(viewLineNumber: number): number { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + return this.lines[lineIndex].getViewLineMaxColumn(this.model, lineIndex + 1, remainder); + } + + public getViewLineData(viewLineNumber: number): ViewLineData { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + return this.lines[lineIndex].getViewLineData(this.model, lineIndex + 1, remainder); + } + + public getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): ViewLineData[] { + this._ensureValidState(); + + viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); + viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); + + let start = this.prefixSumComputer.getIndexOf(viewStartLineNumber - 1); + let viewLineNumber = viewStartLineNumber; + let startModelLineIndex = start.index; + let startRemainder = start.remainder; + + let result: ViewLineData[] = []; + for (let modelLineIndex = startModelLineIndex, len = this.model.getLineCount(); modelLineIndex < len; modelLineIndex++) { + let line = this.lines[modelLineIndex]; + if (!line.isVisible()) { + continue; + } + let fromViewLineIndex = (modelLineIndex === startModelLineIndex ? startRemainder : 0); + let remainingViewLineCount = line.getViewLineCount() - fromViewLineIndex; + + let lastLine = false; + if (viewLineNumber + remainingViewLineCount > viewEndLineNumber) { + lastLine = true; + remainingViewLineCount = viewEndLineNumber - viewLineNumber + 1; + } + let toViewLineIndex = fromViewLineIndex + remainingViewLineCount; + + line.getViewLinesData(this.model, modelLineIndex + 1, fromViewLineIndex, toViewLineIndex, viewLineNumber - viewStartLineNumber, needed, result); + + viewLineNumber += remainingViewLineCount; + + if (lastLine) { + break; + } + } + + return result; + } + + public validateViewPosition(viewLineNumber: number, viewColumn: number, expectedModelPosition: Position): Position { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + let line = this.lines[lineIndex]; + + let minColumn = line.getViewLineMinColumn(this.model, lineIndex + 1, remainder); + let maxColumn = line.getViewLineMaxColumn(this.model, lineIndex + 1, remainder); + if (viewColumn < minColumn) { + viewColumn = minColumn; + } + if (viewColumn > maxColumn) { + viewColumn = maxColumn; + } + + let computedModelColumn = line.getModelColumnOfViewPosition(remainder, viewColumn); + let computedModelPosition = this.model.validatePosition(new Position(lineIndex + 1, computedModelColumn)); + + if (computedModelPosition.equals(expectedModelPosition)) { + return new Position(viewLineNumber, viewColumn); + } + + return this.convertModelPositionToViewPosition(expectedModelPosition.lineNumber, expectedModelPosition.column); + } + + public convertViewPositionToModelPosition(viewLineNumber: number, viewColumn: number): Position { + this._ensureValidState(); + viewLineNumber = this._toValidViewLineNumber(viewLineNumber); + + let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); + let lineIndex = r.index; + let remainder = r.remainder; + + let inputColumn = this.lines[lineIndex].getModelColumnOfViewPosition(remainder, viewColumn); + // console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn); + return this.model.validatePosition(new Position(lineIndex + 1, inputColumn)); + } + + public convertModelPositionToViewPosition(_modelLineNumber: number, _modelColumn: number): Position { + this._ensureValidState(); + + let validPosition = this.model.validatePosition(new Position(_modelLineNumber, _modelColumn)); + let inputLineNumber = validPosition.lineNumber; + let inputColumn = validPosition.column; + + let lineIndex = inputLineNumber - 1, lineIndexChanged = false; + while (lineIndex > 0 && !this.lines[lineIndex].isVisible()) { + lineIndex--; + lineIndexChanged = true; + } + if (lineIndex === 0 && !this.lines[lineIndex].isVisible()) { + // Could not reach a real line + // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + 1 + ',' + 1); + return new Position(1, 1); + } + let deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1)); + + let r: Position; + if (lineIndexChanged) { + r = this.lines[lineIndex].getViewPositionOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1)); + } else { + r = this.lines[inputLineNumber - 1].getViewPositionOfModelPosition(deltaLineNumber, inputColumn); + } + + // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + r.lineNumber + ',' + r); + return r; + } +} + class VisibleIdentitySplitLine implements ISplitLine { public static INSTANCE = new VisibleIdentitySplitLine(); @@ -333,527 +838,3 @@ function createSplitLine(linePositionMapperFactory: ILineMapperFactory, text: st return new SplitLine(positionMapper, isVisible); } } - -export class SplitLinesCollection { - - private model: editorCommon.IModel; - private _validModelVersionId: number; - - private wrappingColumn: number; - private columnsForFullWidthChar: number; - private wrappingIndent: WrappingIndent; - private tabSize: number; - private lines: ISplitLine[]; - - private prefixSumComputer: PrefixSumComputerWithCache; - - private linePositionMapperFactory: ILineMapperFactory; - - private hiddenAreasIds: string[]; - - constructor(model: editorCommon.IModel, linePositionMapperFactory: ILineMapperFactory, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent) { - this.model = model; - this._validModelVersionId = -1; - this.tabSize = tabSize; - this.wrappingColumn = wrappingColumn; - this.columnsForFullWidthChar = columnsForFullWidthChar; - this.wrappingIndent = wrappingIndent; - this.linePositionMapperFactory = linePositionMapperFactory; - - this._constructLines(true); - } - - public dispose(): void { - this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, []); - } - - private _ensureValidState(): void { - let modelVersion = this.model.getVersionId(); - if (modelVersion !== this._validModelVersionId) { - throw new Error('SplitLinesCollection: attempt to access a \'newer\' model'); - } - } - - private _constructLines(resetHiddenAreas: boolean): void { - this.lines = []; - - if (resetHiddenAreas) { - this.hiddenAreasIds = []; - } - - let linesContent = this.model.getLinesContent(); - let lineCount = linesContent.length; - let values = new Uint32Array(lineCount); - - let hiddenAreas = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(Range.compareRangesUsingStarts); - let hiddenAreaStart = 1, hiddenAreaEnd = 0; - let hiddenAreaIdx = -1; - let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; - - for (let i = 0; i < lineCount; i++) { - let lineNumber = i + 1; - - if (lineNumber === nextLineNumberToUpdateHiddenArea) { - hiddenAreaIdx++; - hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; - hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; - nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; - } - - let isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd); - let line = createSplitLine(this.linePositionMapperFactory, linesContent[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); - values[i] = line.getViewLineCount(); - this.lines[i] = line; - } - - this._validModelVersionId = this.model.getVersionId(); - - this.prefixSumComputer = new PrefixSumComputerWithCache(values); - } - - private getHiddenAreas(): Range[] { - return this.hiddenAreasIds.map((decId) => { - return this.model.getDecorationRange(decId); - }).sort(Range.compareRangesUsingStarts); - } - - private _reduceRanges(_ranges: Range[]): Range[] { - if (_ranges.length === 0) { - return []; - } - let ranges = _ranges.map(r => this.model.validateRange(r)).sort(Range.compareRangesUsingStarts); - - let result: Range[] = []; - let currentRangeStart = ranges[0].startLineNumber; - let currentRangeEnd = ranges[0].endLineNumber; - - for (let i = 1, len = ranges.length; i < len; i++) { - let range = ranges[i]; - - if (range.startLineNumber > currentRangeEnd + 1) { - result.push(new Range(currentRangeStart, 1, currentRangeEnd, 1)); - currentRangeStart = range.startLineNumber; - currentRangeEnd = range.endLineNumber; - } else if (range.endLineNumber > currentRangeEnd) { - currentRangeEnd = range.endLineNumber; - } - } - result.push(new Range(currentRangeStart, 1, currentRangeEnd, 1)); - return result; - } - - public setHiddenAreas(eventsCollector: ViewEventsCollector, _ranges: Range[]): boolean { - - let newRanges = this._reduceRanges(_ranges); - - // BEGIN TODO@Martin: Please stop calling this method on each model change! - let oldRanges = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(Range.compareRangesUsingStarts); - - if (newRanges.length === oldRanges.length) { - let hasDifference = false; - for (let i = 0; i < newRanges.length; i++) { - if (!newRanges[i].equalsRange(oldRanges[i])) { - hasDifference = true; - break; - } - } - if (!hasDifference) { - return false; - } - } - // END TODO@Martin: Please stop calling this method on each model change! - - let newDecorations: editorCommon.IModelDeltaDecoration[] = []; - for (let i = 0; i < newRanges.length; i++) { - newDecorations.push({ - range: newRanges[i], - options: { - } - }); - } - - this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, newDecorations); - - let hiddenAreas = newRanges; - let hiddenAreaStart = 1, hiddenAreaEnd = 0; - let hiddenAreaIdx = -1; - let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; - - for (let i = 0; i < this.lines.length; i++) { - let lineNumber = i + 1; - - if (lineNumber === nextLineNumberToUpdateHiddenArea) { - hiddenAreaIdx++; - hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; - hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; - nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; - } - - let lineChanged = false; - if (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd) { - // Line should be hidden - if (this.lines[i].isVisible()) { - this.lines[i] = this.lines[i].setVisible(false); - lineChanged = true; - } - } else { - // Line should be visible - if (!this.lines[i].isVisible()) { - this.lines[i] = this.lines[i].setVisible(true); - lineChanged = true; - } - } - if (lineChanged) { - let newOutputLineCount = this.lines[i].getViewLineCount(); - this.prefixSumComputer.changeValue(i, newOutputLineCount); - } - } - - eventsCollector.emit(new viewEvents.ViewFlushedEvent()); - return true; - } - - public modelPositionIsVisible(modelLineNumber: number, modelColumn: number): boolean { - if (modelLineNumber < 1 || modelLineNumber > this.lines.length) { - // invalid arguments - return false; - } - return this.lines[modelLineNumber - 1].isVisible(); - } - - public setTabSize(eventsCollector: ViewEventsCollector, newTabSize: number): boolean { - if (this.tabSize === newTabSize) { - return false; - } - this.tabSize = newTabSize; - - this._constructLines(false); - eventsCollector.emit(new viewEvents.ViewFlushedEvent()); - - return true; - } - - public setWrappingIndent(eventsCollector: ViewEventsCollector, newWrappingIndent: WrappingIndent): boolean { - if (this.wrappingIndent === newWrappingIndent) { - return false; - } - this.wrappingIndent = newWrappingIndent; - - this._constructLines(false); - eventsCollector.emit(new viewEvents.ViewFlushedEvent()); - - return true; - } - - public setWrappingColumn(eventsCollector: ViewEventsCollector, newWrappingColumn: number, columnsForFullWidthChar: number): boolean { - if (this.wrappingColumn === newWrappingColumn && this.columnsForFullWidthChar === columnsForFullWidthChar) { - return false; - } - this.wrappingColumn = newWrappingColumn; - this.columnsForFullWidthChar = columnsForFullWidthChar; - this._constructLines(false); - eventsCollector.emit(new viewEvents.ViewFlushedEvent()); - - return true; - } - - public onModelFlushed(eventsCollector: ViewEventsCollector): void { - this._constructLines(true); - eventsCollector.emit(new viewEvents.ViewFlushedEvent()); - } - - public onModelLinesDeleted(eventsCollector: ViewEventsCollector, versionId: number, fromLineNumber: number, toLineNumber: number): void { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return; - } - - let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); - let outputToLineNumber = this.prefixSumComputer.getAccumulatedValue(toLineNumber - 1); - - this.lines.splice(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); - this.prefixSumComputer.removeValues(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); - - eventsCollector.emit(new viewEvents.ViewLinesDeletedEvent(outputFromLineNumber, outputToLineNumber)); - } - - public onModelLinesInserted(eventsCollector: ViewEventsCollector, versionId: number, fromLineNumber: number, toLineNumber: number, text: string[]): void { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return; - } - - let hiddenAreas = this.getHiddenAreas(); - let isInHiddenArea = false; - let testPosition = new Position(fromLineNumber, 1); - for (let i = 0; i < hiddenAreas.length; i++) { - if (hiddenAreas[i].containsPosition(testPosition)) { - isInHiddenArea = true; - break; - } - } - - let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); - - let totalOutputLineCount = 0; - let insertLines: ISplitLine[] = []; - let insertPrefixSumValues = new Uint32Array(text.length); - - for (let i = 0, len = text.length; i < len; i++) { - let line = createSplitLine(this.linePositionMapperFactory, text[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); - insertLines.push(line); - - let outputLineCount = line.getViewLineCount(); - totalOutputLineCount += outputLineCount; - insertPrefixSumValues[i] = outputLineCount; - } - - this.lines = this.lines.slice(0, fromLineNumber - 1).concat(insertLines).concat(this.lines.slice(fromLineNumber - 1)); - - this.prefixSumComputer.insertValues(fromLineNumber - 1, insertPrefixSumValues); - - eventsCollector.emit(new viewEvents.ViewLinesInsertedEvent(outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1)); - } - - public onModelLineChanged(eventsCollector: ViewEventsCollector, versionId: number, lineNumber: number, newText: string): boolean { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return false; - } - - let lineIndex = lineNumber - 1; - - let oldOutputLineCount = this.lines[lineIndex].getViewLineCount(); - let isVisible = this.lines[lineIndex].isVisible(); - let line = createSplitLine(this.linePositionMapperFactory, newText, this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, isVisible); - this.lines[lineIndex] = line; - let newOutputLineCount = this.lines[lineIndex].getViewLineCount(); - - let lineMappingChanged = false; - let changeFrom = 0; - let changeTo = -1; - let insertFrom = 0; - let insertTo = -1; - let deleteFrom = 0; - let deleteTo = -1; - - if (oldOutputLineCount > newOutputLineCount) { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + newOutputLineCount - 1; - deleteFrom = changeTo + 1; - deleteTo = deleteFrom + (oldOutputLineCount - newOutputLineCount) - 1; - lineMappingChanged = true; - } else if (oldOutputLineCount < newOutputLineCount) { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + oldOutputLineCount - 1; - insertFrom = changeTo + 1; - insertTo = insertFrom + (newOutputLineCount - oldOutputLineCount) - 1; - lineMappingChanged = true; - } else { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + newOutputLineCount - 1; - } - - this.prefixSumComputer.changeValue(lineIndex, newOutputLineCount); - - if (changeFrom <= changeTo) { - eventsCollector.emit(new viewEvents.ViewLinesChangedEvent(changeFrom, changeTo)); - } - if (insertFrom <= insertTo) { - eventsCollector.emit(new viewEvents.ViewLinesInsertedEvent(insertFrom, insertTo)); - } - if (deleteFrom <= deleteTo) { - eventsCollector.emit(new viewEvents.ViewLinesDeletedEvent(deleteFrom, deleteTo)); - } - - return lineMappingChanged; - } - - public acceptVersionId(versionId: number): void { - this._validModelVersionId = versionId; - } - - public getViewLineCount(): number { - this._ensureValidState(); - return this.prefixSumComputer.getTotalValue(); - } - - private _toValidViewLineNumber(viewLineNumber: number): number { - if (viewLineNumber < 1) { - return 1; - } - let viewLineCount = this.getViewLineCount(); - if (viewLineNumber > viewLineCount) { - return viewLineCount; - } - return viewLineNumber; - } - - /** - * Gives a hint that a lot of requests are about to come in for these line numbers. - */ - public warmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void { - this.prefixSumComputer.warmUpCache(viewStartLineNumber - 1, viewEndLineNumber - 1); - } - - public getViewLineIndentGuide(viewLineNumber: number): number { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - return this.model.getLineIndentGuide(r.index + 1); - } - - public getViewLineContent(viewLineNumber: number): string { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - return this.lines[lineIndex].getViewLineContent(this.model, lineIndex + 1, remainder); - } - - public getViewLineMinColumn(viewLineNumber: number): number { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - return this.lines[lineIndex].getViewLineMinColumn(this.model, lineIndex + 1, remainder); - } - - public getViewLineMaxColumn(viewLineNumber: number): number { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - return this.lines[lineIndex].getViewLineMaxColumn(this.model, lineIndex + 1, remainder); - } - - public getViewLineData(viewLineNumber: number): ViewLineData { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - return this.lines[lineIndex].getViewLineData(this.model, lineIndex + 1, remainder); - } - - public getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): ViewLineData[] { - this._ensureValidState(); - - viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); - viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); - - let start = this.prefixSumComputer.getIndexOf(viewStartLineNumber - 1); - let viewLineNumber = viewStartLineNumber; - let startModelLineIndex = start.index; - let startRemainder = start.remainder; - - let result: ViewLineData[] = []; - for (let modelLineIndex = startModelLineIndex, len = this.model.getLineCount(); modelLineIndex < len; modelLineIndex++) { - let line = this.lines[modelLineIndex]; - if (!line.isVisible()) { - continue; - } - let fromViewLineIndex = (modelLineIndex === startModelLineIndex ? startRemainder : 0); - let remainingViewLineCount = line.getViewLineCount() - fromViewLineIndex; - - let lastLine = false; - if (viewLineNumber + remainingViewLineCount > viewEndLineNumber) { - lastLine = true; - remainingViewLineCount = viewEndLineNumber - viewLineNumber + 1; - } - let toViewLineIndex = fromViewLineIndex + remainingViewLineCount; - - line.getViewLinesData(this.model, modelLineIndex + 1, fromViewLineIndex, toViewLineIndex, viewLineNumber - viewStartLineNumber, needed, result); - - viewLineNumber += remainingViewLineCount; - - if (lastLine) { - break; - } - } - - return result; - } - - public validateViewPosition(viewLineNumber: number, viewColumn: number, expectedModelPosition: Position): Position { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - let line = this.lines[lineIndex]; - - let minColumn = line.getViewLineMinColumn(this.model, lineIndex + 1, remainder); - let maxColumn = line.getViewLineMaxColumn(this.model, lineIndex + 1, remainder); - if (viewColumn < minColumn) { - viewColumn = minColumn; - } - if (viewColumn > maxColumn) { - viewColumn = maxColumn; - } - - let computedModelColumn = line.getModelColumnOfViewPosition(remainder, viewColumn); - let computedModelPosition = this.model.validatePosition(new Position(lineIndex + 1, computedModelColumn)); - - if (computedModelPosition.equals(expectedModelPosition)) { - return new Position(viewLineNumber, viewColumn); - } - - return this.convertModelPositionToViewPosition(expectedModelPosition.lineNumber, expectedModelPosition.column); - } - - public convertViewPositionToModelPosition(viewLineNumber: number, viewColumn: number): Position { - this._ensureValidState(); - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - - let inputColumn = this.lines[lineIndex].getModelColumnOfViewPosition(remainder, viewColumn); - // console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn); - return this.model.validatePosition(new Position(lineIndex + 1, inputColumn)); - } - - public convertModelPositionToViewPosition(_modelLineNumber: number, _modelColumn: number): Position { - this._ensureValidState(); - - let validPosition = this.model.validatePosition(new Position(_modelLineNumber, _modelColumn)); - let inputLineNumber = validPosition.lineNumber; - let inputColumn = validPosition.column; - - let lineIndex = inputLineNumber - 1, lineIndexChanged = false; - while (lineIndex > 0 && !this.lines[lineIndex].isVisible()) { - lineIndex--; - lineIndexChanged = true; - } - if (lineIndex === 0 && !this.lines[lineIndex].isVisible()) { - // Could not reach a real line - // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + 1 + ',' + 1); - return new Position(1, 1); - } - let deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1)); - - let r: Position; - if (lineIndexChanged) { - r = this.lines[lineIndex].getViewPositionOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1)); - } else { - r = this.lines[inputLineNumber - 1].getViewPositionOfModelPosition(deltaLineNumber, inputColumn); - } - - // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + r.lineNumber + ',' + r); - return r; - } -} diff --git a/src/vs/editor/common/viewModel/viewEventHandler.ts b/src/vs/editor/common/viewModel/viewEventHandler.ts index ff0ec8c10d9..a3e03e9005d 100644 --- a/src/vs/editor/common/viewModel/viewEventHandler.ts +++ b/src/vs/editor/common/viewModel/viewEventHandler.ts @@ -37,10 +37,7 @@ export class ViewEventHandler extends Disposable { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { return false; } - public onCursorPositionChanged(e: viewEvents.ViewCursorPositionChangedEvent): boolean { - return false; - } - public onCursorSelectionChanged(e: viewEvents.ViewCursorSelectionChangedEvent): boolean { + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { return false; } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { @@ -70,9 +67,6 @@ export class ViewEventHandler extends Disposable { public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return false; } - public onScrollRequest(e: viewEvents.ViewScrollRequestEvent): boolean { // TODO@cursor - return false; - } public onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean { return false; } @@ -82,6 +76,9 @@ export class ViewEventHandler extends Disposable { public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean { return false; } + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + return false; + } // --- end event handlers @@ -100,14 +97,8 @@ export class ViewEventHandler extends Disposable { } break; - case viewEvents.ViewEventType.ViewCursorPositionChanged: - if (this.onCursorPositionChanged(e)) { - shouldRender = true; - } - break; - - case viewEvents.ViewEventType.ViewCursorSelectionChanged: - if (this.onCursorSelectionChanged(e)) { + case viewEvents.ViewEventType.ViewCursorStateChanged: + if (this.onCursorStateChanged(e)) { shouldRender = true; } break; @@ -166,12 +157,6 @@ export class ViewEventHandler extends Disposable { } break; - case viewEvents.ViewEventType.ViewScrollRequest: - if (this.onScrollRequest(e)) { - shouldRender = true; - } - break; - case viewEvents.ViewEventType.ViewTokensChanged: if (this.onTokensChanged(e)) { shouldRender = true; @@ -190,6 +175,13 @@ export class ViewEventHandler extends Disposable { } break; + + case viewEvents.ViewEventType.ViewThemeChanged: + if (this.onThemeChanged(e)) { + shouldRender = true; + } + break; + default: console.info('View received unknown event: '); console.info(e); diff --git a/src/vs/editor/common/viewModel/viewModel.ts b/src/vs/editor/common/viewModel/viewModel.ts index b9ccbc9982e..6372d3a1415 100644 --- a/src/vs/editor/common/viewModel/viewModel.ts +++ b/src/vs/editor/common/viewModel/viewModel.ts @@ -4,13 +4,16 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { INewScrollPosition, IModelDecoration, EndOfLinePreference } from 'vs/editor/common/editorCommon'; +import { INewScrollPosition, IModelDecoration, EndOfLinePreference, IViewState } from 'vs/editor/common/editorCommon'; import { ViewLineToken } from 'vs/editor/common/core/viewLineToken'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { ViewEvent } from 'vs/editor/common/view/viewEvents'; +import { ViewEvent, IViewEventListener } from 'vs/editor/common/view/viewEvents'; import { IDisposable } from 'vs/base/common/lifecycle'; +import { Scrollable } from 'vs/base/common/scrollable'; +import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; +import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; export interface IViewWhitespaceViewportData { readonly id: number; @@ -37,6 +40,8 @@ export class Viewport { export interface IViewLayout { + readonly scrollable: Scrollable; + onMaxLineWidthChanged(width: number): void; getScrollLeft(): number; @@ -44,9 +49,20 @@ export interface IViewLayout { getScrollHeight(): number; getScrollTop(): number; getCurrentViewport(): Viewport; - getVerticalOffsetForLineNumber(lineNumber: number): number; setScrollPosition(position: INewScrollPosition): void; + getLinesViewportData(): IPartialViewLinesViewportData; + getLinesViewportDataAtScrollTop(scrollTop: number): IPartialViewLinesViewportData; + getWhitespaces(): IEditorWhitespace[]; + + saveState(): IViewState; + restoreState(state: IViewState): void; + + isAfterLines(verticalOffset: number): boolean; + getLineNumberAtVerticalOffset(verticalOffset: number): number; + getVerticalOffsetForLineNumber(lineNumber: number): number; + getWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData; + // --------------- Begin vertical whitespace management /** @@ -67,6 +83,9 @@ export interface IViewLayout { */ getWhitespaceViewportData(): IViewWhitespaceViewportData[]; + // TODO@Alex whitespace management should work via a change accessor sort of thing + onHeightMaybeChanged(): void; + // --------------- End vertical whitespace management } @@ -85,16 +104,14 @@ export interface ICoordinatesConverter { modelPositionIsVisible(modelPosition: Position): boolean; } -export interface IViewModelListener { - (events: ViewEvent[]): void; -} - export interface IViewModel { - addEventListener(listener: IViewModelListener): IDisposable; + addEventListener(listener: IViewEventListener): IDisposable; readonly coordinatesConverter: ICoordinatesConverter; + readonly viewLayout: IViewLayout; + /** * Gives a hint that a lot of requests are about to come in for these line numbers. */ @@ -103,6 +120,8 @@ export interface IViewModel { getDecorationsInViewport(visibleRange: Range): ViewModelDecoration[]; getViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData; getMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData; + getCompletelyVisibleViewRange(): Range; + getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range; getTabSize(): number; getLineCount(): number; @@ -110,17 +129,16 @@ export interface IViewModel { getLineIndentGuide(lineNumber: number): number; getLineMinColumn(lineNumber: number): number; getLineMaxColumn(lineNumber: number): number; - getLineRenderLineNumber(lineNumber: number): string; + getLineFirstNonWhitespaceColumn(lineNumber: number): number; + getLineLastNonWhitespaceColumn(lineNumber: number): number; getAllOverviewRulerDecorations(): ViewModelDecoration[]; - getEOL(): string; getValueInRange(range: Range, eol: EndOfLinePreference): string; - getModelLineContent(modelLineNumber: number): string; getModelLineMaxColumn(modelLineNumber: number): number; validateModelPosition(modelPosition: IPosition): Position; - getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string; - getHTMLToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string; + getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean): string; + getHTMLToCopy(ranges: Range[], emptySelectionClipboard: boolean): string; } export class MinimapLinesRenderingData { diff --git a/src/vs/editor/common/viewModel/viewModelCursors.ts b/src/vs/editor/common/viewModel/viewModelCursors.ts deleted file mode 100644 index fbfae793c15..00000000000 --- a/src/vs/editor/common/viewModel/viewModelCursors.ts +++ /dev/null @@ -1,117 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 editorCommon from 'vs/editor/common/editorCommon'; -import { Position } from 'vs/editor/common/core/position'; -import { ICoordinatesConverter, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; -import { Selection } from 'vs/editor/common/core/selection'; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { ICursorRevealRangeEvent, CursorScrollRequest } from 'vs/editor/common/controller/cursorEvents'; - -export interface ICursorPositionChangedEvent { - readonly position: Position; - readonly viewPosition: Position; - readonly secondaryPositions: Position[]; - readonly secondaryViewPositions: Position[]; - readonly isInEditableRange: boolean; -} - -export interface ICursorSelectionChangedEvent { - readonly selection: Selection; - readonly viewSelection: Selection; - readonly secondarySelections: Selection[]; - readonly secondaryViewSelections: Selection[]; -} - -export class ViewModelCursors { - - private readonly configuration: editorCommon.IConfiguration; - private readonly coordinatesConverter: ICoordinatesConverter; - - private lastCursorPositionChangedEvent: ICursorPositionChangedEvent; - private lastCursorSelectionChangedEvent: ICursorSelectionChangedEvent; - - constructor(configuration: editorCommon.IConfiguration, coordinatesConverter: ICoordinatesConverter) { - this.configuration = configuration; - this.coordinatesConverter = coordinatesConverter; - this.lastCursorPositionChangedEvent = null; - this.lastCursorSelectionChangedEvent = null; - } - - /** - * Limit position to be somewhere where it can actually be rendered - */ - private static _toPositionThatCanBeRendered(position: Position, stopRenderingLineAfter: number) { - // Limit position to be somewhere where it can actually be rendered - if (stopRenderingLineAfter !== -1 && position.column > stopRenderingLineAfter) { - position = new Position(position.lineNumber, stopRenderingLineAfter); - } - return position; - } - - public onCursorPositionChanged(eventsCollector: ViewEventsCollector, e: ICursorPositionChangedEvent): void { - this.lastCursorPositionChangedEvent = e; - - const stopRenderingLineAfter = this.configuration.editor.viewInfo.stopRenderingLineAfter; - - let position = ViewModelCursors._toPositionThatCanBeRendered(e.viewPosition, stopRenderingLineAfter); - let secondaryPositions: Position[] = []; - for (let i = 0, len = e.secondaryPositions.length; i < len; i++) { - secondaryPositions[i] = ViewModelCursors._toPositionThatCanBeRendered(e.secondaryViewPositions[i], stopRenderingLineAfter); - } - - eventsCollector.emit(new viewEvents.ViewCursorPositionChangedEvent(position, secondaryPositions, e.isInEditableRange)); - } - - public onCursorSelectionChanged(eventsCollector: ViewEventsCollector, e: ICursorSelectionChangedEvent): void { - this.lastCursorSelectionChangedEvent = e; - - eventsCollector.emit(new viewEvents.ViewCursorSelectionChangedEvent(e.viewSelection, e.secondaryViewSelections)); - } - - public onCursorRevealRange(eventsCollector: ViewEventsCollector, e: ICursorRevealRangeEvent): void { - // Ensure event has viewRange - const viewRange = ( - e.viewRange - ? e.viewRange - : this.coordinatesConverter.convertModelRangeToViewRange(e.range) - ); - eventsCollector.emit(new viewEvents.ViewRevealRangeRequestEvent( - viewRange, - e.verticalType, - e.revealHorizontal - )); - } - - public onLineMappingChanged(eventsCollector: ViewEventsCollector): void { - if (this.lastCursorPositionChangedEvent) { - const toViewPos = (pos: Position) => this.coordinatesConverter.convertModelPositionToViewPosition(pos); - let e: ICursorPositionChangedEvent = { - position: this.lastCursorPositionChangedEvent.position, - viewPosition: toViewPos(this.lastCursorPositionChangedEvent.position), - secondaryPositions: this.lastCursorPositionChangedEvent.secondaryPositions, - secondaryViewPositions: this.lastCursorPositionChangedEvent.secondaryPositions.map(toViewPos), - isInEditableRange: this.lastCursorPositionChangedEvent.isInEditableRange, - }; - this.onCursorPositionChanged(eventsCollector, e); - } - - if (this.lastCursorSelectionChangedEvent) { - const toViewSel = (sel: Selection) => this.coordinatesConverter.convertModelSelectionToViewSelection(sel); - let e: ICursorSelectionChangedEvent = { - selection: this.lastCursorSelectionChangedEvent.selection, - viewSelection: toViewSel(this.lastCursorSelectionChangedEvent.selection), - secondarySelections: this.lastCursorSelectionChangedEvent.secondarySelections, - secondaryViewSelections: this.lastCursorSelectionChangedEvent.secondarySelections.map(toViewSel), - }; - this.onCursorSelectionChanged(eventsCollector, e); - } - } - - public onCursorScrollRequest(eventsCollector: ViewEventsCollector, e: CursorScrollRequest): void { - eventsCollector.emit(new viewEvents.ViewScrollRequestEvent(e.desiredScrollTop)); - } -} diff --git a/src/vs/editor/common/viewModel/viewModelDecorations.ts b/src/vs/editor/common/viewModel/viewModelDecorations.ts index d129ee76612..2a04c160d94 100644 --- a/src/vs/editor/common/viewModel/viewModelDecorations.ts +++ b/src/vs/editor/common/viewModel/viewModelDecorations.ts @@ -8,8 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { InlineDecoration, ViewModelDecoration, ICoordinatesConverter, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import { InlineDecoration, ViewModelDecoration, ICoordinatesConverter } from 'vs/editor/common/viewModel/viewModel'; import { IModelDecorationsChangedEvent } from 'vs/editor/common/model/textModelEvents'; export interface IDecorationsViewportData { @@ -41,7 +40,6 @@ export class ViewModelDecorations implements IDisposable { this.configuration = configuration; this._coordinatesConverter = coordinatesConverter; this._decorationsCache = Object.create(null); - this._clearCachedModelDecorationsResolver(); } @@ -60,7 +58,7 @@ export class ViewModelDecorations implements IDisposable { this._clearCachedModelDecorationsResolver(); } - public onModelDecorationsChanged(eventsCollector: ViewEventsCollector, e: IModelDecorationsChangedEvent): void { + public onModelDecorationsChanged(e: IModelDecorationsChangedEvent): void { let changedDecorations = e.changedDecorations; for (let i = 0, len = changedDecorations.length; i < len; i++) { let changedDecoration = changedDecorations[i]; @@ -75,18 +73,18 @@ export class ViewModelDecorations implements IDisposable { let removedDecorations = e.removedDecorations; for (let i = 0, len = removedDecorations.length; i < len; i++) { let removedDecoration = removedDecorations[i]; - delete this._decorationsCache[removedDecoration]; + if (removedDecoration !== null && removedDecoration !== undefined) { + delete this._decorationsCache[removedDecoration]; + } } this._clearCachedModelDecorationsResolver(); - eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); } - public onLineMappingChanged(eventsCollector: ViewEventsCollector): void { + public onLineMappingChanged(): void { this._decorationsCache = Object.create(null); this._clearCachedModelDecorationsResolver(); - eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); } private _getOrCreateViewModelDecoration(modelDecoration: editorCommon.IModelDecoration): ViewModelDecoration { diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index f9f313c6f39..a7a7297e881 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -5,7 +5,6 @@ 'use strict'; import { EmitterEvent } from 'vs/base/common/eventEmitter'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import * as strings from 'vs/base/common/strings'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; @@ -13,19 +12,15 @@ import { Selection } from 'vs/editor/common/core/selection'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { TokenizationRegistry, ColorId, LanguageId } from 'vs/editor/common/modes'; import { tokenizeLineToHTML } from 'vs/editor/common/modes/textToHtmlTokenizer'; -import { ViewModelCursors } from 'vs/editor/common/viewModel/viewModelCursors'; import { ViewModelDecorations } from 'vs/editor/common/viewModel/viewModelDecorations'; -import { MinimapLinesRenderingData, ViewLineRenderingData, ViewModelDecoration, IViewModelListener, IViewModel, ICoordinatesConverter, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; +import { MinimapLinesRenderingData, ViewLineRenderingData, ViewModelDecoration, IViewModel, ICoordinatesConverter, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; import { SplitLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import * as errors from 'vs/base/common/errors'; import { MinimapTokensColorTracker } from 'vs/editor/common/view/minimapCharRenderer'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; -import { WrappingIndent, IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { CursorEventType, ICursorPositionChangedEvent, VerticalRevealType, ICursorSelectionChangedEvent, ICursorRevealRangeEvent, CursorScrollRequest } from 'vs/editor/common/controller/cursorEvents'; -import { Cursor } from 'vs/editor/common/controller/cursor'; - -const ConfigurationChanged = 'configurationChanged'; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper'; +import { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout'; export class CoordinatesConverter implements ICoordinatesConverter { @@ -87,212 +82,148 @@ export class CoordinatesConverter implements ICoordinatesConverter { } -export class ViewModel extends Disposable implements IViewModel { +export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel { - private readonly lines: SplitLinesCollection; private readonly editorId: number; private readonly configuration: editorCommon.IConfiguration; private readonly model: editorCommon.IModel; + private readonly lines: SplitLinesCollection; public readonly coordinatesConverter: ICoordinatesConverter; + public readonly viewLayout: ViewLayout; private readonly decorations: ViewModelDecorations; - private readonly cursors: ViewModelCursors; - - private _renderCustomLineNumbers: (lineNumber: number) => string; - private _renderRelativeLineNumbers: boolean; - private _lastCursorPosition: Position; + private _isDisposing: boolean; private _centeredViewLine: number; - private _listeners: IViewModelListener[]; - - constructor(lines: SplitLinesCollection, editorId: number, configuration: editorCommon.IConfiguration, model: editorCommon.IModel) { + constructor(editorId: number, configuration: editorCommon.IConfiguration, model: editorCommon.IModel) { super(); - this.lines = lines; this.editorId = editorId; this.configuration = configuration; this.model = model; + + const conf = this.configuration.editor; + + let hardWrappingLineMapperFactory = new CharacterHardWrappingLineMapperFactory( + conf.wrappingInfo.wordWrapBreakBeforeCharacters, + conf.wrappingInfo.wordWrapBreakAfterCharacters, + conf.wrappingInfo.wordWrapBreakObtrusiveCharacters + ); + + this.lines = new SplitLinesCollection( + this.model, + hardWrappingLineMapperFactory, + this.model.getOptions().tabSize, + conf.wrappingInfo.wrappingColumn, + conf.fontInfo.typicalFullwidthCharacterWidth / conf.fontInfo.typicalHalfwidthCharacterWidth, + conf.wrappingInfo.wrappingIndent + ); + this.configuration.setMaxLineNumber(this.model.getLineCount()); this.coordinatesConverter = new CoordinatesConverter(this.lines); - this._lastCursorPosition = new Position(1, 1); - this._renderCustomLineNumbers = this.configuration.editor.viewInfo.renderCustomLineNumbers; - this._renderRelativeLineNumbers = this.configuration.editor.viewInfo.renderRelativeLineNumbers; + this.viewLayout = this._register(new ViewLayout(this.configuration, this.getLineCount())); + this._register(this.viewLayout.onDidScroll((e) => { + this._emit([new viewEvents.ViewScrollChangedEvent(e)]); + })); + + this._isDisposing = false; this._centeredViewLine = -1; this.decorations = new ViewModelDecorations(this.editorId, this.model, this.configuration, this.coordinatesConverter); - this.decorations.reset(); - this.cursors = new ViewModelCursors(this.configuration, this.coordinatesConverter); - - this._register(this.model.addBulkListener((events: EmitterEvent[]) => this.onEvents(events))); - this._register(this.configuration.onDidChange((e) => { - this.onEvents([new EmitterEvent(ConfigurationChanged, e)]); + this._register(this.model.addBulkListener((events: EmitterEvent[]) => { + if (this._isDisposing) { + // Disposing the lines might end up sending model decoration changed events + // ...we no longer care about them... + return; + } + let eventsCollector = new ViewEventsCollector(); + this._onModelEvents(eventsCollector, events); + this._emit(eventsCollector.finalize()); })); + + this._register(this.configuration.onDidChange((e) => { + const eventsCollector = new ViewEventsCollector(); + this._onConfigurationChanged(eventsCollector, e); + this._emit(eventsCollector.finalize()); + })); + this._register(MinimapTokensColorTracker.getInstance().onDidChange(() => { this._emit([new viewEvents.ViewTokensColorsChangedEvent()]); })); - - this._listeners = []; - } - - public setHiddenAreas(ranges: Range[]): void { - let eventsCollector = new ViewEventsCollector(); - this._setHiddenAreas(eventsCollector, ranges); - this._emit(eventsCollector.finalize()); - } - - private _setHiddenAreas(eventsCollector: ViewEventsCollector, ranges: Range[]): void { - let lineMappingChanged = this.lines.setHiddenAreas(eventsCollector, ranges); - if (lineMappingChanged) { - eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); - this.decorations.onLineMappingChanged(eventsCollector); - this.cursors.onLineMappingChanged(eventsCollector); - } } public dispose(): void { + this._isDisposing = true; this.decorations.dispose(); this.lines.dispose(); - this._listeners = []; super.dispose(); } - public addEventListener(listener: (events: viewEvents.ViewEvent[]) => void): IDisposable { - this._listeners.push(listener); - return { - dispose: () => { - let listeners = this._listeners; - for (let i = 0, len = listeners.length; i < len; i++) { - if (listeners[i] === listener) { - listeners.splice(i, 1); - break; - } - } + private _onConfigurationChanged(eventsCollector: ViewEventsCollector, e: IConfigurationChangedEvent): void { + + // We might need to restore the current centered view range, so save it (if available) + const previousCenteredModelRange = this.getCenteredRangeInViewport(); + let revealPreviousCenteredModelRange = false; + + const conf = this.configuration.editor; + + if (this.lines.setWrappingSettings(conf.wrappingInfo.wrappingIndent, conf.wrappingInfo.wrappingColumn, conf.fontInfo.typicalFullwidthCharacterWidth / conf.fontInfo.typicalHalfwidthCharacterWidth)) { + eventsCollector.emit(new viewEvents.ViewFlushedEvent()); + eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); + this.decorations.onLineMappingChanged(); + this.viewLayout.onFlushed(this.getLineCount()); + + if (this.viewLayout.getScrollTop() !== 0) { + // Never change the scroll position from 0 to something else... + revealPreviousCenteredModelRange = true; } - }; - } + } - private _emit(events: viewEvents.ViewEvent[]): void { - let listeners = this._listeners.slice(0); - for (let i = 0, len = listeners.length; i < len; i++) { - safeInvokeListener(listeners[i], events); + if (e.readOnly) { + // Must read again all decorations due to readOnly filtering + this.decorations.reset(); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); + } + + eventsCollector.emit(new viewEvents.ViewConfigurationChangedEvent(e)); + this.viewLayout.onConfigurationChanged(e); + + if (revealPreviousCenteredModelRange && previousCenteredModelRange) { + // modelLine -> viewLine + const newCenteredViewRange = this.coordinatesConverter.convertModelRangeToViewRange(previousCenteredModelRange); + + // Send a reveal event to restore the centered content + eventsCollector.emit(new viewEvents.ViewRevealRangeRequestEvent( + newCenteredViewRange, + viewEvents.VerticalRevealType.Center, + false + )); } } - private _onTabSizeChange(eventsCollector: ViewEventsCollector, newTabSize: number): boolean { - var lineMappingChanged = this.lines.setTabSize(eventsCollector, newTabSize); - if (lineMappingChanged) { - eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); - this.decorations.onLineMappingChanged(eventsCollector); - this.cursors.onLineMappingChanged(eventsCollector); - } - return lineMappingChanged; - } + private _onModelEvents(eventsCollector: ViewEventsCollector, events: EmitterEvent[]): void { - private _onWrappingIndentChange(eventsCollector: ViewEventsCollector, newWrappingIndent: WrappingIndent): boolean { - var lineMappingChanged = this.lines.setWrappingIndent(eventsCollector, newWrappingIndent); - if (lineMappingChanged) { - eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); - this.decorations.onLineMappingChanged(eventsCollector); - this.cursors.onLineMappingChanged(eventsCollector); - } - return lineMappingChanged; - } - - private _restoreCenteredModelRange(eventsCollector: ViewEventsCollector, range: Range): void { - // modelLine -> viewLine - var newCenteredViewRange = this.coordinatesConverter.convertModelRangeToViewRange(range); - - // Send a reveal event to restore the centered content - eventsCollector.emit(new viewEvents.ViewRevealRangeRequestEvent( - newCenteredViewRange, - VerticalRevealType.Center, - false - )); - } - - private _onWrappingColumnChange(eventsCollector: ViewEventsCollector, newWrappingColumn: number, columnsForFullWidthChar: number): boolean { - let lineMappingChanged = this.lines.setWrappingColumn(eventsCollector, newWrappingColumn, columnsForFullWidthChar); - if (lineMappingChanged) { - eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); - this.decorations.onLineMappingChanged(eventsCollector); - this.cursors.onLineMappingChanged(eventsCollector); - } - return lineMappingChanged; - } - - public addEventSource(eventSource: Cursor): void { - this._register(eventSource.addBulkListener((events: EmitterEvent[]) => this.onEvents(events))); - } - - private onEvents(events: EmitterEvent[]): void { - let eventsCollector = new ViewEventsCollector(); - this._onEvents(eventsCollector, events); - this._emit(eventsCollector.finalize()); - } - - private static _containsModelContentChangeEvent(events: EmitterEvent[]): boolean { + // A quick check if there are model content change events incoming + // in order to update the configuration and reset the centered view line for (let i = 0, len = events.length; i < len; i++) { - let eventType = events[i].type; + const eventType = events[i].type; if (eventType === textModelEvents.TextModelEventType.ModelRawContentChanged2) { - return true; + // There is a content change event + this._centeredViewLine = -1; + this.configuration.setMaxLineNumber(this.model.getLineCount()); + + break; } } - return false; - } - - private static _containsWrappingRelatedEvents(events: EmitterEvent[]): boolean { - for (let i = 0, len = events.length; i < len; i++) { - let eventType = events[i].type; - if (eventType === textModelEvents.TextModelEventType.ModelOptionsChanged) { - return true; - } - if (eventType === ConfigurationChanged) { - return true; - } - } - return false; - } - - public getCenteredRangeInViewport(): Range { - if (this._centeredViewLine === -1) { - // Never got rendered or not rendered since last content change event - return null; - } - let viewLineNumber = this._centeredViewLine; - let currentCenteredViewRange = new Range(viewLineNumber, this.getLineMinColumn(viewLineNumber), viewLineNumber, this.getLineMaxColumn(viewLineNumber)); - return this.coordinatesConverter.convertViewRangeToModelRange(currentCenteredViewRange); - } - - private _onEvents(eventsCollector: ViewEventsCollector, events: EmitterEvent[]): void { - - const containsModelContentChangeEvent = ViewModel._containsModelContentChangeEvent(events); - if (containsModelContentChangeEvent) { - this._centeredViewLine = -1; - this.configuration.setMaxLineNumber(this.model.getLineCount()); - } - - // We might need to restore the current centered view range in the following circumstances: - // All of these changes might lead to a new line mapping: - // (a) model tabSize changed - // (b) wrappingIndent changed - // (c) wrappingColumn changed - // (d) fontInfo changed - // However, we cannot restore the current centered line if the model has changed its content - // because we cannot convert the view range to a model range. - - let previousCenteredModelRange: Range = null; - if (!containsModelContentChangeEvent && ViewModel._containsWrappingRelatedEvents(events)) { - previousCenteredModelRange = this.getCenteredRangeInViewport(); - } let hadOtherModelChange = false; let hadModelLineChangeThatChangedLineMapping = false; - let revealPreviousCenteredModelRange = false; for (let i = 0, len = events.length; i < len; i++) { const _e = events[i]; @@ -310,25 +241,52 @@ export class ViewModel extends Disposable implements IViewModel { const change = changes[j]; switch (change.changeType) { - case textModelEvents.RawContentChangedType.Flush: - this.lines.onModelFlushed(eventsCollector); + case textModelEvents.RawContentChangedType.Flush: { + this.lines.onModelFlushed(); + eventsCollector.emit(new viewEvents.ViewFlushedEvent()); this.decorations.reset(); + this.viewLayout.onFlushed(this.getLineCount()); hadOtherModelChange = true; break; - - case textModelEvents.RawContentChangedType.LinesDeleted: - this.lines.onModelLinesDeleted(eventsCollector, versionId, change.fromLineNumber, change.toLineNumber); + } + case textModelEvents.RawContentChangedType.LinesDeleted: { + const linesDeletedEvent = this.lines.onModelLinesDeleted(versionId, change.fromLineNumber, change.toLineNumber); + if (linesDeletedEvent !== null) { + eventsCollector.emit(linesDeletedEvent); + this.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber); + } hadOtherModelChange = true; break; - - case textModelEvents.RawContentChangedType.LinesInserted: - this.lines.onModelLinesInserted(eventsCollector, versionId, change.fromLineNumber, change.toLineNumber, change.detail.split('\n')); + } + case textModelEvents.RawContentChangedType.LinesInserted: { + const linesInsertedEvent = this.lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, change.detail.split('\n')); + if (linesInsertedEvent !== null) { + eventsCollector.emit(linesInsertedEvent); + this.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber); + } hadOtherModelChange = true; break; - - case textModelEvents.RawContentChangedType.LineChanged: - hadModelLineChangeThatChangedLineMapping = this.lines.onModelLineChanged(eventsCollector, versionId, change.lineNumber, change.detail); + } + case textModelEvents.RawContentChangedType.LineChanged: { + const [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] = this.lines.onModelLineChanged(versionId, change.lineNumber, change.detail); + hadModelLineChangeThatChangedLineMapping = lineMappingChanged; + if (linesChangedEvent) { + eventsCollector.emit(linesChangedEvent); + } + if (linesInsertedEvent) { + eventsCollector.emit(linesInsertedEvent); + this.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber); + } + if (linesDeletedEvent) { + eventsCollector.emit(linesDeletedEvent); + this.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber); + } break; + } + case textModelEvents.RawContentChangedType.EOLChanged: { + // Nothing to do. The new version will be accepted below + break; + } } } this.lines.acceptVersionId(versionId); @@ -361,61 +319,26 @@ export class ViewModel extends Disposable implements IViewModel { } case textModelEvents.TextModelEventType.ModelOptionsChanged: { // A tab size change causes a line mapping changed event => all view parts will repaint OK, no further event needed here - let prevLineCount = this.lines.getViewLineCount(); - let tabSizeChanged = this._onTabSizeChange(eventsCollector, this.model.getOptions().tabSize); - let newLineCount = this.lines.getViewLineCount(); - if (tabSizeChanged && prevLineCount !== newLineCount) { - revealPreviousCenteredModelRange = true; + if (this.lines.setTabSize(this.model.getOptions().tabSize)) { + eventsCollector.emit(new viewEvents.ViewFlushedEvent()); + eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); + this.decorations.onLineMappingChanged(); + this.viewLayout.onFlushed(this.getLineCount()); } break; } case textModelEvents.TextModelEventType.ModelDecorationsChanged: { const e = data; - this.decorations.onModelDecorationsChanged(eventsCollector, e); + this.decorations.onModelDecorationsChanged(e); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); break; } case textModelEvents.TextModelEventType.ModelDispose: { // Ignore, since the editor will take care of this and destroy the view shortly break; } - case CursorEventType.CursorPositionChanged: { - const e = data; - this.cursors.onCursorPositionChanged(eventsCollector, e); - this._lastCursorPosition = e.position; - break; - } - case CursorEventType.CursorSelectionChanged: { - const e = data; - this.cursors.onCursorSelectionChanged(eventsCollector, e); - break; - } - case CursorEventType.CursorRevealRange: { - const e = data; - this.cursors.onCursorRevealRange(eventsCollector, e); - break; - } - case CursorEventType.CursorScrollRequest: { - const e = data; - this.cursors.onCursorScrollRequest(eventsCollector, e); - break; - } - case ConfigurationChanged: { - const e = data; - revealPreviousCenteredModelRange = this._onWrappingIndentChange(eventsCollector, this.configuration.editor.wrappingInfo.wrappingIndent) || revealPreviousCenteredModelRange; - revealPreviousCenteredModelRange = this._onWrappingColumnChange(eventsCollector, this.configuration.editor.wrappingInfo.wrappingColumn, this.configuration.editor.fontInfo.typicalFullwidthCharacterWidth / this.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth) || revealPreviousCenteredModelRange; - - this._renderCustomLineNumbers = this.configuration.editor.viewInfo.renderCustomLineNumbers; - this._renderRelativeLineNumbers = this.configuration.editor.viewInfo.renderRelativeLineNumbers; - - if (e.readOnly) { - // Must read again all decorations due to readOnly filtering - this.decorations.reset(); - eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); - } - eventsCollector.emit(new viewEvents.ViewConfigurationChangedEvent(e)); - break; - } default: console.info('View received unknown event: '); console.info(type, data); @@ -424,13 +347,54 @@ export class ViewModel extends Disposable implements IViewModel { if (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) { eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); - this.decorations.onLineMappingChanged(eventsCollector); - this.cursors.onLineMappingChanged(eventsCollector); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); + this.decorations.onLineMappingChanged(); } + } - if (revealPreviousCenteredModelRange && previousCenteredModelRange) { - this._restoreCenteredModelRange(eventsCollector, previousCenteredModelRange); + public setHiddenAreas(ranges: Range[]): void { + let eventsCollector = new ViewEventsCollector(); + let lineMappingChanged = this.lines.setHiddenAreas(ranges); + if (lineMappingChanged) { + eventsCollector.emit(new viewEvents.ViewFlushedEvent()); + eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); + eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); + this.decorations.onLineMappingChanged(); + this.viewLayout.onFlushed(this.getLineCount()); } + this._emit(eventsCollector.finalize()); + } + + public getCenteredRangeInViewport(): Range { + if (this._centeredViewLine === -1) { + // Never got rendered or not rendered since last content change event + return null; + } + let viewLineNumber = this._centeredViewLine; + let currentCenteredViewRange = new Range(viewLineNumber, this.getLineMinColumn(viewLineNumber), viewLineNumber, this.getLineMaxColumn(viewLineNumber)); + return this.coordinatesConverter.convertViewRangeToModelRange(currentCenteredViewRange); + } + + public getCompletelyVisibleViewRange(): Range { + const partialData = this.viewLayout.getLinesViewportData(); + const startViewLineNumber = partialData.completelyVisibleStartLineNumber; + const endViewLineNumber = partialData.completelyVisibleEndLineNumber; + + return new Range( + startViewLineNumber, this.getLineMinColumn(startViewLineNumber), + endViewLineNumber, this.getLineMaxColumn(endViewLineNumber) + ); + } + + public getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range { + const partialData = this.viewLayout.getLinesViewportDataAtScrollTop(scrollTop); + const startViewLineNumber = partialData.completelyVisibleStartLineNumber; + const endViewLineNumber = partialData.completelyVisibleEndLineNumber; + + return new Range( + startViewLineNumber, this.getLineMinColumn(startViewLineNumber), + endViewLineNumber, this.getLineMaxColumn(endViewLineNumber) + ); } public getTabSize(): number { @@ -481,28 +445,6 @@ export class ViewModel extends Disposable implements IViewModel { return result + 2; } - public getLineRenderLineNumber(viewLineNumber: number): string { - let modelPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(viewLineNumber, 1)); - if (modelPosition.column !== 1) { - return ''; - } - let modelLineNumber = modelPosition.lineNumber; - - if (this._renderCustomLineNumbers) { - return this._renderCustomLineNumbers(modelLineNumber); - } - - if (this._renderRelativeLineNumbers) { - let diff = Math.abs(this._lastCursorPosition.lineNumber - modelLineNumber); - if (diff === 0) { - return '' + modelLineNumber + ''; - } - return String(diff); - } - - return String(modelLineNumber); - } - public getDecorationsInViewport(visibleRange: Range): ViewModelDecoration[] { return this.decorations.getDecorationsViewportData(visibleRange).decorations; } @@ -539,19 +481,11 @@ export class ViewModel extends Disposable implements IViewModel { return this.decorations.getAllOverviewRulerDecorations(); } - public getEOL(): string { - return this.model.getEOL(); - } - public getValueInRange(range: Range, eol: editorCommon.EndOfLinePreference): string { var modelRange = this.coordinatesConverter.convertViewRangeToModelRange(range); return this.model.getValueInRange(modelRange, eol); } - public getModelLineContent(modelLineNumber: number): string { - return this.model.getLineContent(modelLineNumber); - } - public getModelLineMaxColumn(modelLineNumber: number): number { return this.model.getLineMaxColumn(modelLineNumber); } @@ -560,15 +494,15 @@ export class ViewModel extends Disposable implements IViewModel { return this.model.validatePosition(position); } - public getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string { - let newLineCharacter = this.getEOL(); + public getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean): string { + let newLineCharacter = this.model.getEOL(); if (ranges.length === 1) { let range: Range = ranges[0]; if (range.isEmpty()) { - if (enableEmptySelectionClipboard) { + if (emptySelectionClipboard) { let modelLineNumber = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(range.startLineNumber, 1)).lineNumber; - return this.getModelLineContent(modelLineNumber) + newLineCharacter; + return this.model.getLineContent(modelLineNumber) + newLineCharacter; } else { return ''; } @@ -586,7 +520,7 @@ export class ViewModel extends Disposable implements IViewModel { } } - public getHTMLToCopy(viewRanges: Range[], enableEmptySelectionClipboard: boolean): string { + public getHTMLToCopy(viewRanges: Range[], emptySelectionClipboard: boolean): string { if (this.model.getLanguageIdentifier().id === LanguageId.PlainText) { return null; } @@ -598,7 +532,7 @@ export class ViewModel extends Disposable implements IViewModel { let range = this.coordinatesConverter.convertViewRangeToModelRange(viewRanges[0]); if (range.isEmpty()) { - if (!enableEmptySelectionClipboard) { + if (!emptySelectionClipboard) { // nothing to copy return null; } @@ -659,11 +593,3 @@ export class ViewModel extends Disposable implements IViewModel { return result; } } - -function safeInvokeListener(listener: IViewModelListener, events: viewEvents.ViewEvent[]): void { - try { - listener(events); - } catch (e) { - errors.onUnexpectedError(e); - } -} diff --git a/src/vs/editor/contrib/accessibility/browser/accessibility.ts b/src/vs/editor/contrib/accessibility/browser/accessibility.ts index 508072bd26d..1294dc7b306 100644 --- a/src/vs/editor/contrib/accessibility/browser/accessibility.ts +++ b/src/vs/editor/contrib/accessibility/browser/accessibility.ts @@ -17,11 +17,9 @@ import { Widget } from 'vs/base/browser/ui/widget'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { GlobalScreenReaderNVDA } from 'vs/editor/common/config/commonEditorConfig'; import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { editorAction, CommonEditorRegistry, EditorAction, EditorCommand, Command } from 'vs/editor/common/editorCommonExtensions'; +import { editorAction, CommonEditorRegistry, EditorAction, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode'; @@ -29,7 +27,6 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic import { editorWidgetBackground, widgetShadow, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey('accessibilityHelpWidgetVisible', false); -const TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID = 'toggleExperimentalScreenReaderSupport'; @editorContribution class AccessibilityHelpController extends Disposable implements IEditorContribution { @@ -234,40 +231,19 @@ CommonEditorRegistry.registerEditorCommand(new AccessibilityHelpCommand({ } })); -class ToggleExperimentalScreenReaderSupportCommand extends Command { - constructor() { - super({ - id: TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID, - precondition: null, - kbOpts: { - weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), - kbExpr: null, - primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R - } - }); - } - - public runCommand(accessor: ServicesAccessor, args: any): void { - let currentValue = GlobalScreenReaderNVDA.getValue(); - GlobalScreenReaderNVDA.setValue(!currentValue); - } -} -const command = new ToggleExperimentalScreenReaderSupportCommand(); -KeybindingsRegistry.registerCommandAndKeybindingRule(command.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorContrib())); - registerThemingParticipant((theme, collector) => { let widgetBackground = theme.getColor(editorWidgetBackground); if (widgetBackground) { - collector.addRule(`.monaco-editor.${theme.selector} .accessibilityHelpWidget { background-color: ${widgetBackground}; }`); + collector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`); } let widgetShadowColor = theme.getColor(widgetShadow); if (widgetShadowColor) { - collector.addRule(`.monaco-editor.${theme.selector} .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); + collector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); } let hcBorder = theme.getColor(contrastBorder); if (hcBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`); + collector.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`); } }); diff --git a/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.css b/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.css index 161b88a13d9..3acf3fd25bf 100644 --- a/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.css +++ b/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.css @@ -5,8 +5,4 @@ .monaco-editor .bracket-match { box-sizing: border-box; - background-color: rgba(0, 100, 0, 0.1); } -.monaco-editor.vs .bracket-match { border: 1px solid #B9B9B9; } -.monaco-editor.vs-dark .bracket-match { border: 1px solid #888; } -.monaco-editor.hc-black .bracket-match { border: 1px solid #fff; } diff --git a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts index a439d5067f5..7b79df152e7 100644 --- a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts @@ -13,8 +13,10 @@ import { Position } from 'vs/editor/common/core/position'; import { RunOnceScheduler } from 'vs/base/common/async'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @editorAction class SelectBracketAction extends EditorAction { @@ -69,8 +71,7 @@ export class BracketMatchingController extends Disposable implements editorCommo private _matchBrackets: boolean; constructor( - editor: editorCommon.ICommonCodeEditor, - @IConfigurationService private configurationService: IConfigurationService + editor: editorCommon.ICommonCodeEditor ) { super(); this._editor = editor; @@ -81,7 +82,16 @@ export class BracketMatchingController extends Disposable implements editorCommo this._matchBrackets = this._editor.getConfiguration().contribInfo.matchBrackets; this._updateBracketsSoon.schedule(); - this._register(editor.onDidChangeCursorPosition((e) => this._updateBracketsSoon.schedule())); + this._register(editor.onDidChangeCursorPosition((e) => { + + if (!this._matchBrackets) { + // Early exit if nothing needs to be done! + // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) + return; + } + + this._updateBracketsSoon.schedule(); + })); this._register(editor.onDidChangeModel((e) => { this._decorations = []; this._updateBracketsSoon.schedule(); })); this._register(editor.onDidChangeConfiguration((e) => { this._matchBrackets = this._editor.getConfiguration().contribInfo.matchBrackets; @@ -127,10 +137,10 @@ export class BracketMatchingController extends Disposable implements editorCommo } } - private static _DECORATION_OPTIONS: editorCommon.IModelDecorationOptions = { + private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'bracket-match' - }; + }); private _updateBrackets(): void { if (!this._matchBrackets) { @@ -204,3 +214,14 @@ export class BracketMatchingController extends Disposable implements editorCommo this._lastVersionId = versionId; } } + +registerThemingParticipant((theme, collector) => { + let bracketMatchBackground = theme.getColor(editorBracketMatchBackground); + if (bracketMatchBackground) { + collector.addRule(`.monaco-editor .bracket-match { background-color: ${bracketMatchBackground}; }`); + } + let bracketMatchBorder = theme.getColor(editorBracketMatchBorder); + if (bracketMatchBorder) { + collector.addRule(`.monaco-editor .bracket-match { border: 1px solid ${bracketMatchBorder}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/caretOperations/common/caretOperations.ts b/src/vs/editor/contrib/caretOperations/common/caretOperations.ts index aec00037cb5..96e935bd69d 100644 --- a/src/vs/editor/contrib/caretOperations/common/caretOperations.ts +++ b/src/vs/editor/contrib/caretOperations/common/caretOperations.ts @@ -29,7 +29,9 @@ class MoveCaretAction extends EditorAction { commands.push(new MoveCaretCommand(selections[i], this.left)); } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } diff --git a/src/vs/editor/contrib/caretOperations/common/transpose.ts b/src/vs/editor/contrib/caretOperations/common/transpose.ts index fbb87805856..5ca66ce287d 100644 --- a/src/vs/editor/contrib/caretOperations/common/transpose.ts +++ b/src/vs/editor/contrib/caretOperations/common/transpose.ts @@ -63,7 +63,9 @@ class TransposeLettersAction extends EditorAction { } if (commands.length > 0) { + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } } diff --git a/src/vs/editor/contrib/clipboard/browser/clipboard.ts b/src/vs/editor/contrib/clipboard/browser/clipboard.ts index 2dd0f763ede..9ef4294f728 100644 --- a/src/vs/editor/contrib/clipboard/browser/clipboard.ts +++ b/src/vs/editor/contrib/clipboard/browser/clipboard.ts @@ -13,7 +13,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { editorAction, IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions'; -import { CopyOptions } from 'vs/editor/common/controller/textAreaHandler'; +import { CopyOptions } from 'vs/editor/browser/controller/textAreaInput'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste'; @@ -81,9 +81,9 @@ class ExecCommandCutAction extends ExecCommandAction { } public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - var enableEmptySelectionClipboard = editor.getConfiguration().contribInfo.emptySelectionClipboard && browser.enableEmptySelectionClipboard; + const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard; - if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) { + if (!emptySelectionClipboard && editor.getSelection().isEmpty()) { return; } @@ -113,9 +113,9 @@ class ExecCommandCopyAction extends ExecCommandAction { } public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - var enableEmptySelectionClipboard = editor.getConfiguration().contribInfo.emptySelectionClipboard && browser.enableEmptySelectionClipboard; + const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard; - if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) { + if (!emptySelectionClipboard && editor.getSelection().isEmpty()) { return; } @@ -162,9 +162,9 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction { } public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - var enableEmptySelectionClipboard = editor.getConfiguration().contribInfo.emptySelectionClipboard && browser.enableEmptySelectionClipboard; + const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard; - if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) { + if (!emptySelectionClipboard && editor.getSelection().isEmpty()) { return; } diff --git a/src/vs/editor/contrib/codelens/browser/codelens.css b/src/vs/editor/contrib/codelens/browser/codelens.css index 8cd27141065..113a5a1fbb4 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.css +++ b/src/vs/editor/contrib/codelens/browser/codelens.css @@ -7,8 +7,6 @@ overflow: hidden; display: inline-block; text-overflow: ellipsis; - font-size: 90%; - color: #999999; } .monaco-editor .codelens-decoration > span, @@ -28,11 +26,6 @@ .monaco-editor .codelens-decoration > a:hover { text-decoration: underline; cursor: pointer; - color: blue !important; -} - -.monaco-editor.vs-dark .codelens-decoration > a:hover { - color: #4E94CE !important; } .monaco-editor .codelens-decoration.invisible-cl { @@ -49,4 +42,4 @@ -moz-animation: fadein 0.5s linear; -o-animation: fadein 0.5s linear; animation: fadein 0.5s linear; -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index db424a9ea23..2c7e6ff341c 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -8,7 +8,7 @@ import 'vs/css!./codelens'; import { RunOnceScheduler, asWinJsPromise } from 'vs/base/common/async'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposables, IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import Severity from 'vs/base/common/severity'; import { format, escape } from 'vs/base/common/strings'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -17,11 +17,15 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IMessageService } from 'vs/platform/message/common/message'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CodeLensProviderRegistry, CodeLensProvider, ICodeLensSymbol, Command } from 'vs/editor/common/modes'; +import { CodeLensProviderRegistry, ICodeLensSymbol, Command } from 'vs/editor/common/modes'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { ICodeLensData, getCodeLensData } from '../common/codelens'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import { editorCodeLensForeground } from 'vs/editor/common/view/editorColorRegistry'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; class CodeLensViewZone implements editorBrowser.IViewZone { @@ -62,37 +66,43 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { private static ID: number = 0; // Editor.IContentWidget.allowEditorOverflow - readonly allowEditorOverflow = false; - - public suppressMouseDown: boolean; + readonly allowEditorOverflow: boolean = false; + readonly suppressMouseDown: boolean = true; private _id: string; private _domNode: HTMLElement; - private _subscription: IDisposable; + private _disposables: IDisposable[] = []; private _symbolRange: Range; private _widgetPosition: editorBrowser.IContentWidgetPosition; private _editor: editorBrowser.ICodeEditor; private _commands: { [id: string]: Command } = Object.create(null); - public constructor(editor: editorBrowser.ICodeEditor, symbolRange: Range, - commandService: ICommandService, messageService: IMessageService) { + public constructor( + editor: editorBrowser.ICodeEditor, + symbolRange: Range, + commandService: ICommandService, + messageService: IMessageService + ) { this._id = 'codeLensWidget' + (++CodeLensContentWidget.ID); this._editor = editor; - this.suppressMouseDown = true; - this.setSymbolRange(symbolRange); this._domNode = document.createElement('span'); - const lineHeight = editor.getConfiguration().lineHeight; - this._domNode.style.height = `${lineHeight}px`; - this._domNode.style.lineHeight = `${lineHeight}px`; this._domNode.innerHTML = ' '; dom.addClass(this._domNode, 'codelens-decoration'); dom.addClass(this._domNode, 'invisible-cl'); - this._subscription = dom.addDisposableListener(this._domNode, 'click', e => { + this._updateHeight(); + + this._disposables.push(this._editor.onDidChangeConfiguration(e => { + if (e.fontInfo) { + this._updateHeight(); + } + })); + + this._disposables.push(dom.addDisposableListener(this._domNode, 'click', e => { let element = e.target; if (element.tagName === 'A' && element.id) { let command = this._commands[element.id]; @@ -103,16 +113,24 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { }); } } - }); + })); this.updateVisibility(); } public dispose(): void { - this._subscription.dispose(); + dispose(this._disposables); this._symbolRange = null; } + private _updateHeight(): void { + const { fontInfo, lineHeight } = this._editor.getConfiguration(); + this._domNode.style.height = `${Math.round(lineHeight * 1.1)}px`; + this._domNode.style.lineHeight = `${lineHeight}px`; + this._domNode.style.fontSize = `${Math.round(fontInfo.fontSize * .9)}px`; + this._domNode.innerHTML = ' '; + } + public updateVisibility(): void { if (this.isVisible()) { dom.removeClass(this._domNode, 'invisible-cl'); @@ -233,7 +251,7 @@ class CodeLens { helper.addDecoration({ range: codeLensData.symbol.range, - options: {} + options: ModelDecorationOptions.EMPTY }, id => this._decorationIds[i] = id); // the range contains all lenses on this line @@ -280,7 +298,7 @@ class CodeLens { this._data.forEach((codeLensData, i) => { helper.addDecoration({ range: codeLensData.symbol.range, - options: {} + options: ModelDecorationOptions.EMPTY }, id => this._decorationIds[i] = id); }); } @@ -403,24 +421,12 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { return; } - const providerSubscriptions = new Disposables(); - this._localToDispose.push(providerSubscriptions); - - const onEvent = () => { - providerSubscriptions.dispose(); - scheduler.schedule(); - }; - - const subscribeToProviders = (result: ICodeLensData[]) => { - const seen = new Set(); - - for (const { provider } of result) { - if (provider.onDidChange && !seen.has(provider)) { - providerSubscriptions.add(provider.onDidChange(onEvent)); - seen.add(provider); - } + for (const provider of CodeLensProviderRegistry.all(model)) { + if (typeof provider.onDidChange === 'function') { + let registration = provider.onDidChange(() => scheduler.schedule()); + this._localToDispose.push(registration); } - }; + } this._detectVisibleLenses = new RunOnceScheduler(() => { this._onViewportChanged(model.getLanguageIdentifier().language); @@ -437,7 +443,6 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._currentFindCodeLensSymbolsPromise.then((result) => { if (counterValue === this._modelChangeCounter) { // only the last one wins this.renderCodeLensSymbols(result); - subscribeToProviders(result); this._detectVisibleLenses.schedule(); } }, (error) => { @@ -623,3 +628,14 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { }); } } + +registerThemingParticipant((theme, collector) => { + let codeLensForeground = theme.getColor(editorCodeLensForeground); + if (codeLensForeground) { + collector.addRule(`.monaco-editor .codelens-decoration { color: ${codeLensForeground}; }`); + } + let activeLinkForeground = theme.getColor(editorActiveLinkForeground); + if (activeLinkForeground) { + collector.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${activeLinkForeground} !important; }`); + } +}); diff --git a/src/vs/editor/contrib/codelens/common/codelens.ts b/src/vs/editor/contrib/codelens/common/codelens.ts index 864b3f2a25e..28424195ae2 100644 --- a/src/vs/editor/contrib/codelens/common/codelens.ts +++ b/src/vs/editor/contrib/codelens/common/codelens.ts @@ -6,6 +6,7 @@ 'use strict'; import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; +import { stableSort } from 'vs/base/common/arrays'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { IModel } from 'vs/editor/common/editorCommon'; @@ -33,7 +34,8 @@ export function getCodeLensData(model: IModel): TPromise { }, onUnexpectedExternalError)); return TPromise.join(promises).then(() => { - return symbols.sort((a, b) => { + + return stableSort(symbols, (a, b) => { // sort by lineNumber, provider-rank, and column if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { return -1; diff --git a/src/vs/editor/contrib/comment/common/comment.ts b/src/vs/editor/contrib/comment/common/comment.ts index 570d96b7cbb..898e1aa89d0 100644 --- a/src/vs/editor/contrib/comment/common/comment.ts +++ b/src/vs/editor/contrib/comment/common/comment.ts @@ -35,7 +35,9 @@ abstract class CommentLineAction extends EditorAction { commands.push(new LineCommentCommand(selections[i], opts.tabSize, this._type)); } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } @@ -113,6 +115,8 @@ class BlockCommentAction extends EditorAction { commands.push(new BlockCommentCommand(selections[i])); } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } diff --git a/src/vs/editor/contrib/comment/common/lineCommentCommand.ts b/src/vs/editor/contrib/comment/common/lineCommentCommand.ts index 9cf5de8659a..3311aa6ffae 100644 --- a/src/vs/editor/contrib/comment/common/lineCommentCommand.ts +++ b/src/vs/editor/contrib/comment/common/lineCommentCommand.ts @@ -63,34 +63,25 @@ export class LineCommentCommand implements editorCommon.ICommand { * Returns null if any of the lines doesn't support a line comment string. */ public static _gatherPreflightCommentStrings(model: editorCommon.ITokenizedModel, startLineNumber: number, endLineNumber: number): ILinePreflightData[] { - let commentStrForLanguage: string[] = []; + + model.forceTokenization(startLineNumber); + const languageId = model.getLanguageIdAtPosition(startLineNumber, 1); + + const config = LanguageConfigurationRegistry.getComments(languageId); + const commentStr = (config ? config.lineCommentToken : null); + if (!commentStr) { + // Mode does not support line comments + return null; + } + let lines: ILinePreflightData[] = []; for (let i = 0, lineCount = endLineNumber - startLineNumber + 1; i < lineCount; i++) { - let lineNumber = startLineNumber + i; - model.forceTokenization(lineNumber); - let languageId = model.getLanguageIdAtPosition(lineNumber, 1); - - // Find the commentStr for this line, if none is found then bail out: we cannot do line comments - let commentStr: string; - if (commentStrForLanguage[languageId]) { - commentStr = commentStrForLanguage[languageId]; - } else { - let config = LanguageConfigurationRegistry.getComments(languageId); - commentStr = (config ? config.lineCommentToken : null); - if (!commentStr) { - // Mode does not support line comments - return null; - } - - commentStrForLanguage[languageId] = commentStr; - } - - lines.push({ + lines[i] = { ignore: false, commentStr: commentStr, commentStrOffset: 0, commentStrLength: commentStr.length - }); + }; } return lines; diff --git a/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts index 802efd52419..64d900f1dd7 100644 --- a/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts @@ -9,6 +9,12 @@ import { Selection } from 'vs/editor/common/core/selection'; import { ILinePreflightData, IPreflightData, ISimpleModel, LineCommentCommand, Type } from 'vs/editor/contrib/comment/common/lineCommentCommand'; import { testCommand } from 'vs/editor/test/common/commands/commandTestUtils'; import { CommentMode } from 'vs/editor/test/common/commentMode'; +import * as modes from 'vs/editor/common/modes'; +import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; +import { TokenizationResult2 } from 'vs/editor/common/core/token'; +import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; +import { CommentRule } from 'vs/editor/common/modes/languageConfiguration'; +import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; suite('Editor Contrib - Line Comment Command', () => { @@ -827,4 +833,108 @@ suite('Editor Contrib - Line Comment As Block Comment 2', () => { }); }); +suite('Editor Contrib - Line Comment in mixed modes', () => { + const OUTER_LANGUAGE_ID = new modes.LanguageIdentifier('outerMode', 3); + const INNER_LANGUAGE_ID = new modes.LanguageIdentifier('innerMode', 4); + + class OuterMode extends MockMode { + constructor(commentsConfig: CommentRule) { + super(OUTER_LANGUAGE_ID); + this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { + comments: commentsConfig + })); + + this._register(modes.TokenizationRegistry.register(this.getLanguageIdentifier().language, { + getInitialState: (): modes.IState => NULL_STATE, + tokenize: undefined, + tokenize2: (line: string, state: modes.IState): TokenizationResult2 => { + let languageId = (/^ /.test(line) ? INNER_LANGUAGE_ID : OUTER_LANGUAGE_ID); + + let tokens = new Uint32Array(1 << 1); + tokens[(0 << 1)] = 0; + tokens[(0 << 1) + 1] = ( + (modes.ColorId.DefaultForeground << modes.MetadataConsts.FOREGROUND_OFFSET) + | (languageId.id << modes.MetadataConsts.LANGUAGEID_OFFSET) + ); + return new TokenizationResult2(tokens, state); + } + })); + } + } + + class InnerMode extends MockMode { + constructor(commentsConfig: CommentRule) { + super(INNER_LANGUAGE_ID); + this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { + comments: commentsConfig + })); + } + } + + function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + let outerMode = new OuterMode({ lineComment: '//', blockComment: ['/*', '*/'] }); + let innerMode = new InnerMode({ lineComment: null, blockComment: ['{/*', '*/}'] }); + testCommand( + lines, + outerMode.getLanguageIdentifier(), + selection, + (sel) => new LineCommentCommand(sel, 4, Type.Toggle), + expectedLines, + expectedSelection + ); + innerMode.dispose(); + outerMode.dispose(); + } + + test('issue #24047 (part 1): Commenting code in JSX files', () => { + testLineCommentCommand( + [ + 'import React from \'react\';', + 'const Loader = () => (', + '
', + ' Loading...', + '
', + ');', + 'export default Loader;' + ], + new Selection(1, 1, 7, 22), + [ + '// import React from \'react\';', + '// const Loader = () => (', + '//
', + '// Loading...', + '//
', + '// );', + '// export default Loader;' + ], + new Selection(1, 4, 7, 25), + ); + }); + + test('issue #24047 (part 2): Commenting code in JSX files', () => { + testLineCommentCommand( + [ + 'import React from \'react\';', + 'const Loader = () => (', + '
', + ' Loading...', + '
', + ');', + 'export default Loader;' + ], + new Selection(3, 4, 3, 4), + [ + 'import React from \'react\';', + 'const Loader = () => (', + ' {/*
*/}', + ' Loading...', + '
', + ');', + 'export default Loader;' + ], + new Selection(3, 7, 3, 7), + ); + }); + +}); diff --git a/src/vs/editor/contrib/dnd/browser/dnd.ts b/src/vs/editor/contrib/dnd/browser/dnd.ts index cca6986ce33..7628350f4e2 100644 --- a/src/vs/editor/contrib/dnd/browser/dnd.ts +++ b/src/vs/editor/contrib/dnd/browser/dnd.ts @@ -17,6 +17,7 @@ import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { DragAndDropCommand } from '../common/dragAndDropCommand'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @editorContribution export class DragAndDropController implements editorCommon.IEditorContribution { @@ -146,7 +147,9 @@ export class DragAndDropController implements editorCommon.IEditorContribution { this._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition) ) // we allow users to paste content beside the selection )) { + this._editor.pushUndoStop(); this._editor.executeCommand(DragAndDropController.ID, new DragAndDropCommand(this._dragSelection, newCursorPosition, mouseEvent.event[DragAndDropController.TRIGGER_MODIFIER] || this._modiferPressed)); + this._editor.pushUndoStop(); } } @@ -159,12 +162,16 @@ export class DragAndDropController implements editorCommon.IEditorContribution { this._mouseDown = false; } + private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ + className: 'dnd-target' + }); + public showAt(position: Position): void { this._editor.changeDecorations(changeAccessor => { let newDecorations: editorCommon.IModelDeltaDecoration[] = []; newDecorations.push({ range: new Range(position.lineNumber, position.column, position.lineNumber, position.column), - options: { className: 'dnd-target' } + options: DragAndDropController._DECORATION_OPTIONS }); this._dndDecorationIds = changeAccessor.deltaDecorations(this._dndDecorationIds, newDecorations); diff --git a/src/vs/editor/contrib/find/browser/find.ts b/src/vs/editor/contrib/find/browser/find.ts index cc32e668da5..3b5e1d0bb1d 100644 --- a/src/vs/editor/contrib/find/browser/find.ts +++ b/src/vs/editor/contrib/find/browser/find.ts @@ -13,6 +13,7 @@ import { FindWidget, IFindController } from 'vs/editor/contrib/find/browser/find import { FindOptionsWidget } from 'vs/editor/contrib/find/browser/findOptionsWidget'; import { CommonFindController, FindStartFocusAction, IFindStartOptions } from 'vs/editor/contrib/find/common/findController'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IStorageService } from 'vs/platform/storage/common/storage'; @editorContribution export class FindController extends CommonFindController implements IFindController { @@ -25,9 +26,10 @@ export class FindController extends CommonFindController implements IFindControl @IContextViewService contextViewService: IContextViewService, @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService keybindingService: IKeybindingService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IStorageService storageService: IStorageService ) { - super(editor, contextKeyService); + super(editor, contextKeyService, storageService); this._widget = this._register(new FindWidget(editor, this, this._state, contextViewService, keybindingService, contextKeyService, themeService)); this._findOptionsWidget = this._register(new FindOptionsWidget(editor, this._state, keybindingService, themeService)); diff --git a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts index f84b6f2fae0..7634aa1ca30 100644 --- a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts +++ b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts @@ -11,7 +11,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { FIND_IDS } from 'vs/editor/contrib/find/common/findModel'; import { FindReplaceState } from 'vs/editor/contrib/find/common/findState'; -import { CaseSensitiveCheckbox, WholeWordsCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes'; +import { CaseSensitiveCheckbox, WholeWordsCheckbox, RegexCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes'; import { RunOnceScheduler } from 'vs/base/common/async'; import { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { inputActiveOptionBorder, editorWidgetBackground, contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; @@ -25,6 +25,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { private _keybindingService: IKeybindingService; private _domNode: HTMLElement; + private regex: RegexCheckbox; private wholeWords: WholeWordsCheckbox; private caseSensitive: CaseSensitiveCheckbox; @@ -41,7 +42,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { this._keybindingService = keybindingService; this._domNode = document.createElement('div'); - this._domNode.className = 'monaco-editor-background findOptionsWidget'; + this._domNode.className = 'findOptionsWidget'; this._domNode.style.display = 'none'; this._domNode.style.top = '10px'; this._domNode.setAttribute('role', 'presentation'); @@ -73,10 +74,26 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { })); this._domNode.appendChild(this.wholeWords.domNode); + this.regex = this._register(new RegexCheckbox({ + appendTitle: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand), + isChecked: this._state.isRegex, + onChange: (viaKeyboard) => { + this._state.change({ + isRegex: this.regex.checked + }, false); + }, + inputActiveOptionBorder: inputActiveOptionBorderColor + })); + this._domNode.appendChild(this.regex.domNode); + this._editor.addOverlayWidget(this); this._register(this._state.addChangeListener((e) => { let somethingChanged = false; + if (e.isRegex) { + this.regex.checked = this._state.isRegex; + somethingChanged = true; + } if (e.wholeWord) { this.wholeWords.checked = this._state.wholeWord; somethingChanged = true; @@ -167,6 +184,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { let inputStyles = { inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) }; this.caseSensitive.style(inputStyles); this.wholeWords.style(inputStyles); + this.regex.style(inputStyles); } } @@ -174,16 +192,16 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { registerThemingParticipant((theme, collector) => { let widgetBackground = theme.getColor(editorWidgetBackground); if (widgetBackground) { - collector.addRule(`.monaco-editor.${theme.selector} .findOptionsWidget { background-color: ${widgetBackground}; }`); + collector.addRule(`.monaco-editor .findOptionsWidget { background-color: ${widgetBackground}; }`); } let widgetShadowColor = theme.getColor(widgetShadow); if (widgetShadowColor) { - collector.addRule(`.monaco-editor.${theme.selector} .findOptionsWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); + collector.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); } let hcBorder = theme.getColor(contrastBorder); if (hcBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .findOptionsWidget { border: 2px solid ${hcBorder}; }`); + collector.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${hcBorder}; }`); } }); \ No newline at end of file diff --git a/src/vs/editor/contrib/find/browser/findWidget.css b/src/vs/editor/contrib/find/browser/findWidget.css index 6d3ffb0ab28..0fdd4694549 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.css +++ b/src/vs/editor/contrib/find/browser/findWidget.css @@ -51,7 +51,9 @@ height: 64px; /* find input height + replace input height */ } .monaco-editor .find-widget.replaceToggled > .replace-part { - display: inline-block; + display: flex; + display: -webkit-flex; + align-items: center; } .monaco-editor .find-widget.visible, @@ -81,6 +83,9 @@ .monaco-editor .find-widget > .replace-part { margin: 4px 0 0 17px; font-size: 12px; + display: flex; + display: -webkit-flex; + align-items: center; } .monaco-editor .find-widget > .find-part .monaco-inputbox, @@ -88,6 +93,10 @@ height: 25px; } +.monaco-editor .find-widget > .find-part .monaco-inputbox > .wrapper > .input { + width: 100% !important; + padding-right: 66px; +} .monaco-editor .find-widget > .find-part .monaco-inputbox > .wrapper > .input, .monaco-editor .find-widget > .replace-part .monaco-inputbox > .wrapper > .input { padding-top: 2px; @@ -95,21 +104,16 @@ } .monaco-editor .find-widget .monaco-findInput { - display: inline-block; vertical-align: middle; -} - -.monaco-editor .find-widget.no-results .matchesCount { - color: #A1260D; -} - -.monaco-editor.vs-dark .find-widget.no-results .matchesCount, -.monaco-editor.hc-black .find-widget.no-results .matchesCount { - color: #F48771 + display: flex; + display: -webkit-flex; + flex:1; } .monaco-editor .find-widget .matchesCount { - display: inline-block; + display: flex; + display: -webkit-flex; + flex: initial; margin: 0 1px 0 3px; padding: 2px 2px 0 2px; height: 25px; @@ -120,10 +124,12 @@ } .monaco-editor .find-widget .button { + min-width: 20px; width: 20px; height: 20px; - display: inline-block; - vertical-align: middle; + display: flex; + display: -webkit-flex; + flex: initial; margin-left: 3px; background-position: center center; background-repeat: no-repeat; @@ -236,12 +242,10 @@ } .monaco-editor .find-widget > .replace-part > .replace-input { - display: inline-block; + display: flex; + display: -webkit-flex; vertical-align: middle; -} - -.monaco-editor .find-widget > .replace-part > .replace-input > .monaco-inputbox { - width: 100%; + width: auto !important; } /* REDUCED */ @@ -251,15 +255,15 @@ } /* NARROW (SMALLER THAN REDUCED) */ -.monaco-editor .find-widget.narrow-find-widget > .find-part .monaco-findInput, -.monaco-editor .find-widget.narrow-find-widget > .replace-part .replace-input { - width: 171px !important; -} -.monaco-editor .find-widget.narrow-find-widget > .find-part .monaco-inputbox > .wrapper > .input { - width: 105px !important; +.monaco-editor .find-widget.narrow-find-widget { + max-width: 257px !important; } /* COLLAPSED (SMALLER THAN NARROW) */ +.monaco-editor .find-widget.collapsed-find-widget { + max-width: 111px !important; +} + .monaco-editor .find-widget.collapsed-find-widget .button.previous, .monaco-editor .find-widget.collapsed-find-widget .button.next, .monaco-editor .find-widget.collapsed-find-widget .button.replace, @@ -267,10 +271,9 @@ .monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-findInput .controls { display:none; } -.monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-findInput, -.monaco-editor .find-widget.collapsed-find-widget > .replace-part .replace-input, + .monaco-editor .find-widget.collapsed-find-widget > .find-part .monaco-inputbox > .wrapper > .input { - width: 71px !important; + padding-right: 0px; } .monaco-editor .findMatch { @@ -284,6 +287,11 @@ animation-name: inherit !important; } +.monaco-editor .find-widget .monaco-sash { + width: 2px !important; + margin-left: -4px; +} + .monaco-editor.hc-black .find-widget .previous, .monaco-editor.vs-dark .find-widget .previous { background-image: url('images/previous-inverse.svg'); diff --git a/src/vs/editor/contrib/find/browser/findWidget.ts b/src/vs/editor/contrib/find/browser/findWidget.ts index f04848aa1a4..409caf8fb73 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.ts +++ b/src/vs/editor/contrib/find/browser/findWidget.ts @@ -9,15 +9,18 @@ import 'vs/css!./findWidget'; import * as nls from 'vs/nls'; import { onUnexpectedError } from 'vs/base/common/errors'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; +import * as platform from 'vs/base/common/platform'; import * as strings from 'vs/base/common/strings'; import * as dom from 'vs/base/browser/dom'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { IMouseEvent } from 'vs/base/browser/mouseEvent'; import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; import { FindInput, IFindInputStyles } from 'vs/base/browser/ui/findinput/findInput'; import { IMessage as InputBoxMessage, InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { Widget } from 'vs/base/browser/ui/widget'; +import { Sash, IHorizontalSashLayoutProvider, ISashEvent, Orientation } from 'vs/base/browser/ui/sash/sash'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { FIND_IDS, MATCHES_LIMIT } from 'vs/editor/contrib/find/common/findModel'; import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/common/findState'; import { Range } from 'vs/editor/common/core/range'; @@ -26,7 +29,8 @@ import { CONTEXT_FIND_INPUT_FOCUSSED } from 'vs/editor/contrib/find/common/findC import { ITheme, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { editorFindRangeHighlight, editorFindMatch, editorFindMatchHighlight, activeContrastBorder, contrastBorder, inputBackground, editorWidgetBackground, inputActiveOptionBorder, widgetShadow, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorBorder } from 'vs/platform/theme/common/colorRegistry'; +import { editorFindRangeHighlight, editorFindMatch, editorFindMatchHighlight, activeContrastBorder, contrastBorder, inputBackground, editorWidgetBackground, inputActiveOptionBorder, widgetShadow, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorBorder, errorForeground } from 'vs/platform/theme/common/colorRegistry'; + export interface IFindController { replace(): void; @@ -48,16 +52,36 @@ const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize('title.matchesCountLimit', "O const NLS_MATCHES_LOCATION = nls.localize('label.matchesLocation', "{0} of {1}"); const NLS_NO_RESULTS = nls.localize('label.noResults', "No Results"); +const FIND_WIDGET_INITIAL_WIDTH = 411; +const PART_WIDTH = 275; +const FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54; +const REPLACE_INPUT_AREA_WIDTH = FIND_INPUT_AREA_WIDTH; + let MAX_MATCHES_COUNT_WIDTH = 69; -const WIDGET_FIXED_WIDTH = 411 - 69; +let FIND_ALL_CONTROLS_WIDTH = 17/** Find Input margin-left */ + (MAX_MATCHES_COUNT_WIDTH + 3 + 1) /** Match Results */ + 23 /** Button */ * 4 + 2/** sash */; -export class FindWidget extends Widget implements IOverlayWidget { +const FIND_INPUT_AREA_HEIGHT = 34; // The height of Find Widget when Replace Input is not visible. +const FIND_REPLACE_AREA_HEIGHT = 64; // The height of Find Widget when Replace Input is visible. - private static ID = 'editor.contrib.findWidget'; - private static PART_WIDTH = 275; - private static FIND_INPUT_AREA_WIDTH = FindWidget.PART_WIDTH - 54; - private static REPLACE_INPUT_AREA_WIDTH = FindWidget.FIND_INPUT_AREA_WIDTH; +export class FindWidgetViewZone implements IViewZone { + public afterLineNumber: number; + public heightInPx: number; + public suppressMouseDown: boolean; + public domNode: HTMLElement; + + constructor(afterLineNumber: number) { + this.afterLineNumber = afterLineNumber; + + this.heightInPx = FIND_INPUT_AREA_HEIGHT; + this.suppressMouseDown = false; + this.domNode = document.createElement('div'); + this.domNode.className = 'dock-find-viewzone'; + } +} + +export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSashLayoutProvider { + private static ID = 'editor.contrib.findWidget';; private _codeEditor: ICodeEditor; private _state: FindReplaceState; private _controller: IFindController; @@ -82,6 +106,10 @@ export class FindWidget extends Widget implements IOverlayWidget { private _focusTracker: dom.IFocusTracker; private _findInputFocussed: IContextKey; + private _viewZone: FindWidgetViewZone; + private _viewZoneId: number; + + private _resizeSash: Sash; constructor( codeEditor: ICodeEditor, @@ -103,27 +131,47 @@ export class FindWidget extends Widget implements IOverlayWidget { this._isReplaceVisible = false; this._register(this._state.addChangeListener((e) => this._onStateChanged(e))); - this._buildDomNode(); this._updateButtons(); let checkEditorWidth = () => { let editorWidth = this._codeEditor.getConfiguration().layoutInfo.width; + let minimapWidth = this._codeEditor.getConfiguration().layoutInfo.minimapWidth; let collapsedFindWidget = false; let reducedFindWidget = false; let narrowFindWidget = false; - if (WIDGET_FIXED_WIDTH + 28 >= editorWidth + 50) { - collapsedFindWidget = true; + let widgetWidth = dom.getTotalWidth(this._domNode); + + if (widgetWidth > FIND_WIDGET_INITIAL_WIDTH) { + // as the widget is resized by users, we may need to change the max width of the widget as the editor width changes. + this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; + this._replaceInputBox.inputElement.style.width = `${dom.getTotalWidth(this._findInput.inputBox.inputElement)}px`; + return; } - if (WIDGET_FIXED_WIDTH + 28 >= editorWidth) { - narrowFindWidget = true; - } - if (WIDGET_FIXED_WIDTH + MAX_MATCHES_COUNT_WIDTH + 28 >= editorWidth) { + + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth >= editorWidth) { reducedFindWidget = true; } + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth) { + narrowFindWidget = true; + } + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth + 50) { + collapsedFindWidget = true; + } dom.toggleClass(this._domNode, 'collapsed-find-widget', collapsedFindWidget); - dom.toggleClass(this._domNode, 'reduced-find-widget', reducedFindWidget); dom.toggleClass(this._domNode, 'narrow-find-widget', narrowFindWidget); + dom.toggleClass(this._domNode, 'reduced-find-widget', reducedFindWidget); + + if (!narrowFindWidget && !collapsedFindWidget) { + // the minimal left offset of findwidget is 15px. + this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; + } + + let findInputWidth = dom.getTotalWidth(this._findInput.inputBox.inputElement); + if (findInputWidth > 0) { + this._replaceInputBox.inputElement.style.width = `${findInputWidth}px`; + } + }; checkEditorWidth(); @@ -168,9 +216,31 @@ export class FindWidget extends Widget implements IOverlayWidget { }); this._codeEditor.addOverlayWidget(this); + this._viewZone = new FindWidgetViewZone(0); // Put it before the first line then users can scroll beyond the first line. this._applyTheme(themeService.getTheme()); this._register(themeService.onThemeChange(this._applyTheme.bind(this))); + + this._register(this._codeEditor.onDidChangeModel((e) => { + if (!this._isVisible) { + return; + } + + if (this._viewZoneId === undefined) { + return; + } + + this._codeEditor.changeViewZones((accessor) => { + accessor.removeZone(this._viewZoneId); + this._viewZoneId = undefined; + }); + })); + + this._register(this._codeEditor.onDidScrollChange((e) => { + if (e.scrollTopChanged) { + this._layoutViewZone(); + } + })); } // ----- IOverlayWidget API @@ -245,6 +315,9 @@ export class FindWidget extends Widget implements IOverlayWidget { this._updateMatchesCount(); } + if (e.searchString || e.currentMatch) { + this._layoutViewZone(); + } } private _updateMatchesCount(): void { @@ -318,6 +391,13 @@ export class FindWidget extends Widget implements IOverlayWidget { if (!this._isVisible) { this._isVisible = true; + let selection = this._codeEditor.getSelection(); + let isSelection = selection ? (selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn) : false; + if (isSelection && this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection) { + this._toggleSelectionFind.checked = true; + } else { + this._toggleSelectionFind.checked = false; + } this._updateButtons(); setTimeout(() => { @@ -330,6 +410,7 @@ export class FindWidget extends Widget implements IOverlayWidget { } }, 0); this._codeEditor.layoutOverlayWidget(this); + this._showViewZone(); } } @@ -344,9 +425,62 @@ export class FindWidget extends Widget implements IOverlayWidget { this._codeEditor.focus(); } this._codeEditor.layoutOverlayWidget(this); + this._codeEditor.changeViewZones((accessor) => { + if (this._viewZoneId !== undefined) { + accessor.removeZone(this._viewZoneId); + this._viewZoneId = undefined; + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx); + } + }); } } + private _layoutViewZone() { + if (!this._isVisible) { + return; + } + + if (this._viewZoneId !== undefined) { + return; + } + + this._codeEditor.changeViewZones((accessor) => { + if (this._state.isReplaceRevealed) { + this._viewZone.heightInPx = FIND_REPLACE_AREA_HEIGHT; + } else { + this._viewZone.heightInPx = FIND_INPUT_AREA_HEIGHT; + } + + this._viewZoneId = accessor.addZone(this._viewZone); + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + this._viewZone.heightInPx); + }); + } + + private _showViewZone() { + if (!this._isVisible) { + return; + } + + this._codeEditor.changeViewZones((accessor) => { + let scrollAdjustment = FIND_INPUT_AREA_HEIGHT; + + if (this._viewZoneId !== undefined) { + if (this._state.isReplaceRevealed) { + this._viewZone.heightInPx = FIND_REPLACE_AREA_HEIGHT; + scrollAdjustment = FIND_REPLACE_AREA_HEIGHT - FIND_INPUT_AREA_HEIGHT; + } else { + this._viewZone.heightInPx = FIND_INPUT_AREA_HEIGHT; + scrollAdjustment = FIND_INPUT_AREA_HEIGHT - FIND_REPLACE_AREA_HEIGHT; + } + accessor.removeZone(this._viewZoneId); + } else { + this._viewZone.heightInPx = FIND_INPUT_AREA_HEIGHT; + } + this._viewZoneId = accessor.addZone(this._viewZone); + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); + }); + } + private _applyTheme(theme: ITheme) { let inputStyles: IFindInputStyles = { inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), @@ -382,6 +516,13 @@ export class FindWidget extends Widget implements IOverlayWidget { this._findInput.highlightFindOptions(); } + private _onFindInputMouseDown(e: IMouseEvent): void { + // on linux, middle key does pasting. + if (e.middleButton) { + e.stopPropagation(); + } + } + private _onFindInputKeyDown(e: IKeyboardEvent): void { if (e.equals(KeyCode.Enter)) { @@ -446,6 +587,17 @@ export class FindWidget extends Widget implements IOverlayWidget { } } + // ----- sash + public getHorizontalSashTop(sash: Sash): number { + return 0; + } + public getHorizontalSashLeft?(sash: Sash): number { + return 0; + } + public getHorizontalSashWidth?(sash: Sash): number { + return 500; + } + // ----- initialization private _keybindingLabelFor(actionId: string): string { @@ -459,7 +611,7 @@ export class FindWidget extends Widget implements IOverlayWidget { private _buildFindPart(): HTMLElement { // Find input this._findInput = this._register(new FindInput(null, this._contextViewProvider, { - width: FindWidget.FIND_INPUT_AREA_WIDTH, + width: FIND_INPUT_AREA_WIDTH, label: NLS_FIND_INPUT_LABEL, placeholder: NLS_FIND_INPUT_PLACEHOLDER, appendCaseSensitiveLabel: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand), @@ -482,6 +634,9 @@ export class FindWidget extends Widget implements IOverlayWidget { } } })); + this._findInput.setRegex(!!this._state.isRegex); + this._findInput.setCaseSensitive(!!this._state.matchCase); + this._findInput.setWholeWords(!!this._state.wholeWord); this._register(this._findInput.onKeyDown((e) => this._onFindInputKeyDown(e))); this._register(this._findInput.onInput(() => { this._state.change({ searchString: this._findInput.getValue() }, true); @@ -501,6 +656,9 @@ export class FindWidget extends Widget implements IOverlayWidget { } } })); + if (platform.isLinux) { + this._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e))); + } this._matchesCount = document.createElement('div'); this._matchesCount.className = 'matchesCount'; @@ -536,7 +694,7 @@ export class FindWidget extends Widget implements IOverlayWidget { // Toggle selection button this._toggleSelectionFind = this._register(new SimpleCheckbox({ parent: findPart, - title: NLS_TOGGLE_SELECTION_FIND_TITLE, + title: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand), onChange: () => { if (this._toggleSelectionFind.checked) { let selection = this._codeEditor.getSelection(); @@ -557,7 +715,7 @@ export class FindWidget extends Widget implements IOverlayWidget { label: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand), className: 'close-fw', onTrigger: () => { - this._state.change({ isRevealed: false }, false); + this._state.change({ isRevealed: false, searchScope: null }, false); }, onKeyDown: (e) => { if (e.equals(KeyCode.Tab)) { @@ -582,7 +740,7 @@ export class FindWidget extends Widget implements IOverlayWidget { // Replace input let replaceInput = document.createElement('div'); replaceInput.className = 'replace-input'; - replaceInput.style.width = FindWidget.REPLACE_INPUT_AREA_WIDTH + 'px'; + replaceInput.style.width = REPLACE_INPUT_AREA_WIDTH + 'px'; this._replaceInputBox = this._register(new InputBox(replaceInput, null, { ariaLabel: NLS_REPLACE_INPUT_LABEL, placeholder: NLS_REPLACE_INPUT_PLACEHOLDER @@ -640,6 +798,10 @@ export class FindWidget extends Widget implements IOverlayWidget { className: 'toggle left', onTrigger: () => { this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false); + if (this._isReplaceVisible) { + this._replaceInputBox.width = this._findInput.inputBox.width; + } + this._showViewZone(); }, onKeyDown: (e) => { } })); @@ -655,6 +817,36 @@ export class FindWidget extends Widget implements IOverlayWidget { this._domNode.appendChild(this._toggleReplaceBtn.domNode); this._domNode.appendChild(findPart); this._domNode.appendChild(replacePart); + + this._buildSash(); + } + + private _buildSash() { + this._resizeSash = new Sash(this._domNode, this, { orientation: Orientation.VERTICAL }); + let originalWidth = FIND_WIDGET_INITIAL_WIDTH; + + this._register(this._resizeSash.addListener('start', (e: ISashEvent) => { + originalWidth = dom.getTotalWidth(this._domNode); + })); + + this._register(this._resizeSash.addListener('change', (evt: ISashEvent) => { + let width = originalWidth + evt.startX - evt.currentX; + + if (width < FIND_WIDGET_INITIAL_WIDTH) { + // narrow down the find widget should be handled by CSS. + return; + } + + let inputBoxWidth = width - FIND_ALL_CONTROLS_WIDTH; + let maxWidth = parseFloat(dom.getComputedStyle(this._domNode).maxWidth) || 0; + if (width > maxWidth) { + return; + } + this._domNode.style.width = `${width}px`; + if (this._isReplaceVisible) { + this._replaceInputBox.width = inputBoxWidth; + } + })); } } @@ -680,16 +872,19 @@ class SimpleCheckbox extends Widget { this._domNode = document.createElement('div'); this._domNode.className = 'monaco-checkbox'; this._domNode.title = this._opts.title; + this._domNode.tabIndex = 0; this._checkbox = document.createElement('input'); this._checkbox.type = 'checkbox'; this._checkbox.className = 'checkbox'; this._checkbox.id = 'checkbox-' + SimpleCheckbox._COUNTER++; + this._checkbox.tabIndex = -1; this._label = document.createElement('label'); this._label.className = 'label'; // Connect the label and the checkbox. Checkbox will get checked when the label recieves a click. this._label.htmlFor = this._checkbox.id; + this._label.tabIndex = -1; this._domNode.appendChild(this._checkbox); this._domNode.appendChild(this._label); @@ -728,8 +923,10 @@ class SimpleCheckbox extends Widget { public setEnabled(enabled: boolean): void { if (enabled) { this.enable(); + this.domNode.tabIndex = 0; } else { this.disable(); + this.domNode.tabIndex = -1; } } } @@ -790,7 +987,7 @@ class SimpleButton extends Widget { } public setExpanded(expanded: boolean): void { - this._domNode.setAttribute('aria-expanded', String(expanded)); + this._domNode.setAttribute('aria-expanded', String(!!expanded)); } public toggleClass(className: string, shouldHaveIt: boolean): void { @@ -803,7 +1000,7 @@ class SimpleButton extends Widget { registerThemingParticipant((theme, collector) => { function addBackgroundColorRule(selector: string, color: Color): void { if (color) { - collector.addRule(`.monaco-editor.${theme.selector} ${selector} { background-color: ${color}; }`); + collector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`); } } @@ -816,18 +1013,28 @@ registerThemingParticipant((theme, collector) => { let widgetShadowColor = theme.getColor(widgetShadow); if (widgetShadowColor) { - collector.addRule(`.monaco-editor.${theme.selector} .find-widget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); + collector.addRule(`.monaco-editor .find-widget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); } let hcOutline = theme.getColor(activeContrastBorder); if (hcOutline) { - collector.addRule(`.monaco-editor.${theme.selector} .findScope { border: 1px dashed ${hcOutline.transparent(0.4)}; }`); - collector.addRule(`.monaco-editor.${theme.selector} .currentFindMatch { border: 2px solid ${hcOutline}; padding: 1px; -moz-box-sizing: border-box; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor.${theme.selector} .findMatch { border: 1px dotted ${hcOutline}; -moz-box-sizing: border-box; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .findScope { border: 1px dashed ${hcOutline.transparent(0.4)}; }`); + collector.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${hcOutline}; padding: 1px; -moz-box-sizing: border-box; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .findMatch { border: 1px dotted ${hcOutline}; -moz-box-sizing: border-box; box-sizing: border-box; }`); } let hcBorder = theme.getColor(contrastBorder); if (hcBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .find-widget { border: 2px solid ${hcBorder}; }`); + collector.addRule(`.monaco-editor .find-widget { border: 2px solid ${hcBorder}; }`); + } + + let error = theme.getColor(errorForeground); + if (error) { + collector.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${error}; }`); + } + + let border = theme.getColor('panel.border'); + if (border) { + collector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${border}; width: 2px !important; margin-left: -4px;}`); } }); diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index e3a133ee560..a5dae70a8dc 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -14,12 +14,14 @@ import { Selection } from 'vs/editor/common/core/selection'; import * as strings from 'vs/base/common/strings'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import { FIND_IDS, FindModelBoundToEditorModel, ToggleCaseSensitiveKeybinding, ToggleRegexKeybinding, ToggleWholeWordKeybinding, ShowPreviousFindTermKeybinding, ShowNextFindTermKeybinding } from 'vs/editor/contrib/find/common/findModel'; +import { FIND_IDS, FindModelBoundToEditorModel, ToggleCaseSensitiveKeybinding, ToggleRegexKeybinding, ToggleWholeWordKeybinding, ToggleSearchScopeKeybinding, ShowPreviousFindTermKeybinding, ShowNextFindTermKeybinding } from 'vs/editor/contrib/find/common/findModel'; import { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/contrib/find/common/findState'; import { DocumentHighlightProviderRegistry } from 'vs/editor/common/modes'; import { RunOnceScheduler, Delayer } from 'vs/base/common/async'; import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export const enum FindStartFocusAction { NoFocusChange, @@ -48,19 +50,22 @@ export class CommonFindController extends Disposable implements editorCommon.IEd private _currentHistoryNavigator: HistoryNavigator; protected _updateHistoryDelayer: Delayer; private _model: FindModelBoundToEditorModel; + private _storageService: IStorageService; public static get(editor: editorCommon.ICommonCodeEditor): CommonFindController { return editor.getContribution(CommonFindController.ID); } - constructor(editor: editorCommon.ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { + constructor(editor: editorCommon.ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @IStorageService storageService: IStorageService) { super(); this._editor = editor; this._findWidgetVisible = CONTEXT_FIND_WIDGET_VISIBLE.bindTo(contextKeyService); + this._storageService = storageService; this._updateHistoryDelayer = new Delayer(500); this._currentHistoryNavigator = new HistoryNavigator(); this._state = this._register(new FindReplaceState()); + this.loadQueryState(); this._register(this._state.addChangeListener((e) => this._onStateChanged(e))); this._model = null; @@ -71,7 +76,10 @@ export class CommonFindController extends Disposable implements editorCommon.IEd this.disposeModel(); this._state.change({ - searchScope: null + searchScope: null, + matchCase: this._storageService.getBoolean('editor.matchCase', StorageScope.WORKSPACE, false), + wholeWord: this._storageService.getBoolean('editor.wholeWord', StorageScope.WORKSPACE, false), + isRegex: this._storageService.getBoolean('editor.isRegex', StorageScope.WORKSPACE, false) }, false); if (shouldRestartFind) { @@ -102,6 +110,8 @@ export class CommonFindController extends Disposable implements editorCommon.IEd } private _onStateChanged(e: FindReplaceStateChangedEvent): void { + this.saveQueryState(e); + if (e.updateHistory && e.searchString) { this._delayedUpdateHistory(); } @@ -115,6 +125,26 @@ export class CommonFindController extends Disposable implements editorCommon.IEd } } + private saveQueryState(e: FindReplaceStateChangedEvent) { + if (e.isRegex && typeof this._state.isRegex !== 'undefined') { + this._storageService.store('editor.isRegex', this._state.isRegex, StorageScope.WORKSPACE); + } + if (e.wholeWord && typeof this._state.wholeWord !== 'undefined') { + this._storageService.store('editor.wholeWord', this._state.wholeWord, StorageScope.WORKSPACE); + } + if (e.matchCase && typeof this._state.matchCase !== 'undefined') { + this._storageService.store('editor.matchCase', this._state.matchCase, StorageScope.WORKSPACE); + } + } + + private loadQueryState() { + this._state.change({ + matchCase: this._storageService.getBoolean('editor.matchCase', StorageScope.WORKSPACE, this._state.matchCase), + wholeWord: this._storageService.getBoolean('editor.wholeWord', StorageScope.WORKSPACE, this._state.wholeWord), + isRegex: this._storageService.getBoolean('editor.isRegex', StorageScope.WORKSPACE, this._state.isRegex) + }, false); + } + protected _delayedUpdateHistory() { this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)); } @@ -153,6 +183,20 @@ export class CommonFindController extends Disposable implements editorCommon.IEd this._state.change({ isRegex: !this._state.isRegex }, false); } + public toggleSearchScope(): void { + if (this._state.searchScope) { + this._state.change({ searchScope: null }, true); + } else { + let selection = this._editor.getSelection(); + if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { + selection = selection.setEndPosition(selection.endLineNumber - 1, 1); + } + if (!selection.isEmpty()) { + this._state.change({ searchScope: selection }, true); + } + } + } + public setSearchString(searchString: string): void { this._state.change({ searchString: searchString }, false); } @@ -191,7 +235,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd }; // Consider editor selection and overwrite the state with it - if (opts.seedSearchStringFromSelection) { + if (opts.seedSearchStringFromSelection && this._editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection) { let selectionSearchString = this.getSelectionSearchString(); if (selectionSearchString) { if (this._state.isRegex) { @@ -462,11 +506,21 @@ export class StartFindReplaceAction extends EditorAction { } let controller = CommonFindController.get(editor); + let currentSelection = editor.getSelection(); + // we only seed search string from selection when the current selection is single line and not empty. + let seedSearchStringFromSelection = !currentSelection.isEmpty() && + currentSelection.startLineNumber === currentSelection.endLineNumber; + let oldSearchString = controller.getState().searchString; + // if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input + // is still empty, so we should focus the Find Input instead of Replace Input. + let shouldFocus = (!!oldSearchString || seedSearchStringFromSelection) ? + FindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput; + if (controller) { controller.start({ forceRevealReplace: true, - seedSearchStringFromSelection: true, - shouldFocus: FindStartFocusAction.FocusReplaceInput, + seedSearchStringFromSelection: seedSearchStringFromSelection, + shouldFocus: shouldFocus, shouldAnimate: true }); } @@ -561,7 +615,7 @@ export abstract class SelectNextFindMatchAction extends EditorAction { let allSelections = editor.getSelections(); let lastAddedSelection = allSelections[allSelections.length - 1]; - let nextMatch = editor.getModel().findNextMatch(r.searchText, lastAddedSelection.getEndPosition(), false, r.matchCase, r.wholeWord, false); + let nextMatch = editor.getModel().findNextMatch(r.searchText, lastAddedSelection.getEndPosition(), false, r.matchCase, r.wholeWord ? editor.getConfiguration().wordSeparators : null, false); if (!nextMatch) { return null; @@ -588,7 +642,7 @@ export abstract class SelectPreviousFindMatchAction extends EditorAction { let allSelections = editor.getSelections(); let lastAddedSelection = allSelections[allSelections.length - 1]; - let previousMatch = editor.getModel().findPreviousMatch(r.searchText, lastAddedSelection.getStartPosition(), false, r.matchCase, r.wholeWord, false); + let previousMatch = editor.getModel().findPreviousMatch(r.searchText, lastAddedSelection.getStartPosition(), false, r.matchCase, r.wholeWord ? editor.getConfiguration().wordSeparators : null, false); if (!previousMatch) { return null; @@ -760,16 +814,31 @@ export class MoveSelectionToPreviousFindMatchAction extends SelectPreviousFindMa export abstract class AbstractSelectHighlightsAction extends EditorAction { public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - let r = multiCursorFind(editor, { - changeFindSearchString: true, - allowMultiline: true, - highlightFindOptions: true - }); - if (!r) { - return; + let controller = CommonFindController.get(editor); + if (!controller) { + return null; } - let matches = editor.getModel().findMatches(r.searchText, true, false, r.matchCase, r.wholeWord, false).map(m => m.range); + let matches: Range[] = null; + + const findState = controller.getState(); + if (findState.isRevealed && findState.isRegex && findState.searchString.length > 0) { + + matches = editor.getModel().findMatches(findState.searchString, true, findState.isRegex, findState.matchCase, findState.wholeWord ? editor.getConfiguration().wordSeparators : null, false).map(m => m.range); + + } else { + + let r = multiCursorFind(editor, { + changeFindSearchString: true, + allowMultiline: true, + highlightFindOptions: true + }); + if (!r) { + return; + } + + matches = editor.getModel().findMatches(r.searchText, true, false, r.matchCase, r.wholeWord ? editor.getConfiguration().wordSeparators : null, false).map(m => m.range); + } if (matches.length > 0) { let editorSelection = editor.getSelection(); @@ -824,32 +893,74 @@ export class CompatChangeAll extends AbstractSelectHighlightsAction { } } +class SelectionHighlighterState { + public readonly lastWordUnderCursor: Selection; + public readonly searchText: string; + public readonly matchCase: boolean; + public readonly wordSeparators: string; + + constructor(lastWordUnderCursor: Selection, searchText: string, matchCase: boolean, wordSeparators: string) { + this.searchText = searchText; + this.matchCase = matchCase; + this.wordSeparators = wordSeparators; + } + + /** + * Everything equals except for `lastWordUnderCursor` + */ + public static softEquals(a: SelectionHighlighterState, b: SelectionHighlighterState): boolean { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return ( + a.searchText === b.searchText + && a.matchCase === b.matchCase + && a.wordSeparators === b.wordSeparators + ); + } +} + @commonEditorContribution export class SelectionHighlighter extends Disposable implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.selectionHighlighter'; private editor: editorCommon.ICommonCodeEditor; + private _isEnabled: boolean; private decorations: string[]; private updateSoon: RunOnceScheduler; - private lastWordUnderCursor: Range; + private state: SelectionHighlighterState; constructor(editor: editorCommon.ICommonCodeEditor) { super(); this.editor = editor; + this._isEnabled = editor.getConfiguration().contribInfo.selectionHighlight; this.decorations = []; this.updateSoon = this._register(new RunOnceScheduler(() => this._update(), 300)); - this.lastWordUnderCursor = null; + this.state = null; + this._register(editor.onDidChangeConfiguration((e) => { + this._isEnabled = editor.getConfiguration().contribInfo.selectionHighlight; + })); this._register(editor.onDidChangeCursorSelection((e: ICursorSelectionChangedEvent) => { + + if (!this._isEnabled) { + // Early exit if nothing needs to be done! + // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) + return; + } + if (e.selection.isEmpty()) { if (e.reason === CursorChangeReason.Explicit) { - if (!this.lastWordUnderCursor || !this.lastWordUnderCursor.containsPosition(e.selection.getStartPosition())) { + if (this.state && (!this.state.lastWordUnderCursor || !this.state.lastWordUnderCursor.containsPosition(e.selection.getStartPosition()))) { // no longer valid - this.removeDecorations(); + this._setState(null); } this.updateSoon.schedule(); } else { - this.removeDecorations(); + this._setState(null); } } else { @@ -857,7 +968,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd } })); this._register(editor.onDidChangeModel((e) => { - this.removeDecorations(); + this._setState(null); })); this._register(CommonFindController.get(editor).getState().addChangeListener((e) => { this._update(); @@ -868,73 +979,63 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd return SelectionHighlighter.ID; } - private removeDecorations(): void { - this.lastWordUnderCursor = null; - if (this.decorations.length > 0) { - this.decorations = this.editor.deltaDecorations(this.decorations, []); - } + private _update(): void { + this._setState(SelectionHighlighter._createState(this._isEnabled, this.editor)); } - private _update(): void { - const model = this.editor.getModel(); + private static _createState(isEnabled: boolean, editor: editorCommon.ICommonCodeEditor): SelectionHighlighterState { + const model = editor.getModel(); if (!model) { - return; + return null; } - const config = this.editor.getConfiguration(); + const config = editor.getConfiguration(); - this.lastWordUnderCursor = null; - if (!config.contribInfo.selectionHighlight) { - this.removeDecorations(); - return; + let lastWordUnderCursor: Selection = null; + if (!isEnabled) { + return null; } - let r = multiCursorFind(this.editor, { + const r = multiCursorFind(editor, { changeFindSearchString: false, allowMultiline: false, highlightFindOptions: false }); if (!r) { - this.removeDecorations(); - return; + return null; } - let hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); if (r.currentMatch) { // This is an empty selection if (hasFindOccurences) { // Do not interfere with semantic word highlighting in the no selection case - this.removeDecorations(); - return; + return null; } if (!config.contribInfo.occurrencesHighlight) { - this.removeDecorations(); - return; + return null; } - this.lastWordUnderCursor = r.currentMatch; + lastWordUnderCursor = r.currentMatch; } if (/^[ \t]+$/.test(r.searchText)) { // whitespace only selection - this.removeDecorations(); - return; + return null; } if (r.searchText.length > 200) { // very long selection - this.removeDecorations(); - return; + return null; } - const controller = CommonFindController.get(this.editor); + const controller = CommonFindController.get(editor); if (!controller) { - this.removeDecorations(); - return; + return null; } const findState = controller.getState(); const caseSensitive = findState.matchCase; - let selections = this.editor.getSelections(); + const selections = editor.getSelections(); let firstSelectedText = model.getValueInRange(selections[0]); if (!caseSensitive) { firstSelectedText = firstSelectedText.toLowerCase(); @@ -946,28 +1047,48 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd } if (firstSelectedText !== selectedText) { // not all selections have the same text - this.removeDecorations(); - return; + return null; } } + return new SelectionHighlighterState(lastWordUnderCursor, r.searchText, r.matchCase, r.wholeWord ? editor.getConfiguration().wordSeparators : null); + } - let allMatches = model.findMatches(r.searchText, true, false, r.matchCase, r.wholeWord, false).map(m => m.range); + + private _setState(state: SelectionHighlighterState): void { + if (SelectionHighlighterState.softEquals(this.state, state)) { + this.state = state; + return; + } + this.state = state; + + if (!this.state) { + if (this.decorations.length > 0) { + this.decorations = this.editor.deltaDecorations(this.decorations, []); + } + return; + } + + const model = this.editor.getModel(); + const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + + let allMatches = model.findMatches(this.state.searchText, true, false, this.state.matchCase, this.state.wordSeparators, false).map(m => m.range); allMatches.sort(Range.compareRangesUsingStarts); + let selections = this.editor.getSelections(); selections.sort(Range.compareRangesUsingStarts); // do not overlap with selection (issue #64 and #512) let matches: Range[] = []; for (let i = 0, j = 0, len = allMatches.length, lenJ = selections.length; i < len;) { - let match = allMatches[i]; + const match = allMatches[i]; if (j >= lenJ) { // finished all editor selections matches.push(match); i++; } else { - let cmp = Range.compareRangesUsingStarts(match, selections[j]); + const cmp = Range.compareRangesUsingStarts(match, selections[j]); if (cmp < 0) { // match is before sel matches.push(match); @@ -983,27 +1104,34 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd } } - let decorations = matches.map(r => { + const decorations = matches.map(r => { return { range: r, - options: { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'selectionHighlight', - // Show in overviewRuler only if model has no semantic highlighting - overviewRuler: (hasFindOccurences ? undefined : { - color: '#A0A0A0', - darkColor: '#A0A0A0', - position: editorCommon.OverviewRulerLane.Center - }) - } + // Show in overviewRuler only if model has no semantic highlighting + options: (hasFindOccurences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) }; }); this.decorations = this.editor.deltaDecorations(this.decorations, decorations); } + private static _SELECTION_HIGHLIGHT_OVERVIEW = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'selectionHighlight', + overviewRuler: { + color: '#A0A0A0', + darkColor: '#A0A0A0', + position: editorCommon.OverviewRulerLane.Center + } + }); + + private static _SELECTION_HIGHLIGHT = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'selectionHighlight', + }); + public dispose(): void { - this.removeDecorations(); + this._setState(null); super.dispose(); } } @@ -1064,6 +1192,20 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({ } })); +CommonEditorRegistry.registerEditorCommand(new FindCommand({ + id: FIND_IDS.ToggleSearchScopeCommand, + precondition: null, + handler: x => x.toggleSearchScope(), + kbOpts: { + weight: CommonEditorRegistry.commandWeight(5), + kbExpr: EditorContextKeys.focus, + primary: ToggleSearchScopeKeybinding.primary, + mac: ToggleSearchScopeKeybinding.mac, + win: ToggleSearchScopeKeybinding.win, + linux: ToggleSearchScopeKeybinding.linux + } +})); + CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ReplaceOneAction, precondition: CONTEXT_FIND_WIDGET_VISIBLE, diff --git a/src/vs/editor/contrib/find/common/findDecorations.ts b/src/vs/editor/contrib/find/common/findDecorations.ts index 599e3d04c27..4cf3d631284 100644 --- a/src/vs/editor/contrib/find/common/findDecorations.ts +++ b/src/vs/editor/contrib/find/common/findDecorations.ts @@ -8,6 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class FindDecorations implements IDisposable { @@ -105,7 +106,7 @@ export class FindDecorations implements IDisposable { } if (newCurrentDecorationId !== null) { let rng = this._editor.getModel().getDecorationRange(newCurrentDecorationId); - this._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations.createRangeHighlightDecoration()); + this._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations._RANGE_HIGHLIGHT_DECORATION); } }); } @@ -123,7 +124,7 @@ export class FindDecorations implements IDisposable { if (findScope) { newDecorations.unshift({ range: findScope, - options: FindDecorations.createFindScopeDecorationOptions() + options: FindDecorations._FIND_SCOPE_DECORATION }); } let tmpDecorations = this._editor.deltaDecorations(this._allDecorations(), newDecorations); @@ -150,30 +151,40 @@ export class FindDecorations implements IDisposable { return result; } - private static createFindMatchDecorationOptions(isCurrent: boolean): editorCommon.IModelDecorationOptions { - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: isCurrent ? 'currentFindMatch' : 'findMatch', - overviewRuler: { - color: 'rgba(246, 185, 77, 0.7)', - darkColor: 'rgba(246, 185, 77, 0.7)', - position: editorCommon.OverviewRulerLane.Center - } - }; + private static createFindMatchDecorationOptions(isCurrent: boolean): ModelDecorationOptions { + return (isCurrent ? this._CURRENT_FIND_MATCH_DECORATION : this._FIND_MATCH_DECORATION); } - private static createRangeHighlightDecoration(): editorCommon.IModelDecorationOptions { - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'rangeHighlight', - isWholeLine: true - }; - } + private static _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'currentFindMatch', + showIfCollapsed: true, + overviewRuler: { + color: 'rgba(246, 185, 77, 0.7)', + darkColor: 'rgba(246, 185, 77, 0.7)', + position: editorCommon.OverviewRulerLane.Center + } + }); - private static createFindScopeDecorationOptions(): editorCommon.IModelDecorationOptions { - return { - className: 'findScope', - isWholeLine: true - }; - } + private static _FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'findMatch', + showIfCollapsed: true, + overviewRuler: { + color: 'rgba(246, 185, 77, 0.7)', + darkColor: 'rgba(246, 185, 77, 0.7)', + position: editorCommon.OverviewRulerLane.Center + } + }); + + private static _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'rangeHighlight', + isWholeLine: true + }); + + private static _FIND_SCOPE_DECORATION = ModelDecorationOptions.register({ + className: 'findScope', + isWholeLine: true + }); } diff --git a/src/vs/editor/contrib/find/common/findModel.ts b/src/vs/editor/contrib/find/common/findModel.ts index a21568981d2..ed888ad922a 100644 --- a/src/vs/editor/contrib/find/common/findModel.ts +++ b/src/vs/editor/contrib/find/common/findModel.ts @@ -33,6 +33,10 @@ export const ToggleRegexKeybinding: IKeybindings = { primary: KeyMod.Alt | KeyCode.KEY_R, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_R } }; +export const ToggleSearchScopeKeybinding: IKeybindings = { + primary: KeyMod.Alt | KeyCode.KEY_L, + mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_L } +}; export const ShowPreviousFindTermKeybinding: IKeybindings = { primary: KeyMod.Alt | KeyCode.UpArrow }; @@ -55,6 +59,7 @@ export const FIND_IDS = { ToggleCaseSensitiveCommand: 'toggleFindCaseSensitive', ToggleWholeWordCommand: 'toggleFindWholeWord', ToggleRegexCommand: 'toggleFindRegex', + ToggleSearchScopeCommand: 'toggleFindInSelection', ReplaceOneAction: 'editor.action.replaceOne', ReplaceAllAction: 'editor.action.replaceAll', SelectAllMatchesAction: 'editor.action.selectAllMatches', @@ -230,7 +235,7 @@ export class FindModelBoundToEditorModel { let position = new Position(lineNumber, column); - let prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord, false); + let prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null, false); if (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) { // Looks like we're stuck at this position, unacceptable! @@ -252,7 +257,7 @@ export class FindModelBoundToEditorModel { } position = new Position(lineNumber, column); - prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord, false); + prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null, false); } if (!prevMatch) { @@ -272,13 +277,13 @@ export class FindModelBoundToEditorModel { } private _moveToNextMatch(after: Position): void { - let nextMatch = this._getNextMatch(after, false); + let nextMatch = this._getNextMatch(after, false, true); if (nextMatch) { this._setCurrentFindMatch(nextMatch.range); } } - private _getNextMatch(after: Position, captureMatches: boolean, isRecursed: boolean = false): editorCommon.FindMatch { + private _getNextMatch(after: Position, captureMatches: boolean, forceMove: boolean, isRecursed: boolean = false): editorCommon.FindMatch { if (this._cannotFind()) { return null; } @@ -301,9 +306,9 @@ export class FindModelBoundToEditorModel { let position = new Position(lineNumber, column); - let nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord, captureMatches); + let nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null, captureMatches); - if (nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) { + if (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) { // Looks like we're stuck at this position, unacceptable! let isUsingLineStops = this._state.isRegex && ( @@ -323,7 +328,7 @@ export class FindModelBoundToEditorModel { } position = new Position(lineNumber, column); - nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord, captureMatches); + nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null, captureMatches); } if (!nextMatch) { @@ -332,7 +337,7 @@ export class FindModelBoundToEditorModel { } if (!isRecursed && !searchRange.containsRange(nextMatch.range)) { - return this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, true); + return this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true); } return nextMatch; @@ -356,7 +361,7 @@ export class FindModelBoundToEditorModel { let replacePattern = this._getReplacePattern(); let selection = this._editor.getSelection(); - let nextMatch = this._getNextMatch(selection.getStartPosition(), replacePattern.hasReplacementPatterns); + let nextMatch = this._getNextMatch(selection.getStartPosition(), replacePattern.hasReplacementPatterns, false); if (nextMatch) { if (selection.equalsRange(nextMatch.range)) { // selection sits on a find match => replace it! @@ -377,7 +382,7 @@ export class FindModelBoundToEditorModel { private _findMatches(findScope: Range, captureMatches: boolean, limitResultCount: number): editorCommon.FindMatch[] { let searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), this._state.isReplaceRevealed, findScope); - return this._editor.getModel().findMatches(this._state.searchString, searchRange, this._state.isRegex, this._state.matchCase, this._state.wholeWord, captureMatches, limitResultCount); + return this._editor.getModel().findMatches(this._state.searchString, searchRange, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null, captureMatches, limitResultCount); } public replaceAll(): void { @@ -398,7 +403,7 @@ export class FindModelBoundToEditorModel { } private _largeReplaceAll(): void { - const searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord); + const searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().wordSeparators : null); const searchData = searchParams.parseSearchRequest(); if (!searchData) { return; @@ -463,7 +468,9 @@ export class FindModelBoundToEditorModel { private _executeEditorCommand(source: string, command: editorCommon.ICommand): void { try { this._ignoreModelContentChanged = true; + this._editor.pushUndoStop(); this._editor.executeCommand(source, command); + this._editor.pushUndoStop(); } finally { this._ignoreModelContentChanged = false; } diff --git a/src/vs/editor/contrib/find/test/common/findController.test.ts b/src/vs/editor/contrib/find/test/common/findController.test.ts index 949fbc5632e..aa2fb4de23d 100644 --- a/src/vs/editor/contrib/find/test/common/findController.test.ts +++ b/src/vs/editor/contrib/find/test/common/findController.test.ts @@ -11,7 +11,7 @@ import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; import { Range } from 'vs/editor/common/core/range'; -import { EndOfLineSequence, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { EndOfLineSequence, ICommonCodeEditor, Handler } from 'vs/editor/common/editorCommon'; import { CommonFindController, FindStartFocusAction, IFindStartOptions, NextMatchFindAction, StartFindAction, SelectHighlightsAction, @@ -20,6 +20,8 @@ import { import { MockCodeEditor, withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import { HistoryNavigator } from 'vs/base/common/history'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { Delayer } from 'vs/base/common/async'; class TestFindController extends CommonFindController { @@ -30,8 +32,8 @@ class TestFindController extends CommonFindController { private _delayedUpdateHistoryEvent: Emitter = new Emitter(); - constructor(editor: ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { - super(editor, contextKeyService); + constructor(editor: ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @IStorageService storageService: IStorageService) { + super(editor, contextKeyService, storageService); this._updateHistoryDelayer = new Delayer(50); } @@ -66,11 +68,18 @@ class TestFindController extends CommonFindController { } } -suite('FindController', () => { +function fromRange(rng: Range): number[] { + return [rng.startLineNumber, rng.startColumn, rng.endLineNumber, rng.endColumn]; +} - function fromRange(rng: Range): number[] { - return [rng.startLineNumber, rng.startColumn, rng.endLineNumber, rng.endColumn]; - } +suite('FindController', () => { + let queryState: { [key: string]: any; } = {}; + let serviceCollection = new ServiceCollection(); + serviceCollection.set(IStorageService, { + get: (key: string) => queryState[key], + getBoolean: (key: string) => !!queryState[key], + store: (key: string, value: any) => { queryState[key] = value; } + }); test('issue #1857: F3, Find Next, acts like "Find Under Cursor"', () => { withMockCodeEditor([ @@ -78,7 +87,7 @@ suite('FindController', () => { 'ABC', 'XYZ', 'ABC' - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { // The cursor is at the very top, of the file, at the first ABC let findController = editor.registerAndInstantiateContribution(TestFindController); @@ -133,7 +142,7 @@ suite('FindController', () => { test('issue #3090: F3 does not loop with two matches on a single line', () => { withMockCodeEditor([ 'import nls = require(\'vs/nls\');' - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); let nextMatchFindAction = new NextMatchFindAction(); @@ -158,7 +167,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); let startFindAction = new StartFindAction(); @@ -184,7 +193,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); let selectHighlightsAction = new SelectHighlightsAction(); @@ -206,12 +215,39 @@ suite('FindController', () => { }); }); + test('issue #5400: "Select All Occurences of Find Match" does not select all if find uses regex', () => { + withMockCodeEditor([ + 'something', + 'someething', + 'someeething', + 'nothing' + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + + let findController = editor.registerAndInstantiateContribution(TestFindController); + let selectHighlightsAction = new SelectHighlightsAction(); + + editor.setSelection(new Selection(1, 1, 1, 1)); + findController.getState().change({ searchString: 'some+thing', isRegex: true, isRevealed: true }, false); + + selectHighlightsAction.run(null, editor); + assert.deepEqual(editor.getSelections().map(fromRange), [ + [1, 1, 1, 10], + [2, 1, 2, 11], + [3, 1, 3, 12], + ]); + + assert.equal(findController.getState().searchString, 'some+thing'); + + findController.dispose(); + }); + }); + test('issue #9043: Clear search scope when find widget is hidden', () => { withMockCodeEditor([ 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.start({ @@ -239,7 +275,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.getState().change({ searchString: '1' }, false); @@ -255,7 +291,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.delayUpdateHistory = true; @@ -275,7 +311,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.getState().change({ searchString: '1' }, false); @@ -292,7 +328,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.getState().change({ searchString: '1' }, false); @@ -309,7 +345,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.getState().change({ searchString: '1' }, false); @@ -329,7 +365,7 @@ suite('FindController', () => { 'var x = (3 * 5)', 'var y = (3 * 5)', 'var z = (3 * 5)', - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); findController.getState().change({ searchString: '1' }, false); @@ -355,7 +391,7 @@ suite('FindController', () => { 'rty', 'qwe', 'rty' - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); let addSelectionToNextFindMatch = new AddSelectionToNextFindMatchAction(); @@ -376,6 +412,53 @@ suite('FindController', () => { }); }); + test('issue #6661: AddSelectionToNextFindMatchAction can work with touching ranges', () => { + withMockCodeEditor([ + 'abcabc', + 'abc', + 'abcabc', + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + + let findController = editor.registerAndInstantiateContribution(TestFindController); + let addSelectionToNextFindMatch = new AddSelectionToNextFindMatchAction(); + + editor.setSelection(new Selection(1, 1, 1, 4)); + + addSelectionToNextFindMatch.run(null, editor); + assert.deepEqual(editor.getSelections().map(fromRange), [ + [1, 1, 1, 4], + [1, 4, 1, 7] + ]); + + addSelectionToNextFindMatch.run(null, editor); + addSelectionToNextFindMatch.run(null, editor); + addSelectionToNextFindMatch.run(null, editor); + assert.deepEqual(editor.getSelections().map(fromRange), [ + [1, 1, 1, 4], + [1, 4, 1, 7], + [2, 1, 2, 4], + [3, 1, 3, 4], + [3, 4, 3, 7] + ]); + + editor.trigger('test', Handler.Type, { text: 'z' }); + assert.deepEqual(editor.getSelections().map(fromRange), [ + [1, 2, 1, 2], + [1, 3, 1, 3], + [2, 2, 2, 2], + [3, 2, 3, 2], + [3, 3, 3, 3] + ]); + assert.equal(editor.getValue(), [ + 'zz', + 'z', + 'zz', + ].join('\n')); + + findController.dispose(); + }); + }); + test('issue #23541: Multiline Ctrl+D does not work in CRLF files', () => { withMockCodeEditor([ '', @@ -387,7 +470,7 @@ suite('FindController', () => { 'rty', 'qwe', 'rty' - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { editor.getModel().setEOL(EndOfLineSequence.CRLF); @@ -413,7 +496,7 @@ suite('FindController', () => { test('issue #18111: Regex replace with single space replaces with no space', () => { withMockCodeEditor([ 'HRESULT OnAmbientPropertyChange(DISPID dispid);' - ], {}, (editor, cursor) => { + ], { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); @@ -435,6 +518,33 @@ suite('FindController', () => { }); }); + test('issue #24714: Regular expression with ^ in search & replace', () => { + withMockCodeEditor([ + '', + 'line2', + 'line3' + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + + let findController = editor.registerAndInstantiateContribution(TestFindController); + + let startFindAction = new StartFindAction(); + startFindAction.run(null, editor); + + findController.getState().change({ searchString: '^', replaceString: 'x', isRegex: true }, false); + findController.moveToNextMatch(); + + assert.deepEqual(editor.getSelections().map(fromRange), [ + [2, 1, 2, 1] + ]); + + findController.replace(); + + assert.deepEqual(editor.getValue(), '\nxline2\nline3'); + + findController.dispose(); + }); + }); + function toArray(historyNavigator: HistoryNavigator): string[] { let result = []; historyNavigator.first(); @@ -447,7 +557,7 @@ suite('FindController', () => { } function testAddSelectionToNextFindMatchAction(text: string[], callback: (editor: MockCodeEditor, action: AddSelectionToNextFindMatchAction, findController: TestFindController) => void): void { - withMockCodeEditor(text, {}, (editor, cursor) => { + withMockCodeEditor(text, { serviceCollection: serviceCollection }, (editor, cursor) => { let findController = editor.registerAndInstantiateContribution(TestFindController); @@ -677,3 +787,85 @@ suite('FindController', () => { }); }); }); + +suite('FindController query options persistence', () => { + let queryState: { [key: string]: any; } = {}; + queryState['editor.isRegex'] = false; + queryState['editor.matchCase'] = false; + queryState['editor.wholeWord'] = false; + let serviceCollection = new ServiceCollection(); + serviceCollection.set(IStorageService, { + get: (key: string) => queryState[key], + getBoolean: (key: string) => !!queryState[key], + store: (key: string, value: any) => { queryState[key] = value; } + }); + + test('matchCase', () => { + withMockCodeEditor([ + 'abc', + 'ABC', + 'XYZ', + 'ABC' + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + queryState = { 'editor.isRegex': false, 'editor.matchCase': true, 'editor.wholeWord': false }; + // The cursor is at the very top, of the file, at the first ABC + let findController = editor.registerAndInstantiateContribution(TestFindController); + let findState = findController.getState(); + let startFindAction = new StartFindAction(); + + // I hit Ctrl+F to show the Find dialog + startFindAction.run(null, editor); + + // I type ABC. + findState.change({ searchString: 'ABC' }, true); + // The second ABC is highlighted as matchCase is true. + assert.deepEqual(fromRange(editor.getSelection()), [2, 1, 2, 4]); + + findController.dispose(); + }); + }); + + queryState = { 'editor.isRegex': false, 'editor.matchCase': false, 'editor.wholeWord': true }; + + test('wholeWord', () => { + withMockCodeEditor([ + 'ABC', + 'AB', + 'XYZ', + 'ABC' + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + queryState = { 'editor.isRegex': false, 'editor.matchCase': false, 'editor.wholeWord': true }; + // The cursor is at the very top, of the file, at the first ABC + let findController = editor.registerAndInstantiateContribution(TestFindController); + let findState = findController.getState(); + let startFindAction = new StartFindAction(); + + // I hit Ctrl+F to show the Find dialog + startFindAction.run(null, editor); + + // I type AB. + findState.change({ searchString: 'AB' }, true); + // The second AB is highlighted as wholeWord is true. + assert.deepEqual(fromRange(editor.getSelection()), [2, 1, 2, 3]); + + findController.dispose(); + }); + }); + + test('toggling options is saved', () => { + withMockCodeEditor([ + 'ABC', + 'AB', + 'XYZ', + 'ABC' + ], { serviceCollection: serviceCollection }, (editor, cursor) => { + queryState = { 'editor.isRegex': false, 'editor.matchCase': false, 'editor.wholeWord': true }; + // The cursor is at the very top, of the file, at the first ABC + let findController = editor.registerAndInstantiateContribution(TestFindController); + findController.toggleRegex(); + assert.equal(queryState['editor.isRegex'], true); + + findController.dispose(); + }); + }); +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/find/test/common/findModel.test.ts b/src/vs/editor/contrib/find/test/common/findModel.test.ts index a4dca9c06a9..7dd3ee4ad4d 100644 --- a/src/vs/editor/contrib/find/test/common/findModel.test.ts +++ b/src/vs/editor/contrib/find/test/common/findModel.test.ts @@ -13,7 +13,7 @@ import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { FindModelBoundToEditorModel } from 'vs/editor/contrib/find/common/findModel'; import { FindReplaceState } from 'vs/editor/contrib/find/common/findState'; import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; -import { CoreCommands } from 'vs/editor/common/controller/coreCommands'; +import { CoreNavigationCommands } from 'vs/editor/common/controller/coreCommands'; suite('FindModel', () => { @@ -303,7 +303,7 @@ suite('FindModel', () => { ] ); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + editor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(6, 20) }); @@ -663,7 +663,7 @@ suite('FindModel', () => { ] ); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + editor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(6, 20) }); assertFindState( @@ -1150,7 +1150,7 @@ suite('FindModel', () => { ] ); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + editor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(6, 20) }); assertFindState( @@ -1311,7 +1311,7 @@ suite('FindModel', () => { ] ); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + editor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(6, 20) }); assertFindState( @@ -1741,7 +1741,7 @@ suite('FindModel', () => { findState.change({ searchString: 'hello(?=\\sworld)', replaceString: 'hi', isRegex: true }, false); let findModel = new FindModelBoundToEditorModel(editor, findState); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + editor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(8, 14) }); diff --git a/src/vs/editor/contrib/folding/browser/folding.css b/src/vs/editor/contrib/folding/browser/folding.css index 14c6c882bd1..fbc0462fe35 100644 --- a/src/vs/editor/contrib/folding/browser/folding.css +++ b/src/vs/editor/contrib/folding/browser/folding.css @@ -14,8 +14,17 @@ transition: opacity 0.5s; } -.monaco-editor .margin-view-overlays:hover .folding { +.monaco-editor .margin-view-overlays .folding { background-image: url('arrow-expand.svg'); +} + +.monaco-editor.hc-black .margin-view-overlays .folding, +.monaco-editor.vs-dark .margin-view-overlays .folding { + background-image: url('arrow-expand-dark.svg'); +} + +.monaco-editor .margin-view-overlays:hover .folding, +.monaco-editor.alwaysShowFoldIcons .margin-view-overlays .folding { opacity: 1; } @@ -24,11 +33,6 @@ opacity: 1; } -.monaco-editor.hc-black .margin-view-overlays:hover .folding, -.monaco-editor.vs-dark .margin-view-overlays:hover .folding { - background-image: url('arrow-expand-dark.svg'); -} - .monaco-editor.hc-black .margin-view-overlays .folding.collapsed, .monaco-editor.vs-dark .margin-view-overlays .folding.collapsed { background-image: url('arrow-collapse-dark.svg'); diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index 613db084fc2..74df9c51570 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -8,6 +8,7 @@ import * as nls from 'vs/nls'; import * as types from 'vs/base/common/types'; +import * as dom from 'vs/base/browser/dom'; import { RunOnceScheduler } from 'vs/base/common/async'; import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -35,6 +36,7 @@ export class FoldingController implements IFoldingController { private editor: ICodeEditor; private _isEnabled: boolean; + private _showFoldingControls: 'always' | 'mouseover'; private globalToDispose: IDisposable[]; private computeToken: number; @@ -47,6 +49,7 @@ export class FoldingController implements IFoldingController { constructor(editor: ICodeEditor) { this.editor = editor; this._isEnabled = this.editor.getConfiguration().contribInfo.folding; + this._showFoldingControls = this.editor.getConfiguration().contribInfo.showFoldingControls; this.globalToDispose = []; this.localToDispose = []; @@ -60,6 +63,11 @@ export class FoldingController implements IFoldingController { if (oldIsEnabled !== this._isEnabled) { this.onModelChanged(); } + let oldShowFoldingControls = this._showFoldingControls; + this._showFoldingControls = this.editor.getConfiguration().contribInfo.showFoldingControls; + if (oldShowFoldingControls !== this._showFoldingControls) { + this.updateHideFoldIconClass(); + } })); this.onModelChanged(); @@ -74,6 +82,13 @@ export class FoldingController implements IFoldingController { this.globalToDispose = dispose(this.globalToDispose); } + private updateHideFoldIconClass(): void { + let domNode = this.editor.getDomNode(); + if (domNode) { + dom.toggleClass(domNode, 'alwaysShowFoldIcons', this._showFoldingControls === 'always'); + } + } + /** * Store view state. */ @@ -190,6 +205,7 @@ export class FoldingController implements IFoldingController { private onModelChanged(): void { this.cleanState(); + this.updateHideFoldIconClass(); let model = this.editor.getModel(); if (!this._isEnabled || !model) { @@ -203,7 +219,16 @@ export class FoldingController implements IFoldingController { this.localToDispose.push(this.cursorChangedScheduler); this.localToDispose.push(this.editor.onDidChangeModelContent(e => this.contentChangedScheduler.schedule())); - this.localToDispose.push(this.editor.onDidChangeCursorPosition(e => this.cursorChangedScheduler.schedule())); + this.localToDispose.push(this.editor.onDidChangeCursorPosition((e) => { + + if (!this._isEnabled) { + // Early exit if nothing needs to be done! + // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) + return; + } + + this.cursorChangedScheduler.schedule(); + })); this.localToDispose.push(this.editor.onMouseDown(e => this.onEditorMouseDown(e))); this.localToDispose.push(this.editor.onMouseUp(e => this.onEditorMouseUp(e))); @@ -262,7 +287,7 @@ export class FoldingController implements IFoldingController { return; } let range = e.target.range; - if (!range || !range.isEmpty) { + if (!range) { return; } if (!e.event.leftButton) { @@ -278,7 +303,7 @@ export class FoldingController implements IFoldingController { break; case MouseTargetType.CONTENT_EMPTY: case MouseTargetType.CONTENT_TEXT: - if (range.isEmpty && range.startColumn === model.getLineMaxColumn(range.startLineNumber)) { + if (range.startColumn === model.getLineMaxColumn(range.startLineNumber)) { break; } return; @@ -297,7 +322,7 @@ export class FoldingController implements IFoldingController { let iconClicked = this.mouseDownInfo.iconClicked; let range = e.target.range; - if (!range || !range.isEmpty || range.startLineNumber !== lineNumber) { + if (!range || range.startLineNumber !== lineNumber) { return; } @@ -515,7 +540,7 @@ interface FoldingArguments { direction?: 'up' | 'down'; } -function foldingArgumentsConstraint(args) { +function foldingArgumentsConstraint(args: any) { if (!types.isUndefined(args)) { if (!types.isObject(args)) { return false; diff --git a/src/vs/editor/contrib/folding/common/folding.ts b/src/vs/editor/contrib/folding/common/folding.ts index 148fd8f6b88..c0f677cb95c 100644 --- a/src/vs/editor/contrib/folding/common/folding.ts +++ b/src/vs/editor/contrib/folding/common/folding.ts @@ -9,7 +9,7 @@ export const ID = 'editor.contrib.folding'; export interface IFoldingController extends IEditorContribution { - foldAll(); - unfoldAll(); + foldAll(): void; + unfoldAll(): void; } \ No newline at end of file diff --git a/src/vs/editor/contrib/folding/common/foldingModel.ts b/src/vs/editor/contrib/folding/common/foldingModel.ts index fe771764da6..8ebd2424cc7 100644 --- a/src/vs/editor/contrib/folding/common/foldingModel.ts +++ b/src/vs/editor/contrib/folding/common/foldingModel.ts @@ -5,6 +5,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IFoldingRange { startLineNumber: number; @@ -68,25 +69,31 @@ export class CollapsibleRegion { return null; } - private getVisualDecorationOptions(): editorCommon.IModelDecorationOptions { + private static _COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + afterContentClassName: 'inline-folded', + linesDecorationsClassName: 'folding collapsed' + }); + + private static _EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + linesDecorationsClassName: 'folding' + }); + + private getVisualDecorationOptions(): ModelDecorationOptions { if (this._isCollapsed) { - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - afterContentClassName: 'inline-folded', - linesDecorationsClassName: 'folding collapsed' - }; + return CollapsibleRegion._COLLAPSED_VISUAL_DECORATION; } else { - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - linesDecorationsClassName: 'folding' - }; + return CollapsibleRegion._EXPANDED_VISUAL_DECORATION; } } - private getRangeDecorationOptions(): editorCommon.IModelDecorationOptions { - return { - stickiness: editorCommon.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore - }; + private static _RANGE_DECORATION = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore + }); + + private getRangeDecorationOptions(): ModelDecorationOptions { + return CollapsibleRegion._RANGE_DECORATION; } public update(newRange: IFoldingRange, model: editorCommon.IModel, changeAccessor: editorCommon.IModelDecorationsChangeAccessor): void { diff --git a/src/vs/editor/contrib/folding/common/indentFoldStrategy.ts b/src/vs/editor/contrib/folding/common/indentFoldStrategy.ts index 66e7af5ffe1..39f3b5aa635 100644 --- a/src/vs/editor/contrib/folding/common/indentFoldStrategy.ts +++ b/src/vs/editor/contrib/folding/common/indentFoldStrategy.ts @@ -21,7 +21,7 @@ export function limitByIndent(ranges: IFoldingRange[], maxEntries: number): IFol return ranges; } - let indentOccurrences = []; + let indentOccurrences: number[] = []; ranges.forEach(r => { if (r.indent < 1000) { indentOccurrences[r.indent] = (indentOccurrences[r.indent] || 0) + 1; diff --git a/src/vs/editor/contrib/format/common/formatCommand.ts b/src/vs/editor/contrib/format/common/formatCommand.ts index dcf612c8d33..8a77bff13e3 100644 --- a/src/vs/editor/contrib/format/common/formatCommand.ts +++ b/src/vs/editor/contrib/format/common/formatCommand.ts @@ -17,7 +17,9 @@ export class EditOperationsCommand implements editorCommon.ICommand { if (typeof cmd._newEol === 'number') { editor.getModel().setEOL(cmd._newEol); } + editor.pushUndoStop(); editor.executeCommand('formatEditsCommand', cmd); + editor.pushUndoStop(); } private _edits: TextEdit[]; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts b/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts new file mode 100644 index 00000000000..79d1043cf50 --- /dev/null +++ b/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts @@ -0,0 +1,205 @@ +/*--------------------------------------------------------------------------------------------- + * 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 'vs/css!./goToDeclarationMouse'; +import { KeyCode } from 'vs/base/common/keyCodes'; +import * as browser from 'vs/base/browser/browser'; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { ICodeEditor, IEditorMouseEvent, IMouseTarget } from 'vs/editor/browser/editorBrowser'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import Event, { Emitter } from 'vs/base/common/event'; +import * as platform from 'vs/base/common/platform'; + +function hasModifier(e: { ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean }, modifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey'): boolean { + return !!e[modifier]; +} + +/** + * An event that encapsulates the various trigger modifiers logic needed for go to definition. + */ +export class ClickLinkMouseEvent { + + public readonly target: IMouseTarget; + public readonly hasTriggerModifier: boolean; + public readonly hasSideBySideModifier: boolean; + public readonly isNoneOrSingleMouseDown: boolean; + + constructor(source: IEditorMouseEvent, opts: ClickLinkOptions) { + this.target = source.target; + this.hasTriggerModifier = hasModifier(source.event, opts.triggerModifier); + this.hasSideBySideModifier = hasModifier(source.event, opts.triggerSideBySideModifier); + this.isNoneOrSingleMouseDown = (browser.isIE || source.event.detail <= 1); // IE does not support event.detail properly + } +} + +/** + * An event that encapsulates the various trigger modifiers logic needed for go to definition. + */ +export class ClickLinkKeyboardEvent { + + public readonly keyCodeIsTriggerKey: boolean; + public readonly keyCodeIsSideBySideKey: boolean; + public readonly hasTriggerModifier: boolean; + + constructor(source: IKeyboardEvent, opts: ClickLinkOptions) { + this.keyCodeIsTriggerKey = (source.keyCode === opts.triggerKey); + this.keyCodeIsSideBySideKey = (source.keyCode === opts.triggerSideBySideKey); + this.hasTriggerModifier = hasModifier(source, opts.triggerModifier); + } +} + +export class ClickLinkOptions { + + public readonly triggerKey: KeyCode; + public readonly triggerModifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey'; + public readonly triggerSideBySideKey: KeyCode; + public readonly triggerSideBySideModifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey'; + + constructor( + triggerKey: KeyCode, + triggerModifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey', + triggerSideBySideKey: KeyCode, + triggerSideBySideModifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey' + ) { + this.triggerKey = triggerKey; + this.triggerModifier = triggerModifier; + this.triggerSideBySideKey = triggerSideBySideKey; + this.triggerSideBySideModifier = triggerSideBySideModifier; + } + + public equals(other: ClickLinkOptions): boolean { + return ( + this.triggerKey === other.triggerKey + && this.triggerModifier === other.triggerModifier + && this.triggerSideBySideKey === other.triggerSideBySideKey + && this.triggerSideBySideModifier === other.triggerSideBySideModifier + ); + } +} + +function createOptions(multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'): ClickLinkOptions { + if (multicursorModifier === 'altKey') { + if (platform.isMacintosh) { + return new ClickLinkOptions(KeyCode.Meta, 'metaKey', KeyCode.Alt, 'altKey'); + } + return new ClickLinkOptions(KeyCode.Ctrl, 'ctrlKey', KeyCode.Alt, 'altKey'); + } + + if (platform.isMacintosh) { + return new ClickLinkOptions(KeyCode.Alt, 'altKey', KeyCode.Meta, 'metaKey'); + } + return new ClickLinkOptions(KeyCode.Alt, 'altKey', KeyCode.Ctrl, 'ctrlKey'); +} + +export class ClickLinkGesture extends Disposable { + + private readonly _onMouseMoveOrRelevantKeyDown: Emitter<[ClickLinkMouseEvent, ClickLinkKeyboardEvent]> = this._register(new Emitter<[ClickLinkMouseEvent, ClickLinkKeyboardEvent]>()); + public readonly onMouseMoveOrRelevantKeyDown: Event<[ClickLinkMouseEvent, ClickLinkKeyboardEvent]> = this._onMouseMoveOrRelevantKeyDown.event; + + private readonly _onExecute: Emitter = this._register(new Emitter()); + public readonly onExecute: Event = this._onExecute.event; + + private readonly _onCancel: Emitter = this._register(new Emitter()); + public readonly onCancel: Event = this._onCancel.event; + + private readonly _editor: ICodeEditor; + private _opts: ClickLinkOptions; + + private lastMouseMoveEvent: ClickLinkMouseEvent; + private hasTriggerKeyOnMouseDown: boolean; + + constructor(editor: ICodeEditor) { + super(); + + this._editor = editor; + this._opts = createOptions(this._editor.getConfiguration().multicursorModifier); + + this.lastMouseMoveEvent = null; + this.hasTriggerKeyOnMouseDown = false; + + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.multicursorModifier) { + const newOpts = createOptions(this._editor.getConfiguration().multicursorModifier); + if (this._opts.equals(newOpts)) { + return; + } + this._opts = newOpts; + this.lastMouseMoveEvent = null; + this.hasTriggerKeyOnMouseDown = false; + this._onCancel.fire(); + } + })); + this._register(this._editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onMouseDown((e: IEditorMouseEvent) => this.onEditorMouseDown(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onMouseUp((e: IEditorMouseEvent) => this.onEditorMouseUp(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(new ClickLinkKeyboardEvent(e, this._opts)))); + this._register(this._editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(new ClickLinkKeyboardEvent(e, this._opts)))); + this._register(this._editor.onMouseDrag(() => this.resetHandler())); + + this._register(this._editor.onDidChangeCursorSelection((e) => this.onDidChangeCursorSelection(e))); + this._register(this._editor.onDidChangeModel((e) => this.resetHandler())); + this._register(this._editor.onDidChangeModelContent(() => this.resetHandler())); + this._register(this._editor.onDidScrollChange((e) => { + if (e.scrollTopChanged || e.scrollLeftChanged) { + this.resetHandler(); + } + })); + } + + private onDidChangeCursorSelection(e: ICursorSelectionChangedEvent): void { + if (e.selection && e.selection.startColumn !== e.selection.endColumn) { + this.resetHandler(); // immediately stop this feature if the user starts to select (https://github.com/Microsoft/vscode/issues/7827) + } + } + + private onEditorMouseMove(mouseEvent: ClickLinkMouseEvent): void { + this.lastMouseMoveEvent = mouseEvent; + + this._onMouseMoveOrRelevantKeyDown.fire([mouseEvent, null]); + } + + private onEditorMouseDown(mouseEvent: ClickLinkMouseEvent): void { + // We need to record if we had the trigger key on mouse down because someone might select something in the editor + // holding the mouse down and then while mouse is down start to press Ctrl/Cmd to start a copy operation and then + // release the mouse button without wanting to do the navigation. + // With this flag we prevent goto definition if the mouse was down before the trigger key was pressed. + this.hasTriggerKeyOnMouseDown = mouseEvent.hasTriggerModifier; + } + + private onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void { + if (this.hasTriggerKeyOnMouseDown) { + this._onExecute.fire(mouseEvent); + } + } + + private onEditorKeyDown(e: ClickLinkKeyboardEvent): void { + if ( + this.lastMouseMoveEvent + && ( + e.keyCodeIsTriggerKey // User just pressed Ctrl/Cmd (normal goto definition) + || (e.keyCodeIsSideBySideKey && e.hasTriggerModifier) // User pressed Ctrl/Cmd+Alt (goto definition to the side) + ) + ) { + this._onMouseMoveOrRelevantKeyDown.fire([this.lastMouseMoveEvent, e]); + } else if (e.hasTriggerModifier) { + this._onCancel.fire(); // remove decorations if user holds another key with ctrl/cmd to prevent accident goto declaration + } + } + + private onEditorKeyUp(e: ClickLinkKeyboardEvent): void { + if (e.keyCodeIsTriggerKey) { + this._onCancel.fire(); + } + } + + private resetHandler(): void { + this.lastMouseMoveEvent = null; + this.hasTriggerKeyOnMouseDown = false; + this._onCancel.fire(); + } +} diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts index e2e84d0d951..61afed81136 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts @@ -5,623 +5,70 @@ 'use strict'; -import 'vs/css!./goToDeclaration'; -import * as nls from 'vs/nls'; -import { Throttler } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { MarkedString } from 'vs/base/common/htmlContent'; -import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; -import * as platform from 'vs/base/common/platform'; -import Severity from 'vs/base/common/severity'; +import { onUnexpectedExternalError } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as browser from 'vs/base/browser/browser'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IEditorService } from 'vs/platform/editor/common/editor'; -import { IModeService } from 'vs/editor/common/services/modeService'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { editorAction, IActionOptions, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; -import { Location, DefinitionProviderRegistry } from 'vs/editor/common/modes'; -import { ICodeEditor, IEditorMouseEvent, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; -import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; -import { ReferencesController } from 'vs/editor/contrib/referenceSearch/browser/referencesController'; -import { ReferencesModel } from 'vs/editor/contrib/referenceSearch/browser/referencesModel'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { PeekContext } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; -import { MessageController } from './messageController'; -import * as corePosition from 'vs/editor/common/core/position'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; -import { EditorState, CodeEditorStateFlag } from 'vs/editor/common/core/editorState'; +import { IReadOnlyModel } from 'vs/editor/common/editorCommon'; +import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; +import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; +import { DefinitionProviderRegistry, ImplementationProviderRegistry, TypeDefinitionProviderRegistry, Location } from 'vs/editor/common/modes'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { asWinJsPromise } from 'vs/base/common/async'; +import { Position } from 'vs/editor/common/core/position'; - -export class DefinitionActionConfig { - - constructor( - public openToSide = false, - public openInPeek = false, - public filterCurrent = true - ) { - // - } +function outputResults(promises: TPromise[]) { + return TPromise.join(promises).then(allReferences => { + let result: Location[] = []; + for (let references of allReferences) { + if (Array.isArray(references)) { + result.push(...references); + } else if (references) { + result.push(references); + } + } + return result; + }); } -export class DefinitionAction extends EditorAction { +function getDefinitions( + model: IReadOnlyModel, + position: Position, + registry: LanguageFeatureRegistry, + provide: (provider: T, model: IReadOnlyModel, position: Position, token: CancellationToken) => Location | Location[] | Thenable +): TPromise { + const provider = registry.ordered(model); - private _configuration: DefinitionActionConfig; - - constructor(configuration: DefinitionActionConfig, opts: IActionOptions) { - super(opts); - this._configuration = configuration; - } - - public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): TPromise { - const messageService = accessor.get(IMessageService); - const editorService = accessor.get(IEditorService); - - let model = editor.getModel(); - let pos = editor.getPosition(); - - return this.getDeclarationsAtPosition(model, pos).then(references => { - - // * remove falsy references - // * remove reference at the current pos - let result: Location[] = []; - for (let i = 0; i < references.length; i++) { - let reference = references[i]; - if (!reference || !reference.range) { - continue; - } - let { uri, range } = reference; - if (!this._configuration.filterCurrent - || uri.toString() !== model.uri.toString() - || !Range.containsPosition(range, pos)) { - - result.push({ - uri, - range - }); - } - } - - if (result.length === 0) { - const info = model.getWordAtPosition(pos); - MessageController.get(editor).showMessage(this.getNoResultFoundMessage(info), pos); - return; - } - - return this._onResult(editorService, editor, new ReferencesModel(result)); - - }, (err) => { - // report an error - messageService.show(Severity.Error, err); - return false; + // get results + const promises = provider.map((provider, idx) => { + return asWinJsPromise((token) => { + return provide(provider, model, position, token); + }).then(result => { + return result; + }, err => { + onUnexpectedExternalError(err); }); - } - - protected getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { - return getDefinitionsAtPosition(model, position); - } - - protected getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { - return info && info.word - ? nls.localize('noResultWord', "No definition found for '{0}'", info.word) - : nls.localize('generic.noResults', "No definition found"); - } - - protected getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.title', " – {0} definitions", model.references.length); - } - - private _onResult(editorService: IEditorService, editor: editorCommon.ICommonCodeEditor, model: ReferencesModel) { - - const msg = model.getAriaMessage(); - alert(msg); - - if (this._configuration.openInPeek) { - this._openInPeek(editorService, editor, model); - } else { - let next = model.nearestReference(editor.getModel().uri, editor.getPosition()); - this._openReference(editorService, next, this._configuration.openToSide).then(editor => { - if (editor && model.references.length > 1) { - this._openInPeek(editorService, editor, model); - } else { - model.dispose(); - } - }); - } - } - - private _openReference(editorService: IEditorService, reference: Location, sideBySide: boolean): TPromise { - let { uri, range } = reference; - return editorService.openEditor({ - resource: uri, - options: { - selection: Range.collapseToStart(range), - revealIfVisible: !sideBySide - } - }, sideBySide).then(editor => { - return editor && editor.getControl(); - }); - } - - private _openInPeek(editorService: IEditorService, target: editorCommon.ICommonCodeEditor, model: ReferencesModel) { - let controller = ReferencesController.get(target); - if (controller) { - controller.toggleWidget(target.getSelection(), TPromise.as(model), { - getMetaTitle: (model) => { - return this.getMetaTitle(model); - }, - onGoto: (reference) => { - controller.closeWidget(); - return this._openReference(editorService, reference, false); - } - }); - } else { - model.dispose(); - } - } -} - -const goToDeclarationKb = platform.isWeb - ? KeyMod.CtrlCmd | KeyCode.F12 - : KeyCode.F12; - -@editorAction -export class GoToDefinitionAction extends DefinitionAction { - - public static ID = 'editor.action.goToDeclaration'; - - constructor() { - super(new DefinitionActionConfig(), { - id: GoToDefinitionAction.ID, - label: nls.localize('actions.goToDecl.label', "Go to Definition"), - alias: 'Go to Definition', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasDefinitionProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: goToDeclarationKb - }, - menuOpts: { - group: 'navigation', - order: 1.1 - } - }); - } -} - -@editorAction -export class OpenDefinitionToSideAction extends DefinitionAction { - - public static ID = 'editor.action.openDeclarationToTheSide'; - - constructor() { - super(new DefinitionActionConfig(true), { - id: OpenDefinitionToSideAction.ID, - label: nls.localize('actions.goToDeclToSide.label', "Open Definition to the Side"), - alias: 'Open Definition to the Side', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasDefinitionProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb) - } - }); - } -} - -@editorAction -export class PeekDefinitionAction extends DefinitionAction { - constructor() { - super(new DefinitionActionConfig(void 0, true, false), { - id: 'editor.action.previewDeclaration', - label: nls.localize('actions.previewDecl.label', "Peek Definition"), - alias: 'Peek Definition', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasDefinitionProvider, - PeekContext.notInPeekEditor, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: KeyMod.Alt | KeyCode.F12, - linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 } - }, - menuOpts: { - group: 'navigation', - order: 1.2 - } - }); - } -} - -export class ImplementationAction extends DefinitionAction { - protected getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { - return getImplementationsAtPosition(model, position); - } - - protected getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { - return info && info.word - ? nls.localize('goToImplementation.noResultWord', "No implementation found for '{0}'", info.word) - : nls.localize('goToImplementation.generic.noResults', "No implementation found"); - } - - protected getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.implementations.title', " – {0} implementations", model.references.length); - } -} - -@editorAction -export class GoToImplementationAction extends ImplementationAction { - - public static ID = 'editor.action.goToImplementation'; - - constructor() { - super(new DefinitionActionConfig(), { - id: GoToImplementationAction.ID, - label: nls.localize('actions.goToImplementation.label', "Go to Implementation"), - alias: 'Go to Implementation', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasImplementationProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: KeyMod.CtrlCmd | KeyCode.F12 - }, - menuOpts: { - group: 'navigation', - order: 1.3 - } - }); - } -} - -@editorAction -export class PeekImplementationAction extends ImplementationAction { - - public static ID = 'editor.action.peekImplementation'; - - constructor() { - super(new DefinitionActionConfig(false, true, false), { - id: PeekImplementationAction.ID, - label: nls.localize('actions.peekImplementation.label', "Peek Implementation"), - alias: 'Peek Implementation', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasImplementationProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12 - } - }); - } -} - -export class TypeDefinitionAction extends DefinitionAction { - protected getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { - return getTypeDefinitionsAtPosition(model, position); - } - - protected getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { - return info && info.word - ? nls.localize('goToTypeDefinition.noResultWord', "No type definition found for '{0}'", info.word) - : nls.localize('goToTypeDefinition.generic.noResults', "No type definition found"); - } - - protected getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.typeDefinitions.title', " – {0} type definitions", model.references.length); - } -} - -@editorAction -export class GoToTypeDefintionAction extends TypeDefinitionAction { - - public static ID = 'editor.action.goToTypeDefinition'; - - constructor() { - super(new DefinitionActionConfig(), { - id: GoToTypeDefintionAction.ID, - label: nls.localize('actions.goToTypeDefinition.label', "Go to Type Definition"), - alias: 'Go to Type Definition', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasTypeDefinitionProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: 0 - }, - menuOpts: { - group: 'navigation', - order: 1.4 - } - }); - } -} - -@editorAction -export class PeekTypeDefinitionAction extends TypeDefinitionAction { - - public static ID = 'editor.action.peekTypeDefinition'; - - constructor() { - super(new DefinitionActionConfig(false, true, false), { - id: PeekTypeDefinitionAction.ID, - label: nls.localize('actions.peekTypeDefinition.label', "Peek Type Definition"), - alias: 'Peek Type Definition', - precondition: ContextKeyExpr.and( - EditorContextKeys.hasTypeDefinitionProvider, - EditorContextKeys.isInEmbeddedEditor.toNegated()), - kbOpts: { - kbExpr: EditorContextKeys.textFocus, - primary: 0 - } - }); - } + }); + return outputResults(promises); } -// --- Editor Contribution to goto definition using the mouse and a modifier key - -@editorContribution -class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { - - private static ID = 'editor.contrib.gotodefinitionwithmouse'; - static TRIGGER_MODIFIER = platform.isMacintosh ? 'metaKey' : 'ctrlKey'; - static TRIGGER_SIDEBYSIDE_KEY_VALUE = KeyCode.Alt; - static TRIGGER_KEY_VALUE = platform.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl; - static MAX_SOURCE_PREVIEW_LINES = 8; - - private editor: ICodeEditor; - private toUnhook: IDisposable[]; - private decorations: string[]; - private currentWordUnderMouse: editorCommon.IWordAtPosition; - private throttler: Throttler; - private lastMouseMoveEvent: IEditorMouseEvent; - private hasTriggerKeyOnMouseDown: boolean; - - constructor( - editor: ICodeEditor, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, - @IModeService private modeService: IModeService - ) { - this.toUnhook = []; - this.decorations = []; - this.editor = editor; - this.throttler = new Throttler(); - - this.toUnhook.push(this.editor.onMouseDown((e: IEditorMouseEvent) => this.onEditorMouseDown(e))); - this.toUnhook.push(this.editor.onMouseUp((e: IEditorMouseEvent) => this.onEditorMouseUp(e))); - this.toUnhook.push(this.editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(e))); - this.toUnhook.push(this.editor.onMouseDrag(() => this.resetHandler())); - this.toUnhook.push(this.editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e))); - this.toUnhook.push(this.editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e))); - - this.toUnhook.push(this.editor.onDidChangeCursorSelection((e) => this.onDidChangeCursorSelection(e))); - this.toUnhook.push(this.editor.onDidChangeModel((e) => this.resetHandler())); - this.toUnhook.push(this.editor.onDidChangeModelContent(() => this.resetHandler())); - this.toUnhook.push(this.editor.onDidScrollChange((e) => { - if (e.scrollTopChanged || e.scrollLeftChanged) { - this.resetHandler(); - } - })); - } - - private onDidChangeCursorSelection(e: ICursorSelectionChangedEvent): void { - if (e.selection && e.selection.startColumn !== e.selection.endColumn) { - this.resetHandler(); // immediately stop this feature if the user starts to select (https://github.com/Microsoft/vscode/issues/7827) - } - } - - private onEditorMouseMove(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): void { - this.lastMouseMoveEvent = mouseEvent; - - this.startFindDefinition(mouseEvent, withKey); - } - - private startFindDefinition(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): void { - if (!this.isEnabled(mouseEvent, withKey)) { - this.currentWordUnderMouse = null; - this.removeDecorations(); - return; - } - - // Find word at mouse position - let position = mouseEvent.target.position; - let word = position ? this.editor.getModel().getWordAtPosition(position) : null; - if (!word) { - this.currentWordUnderMouse = null; - this.removeDecorations(); - return; - } - - // Return early if word at position is still the same - if (this.currentWordUnderMouse && this.currentWordUnderMouse.startColumn === word.startColumn && this.currentWordUnderMouse.endColumn === word.endColumn && this.currentWordUnderMouse.word === word.word) { - return; - } - - this.currentWordUnderMouse = word; - - // Find definition and decorate word if found - let state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll); - - this.throttler.queue(() => { - return state.validate(this.editor) - ? this.findDefinition(mouseEvent.target) - : TPromise.as(null); - - }).then(results => { - if (!results || !results.length || !state.validate(this.editor)) { - this.removeDecorations(); - return; - } - - // Multiple results - if (results.length > 1) { - this.addDecoration(new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn), nls.localize('multipleResults', "Click to show {0} definitions.", results.length)); - } - - // Single result - else { - let result = results[0]; - - if (!result.uri) { - return; - } - - this.textModelResolverService.createModelReference(result.uri).then(ref => { - - if (!ref.object || !ref.object.textEditorModel) { - ref.dispose(); - return; - } - - const { object: { textEditorModel } } = ref; - const { startLineNumber } = result.range; - - if (textEditorModel.getLineMaxColumn(startLineNumber) === 0) { - ref.dispose(); - return; - } - - const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); - const maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionWithMouseEditorContribution.MAX_SOURCE_PREVIEW_LINES); - let endLineNumber = startLineNumber + 1; - let minIndent = startIndent; - - for (; endLineNumber < maxLineNumber; endLineNumber++) { - let endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); - minIndent = Math.min(minIndent, endIndent); - if (startIndent === endIndent) { - break; - } - } - - const previewRange = new Range(startLineNumber, 1, endLineNumber + 1, 1); - const value = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\s{${minIndent - 1}}`, 'gm'), '').trim(); - - this.addDecoration(new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn), { - language: this.modeService.getModeIdByFilenameOrFirstLine(textEditorModel.uri.fsPath), - value - }); - ref.dispose(); - }); - } - }).done(undefined, onUnexpectedError); - } - - private addDecoration(range: Range, hoverMessage: MarkedString): void { - - const newDecorations: editorCommon.IModelDeltaDecoration = { - range: range, - options: { - inlineClassName: 'goto-definition-link', - hoverMessage - } - }; - - this.decorations = this.editor.deltaDecorations(this.decorations, [newDecorations]); - } - - private removeDecorations(): void { - if (this.decorations.length > 0) { - this.decorations = this.editor.deltaDecorations(this.decorations, []); - } - } - - private onEditorKeyDown(e: IKeyboardEvent): void { - if ( - this.lastMouseMoveEvent && ( - e.keyCode === GotoDefinitionWithMouseEditorContribution.TRIGGER_KEY_VALUE || // User just pressed Ctrl/Cmd (normal goto definition) - e.keyCode === GotoDefinitionWithMouseEditorContribution.TRIGGER_SIDEBYSIDE_KEY_VALUE && e[GotoDefinitionWithMouseEditorContribution.TRIGGER_MODIFIER] // User pressed Ctrl/Cmd+Alt (goto definition to the side) - ) - ) { - this.startFindDefinition(this.lastMouseMoveEvent, e); - } else if (e[GotoDefinitionWithMouseEditorContribution.TRIGGER_MODIFIER]) { - this.removeDecorations(); // remove decorations if user holds another key with ctrl/cmd to prevent accident goto declaration - } - } - - private resetHandler(): void { - this.lastMouseMoveEvent = null; - this.hasTriggerKeyOnMouseDown = false; - this.removeDecorations(); - } - - private onEditorMouseDown(mouseEvent: IEditorMouseEvent): void { - // We need to record if we had the trigger key on mouse down because someone might select something in the editor - // holding the mouse down and then while mouse is down start to press Ctrl/Cmd to start a copy operation and then - // release the mouse button without wanting to do the navigation. - // With this flag we prevent goto definition if the mouse was down before the trigger key was pressed. - this.hasTriggerKeyOnMouseDown = !!mouseEvent.event[GotoDefinitionWithMouseEditorContribution.TRIGGER_MODIFIER]; - } - - private onEditorMouseUp(mouseEvent: IEditorMouseEvent): void { - if (this.isEnabled(mouseEvent) && this.hasTriggerKeyOnMouseDown) { - this.gotoDefinition(mouseEvent.target, mouseEvent.event.altKey).done(() => { - this.removeDecorations(); - }, (error: Error) => { - this.removeDecorations(); - onUnexpectedError(error); - }); - } - } - - private onEditorKeyUp(e: IKeyboardEvent): void { - if (e.keyCode === GotoDefinitionWithMouseEditorContribution.TRIGGER_KEY_VALUE) { - this.removeDecorations(); - this.currentWordUnderMouse = null; - } - } - - private isEnabled(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): boolean { - return this.editor.getModel() && - (browser.isIE || mouseEvent.event.detail <= 1) && // IE does not support event.detail properly - mouseEvent.target.type === MouseTargetType.CONTENT_TEXT && - (mouseEvent.event[GotoDefinitionWithMouseEditorContribution.TRIGGER_MODIFIER] || (withKey && withKey.keyCode === GotoDefinitionWithMouseEditorContribution.TRIGGER_KEY_VALUE)) && - DefinitionProviderRegistry.has(this.editor.getModel()); - } - - private findDefinition(target: IMouseTarget): TPromise { - let model = this.editor.getModel(); - if (!model) { - return TPromise.as(null); - } - - return getDefinitionsAtPosition(this.editor.getModel(), target.position); - } - - private gotoDefinition(target: IMouseTarget, sideBySide: boolean): TPromise { - - const targetAction = sideBySide - ? OpenDefinitionToSideAction.ID - : GoToDefinitionAction.ID; - - // just run the corresponding action - this.editor.setPosition(target.position); - return this.editor.getAction(targetAction).run(); - } - - public getId(): string { - return GotoDefinitionWithMouseEditorContribution.ID; - } - - public dispose(): void { - this.toUnhook = dispose(this.toUnhook); - } +export function getDefinitionsAtPosition(model: IReadOnlyModel, position: Position): TPromise { + return getDefinitions(model, position, DefinitionProviderRegistry, (provider, model, position, token) => { + return provider.provideDefinition(model, position, token); + }); } -registerThemingParticipant((theme, collector) => { - let activeLinkForeground = theme.getColor(editorActiveLinkForeground); - if (activeLinkForeground) { - collector.addRule(`.monaco-editor.${theme.selector} .goto-definition-link { color: ${activeLinkForeground} !important; }`); - } -}); +export function getImplementationsAtPosition(model: IReadOnlyModel, position: Position): TPromise { + return getDefinitions(model, position, ImplementationProviderRegistry, (provider, model, position, token) => { + return provider.provideImplementation(model, position, token); + }); +} + +export function getTypeDefinitionsAtPosition(model: IReadOnlyModel, position: Position): TPromise { + return getDefinitions(model, position, TypeDefinitionProviderRegistry, (provider, model, position, token) => { + return provider.provideTypeDefinition(model, position, token); + }); +} + +CommonEditorRegistry.registerDefaultLanguageCommand('_executeDefinitionProvider', getDefinitionsAtPosition); +CommonEditorRegistry.registerDefaultLanguageCommand('_executeImplementationProvider', getImplementationsAtPosition); +CommonEditorRegistry.registerDefaultLanguageCommand('_executeTypeDefinitionProvider', getTypeDefinitionsAtPosition); \ No newline at end of file diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts new file mode 100644 index 00000000000..7db3d8f0c5a --- /dev/null +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts @@ -0,0 +1,367 @@ +/*--------------------------------------------------------------------------------------------- + * 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 nls from 'vs/nls'; +import { alert } from 'vs/base/browser/ui/aria/aria'; +import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; +import * as platform from 'vs/base/common/platform'; +import Severity from 'vs/base/common/severity'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { IEditorService } from 'vs/platform/editor/common/editor'; +import { IMessageService } from 'vs/platform/message/common/message'; +import { Range } from 'vs/editor/common/core/range'; +import * as editorCommon from 'vs/editor/common/editorCommon'; +import { editorAction, IActionOptions, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { Location } from 'vs/editor/common/modes'; +import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from './goToDeclaration'; +import { ReferencesController } from 'vs/editor/contrib/referenceSearch/browser/referencesController'; +import { ReferencesModel } from 'vs/editor/contrib/referenceSearch/browser/referencesModel'; +import { PeekContext } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { MessageController } from './messageController'; +import * as corePosition from 'vs/editor/common/core/position'; +import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; + +export class DefinitionActionConfig { + + constructor( + public readonly openToSide = false, + public readonly openInPeek = false, + public readonly filterCurrent = true, + public readonly showMessage = true, + ) { + // + } +} + +export class DefinitionAction extends EditorAction { + + private _configuration: DefinitionActionConfig; + + constructor(configuration: DefinitionActionConfig, opts: IActionOptions) { + super(opts); + this._configuration = configuration; + } + + public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): TPromise { + const messageService = accessor.get(IMessageService); + const editorService = accessor.get(IEditorService); + + const model = editor.getModel(); + const pos = editor.getPosition(); + + return this._getDeclarationsAtPosition(model, pos).then(references => { + + if (model.isDisposed() || editor.getModel() !== model) { + // new model, no more model + return; + } + + // * remove falsy references + // * find reference at the current pos + let idxOfCurrent = -1; + let result: Location[] = []; + for (let i = 0; i < references.length; i++) { + let reference = references[i]; + if (!reference || !reference.range) { + continue; + } + let { uri, range } = reference; + let newLen = result.push({ + uri, + range + }); + if (this._configuration.filterCurrent + && uri.toString() === model.uri.toString() + && Range.containsPosition(range, pos) + && idxOfCurrent === -1 + ) { + idxOfCurrent = newLen - 1; + } + } + + if (result.length === 0) { + // no result -> show message + if (this._configuration.showMessage) { + const info = model.getWordAtPosition(pos); + MessageController.get(editor).showMessage(this._getNoResultFoundMessage(info), pos); + } + } else if (result.length === 1 && idxOfCurrent !== -1) { + // only the position at which we are -> adjust selection + let [current] = result; + this._openReference(editorService, current, false); + + } else { + // handle multile results + this._onResult(editorService, editor, new ReferencesModel(result)); + } + + }, (err) => { + // report an error + messageService.show(Severity.Error, err); + return false; + }); + } + + protected _getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { + return getDefinitionsAtPosition(model, position); + } + + protected _getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { + return info && info.word + ? nls.localize('noResultWord', "No definition found for '{0}'", info.word) + : nls.localize('generic.noResults', "No definition found"); + } + + protected _getMetaTitle(model: ReferencesModel): string { + return model.references.length > 1 && nls.localize('meta.title', " – {0} definitions", model.references.length); + } + + private _onResult(editorService: IEditorService, editor: editorCommon.ICommonCodeEditor, model: ReferencesModel) { + + const msg = model.getAriaMessage(); + alert(msg); + + if (this._configuration.openInPeek) { + this._openInPeek(editorService, editor, model); + } else { + let next = model.nearestReference(editor.getModel().uri, editor.getPosition()); + this._openReference(editorService, next, this._configuration.openToSide).then(editor => { + if (editor && model.references.length > 1) { + this._openInPeek(editorService, editor, model); + } else { + model.dispose(); + } + }); + } + } + + private _openReference(editorService: IEditorService, reference: Location, sideBySide: boolean): TPromise { + let { uri, range } = reference; + return editorService.openEditor({ + resource: uri, + options: { + selection: Range.collapseToStart(range), + revealIfVisible: !sideBySide + } + }, sideBySide).then(editor => { + return editor && editor.getControl(); + }); + } + + private _openInPeek(editorService: IEditorService, target: editorCommon.ICommonCodeEditor, model: ReferencesModel) { + let controller = ReferencesController.get(target); + if (controller) { + controller.toggleWidget(target.getSelection(), TPromise.as(model), { + getMetaTitle: (model) => { + return this._getMetaTitle(model); + }, + onGoto: (reference) => { + controller.closeWidget(); + return this._openReference(editorService, reference, false); + } + }); + } else { + model.dispose(); + } + } +} + +const goToDeclarationKb = platform.isWeb + ? KeyMod.CtrlCmd | KeyCode.F12 + : KeyCode.F12; + +@editorAction +export class GoToDefinitionAction extends DefinitionAction { + + public static ID = 'editor.action.goToDeclaration'; + + constructor() { + super(new DefinitionActionConfig(), { + id: GoToDefinitionAction.ID, + label: nls.localize('actions.goToDecl.label', "Go to Definition"), + alias: 'Go to Definition', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasDefinitionProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: goToDeclarationKb + }, + menuOpts: { + group: 'navigation', + order: 1.1 + } + }); + } +} + +@editorAction +export class OpenDefinitionToSideAction extends DefinitionAction { + + public static ID = 'editor.action.openDeclarationToTheSide'; + + constructor() { + super(new DefinitionActionConfig(true), { + id: OpenDefinitionToSideAction.ID, + label: nls.localize('actions.goToDeclToSide.label', "Open Definition to the Side"), + alias: 'Open Definition to the Side', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasDefinitionProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb) + } + }); + } +} + +@editorAction +export class PeekDefinitionAction extends DefinitionAction { + constructor() { + super(new DefinitionActionConfig(void 0, true, false), { + id: 'editor.action.previewDeclaration', + label: nls.localize('actions.previewDecl.label', "Peek Definition"), + alias: 'Peek Definition', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasDefinitionProvider, + PeekContext.notInPeekEditor, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: KeyMod.Alt | KeyCode.F12, + linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 } + }, + menuOpts: { + group: 'navigation', + order: 1.2 + } + }); + } +} + +export class ImplementationAction extends DefinitionAction { + protected _getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { + return getImplementationsAtPosition(model, position); + } + + protected _getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { + return info && info.word + ? nls.localize('goToImplementation.noResultWord', "No implementation found for '{0}'", info.word) + : nls.localize('goToImplementation.generic.noResults', "No implementation found"); + } + + protected _getMetaTitle(model: ReferencesModel): string { + return model.references.length > 1 && nls.localize('meta.implementations.title', " – {0} implementations", model.references.length); + } +} + +@editorAction +export class GoToImplementationAction extends ImplementationAction { + + public static ID = 'editor.action.goToImplementation'; + + constructor() { + super(new DefinitionActionConfig(), { + id: GoToImplementationAction.ID, + label: nls.localize('actions.goToImplementation.label', "Go to Implementation"), + alias: 'Go to Implementation', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasImplementationProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: KeyMod.CtrlCmd | KeyCode.F12 + } + }); + } +} + +@editorAction +export class PeekImplementationAction extends ImplementationAction { + + public static ID = 'editor.action.peekImplementation'; + + constructor() { + super(new DefinitionActionConfig(false, true, false), { + id: PeekImplementationAction.ID, + label: nls.localize('actions.peekImplementation.label', "Peek Implementation"), + alias: 'Peek Implementation', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasImplementationProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12 + } + }); + } +} + +export class TypeDefinitionAction extends DefinitionAction { + protected _getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise { + return getTypeDefinitionsAtPosition(model, position); + } + + protected _getNoResultFoundMessage(info?: editorCommon.IWordAtPosition): string { + return info && info.word + ? nls.localize('goToTypeDefinition.noResultWord', "No type definition found for '{0}'", info.word) + : nls.localize('goToTypeDefinition.generic.noResults', "No type definition found"); + } + + protected _getMetaTitle(model: ReferencesModel): string { + return model.references.length > 1 && nls.localize('meta.typeDefinitions.title', " – {0} type definitions", model.references.length); + } +} + +@editorAction +export class GoToTypeDefintionAction extends TypeDefinitionAction { + + public static ID = 'editor.action.goToTypeDefinition'; + + constructor() { + super(new DefinitionActionConfig(), { + id: GoToTypeDefintionAction.ID, + label: nls.localize('actions.goToTypeDefinition.label', "Go to Type Definition"), + alias: 'Go to Type Definition', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasTypeDefinitionProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: 0 + }, + menuOpts: { + group: 'navigation', + order: 1.4 + } + }); + } +} + +@editorAction +export class PeekTypeDefinitionAction extends TypeDefinitionAction { + + public static ID = 'editor.action.peekTypeDefinition'; + + constructor() { + super(new DefinitionActionConfig(false, true, false), { + id: PeekTypeDefinitionAction.ID, + label: nls.localize('actions.peekTypeDefinition.label', "Peek Type Definition"), + alias: 'Peek Type Definition', + precondition: ContextKeyExpr.and( + EditorContextKeys.hasTypeDefinitionProvider, + EditorContextKeys.isInEmbeddedEditor.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textFocus, + primary: 0 + } + }); + } +} + diff --git a/src/vs/workbench/parts/git/browser/views/huge/hugeView.css b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.css similarity index 76% rename from src/vs/workbench/parts/git/browser/views/huge/hugeView.css rename to src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.css index a428d2328c0..3361b104429 100644 --- a/src/vs/workbench/parts/git/browser/views/huge/hugeView.css +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.css @@ -3,10 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.git-viewlet > .huge-view { - padding: 0 20px 0 20px; -} - -.git-viewlet > .huge-view > p { - line-height: 1.5em; +.monaco-editor .goto-definition-link { + text-decoration: underline; + cursor: pointer; } \ No newline at end of file diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts new file mode 100644 index 00000000000..124e4229c3d --- /dev/null +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * 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 'vs/css!./goToDeclarationMouse'; +import * as nls from 'vs/nls'; +import { Throttler } from 'vs/base/common/async'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { MarkedString } from 'vs/base/common/htmlContent'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { IModeService } from 'vs/editor/common/services/modeService'; +import { Range } from 'vs/editor/common/core/range'; +import * as editorCommon from 'vs/editor/common/editorCommon'; +import { Location, DefinitionProviderRegistry } from 'vs/editor/common/modes'; +import { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; +import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; +import { getDefinitionsAtPosition } from './goToDeclaration'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; +import { EditorState, CodeEditorStateFlag } from 'vs/editor/common/core/editorState'; +import { DefinitionAction, DefinitionActionConfig } from './goToDeclarationCommands'; +import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDeclaration/browser/clickLinkGesture'; + +@editorContribution +class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { + + private static ID = 'editor.contrib.gotodefinitionwithmouse'; + static MAX_SOURCE_PREVIEW_LINES = 8; + + private editor: ICodeEditor; + private toUnhook: IDisposable[]; + private decorations: string[]; + private currentWordUnderMouse: editorCommon.IWordAtPosition; + private throttler: Throttler; + + constructor( + editor: ICodeEditor, + @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @IModeService private modeService: IModeService + ) { + this.toUnhook = []; + this.decorations = []; + this.editor = editor; + this.throttler = new Throttler(); + + let linkGesture = new ClickLinkGesture(editor); + this.toUnhook.push(linkGesture); + + this.toUnhook.push(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this.startFindDefinition(mouseEvent, keyboardEvent); + })); + + this.toUnhook.push(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { + if (this.isEnabled(mouseEvent)) { + this.gotoDefinition(mouseEvent.target, mouseEvent.hasSideBySideModifier).done(() => { + this.removeDecorations(); + }, (error: Error) => { + this.removeDecorations(); + onUnexpectedError(error); + }); + } + })); + + this.toUnhook.push(linkGesture.onCancel(() => { + this.removeDecorations(); + this.currentWordUnderMouse = null; + })); + + } + + private startFindDefinition(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void { + if (!this.isEnabled(mouseEvent, withKey)) { + this.currentWordUnderMouse = null; + this.removeDecorations(); + return; + } + + // Find word at mouse position + let position = mouseEvent.target.position; + let word = position ? this.editor.getModel().getWordAtPosition(position) : null; + if (!word) { + this.currentWordUnderMouse = null; + this.removeDecorations(); + return; + } + + // Return early if word at position is still the same + if (this.currentWordUnderMouse && this.currentWordUnderMouse.startColumn === word.startColumn && this.currentWordUnderMouse.endColumn === word.endColumn && this.currentWordUnderMouse.word === word.word) { + return; + } + + this.currentWordUnderMouse = word; + + // Find definition and decorate word if found + let state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll); + + this.throttler.queue(() => { + return state.validate(this.editor) + ? this.findDefinition(mouseEvent.target) + : TPromise.as(null); + + }).then(results => { + if (!results || !results.length || !state.validate(this.editor)) { + this.removeDecorations(); + return; + } + + // Multiple results + if (results.length > 1) { + this.addDecoration(new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn), nls.localize('multipleResults', "Click to show {0} definitions.", results.length)); + } + + // Single result + else { + let result = results[0]; + + if (!result.uri) { + return; + } + + this.textModelResolverService.createModelReference(result.uri).then(ref => { + + if (!ref.object || !ref.object.textEditorModel) { + ref.dispose(); + return; + } + + const { object: { textEditorModel } } = ref; + const { startLineNumber } = result.range; + + if (textEditorModel.getLineMaxColumn(startLineNumber) === 0) { + ref.dispose(); + return; + } + + const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); + const maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionWithMouseEditorContribution.MAX_SOURCE_PREVIEW_LINES); + let endLineNumber = startLineNumber + 1; + let minIndent = startIndent; + + for (; endLineNumber < maxLineNumber; endLineNumber++) { + let endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); + minIndent = Math.min(minIndent, endIndent); + if (startIndent === endIndent) { + break; + } + } + + const previewRange = new Range(startLineNumber, 1, endLineNumber + 1, 1); + const value = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\s{${minIndent - 1}}`, 'gm'), '').trim(); + + this.addDecoration(new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn), { + language: this.modeService.getModeIdByFilenameOrFirstLine(textEditorModel.uri.fsPath), + value + }); + ref.dispose(); + }); + } + }).done(undefined, onUnexpectedError); + } + + private addDecoration(range: Range, hoverMessage: MarkedString): void { + + const newDecorations: editorCommon.IModelDeltaDecoration = { + range: range, + options: { + inlineClassName: 'goto-definition-link', + hoverMessage + } + }; + + this.decorations = this.editor.deltaDecorations(this.decorations, [newDecorations]); + } + + private removeDecorations(): void { + if (this.decorations.length > 0) { + this.decorations = this.editor.deltaDecorations(this.decorations, []); + } + } + + private isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean { + return this.editor.getModel() && + mouseEvent.isNoneOrSingleMouseDown && + mouseEvent.target.type === MouseTargetType.CONTENT_TEXT && + (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)) && + DefinitionProviderRegistry.has(this.editor.getModel()); + } + + private findDefinition(target: IMouseTarget): TPromise { + let model = this.editor.getModel(); + if (!model) { + return TPromise.as(null); + } + + return getDefinitionsAtPosition(this.editor.getModel(), target.position); + } + + private gotoDefinition(target: IMouseTarget, sideBySide: boolean): TPromise { + this.editor.setPosition(target.position); + const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: undefined, label: undefined, id: undefined, precondition: undefined }); + return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor)); + } + + public getId(): string { + return GotoDefinitionWithMouseEditorContribution.ID; + } + + public dispose(): void { + this.toUnhook = dispose(this.toUnhook); + } +} + +registerThemingParticipant((theme, collector) => { + let activeLinkForeground = theme.getColor(editorActiveLinkForeground); + if (activeLinkForeground) { + collector.addRule(`.monaco-editor .goto-definition-link { color: ${activeLinkForeground} !important; }`); + } +}); diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.css b/src/vs/editor/contrib/goToDeclaration/browser/messageController.css index 576dc53a636..36c68465b2c 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.css +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.css @@ -25,8 +25,6 @@ .monaco-editor .monaco-editor-overlaymessage .message { padding: 1px 4px; - background: #1382CE; - color: white; } .monaco-editor .monaco-editor-overlaymessage .anchor { @@ -36,6 +34,5 @@ border-style: solid; z-index: 1000; border-width: 8px; - border-top-color: #1382CE; position: absolute; } diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts index d9422640154..d5453254827 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts @@ -17,6 +17,8 @@ import { commonEditorContribution, CommonEditorRegistry, EditorCommand } from 'v import { ICodeEditor, IContentWidget, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IPosition } from 'vs/editor/common/core/position'; +import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; +import { inputValidationInfoBorder, inputValidationInfoBackground } from 'vs/platform/theme/common/colorRegistry'; @commonEditorContribution export class MessageController { @@ -170,3 +172,16 @@ class MessageWidget implements IContentWidget { return { position: this._position, preference: [ContentWidgetPositionPreference.ABOVE] }; } } + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(inputValidationInfoBorder); + if (border) { + let borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1; + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: ${border}; }`); + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${borderWidth}px solid ${border}; }`); + } + let background = theme.getColor(inputValidationInfoBackground); + if (background) { + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/goToDeclaration/common/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/common/goToDeclaration.ts deleted file mode 100644 index 61afed81136..00000000000 --- a/src/vs/editor/contrib/goToDeclaration/common/goToDeclaration.ts +++ /dev/null @@ -1,74 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IReadOnlyModel } from 'vs/editor/common/editorCommon'; -import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; -import { DefinitionProviderRegistry, ImplementationProviderRegistry, TypeDefinitionProviderRegistry, Location } from 'vs/editor/common/modes'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { asWinJsPromise } from 'vs/base/common/async'; -import { Position } from 'vs/editor/common/core/position'; - -function outputResults(promises: TPromise[]) { - return TPromise.join(promises).then(allReferences => { - let result: Location[] = []; - for (let references of allReferences) { - if (Array.isArray(references)) { - result.push(...references); - } else if (references) { - result.push(references); - } - } - return result; - }); -} - -function getDefinitions( - model: IReadOnlyModel, - position: Position, - registry: LanguageFeatureRegistry, - provide: (provider: T, model: IReadOnlyModel, position: Position, token: CancellationToken) => Location | Location[] | Thenable -): TPromise { - const provider = registry.ordered(model); - - // get results - const promises = provider.map((provider, idx) => { - return asWinJsPromise((token) => { - return provide(provider, model, position, token); - }).then(result => { - return result; - }, err => { - onUnexpectedExternalError(err); - }); - }); - return outputResults(promises); -} - - -export function getDefinitionsAtPosition(model: IReadOnlyModel, position: Position): TPromise { - return getDefinitions(model, position, DefinitionProviderRegistry, (provider, model, position, token) => { - return provider.provideDefinition(model, position, token); - }); -} - -export function getImplementationsAtPosition(model: IReadOnlyModel, position: Position): TPromise { - return getDefinitions(model, position, ImplementationProviderRegistry, (provider, model, position, token) => { - return provider.provideImplementation(model, position, token); - }); -} - -export function getTypeDefinitionsAtPosition(model: IReadOnlyModel, position: Position): TPromise { - return getDefinitions(model, position, TypeDefinitionProviderRegistry, (provider, model, position, token) => { - return provider.provideTypeDefinition(model, position, token); - }); -} - -CommonEditorRegistry.registerDefaultLanguageCommand('_executeDefinitionProvider', getDefinitionsAtPosition); -CommonEditorRegistry.registerDefaultLanguageCommand('_executeImplementationProvider', getImplementationsAtPosition); -CommonEditorRegistry.registerDefaultLanguageCommand('_executeTypeDefinitionProvider', getTypeDefinitionsAtPosition); \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index 30de9d1b446..cf7c1658777 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -13,7 +13,6 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; -import { ICommandService } from 'vs/platform/commands/common/commands'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMarker, IMarkerService } from 'vs/platform/markers/common/markers'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -28,6 +27,8 @@ import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { getAccessibilitySupport } from 'vs/base/browser/browser'; +import { AccessibilitySupport } from 'vs/base/common/platform'; class MarkerModel { @@ -221,7 +222,7 @@ class MarkerNavigationWidget extends ZoneWidget { private _severity: Severity; private _backgroundColor: Color; - constructor(editor: ICodeEditor, private _model: MarkerModel, private _commandService: ICommandService, private _themeService: IThemeService) { + constructor(editor: ICodeEditor, private _model: MarkerModel, private _themeService: IThemeService) { super(editor, { showArrow: true, showFrame: true, isAccessible: true }); this._severity = Severity.Warning; this._backgroundColor = Color.white; @@ -277,7 +278,9 @@ class MarkerNavigationWidget extends ZoneWidget { public show(where: Position, heightInLines: number): void { super.show(where, heightInLines); - this.focus(); + if (getAccessibilitySupport() !== AccessibilitySupport.Disabled) { + this.focus(); + } } private _wireModelAndView(): void { @@ -377,7 +380,6 @@ class MarkerController implements editorCommon.IEditorContribution { editor: ICodeEditor, @IMarkerService private _markerService: IMarkerService, @IContextKeyService private _contextKeyService: IContextKeyService, - @ICommandService private _commandService: ICommandService, @IThemeService private _themeService: IThemeService ) { this._editor = editor; @@ -407,7 +409,7 @@ class MarkerController implements editorCommon.IEditorContribution { const markers = this._getMarkers(); this._model = new MarkerModel(this._editor, markers); - this._zone = new MarkerNavigationWidget(this._editor, this._model, this._commandService, this._themeService); + this._zone = new MarkerNavigationWidget(this._editor, this._model, this._themeService); this._markersNavigationVisible.set(true); this._callOnClose.push(this._model); diff --git a/src/vs/editor/contrib/hover/browser/hover.css b/src/vs/editor/contrib/hover/browser/hover.css index 191c253ae2d..076675d3e48 100644 --- a/src/vs/editor/contrib/hover/browser/hover.css +++ b/src/vs/editor/contrib/hover/browser/hover.css @@ -60,7 +60,6 @@ } .monaco-editor-hover code { - background-color: rgba(132, 132, 132, 0.14); border-radius: 3px; padding: 0 0.4em; } @@ -68,7 +67,4 @@ .monaco-editor-hover .monaco-tokenized-source { white-space: pre-wrap; word-break: break-all; -} - -.monaco-editor.vs-dark .monaco-editor-hover a { color: #1C5DAF; } -.monaco-editor.hc-black .monaco-editor-hover a { color: #1C5DAF; } \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 6e424a667d6..b0229e73f1b 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -21,7 +21,7 @@ import { ModesContentHoverWidget } from './modesContentHover'; import { ModesGlyphHoverWidget } from './modesGlyphHover'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { editorHoverHighlight, editorHoverBackground, editorHoverBorder, textLinkForeground, textCodeBlockBackground } from 'vs/platform/theme/common/colorRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; @editorContribution @@ -112,8 +112,7 @@ export class ModesHoverController implements editorCommon.IEditorContribution { } private _onKeyDown(e: IKeyboardEvent): void { - var stopKey = platform.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl; - if (e.keyCode !== stopKey) { + if (e.keyCode !== KeyCode.Ctrl && e.keyCode !== KeyCode.Alt && e.keyCode !== KeyCode.Meta) { // Do not hide hover when Ctrl/Meta is pressed this._hideWidgets(); } @@ -173,23 +172,27 @@ class ShowHoverAction extends EditorAction { } // theming - -export const editorHoverHighlight = registerColor('editor.hoverHighlightBackground', { light: '#ADD6FF26', dark: '#264f7840', hc: '#ADD6FF26' }, nls.localize('hoverHighlight', 'Highlight below the word for which a hover is shown.')); -export const editorHoverBackground = registerColor('editorHoverWidget.background', { light: '#F3F3F3', dark: '#2D2D30', hc: '#0C141F' }, nls.localize('hoverBackground', 'Background color of the editor hover.')); -export const editorHoverBorder = registerColor('editorHoverWidget.border', { light: '#CCCCCC', dark: '#555555', hc: '#CCCCCC' }, nls.localize('hoverBorder', 'Border color of the editor hover.')); - registerThemingParticipant((theme, collector) => { let editorHoverHighlightColor = theme.getColor(editorHoverHighlight); if (editorHoverHighlightColor) { - collector.addRule(`.monaco-editor.${theme.selector} .hoverHighlight { background-color: ${editorHoverHighlightColor}; }`); + collector.addRule(`.monaco-editor .hoverHighlight { background-color: ${editorHoverHighlightColor}; }`); } let hoverBackground = theme.getColor(editorHoverBackground); if (hoverBackground) { - collector.addRule(`.monaco-editor.${theme.selector} .monaco-editor-hover { background-color: ${hoverBackground}; }`); + collector.addRule(`.monaco-editor .monaco-editor-hover { background-color: ${hoverBackground}; }`); } let hoverBorder = theme.getColor(editorHoverBorder); if (hoverBorder) { - collector.addRule(`.monaco-editor.${theme.selector} .monaco-editor-hover { border: 1px solid ${hoverBorder}; }`); - collector.addRule(`.monaco-editor.${theme.selector} .monaco-editor-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); + collector.addRule(`.monaco-editor .monaco-editor-hover { border: 1px solid ${hoverBorder}; }`); + collector.addRule(`.monaco-editor .monaco-editor-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); } + let link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-editor .monaco-editor-hover a { color: ${link}; }`); + } + let codeBackground = theme.getColor(textCodeBlockBackground); + if (codeBackground) { + collector.addRule(`.monaco-editor .monaco-editor-hover code { background-color: ${codeBackground}; }`); + } + }); diff --git a/src/vs/editor/contrib/hover/browser/modesContentHover.ts b/src/vs/editor/contrib/hover/browser/modesContentHover.ts index 6c9d4105c27..0814b278789 100644 --- a/src/vs/editor/contrib/hover/browser/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/browser/modesContentHover.ts @@ -22,6 +22,7 @@ import { getHover } from '../common/hover'; import { HoverOperation, IHoverComputer } from './hoverOperation'; import { ContentHoverWidget } from './hoverWidgets'; import { textToMarkedString, MarkedString } from 'vs/base/common/htmlContent'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; class ModesContentComputer implements IHoverComputer { @@ -274,10 +275,12 @@ export class ModesContentHoverWidget extends ContentHoverWidget { this._isChangingDecorations = true; this._highlightDecorations = this._editor.deltaDecorations(this._highlightDecorations, [{ range: highlightRange, - options: { - className: 'hoverHighlight' - } + options: ModesContentHoverWidget._DECORATION_OPTIONS }]); this._isChangingDecorations = false; } -} \ No newline at end of file + + private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ + className: 'hoverHighlight' + }); +} diff --git a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts index 1693459d3f2..030eff62c25 100644 --- a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts @@ -16,6 +16,9 @@ import { IInplaceReplaceSupportResult } from 'vs/editor/common/modes'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { InPlaceReplaceCommand } from './inPlaceReplaceCommand'; import { EditorState, CodeEditorStateFlag } from 'vs/editor/common/core/editorState'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @commonEditorContribution class InPlaceReplaceController implements IEditorContribution { @@ -26,9 +29,9 @@ class InPlaceReplaceController implements IEditorContribution { return editor.getContribution(InPlaceReplaceController.ID); } - private static DECORATION = { + private static DECORATION = ModelDecorationOptions.register({ className: 'valueSetReplacement' - }; + }); private editor: ICommonCodeEditor; private requestIdPool: number; @@ -110,7 +113,10 @@ class InPlaceReplaceController implements IEditorContribution { // Insert new text var command = new InPlaceReplaceCommand(editRange, selection, result.value); + + this.editor.pushUndoStop(); this.editor.executeCommand(source, command); + this.editor.pushUndoStop(); // add decoration this.decorationIds = this.editor.deltaDecorations(this.decorationIds, [{ @@ -179,3 +185,10 @@ class InPlaceReplaceDown extends EditorAction { return controller.run(this.id, false); } } + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(editorBracketMatchBorder); + if (border) { + collector.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${border}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/indentation/common/indentation.ts b/src/vs/editor/contrib/indentation/common/indentation.ts index 44d1a1bdac3..7fb494c770d 100644 --- a/src/vs/editor/contrib/indentation/common/indentation.ts +++ b/src/vs/editor/contrib/indentation/common/indentation.ts @@ -164,7 +164,11 @@ export class IndentationToSpacesAction extends EditorAction { } let modelOpts = model.getOptions(); const command = new IndentationToSpacesCommand(editor.getSelection(), modelOpts.tabSize); + + editor.pushUndoStop(); editor.executeCommands(this.id, [command]); + editor.pushUndoStop(); + model.updateOptions({ insertSpaces: true }); @@ -191,7 +195,11 @@ export class IndentationToTabsAction extends EditorAction { } let modelOpts = model.getOptions(); const command = new IndentationToTabsCommand(editor.getSelection(), modelOpts.tabSize); + + editor.pushUndoStop(); editor.executeCommands(this.id, [command]); + editor.pushUndoStop(); + model.updateOptions({ insertSpaces: false }); diff --git a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css b/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css index 6f02755f597..0c4905290d2 100644 --- a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css +++ b/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ .tm-inspect-widget { - background-color: #F3F3F3; - border: 1px solid #CCC; z-index: 50; -webkit-user-select: text; -ms-user-select: text; @@ -16,14 +14,15 @@ padding: 10px; } -.monaco-editor.vs-dark .tm-inspect-widget { background-color: #2D2D30; border-color: #555; } - -.monaco-editor.hc-black .tm-inspect-widget { background-color: #0C141F; } - .tm-token { font-family: monospace; } +.tm-metadata-separator { + height: 1px; + border: 0; +} + .tm-token-length { font-weight: normal; font-size: 60%; diff --git a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts b/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts index f8bfa8c6447..e407188b906 100644 --- a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts +++ b/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts @@ -9,6 +9,7 @@ import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; import { Disposable } from 'vs/base/common/lifecycle'; import { escape } from 'vs/base/common/strings'; +import { KeyCode } from 'vs/base/common/keyCodes'; import { Position } from 'vs/editor/common/core/position'; import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon'; import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions'; @@ -26,6 +27,8 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work import { Color } from 'vs/base/common/color'; import { IMessageService } from 'vs/platform/message/common/message'; import Severity from 'vs/base/common/severity'; +import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; +import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; @editorContribution class InspectTMScopesController extends Disposable implements IEditorContribution { @@ -60,6 +63,7 @@ class InspectTMScopesController extends Disposable implements IEditorContributio this._register(this._editor.onDidChangeModel((e) => this.stop())); this._register(this._editor.onDidChangeModelLanguage((e) => this.stop())); + this._register(this._editor.onKeyUp((e) => e.keyCode === KeyCode.Escape && this.stop())); } public getId(): string { @@ -87,6 +91,14 @@ class InspectTMScopesController extends Disposable implements IEditorContributio this._widget = null; } } + + public toggle(): void { + if (!this._widget) { + this.launch(); + } else { + this.stop(); + } + } } @editorAction @@ -104,7 +116,7 @@ class InspectTMScopes extends EditorAction { public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { let controller = InspectTMScopesController.get(editor); if (controller) { - controller.launch(); + controller.toggle(); } } } @@ -251,7 +263,7 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget { let tokenText = this._model.getLineContent(position.lineNumber).substring(tokenStartIndex, tokenEndIndex); result += `

${renderTokenText(tokenText)}(${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'})

`; - result += `
`; + result += ``; let metadata = this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]); result += ``; @@ -263,7 +275,7 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget { result += ``; let theme = this._themeService.getColorTheme(); - result += `
`; + result += ``; let matchingRule = findMatchingThemeRule(theme, data.tokens1[token1Index].scopes); if (matchingRule) { result += `${matchingRule.rawSelector}\n${JSON.stringify(matchingRule.settings, null, '\t')}`; @@ -271,7 +283,7 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget { result += `No theme selector.`; } - result += `
`; + result += ``; result += `
    `; for (let i = data.tokens1[token1Index].scopes.length - 1; i >= 0; i--) { @@ -363,3 +375,16 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget { }; } } + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(editorHoverBorder); + if (border) { + let borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1; + collector.addRule(`.monaco-editor .tm-inspect-widget { border: ${borderWidth}px solid ${border}; }`); + collector.addRule(`.monaco-editor .tm-inspect-widget .tm-metadata-separator { background-color: ${border}; }`); + } + let background = theme.getColor(editorHoverBackground); + if (background) { + collector.addRule(`.monaco-editor .tm-inspect-widget { background-color: ${background}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css b/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css index 33d668042e5..78b1b178c84 100644 --- a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css +++ b/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ .monaco-editor .tokens-inspect-widget { - background-color: #F3F3F3; - border: 1px solid #CCC; z-index: 50; -webkit-user-select: text; -ms-user-select: text; @@ -16,9 +14,10 @@ padding: 10px; } -.monaco-editor.vs-dark .tokens-inspect-widget { background-color: #2D2D30; border-color: #555; } - -.monaco-editor.hc-black .tokens-inspect-widget { background-color: #0C141F; } +.tokens-inspect-separator { + height: 1px; + border: 0; +} .monaco-editor .tokens-inspect-widget .tm-token { font-family: monospace; diff --git a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts b/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts index 66647f525cd..b84e899b137 100644 --- a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts +++ b/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts @@ -21,6 +21,9 @@ import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThe import { NULL_STATE, nullTokenize, nullTokenize2 } from 'vs/editor/common/modes/nullMode'; import { Token } from 'vs/editor/common/core/token'; import { Color } from 'vs/base/common/color'; +import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; +import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; + @editorContribution class InspectTokensController extends Disposable implements IEditorContribution { @@ -230,7 +233,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget { } result += `

    ${renderTokenText(tokenText)}(${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'})

    `; - result += `
    `; + result += `
    `; let metadata = this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]); result += ``; @@ -241,7 +244,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget { result += ``; result += ``; - result += `
    `; + result += `
    `; if (token1Index < data.tokens1.length) { result += `${escape(data.tokens1[token1Index].type)}`; @@ -330,3 +333,16 @@ class InspectTokensWidget extends Disposable implements IContentWidget { }; } } + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(editorHoverBorder); + if (border) { + let borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1; + collector.addRule(`.monaco-editor .tokens-inspect-widget { border: ${borderWidth}px solid ${border}; }`); + collector.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${border}; }`); + } + let background = theme.getColor(editorHoverBackground); + if (background) { + collector.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${background}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts index 54255479f30..a41829a885b 100644 --- a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts @@ -9,15 +9,17 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; import { SortLinesCommand } from 'vs/editor/contrib/linesOperations/common/sortLinesCommand'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { TrimTrailingWhitespaceCommand } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand'; -import { Handler, ICommand, ICommonCodeEditor, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; +import { ICommand, ICommonCodeEditor, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { editorAction, ServicesAccessor, IActionOptions, EditorAction, HandlerEditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { editorAction, ServicesAccessor, IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { CopyLinesCommand } from './copyLinesCommand'; import { DeleteLinesCommand } from './deleteLinesCommand'; import { MoveLinesCommand } from './moveLinesCommand'; +import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; // copy lines @@ -39,7 +41,9 @@ abstract class AbstractCopyLinesAction extends EditorAction { commands.push(new CopyLinesCommand(selections[i], this.down)); } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } @@ -97,7 +101,9 @@ abstract class AbstractMoveLinesAction extends EditorAction { commands.push(new MoveLinesCommand(selections[i], this.down)); } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } @@ -151,7 +157,9 @@ abstract class AbstractSortLinesAction extends EditorAction { var command = new SortLinesCommand(editor.getSelection(), this.descending); + editor.pushUndoStop(); editor.executeCommands(this.id, [command]); + editor.pushUndoStop(); } } @@ -201,7 +209,9 @@ export class TrimTrailingWhitespaceAction extends EditorAction { var command = new TrimTrailingWhitespaceCommand(editor.getSelection()); + editor.pushUndoStop(); editor.executeCommands(this.id, [command]); + editor.pushUndoStop(); } } @@ -280,76 +290,94 @@ class DeleteLinesAction extends AbstractRemoveLinesAction { return new DeleteLinesCommand(op.startLineNumber, op.endLineNumber, op.positionColumn); }); + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } @editorAction -class IndentLinesAction extends HandlerEditorAction { +export class IndentLinesAction extends EditorAction { constructor() { super({ id: 'editor.action.indentLines', label: nls.localize('lines.indent', "Indent Line"), alias: 'Indent Line', precondition: EditorContextKeys.writable, - handlerId: Handler.Indent, kbOpts: { kbExpr: EditorContextKeys.textFocus, primary: KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET } }); } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.indent(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + editor.pushUndoStop(); + } } @editorAction -class OutdentLinesAction extends HandlerEditorAction { +class OutdentLinesAction extends EditorAction { constructor() { super({ id: 'editor.action.outdentLines', label: nls.localize('lines.outdent', "Outdent Line"), alias: 'Outdent Line', precondition: EditorContextKeys.writable, - handlerId: Handler.Outdent, kbOpts: { kbExpr: EditorContextKeys.textFocus, primary: KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET } }); } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { + CoreEditingCommands.Outdent.runEditorCommand(null, editor, null); + } } @editorAction -class InsertLineBeforeAction extends HandlerEditorAction { +export class InsertLineBeforeAction extends EditorAction { constructor() { super({ id: 'editor.action.insertLineBefore', label: nls.localize('lines.insertBefore', "Insert Line Above"), alias: 'Insert Line Above', precondition: EditorContextKeys.writable, - handlerId: Handler.LineInsertBefore, kbOpts: { kbExpr: EditorContextKeys.textFocus, primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter } }); } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.lineInsertBefore(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + } } @editorAction -class InsertLineAfterAction extends HandlerEditorAction { +export class InsertLineAfterAction extends EditorAction { constructor() { super({ id: 'editor.action.insertLineAfter', label: nls.localize('lines.insertAfter', "Insert Line Below"), alias: 'Insert Line Below', precondition: EditorContextKeys.writable, - handlerId: Handler.LineInsertAfter, kbOpts: { kbExpr: EditorContextKeys.textFocus, primary: KeyMod.CtrlCmd | KeyCode.Enter } }); } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { + editor.pushUndoStop(); + editor.executeCommands(this.id, TypeOperations.lineInsertAfter(editor._getCursorConfiguration(), editor.getModel(), editor.getSelections())); + } } export abstract class AbstractDeleteAllToBoundaryAction extends EditorAction { @@ -406,8 +434,8 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction { } _getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] { - let endPrimaryCursor: Range; - let endCursorState = []; + let endPrimaryCursor: Selection; + let endCursorState: Selection[] = []; for (let i = 0, len = rangesToDelete.length; i < len; i++) { let range = rangesToDelete[i]; @@ -460,8 +488,8 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction { } _getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] { - let endPrimaryCursor: Range; - let endCursorState = []; + let endPrimaryCursor: Selection; + let endCursorState: Selection[] = []; for (let i = 0, len = rangesToDelete.length, offset = 0; i < len; i++) { let range = rangesToDelete[i]; let endCursor = new Selection(range.startLineNumber - offset, range.startColumn, range.startLineNumber - offset, range.startColumn); @@ -694,7 +722,9 @@ export class TransposeAction extends EditorAction { } } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } } @@ -725,7 +755,9 @@ export abstract class AbstractCaseAction extends EditorAction { } } + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } protected abstract _modifyText(text: string): string; diff --git a/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts b/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts index 0239d6ee087..64c67e2cb9a 100644 --- a/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts @@ -6,9 +6,13 @@ import * as assert from 'assert'; import { Selection } from 'vs/editor/common/core/selection'; -import { Handler } from 'vs/editor/common/editorCommon'; +import { Position } from 'vs/editor/common/core/position'; +import { Handler, IModel, DefaultEndOfLine } from 'vs/editor/common/editorCommon'; import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; -import { DeleteAllLeftAction, JoinLinesAction, TransposeAction, UpperCaseAction, LowerCaseAction, DeleteAllRightAction } from 'vs/editor/contrib/linesOperations/common/linesOperations'; +import { DeleteAllLeftAction, JoinLinesAction, TransposeAction, UpperCaseAction, LowerCaseAction, DeleteAllRightAction, InsertLineBeforeAction, InsertLineAfterAction, IndentLinesAction } from 'vs/editor/contrib/linesOperations/common/linesOperations'; +import { Cursor } from 'vs/editor/common/controller/cursor'; +import { Model } from 'vs/editor/common/model/model'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; suite('Editor Contrib - Line Operations', () => { suite('DeleteAllLeftAction', () => { @@ -474,13 +478,13 @@ suite('Editor Contrib - Line Operations', () => { new Selection(2, 4, 2, 4) ]); - cursor.trigger('tests', Handler.Undo, {}); + editor.trigger('tests', Handler.Undo, {}); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), new Selection(1, 6, 1, 6), new Selection(3, 4, 3, 4) ]); - cursor.trigger('tests', Handler.Redo, {}); + editor.trigger('tests', Handler.Redo, {}); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), new Selection(2, 4, 2, 4) @@ -488,4 +492,116 @@ suite('Editor Contrib - Line Operations', () => { }); }); }); -}); \ No newline at end of file + + test('InsertLineBeforeAction', function () { + function testInsertLineBefore(lineNumber: number, column: number, callback: (model: IModel, cursor: Cursor) => void): void { + const TEXT = [ + 'First line', + 'Second line', + 'Third line' + ]; + withMockCodeEditor(TEXT, {}, (editor, cursor) => { + editor.setPosition(new Position(lineNumber, column)); + let insertLineBeforeAction = new InsertLineBeforeAction(); + + insertLineBeforeAction.run(null, editor); + callback(editor.getModel(), cursor); + }); + } + + testInsertLineBefore(1, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(1, 1, 1, 1)); + assert.equal(model.getLineContent(1), ''); + assert.equal(model.getLineContent(2), 'First line'); + assert.equal(model.getLineContent(3), 'Second line'); + assert.equal(model.getLineContent(4), 'Third line'); + }); + + testInsertLineBefore(2, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(2, 1, 2, 1)); + assert.equal(model.getLineContent(1), 'First line'); + assert.equal(model.getLineContent(2), ''); + assert.equal(model.getLineContent(3), 'Second line'); + assert.equal(model.getLineContent(4), 'Third line'); + }); + + testInsertLineBefore(3, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(3, 1, 3, 1)); + assert.equal(model.getLineContent(1), 'First line'); + assert.equal(model.getLineContent(2), 'Second line'); + assert.equal(model.getLineContent(3), ''); + assert.equal(model.getLineContent(4), 'Third line'); + }); + }); + + test('InsertLineAfterAction', () => { + function testInsertLineAfter(lineNumber: number, column: number, callback: (model: IModel, cursor: Cursor) => void): void { + const TEXT = [ + 'First line', + 'Second line', + 'Third line' + ]; + withMockCodeEditor(TEXT, {}, (editor, cursor) => { + editor.setPosition(new Position(lineNumber, column)); + let insertLineAfterAction = new InsertLineAfterAction(); + + insertLineAfterAction.run(null, editor); + callback(editor.getModel(), cursor); + }); + } + + testInsertLineAfter(1, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(2, 1, 2, 1)); + assert.equal(model.getLineContent(1), 'First line'); + assert.equal(model.getLineContent(2), ''); + assert.equal(model.getLineContent(3), 'Second line'); + assert.equal(model.getLineContent(4), 'Third line'); + }); + + testInsertLineAfter(2, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(3, 1, 3, 1)); + assert.equal(model.getLineContent(1), 'First line'); + assert.equal(model.getLineContent(2), 'Second line'); + assert.equal(model.getLineContent(3), ''); + assert.equal(model.getLineContent(4), 'Third line'); + }); + + testInsertLineAfter(3, 3, (model, cursor) => { + assert.deepEqual(cursor.getSelection(), new Selection(4, 1, 4, 1)); + assert.equal(model.getLineContent(1), 'First line'); + assert.equal(model.getLineContent(2), 'Second line'); + assert.equal(model.getLineContent(3), 'Third line'); + assert.equal(model.getLineContent(4), ''); + }); + }); + + test('Bug 18276:[editor] Indentation broken when selection is empty', () => { + + let model = Model.createFromString( + [ + 'function baz() {' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + let indentLinesAction = new IndentLinesAction(); + editor.setPosition(new Position(1, 2)); + + indentLinesAction.run(null, editor); + assert.equal(model.getLineContent(1), '\tfunction baz() {'); + assert.deepEqual(editor.getSelection(), new Selection(1, 3, 1, 3)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(1), '\tf\tunction baz() {'); + }); + + model.dispose(); + }); +}); diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index cb507783d81..d25c7a9a3ad 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -8,28 +8,59 @@ import 'vs/css!./links'; import * as nls from 'vs/nls'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { KeyCode } from 'vs/base/common/keyCodes'; import * as platform from 'vs/base/common/platform'; import Severity from 'vs/base/common/severity'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IMessageService } from 'vs/platform/message/common/message'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { LinkProviderRegistry } from 'vs/editor/common/modes'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { IEditorMouseEvent, ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; +import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { getLinks, Link } from 'vs/editor/contrib/links/common/links'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { Position } from 'vs/editor/common/core/position'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDeclaration/browser/clickLinkGesture'; + +const HOVER_MESSAGE_GENERAL_META = ( + platform.isMacintosh + ? nls.localize('links.navigate.mac', "Cmd + click to follow link") + : nls.localize('links.navigate', "Ctrl + click to follow link") +); + +const HOVER_MESSAGE_GENERAL_ALT = nls.localize('links.navigate.al', "Alt + click to follow link"); + +const decoration = { + meta: ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + inlineClassName: 'detected-link', + hoverMessage: HOVER_MESSAGE_GENERAL_META + }), + metaActive: ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + inlineClassName: 'detected-link-active', + hoverMessage: HOVER_MESSAGE_GENERAL_META + }), + alt: ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + inlineClassName: 'detected-link', + hoverMessage: HOVER_MESSAGE_GENERAL_ALT + }), + altActive: ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + inlineClassName: 'detected-link-active', + hoverMessage: HOVER_MESSAGE_GENERAL_ALT + }), +}; class LinkOccurence { - public static decoration(link: Link): editorCommon.IModelDeltaDecoration { + public static decoration(link: Link, useMetaKey: boolean): editorCommon.IModelDeltaDecoration { return { range: { startLineNumber: link.range.startLineNumber, @@ -37,40 +68,31 @@ class LinkOccurence { endLineNumber: link.range.endLineNumber, endColumn: link.range.endColumn }, - options: LinkOccurence._getOptions(link, false) + options: LinkOccurence._getOptions(useMetaKey, false) }; } - private static _getOptions(link: Link, isActive: boolean): editorCommon.IModelDecorationOptions { - var result = ''; - - if (isActive) { - result += LinkDetector.CLASS_NAME_ACTIVE; - } else { - result += LinkDetector.CLASS_NAME; + private static _getOptions(useMetaKey: boolean, isActive: boolean): ModelDecorationOptions { + if (useMetaKey) { + return (isActive ? decoration.metaActive : decoration.meta); } - - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - inlineClassName: result, - hoverMessage: LinkDetector.HOVER_MESSAGE_GENERAL - }; + return (isActive ? decoration.altActive : decoration.alt); } public decorationId: string; public link: Link; - constructor(link: Link, decorationId: string/*, changeAccessor:editorCommon.IModelDecorationsChangeAccessor*/) { + constructor(link: Link, decorationId: string) { this.link = link; this.decorationId = decorationId; } - public activate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(this.link, true)); + public activate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, true)); } - public deactivate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(this.link, false)); + public deactivate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, false)); } } @@ -84,18 +106,12 @@ class LinkDetector implements editorCommon.IEditorContribution { } static RECOMPUTE_TIME = 1000; // ms - static TRIGGER_KEY_VALUE = platform.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl; - static TRIGGER_MODIFIER = platform.isMacintosh ? 'metaKey' : 'ctrlKey'; - static HOVER_MESSAGE_GENERAL = platform.isMacintosh ? nls.localize('links.navigate.mac', "Cmd + click to follow link") : nls.localize('links.navigate', "Ctrl + click to follow link"); - static CLASS_NAME = 'detected-link'; - static CLASS_NAME_ACTIVE = 'detected-link-active'; private editor: ICodeEditor; private listenersToRemove: IDisposable[]; private timeoutPromise: TPromise; private computePromise: TPromise; private activeLinkDecorationId: string; - private lastMouseEvent: IEditorMouseEvent; private openerService: IOpenerService; private messageService: IMessageService; private editorWorkerService: IEditorWorkerService; @@ -112,14 +128,24 @@ class LinkDetector implements editorCommon.IEditorContribution { this.messageService = messageService; this.editorWorkerService = editorWorkerService; this.listenersToRemove = []; + + let clickLinkGesture = new ClickLinkGesture(editor); + this.listenersToRemove.push(clickLinkGesture); + this.listenersToRemove.push(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this._onEditorMouseMove(mouseEvent, keyboardEvent); + })); + this.listenersToRemove.push(clickLinkGesture.onExecute((e) => { + this.onEditorMouseUp(e); + })); + this.listenersToRemove.push(clickLinkGesture.onCancel((e) => { + this.cleanUpActiveLinkDecoration(); + })); + this.listenersToRemove.push(editor.onDidChangeModelContent((e) => this.onChange())); this.listenersToRemove.push(editor.onDidChangeModel((e) => this.onModelChanged())); this.listenersToRemove.push(editor.onDidChangeModelLanguage((e) => this.onModelModeChanged())); this.listenersToRemove.push(LinkProviderRegistry.onDidChange((e) => this.onModelModeChanged())); - this.listenersToRemove.push(this.editor.onMouseUp((e: IEditorMouseEvent) => this.onEditorMouseUp(e))); - this.listenersToRemove.push(this.editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(e))); - this.listenersToRemove.push(this.editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e))); - this.listenersToRemove.push(this.editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e))); + this.timeoutPromise = null; this.computePromise = null; this.currentOccurences = {}; @@ -136,7 +162,6 @@ class LinkDetector implements editorCommon.IEditorContribution { } private onModelChanged(): void { - this.lastMouseEvent = null; this.currentOccurences = {}; this.activeLinkDecorationId = null; this.stop(); @@ -174,6 +199,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } private updateDecorations(links: Link[]): void { + const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { var oldDecorations: string[] = []; let keys = Object.keys(this.currentOccurences); @@ -187,7 +213,7 @@ class LinkDetector implements editorCommon.IEditorContribution { if (links) { // Not sure why this is sometimes null for (var i = 0; i < links.length; i++) { - newDecorations.push(LinkOccurence.decoration(links[i])); + newDecorations.push(LinkOccurence.decoration(links[i], useMetaKey)); } } @@ -202,27 +228,14 @@ class LinkDetector implements editorCommon.IEditorContribution { }); } - private onEditorKeyDown(e: IKeyboardEvent): void { - if (e.keyCode === LinkDetector.TRIGGER_KEY_VALUE && this.lastMouseEvent) { - this.onEditorMouseMove(this.lastMouseEvent, e); - } - } - - private onEditorKeyUp(e: IKeyboardEvent): void { - if (e.keyCode === LinkDetector.TRIGGER_KEY_VALUE) { - this.cleanUpActiveLinkDecoration(); - } - } - - private onEditorMouseMove(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): void { - this.lastMouseEvent = mouseEvent; - + private _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void { + const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); if (this.isEnabled(mouseEvent, withKey)) { this.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one var occurence = this.getLinkOccurence(mouseEvent.target.position); if (occurence) { this.editor.changeDecorations((changeAccessor) => { - occurence.activate(changeAccessor); + occurence.activate(changeAccessor, useMetaKey); this.activeLinkDecorationId = occurence.decorationId; }); } @@ -232,11 +245,12 @@ class LinkDetector implements editorCommon.IEditorContribution { } private cleanUpActiveLinkDecoration(): void { + const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); if (this.activeLinkDecorationId) { var occurence = this.currentOccurences[this.activeLinkDecorationId]; if (occurence) { this.editor.changeDecorations((changeAccessor) => { - occurence.deactivate(changeAccessor); + occurence.deactivate(changeAccessor, useMetaKey); }); } @@ -244,7 +258,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } } - private onEditorMouseUp(mouseEvent: IEditorMouseEvent): void { + private onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void { if (!this.isEnabled(mouseEvent)) { return; } @@ -252,7 +266,7 @@ class LinkDetector implements editorCommon.IEditorContribution { if (!occurence) { return; } - this.openLinkOccurence(occurence, mouseEvent.event.altKey); + this.openLinkOccurence(occurence, mouseEvent.hasSideBySideModifier); } public openLinkOccurence(occurence: LinkOccurence, openToSide: boolean): void { @@ -298,9 +312,11 @@ class LinkDetector implements editorCommon.IEditorContribution { return null; } - private isEnabled(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): boolean { - return mouseEvent.target.type === MouseTargetType.CONTENT_TEXT && - (mouseEvent.event[LinkDetector.TRIGGER_MODIFIER] || (withKey && withKey.keyCode === LinkDetector.TRIGGER_KEY_VALUE)); + private isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean { + return ( + mouseEvent.target.type === MouseTargetType.CONTENT_TEXT + && (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)) + ); } private stop(): void { @@ -348,6 +364,6 @@ class OpenLinkAction extends EditorAction { registerThemingParticipant((theme, collector) => { let activeLinkForeground = theme.getColor(editorActiveLinkForeground); if (activeLinkForeground) { - collector.addRule(`.monaco-editor.${theme.selector} .detected-link-active { color: ${activeLinkForeground} !important; }`); + collector.addRule(`.monaco-editor .detected-link-active { color: ${activeLinkForeground} !important; }`); } }); \ No newline at end of file diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHints.css b/src/vs/editor/contrib/parameterHints/browser/parameterHints.css index dd628db6a5e..abb195c2d0b 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHints.css +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHints.css @@ -5,8 +5,6 @@ .monaco-editor .parameter-hints-widget { z-index: 10; - background-color: #F3F3F3; - border: 1px solid rgb(200, 200, 200); display: flex; flex-direction: column; line-height: 1.5em; @@ -41,20 +39,13 @@ flex-direction: column; } -.monaco-editor .parameter-hints-widget.multiple .body { - border-left: 1px solid rgba(204, 204, 204, 0.5); -} - .monaco-editor .parameter-hints-widget .signature { padding: 4px 5px; } -.monaco-editor .parameter-hints-widget .signature.has-docs { - border-bottom: 1px solid rgba(204, 204, 204, 0.5); -} - .monaco-editor .parameter-hints-widget .docs { padding: 0 10px 0 5px; + white-space: pre-wrap; } .monaco-editor .parameter-hints-widget .buttons { @@ -117,19 +108,7 @@ margin-right: 0.5em; } -/*** VS Dark */ - -.monaco-editor.vs-dark .parameter-hints-widget { - background-color: #2D2D30; - border-color: rgba(85,85,85,0.5); -} - -.monaco-editor.hc-black .parameter-hints-widget .body, -.monaco-editor.vs-dark .parameter-hints-widget .body, -.monaco-editor.hc-black .parameter-hints-widget .signature, -.monaco-editor.vs-dark .parameter-hints-widget .signature { - border-color: rgba(85,85,85,0.5); -} +/*** VS Dark & High Contrast*/ .monaco-editor.hc-black .parameter-hints-widget .button.previous, .monaco-editor.vs-dark .parameter-hints-widget .button.previous { @@ -139,11 +118,4 @@ .monaco-editor.hc-black .parameter-hints-widget .button.next, .monaco-editor.vs-dark .parameter-hints-widget .button.next { background-image: url('arrow-down-dark.svg'); -} - -/*** High Contrast */ - -.monaco-editor.hc-black .parameter-hints-widget { - background-color: #0C141F; - border: 2px solid #6FC3DF; } \ No newline at end of file diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index fd8a7952870..a9fec25edf6 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -24,6 +24,8 @@ import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableEle import { CharacterSet } from 'vs/editor/common/core/characterClassifier'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; +import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; @@ -471,4 +473,19 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { this.disposables = dispose(this.disposables); this.model = null; } -} \ No newline at end of file +} + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(editorHoverBorder); + if (border) { + let borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1; + collector.addRule(`.monaco-editor .parameter-hints-widget { border: ${borderWidth}px solid ${border}; }`); + collector.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${border.transparent(0.5)}; }`); + collector.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${border.transparent(0.5)}; }`); + + } + let background = theme.getColor(editorHoverBackground); + if (background) { + collector.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${background}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts b/src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts index f0946cd7929..c1bde40b2d7 100644 --- a/src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts +++ b/src/vs/editor/contrib/quickFix/browser/lightBulbWidget.ts @@ -18,7 +18,7 @@ export class LightBulbWidget implements IDisposable { private readonly _options = { stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, glyphMarginClassName: 'lightbulb-glyph', - glyphMarginHoverMessage: undefined + glyphMarginHoverMessage: undefined }; private readonly _editor: ICodeEditor; diff --git a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts b/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts index feb1726927b..6117ad98768 100644 --- a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts @@ -14,6 +14,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Range } from 'vs/editor/common/core/range'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IQuickOpenControllerOpts { inputAriaLabel: string; @@ -94,6 +95,11 @@ export class QuickOpenController implements editorCommon.IEditorContribution { this.widget.show(''); } + private static _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + className: 'rangeHighlight', + isWholeLine: true + }); + public decorateLine(range: Range, editor: ICodeEditor): void { editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { var oldDecorations: string[] = []; @@ -105,10 +111,7 @@ export class QuickOpenController implements editorCommon.IEditorContribution { var newDecorations: editorCommon.IModelDeltaDecoration[] = [ { range: range, - options: { - className: 'rangeHighlight', - isWholeLine: true - } + options: QuickOpenController._RANGE_HIGHLIGHT_DECORATION } ]; diff --git a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts index 3adcedc0662..6249277425f 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts @@ -163,8 +163,8 @@ CommandsRegistry.registerCommand('editor.action.showReferences', { } }); -function closeActiveReferenceSearch(accessor, args) { - var outerEditor = getOuterEditor(accessor, args); +function closeActiveReferenceSearch(accessor: ServicesAccessor, args: any) { + var outerEditor = getOuterEditor(accessor); if (!outerEditor) { return; } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts index d4bff8009dd..140a7e3e0e8 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts @@ -58,7 +58,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @IEditorService private _editorService: IEditorService, - @ITextModelResolverService private _textModelResolverService, + @ITextModelResolverService private _textModelResolverService: ITextModelResolverService, @ITelemetryService private _telemetryService: ITelemetryService, @IMessageService private _messageService: IMessageService, @IInstantiationService private _instantiationService: IInstantiationService, diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css index 54a5b82fa70..922f4807e48 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css @@ -19,13 +19,6 @@ vertical-align: top; } -.monaco-editor .reference-zone-widget .label { - font-size: 0.9em; - text-align: center; - color: #646465; - margin-top: 6px; -} - .monaco-editor .reference-zone-widget .messages { height: 100%; width: 100%; @@ -38,19 +31,6 @@ font-size: 13px; } -.monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.has-children > .content:before { - border-left-color: #A6A6A6; -} - -.monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.has-children > .content:after { - border-left-color: rgba(51, 153, 255, .2); -} - -.monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.expanded > .content:before { - border-right-color: #646465; - border-left-color: transparent; -} - .monaco-editor .reference-zone-widget .ref-tree .reference { text-overflow: ellipsis; overflow: hidden; @@ -61,43 +41,13 @@ line-height: 22px; } -.monaco-editor .reference-zone-widget .ref-tree .reference-file .directory { - opacity: 0.7; - margin-left: 0.5em; - font-size: 0.9em; -} - .monaco-editor .reference-zone-widget .monaco-count-badge { margin-right: 12px; } -/* dark room */ - -.monaco-editor.vs-dark .reference-zone-widget .ref-tree .block, -.monaco-editor.vs-dark .reference-zone-widget .overlay { - background-color: #1e1e1e; -} - -.monaco-editor.vs-dark .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.has-children > .content:before { - border-left-color: white; -} - -.monaco-editor.vs-dark .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.has-children > .content:after { - border-left-color: rgba(51, 153, 255, .2); -} - -.monaco-editor.vs-dark .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected.expanded > .content:before { - border-right-color: white; - border-left-color: transparent; -} - /* High Contrast Theming */ .monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file { line-height: 20px; font-weight: bold; -} - -.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file .directory { - font-weight: normal; } \ No newline at end of file diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts index 35a4b56d096..959c2bc8939 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts @@ -27,10 +27,9 @@ import { LeftRightWidget } from 'vs/base/browser/ui/leftRightWidget/leftRightWid import * as tree from 'vs/base/parts/tree/browser/tree'; import { DefaultController, LegacyRenderer } from 'vs/base/parts/tree/browser/treeDefaults'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; @@ -41,16 +40,18 @@ import { FileReferences, OneReference, ReferencesModel } from './referencesModel import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { registerColor, activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant, ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { attachListStyler, attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IModelDecorationsChangedEvent } from 'vs/editor/common/model/textModelEvents'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; class DecorationsManager implements IDisposable { - private static DecorationOptions: editorCommon.IModelDecorationOptions = { + private static DecorationOptions = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'reference-decoration' - }; + }); private _decorations = new Map(); private _decorationIgnoreSet = new Set(); @@ -345,10 +346,19 @@ class Controller extends DefaultController { class Renderer extends LegacyRenderer { private _contextService: IWorkspaceContextService; + private _themeService: IThemeService; + private _environmentService: IEnvironmentService; - constructor( @IWorkspaceContextService contextService: IWorkspaceContextService) { + constructor( + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IThemeService themeService: IThemeService, + @optional(IEnvironmentService) environmentService: IEnvironmentService + ) { super(); + this._contextService = contextService; + this._themeService = themeService; + this._environmentService = environmentService; } public getHeight(tree: tree.ITree, element: any): number { @@ -357,6 +367,7 @@ class Renderer extends LegacyRenderer { protected render(tree: tree.ITree, element: FileReferences | OneReference, container: HTMLElement): tree.IElementCallback { + const toDispose: IDisposable[] = []; dom.clearNode(container); if (element instanceof FileReferences) { @@ -365,13 +376,15 @@ class Renderer extends LegacyRenderer { /* tslint:disable:no-unused-expression */ new LeftRightWidget(fileReferencesContainer, (left: HTMLElement) => { - new FileLabel(left, element.uri, this._contextService); + const label = new FileLabel(left, element.uri, this._contextService, this._environmentService); + toDispose.push(label); return null; }, (right: HTMLElement) => { const len = element.children.length; - const badge = new CountBadge(right, len); + const badge = new CountBadge(right, { count: len }); + toDispose.push(attachBadgeStyler(badge, this._themeService)); if (element.failure) { badge.setTitleFormat(nls.localize('referencesFailre', "Failed to resolve file.")); @@ -403,7 +416,9 @@ class Renderer extends LegacyRenderer { strings.escape(preview.after))).appendTo(container); } - return null; + return () => { + dispose(toDispose); + }; } } @@ -591,7 +606,13 @@ export class ReferenceWidget extends PeekViewWidget { var options: IEditorOptions = { scrollBeyondLastLine: false, - scrollbar: DefaultConfig.editor.scrollbar, + scrollbar: { + verticalScrollbarSize: 14, + horizontal: 'auto', + useShadows: true, + verticalHasArrows: false, + horizontalHasArrows: false + }, overviewRulerLanes: 2, fixedOverflowWidgets: true, minimap: { @@ -808,6 +829,7 @@ export const peekViewResultsFileForeground = registerColor('peekViewResult.fileF export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hc: null }, nls.localize('peekViewResultsSelectionBackground', 'Background color of the selected entry in the peek view result list.')); export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hc: Color.white }, nls.localize('peekViewResultsSelectionForeground', 'Foreground color of the selected entry in the peek view result list.')); export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hc: Color.black }, nls.localize('peekViewEditorBackground', 'Background color of the peek view editor.')); +export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', { dark: peekViewEditorBackground, light: peekViewEditorBackground, hc: peekViewEditorBackground }, nls.localize('peekViewEditorGutterBackground', 'Background color of the gutter in the peek view editor.')); export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hc: null }, nls.localize('peekViewResultsMatchHighlight', 'Match highlight color in the peek view result list.')); export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hc: null }, nls.localize('peekViewEditorMatchHighlight', 'Match highlight color in the peek view editor.')); @@ -816,45 +838,50 @@ export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchH registerThemingParticipant((theme, collector) => { let findMatchHighlightColor = theme.getColor(peekViewResultsMatchHighlight); if (findMatchHighlightColor) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree .referenceMatch { background-color: ${findMatchHighlightColor}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch { background-color: ${findMatchHighlightColor}; }`); } let referenceHighlightColor = theme.getColor(peekViewEditorMatchHighlight); if (referenceHighlightColor) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .preview .reference-decoration { background-color: ${referenceHighlightColor}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${referenceHighlightColor}; }`); } let hcOutline = theme.getColor(activeContrastBorder); if (hcOutline) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree .referenceMatch { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .preview .reference-decoration { border: 2px solid ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${hcOutline}; box-sizing: border-box; }`); } let resultsBackground = theme.getColor(peekViewResultsBackground); if (resultsBackground) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree { background-color: ${resultsBackground}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${resultsBackground}; }`); } let resultsMatchForeground = theme.getColor(peekViewResultsMatchForeground); if (resultsMatchForeground) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree { color: ${resultsMatchForeground}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${resultsMatchForeground}; }`); } let resultsFileForeground = theme.getColor(peekViewResultsFileForeground); if (resultsFileForeground) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree .reference-file { color: ${resultsFileForeground}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${resultsFileForeground}; }`); } let resultsSelectedBackground = theme.getColor(peekViewResultsSelectionBackground); if (resultsSelectedBackground) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${resultsSelectedBackground}; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${resultsSelectedBackground}; }`); } let resultsSelectedForeground = theme.getColor(peekViewResultsSelectionForeground); if (resultsSelectedForeground) { - collector.addRule(`.monaco-editor.${theme.selector} .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${resultsSelectedForeground} !important; }`); + collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${resultsSelectedForeground} !important; }`); } let editorBackground = theme.getColor(peekViewEditorBackground); if (editorBackground) { collector.addRule( - `.monaco-editor.${theme.selector} .reference-zone-widget .preview .monaco-editor,` + - `.monaco-editor.${theme.selector} .reference-zone-widget .preview .glyph-margin,` + - `.monaco-editor.${theme.selector} .reference-zone-widget .preview .monaco-editor-background,` + - `.monaco-editor.${theme.selector} .reference-zone-widget .preview .monaco-editor .margin .view-line {` + + `.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,` + + `.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {` + ` background-color: ${editorBackground};` + `}`); } + let editorGutterBackground = theme.getColor(peekViewEditorGutterBackground); + if (editorGutterBackground) { + collector.addRule( + `.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {` + + ` background-color: ${editorGutterBackground};` + + `}`); + } }); diff --git a/src/vs/editor/contrib/rename/browser/renameInputField.ts b/src/vs/editor/contrib/rename/browser/renameInputField.ts index 241d5f6c51d..11564d8e05a 100644 --- a/src/vs/editor/contrib/rename/browser/renameInputField.ts +++ b/src/vs/editor/contrib/rename/browser/renameInputField.ts @@ -13,7 +13,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Range } from 'vs/editor/common/core/range'; import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; -import { inputBackground, inputBorder, inputForeground, widgetShadow, focusBorder } from 'vs/platform/theme/common/colorRegistry'; +import { inputBackground, inputBorder, inputForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; import { Position } from 'vs/editor/common/core/position'; export default class RenameInputField implements IContentWidget, IDisposable { @@ -79,7 +79,7 @@ export default class RenameInputField implements IContentWidget, IDisposable { const background = theme.getColor(inputBackground); const foreground = theme.getColor(inputForeground); const widgetShadowColor = theme.getColor(widgetShadow); - const border = theme.getColor(inputBorder) || theme.getColor(focusBorder); + const border = theme.getColor(inputBorder); this._inputField.style.backgroundColor = background ? background.toString() : null; this._inputField.style.color = foreground ? foreground.toString() : null; @@ -151,7 +151,7 @@ export default class RenameInputField implements IContentWidget, IDisposable { this._currentAcceptInput = () => { if (this._inputField.value.trim().length === 0 || this._inputField.value === value) { // empty or whitespace only or not changed - this._currentCancelInput(); + this.cancelInput(); return; } @@ -162,12 +162,12 @@ export default class RenameInputField implements IContentWidget, IDisposable { let onCursorChanged = () => { if (!Range.containsPosition(where, this._editor.getPosition())) { - this._currentCancelInput(); + this.cancelInput(); } }; disposeOnDone.push(this._editor.onDidChangeCursorSelection(onCursorChanged)); - disposeOnDone.push(this._editor.onDidBlurEditor(this._currentCancelInput)); + disposeOnDone.push(this._editor.onDidBlurEditor(() => this.cancelInput())); this._show(); diff --git a/src/vs/editor/contrib/snippet/common/snippet.md b/src/vs/editor/contrib/snippet/browser/snippet.md similarity index 100% rename from src/vs/editor/contrib/snippet/common/snippet.md rename to src/vs/editor/contrib/snippet/browser/snippet.md diff --git a/src/vs/editor/contrib/snippet/browser/snippetController2.ts b/src/vs/editor/contrib/snippet/browser/snippetController2.ts new file mode 100644 index 00000000000..4c210d851ac --- /dev/null +++ b/src/vs/editor/contrib/snippet/browser/snippetController2.ts @@ -0,0 +1,228 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { RawContextKey, IContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { commonEditorContribution, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { SnippetSession } from './snippetSession'; +import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; + +class SnippetSessions { + + private _stack: SnippetSession[] = []; + + add(session: SnippetSession): number { + return this._stack.push(session); + } + + clear(): void { + dispose(this._stack); + this._stack.length = 0; + } + + get empty(): boolean { + return this._stack.length === 0; + } + + get hasPlaceholder(): boolean { + return this._stack.some(s => s.hasPlaceholder); + } + + get isAtFirstPlaceholder(): boolean { + return this._stack.every(s => s.isAtFirstPlaceholder); + } + + get isAtFinalPlaceholder(): boolean { + return !this.empty && this._stack[0].isAtLastPlaceholder; + } + + get isSelectionWithinPlaceholders(): boolean { + return this._stack.some(s => s.isSelectionWithinPlaceholders()); + } + + prev(): void { + for (let i = this._stack.length - 1; i >= 0; i--) { + const snippet = this._stack[i]; + if (!snippet.isAtFirstPlaceholder) { + snippet.prev(); + break; + } + } + } + + next(): void { + for (let i = this._stack.length - 1; i >= 0; i--) { + const snippet = this._stack[i]; + if (!snippet.isAtLastPlaceholder) { + snippet.next(); + break; + } + } + } +} + +@commonEditorContribution +export class SnippetController2 { + + static get(editor: ICommonCodeEditor): SnippetController2 { + return editor.getContribution('snippetController2'); + } + + static InSnippetMode = new RawContextKey('inSnippetMode', false); + static HasNextTabstop = new RawContextKey('hasNextTabstop', false); + static HasPrevTabstop = new RawContextKey('hasPrevTabstop', false); + + private readonly _inSnippet: IContextKey; + private readonly _hasNextTabstop: IContextKey; + private readonly _hasPrevTabstop: IContextKey; + + // private _snippet: SnippetSession; + private _sessions = new SnippetSessions(); + private _snippetListener: IDisposable[] = []; + + constructor( + private readonly _editor: ICommonCodeEditor, + @IContextKeyService contextKeyService: IContextKeyService + ) { + this._inSnippet = SnippetController2.InSnippetMode.bindTo(contextKeyService); + this._hasNextTabstop = SnippetController2.HasNextTabstop.bindTo(contextKeyService); + this._hasPrevTabstop = SnippetController2.HasPrevTabstop.bindTo(contextKeyService); + } + + dispose(): void { + this._inSnippet.reset(); + this._hasPrevTabstop.reset(); + this._hasNextTabstop.reset(); + this._sessions.clear(); + } + + getId(): string { + return 'snippetController2'; + } + + insert( + template: string, + overwriteBefore: number = 0, overwriteAfter: number = 0, + undoStopBefore: boolean = true, undoStopAfter: boolean = true + ): void { + + // don't listen while inserting the snippet + // as that is the inflight state causing cancelation + this._snippetListener = dispose(this._snippetListener); + + if (undoStopBefore) { + this._editor.getModel().pushStackElement(); + } + + const snippet = new SnippetSession(this._editor, template, overwriteBefore, overwriteAfter); + const newLen = this._sessions.add(snippet); + snippet.insert(newLen > 1); + + if (undoStopAfter) { + this._editor.getModel().pushStackElement(); + } + + this._snippetListener = [ + this._editor.onDidChangeModel(() => this.cancel()), + this._editor.onDidChangeCursorSelection(() => this._updateState()) + ]; + this._updateState(); + } + + private _updateState(): void { + if (this._sessions.empty) { + // canceled in the meanwhile + return; + } + + if (!this._sessions.hasPlaceholder) { + // don't listen for selection changes and don't + // update context keys when the snippet is plain text + return this.cancel(); + } + + if (this._sessions.isAtFinalPlaceholder || !this._sessions.isSelectionWithinPlaceholders) { + return this.cancel(); + } + + this._inSnippet.set(true); + this._hasPrevTabstop.set(!this._sessions.isAtFirstPlaceholder); + this._hasNextTabstop.set(!this._sessions.isAtFinalPlaceholder); + } + + finish(): void { + while (this._inSnippet.get()) { + this.next(); + } + } + + cancel(): void { + this._inSnippet.reset(); + this._hasPrevTabstop.reset(); + this._hasNextTabstop.reset(); + this._sessions.clear(); + dispose(this._snippetListener); + } + + prev(): void { + this._sessions.prev(); + this._updateState(); + } + + next(): void { + this._sessions.next(); + this._updateState(); + } +} + + +const CommandCtor = EditorCommand.bindToContribution(SnippetController2.get); + +CommonEditorRegistry.registerEditorCommand(new CommandCtor({ + id: 'jumpToNextSnippetPlaceholder', + precondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasNextTabstop), + handler: ctrl => ctrl.next(), + kbOpts: { + weight: CommonEditorRegistry.commandWeight(30), + kbExpr: EditorContextKeys.textFocus, + primary: KeyCode.Tab + } +})); +CommonEditorRegistry.registerEditorCommand(new CommandCtor({ + id: 'jumpToPrevSnippetPlaceholder', + precondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasPrevTabstop), + handler: ctrl => ctrl.prev(), + kbOpts: { + weight: CommonEditorRegistry.commandWeight(30), + kbExpr: EditorContextKeys.textFocus, + primary: KeyMod.Shift | KeyCode.Tab + } +})); +CommonEditorRegistry.registerEditorCommand(new CommandCtor({ + id: 'leaveSnippet', + precondition: SnippetController2.InSnippetMode, + handler: ctrl => ctrl.cancel(), + kbOpts: { + weight: CommonEditorRegistry.commandWeight(30), + kbExpr: EditorContextKeys.textFocus, + primary: KeyCode.Escape, + secondary: [KeyMod.Shift | KeyCode.Escape] + } +})); + +CommonEditorRegistry.registerEditorCommand(new CommandCtor({ + id: 'acceptSnippet', + precondition: SnippetController2.InSnippetMode, + handler: ctrl => ctrl.finish(), + // kbOpts: { + // weight: CommonEditorRegistry.commandWeight(30), + // kbExpr: EditorContextKeys.textFocus, + // primary: KeyCode.Enter, + // } +})); diff --git a/src/vs/editor/contrib/snippet/common/snippetParser.ts b/src/vs/editor/contrib/snippet/browser/snippetParser.ts similarity index 68% rename from src/vs/editor/contrib/snippet/common/snippetParser.ts rename to src/vs/editor/contrib/snippet/browser/snippetParser.ts index 7017f77383c..0506b2b187b 100644 --- a/src/vs/editor/contrib/snippet/common/snippetParser.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetParser.ts @@ -132,9 +132,18 @@ export abstract class Marker { return result; } + parent: Marker; + + protected _adopt(child: Marker): void { + child.parent = this; + } + toString() { return ''; } + len(): number { + return 0; + } } export class Text extends Marker { @@ -144,11 +153,35 @@ export class Text extends Marker { toString() { return this.string; } + len(): number { + return this.string.length; + } } export class Placeholder extends Marker { - constructor(public name: string = '', public defaultValue: Marker[]) { + + static compareByIndex(a: Placeholder, b: Placeholder): number { + if (a.index === b.index) { + return 0; + } else if (a.isFinalTabstop) { + return 1; + } else if (b.isFinalTabstop) { + return -1; + } else if (a.index < b.index) { + return -1; + } else if (a.index > b.index) { + return 1; + } else { + return 0; + } + } + + constructor(public index: string = '', public defaultValue: Marker[]) { super(); + defaultValue.forEach(this._adopt, this); + } + get isFinalTabstop() { + return this.index === '0'; } toString() { return Marker.toString(this.defaultValue); @@ -161,19 +194,126 @@ export class Variable extends Marker { constructor(public name: string = '', public defaultValue: Marker[]) { super(); + defaultValue.forEach(this._adopt, this); } - get isDefined(): boolean { return this.resolvedValue !== undefined; } - + len(): number { + if (this.isDefined) { + return this.resolvedValue.length; + } else { + return super.len(); + } + } toString() { return this.isDefined ? this.resolvedValue : Marker.toString(this.defaultValue); } } +export function walk(marker: Marker[], visitor: (marker: Marker) => boolean): void { + const stack = [...marker]; + while (stack.length > 0) { + const marker = stack.shift(); + const recurse = visitor(marker); + if (!recurse) { + break; + } + if (marker instanceof Placeholder || marker instanceof Variable) { + stack.unshift(...marker.defaultValue); + } + } +} + +export class TextmateSnippet { + + readonly marker: Marker[]; + readonly placeholders: Placeholder[]; + + constructor(marker: Marker[]) { + this.marker = marker; + this.placeholders = []; + + // fill in placeholders + walk(marker, candidate => { + if (candidate instanceof Placeholder) { + this.placeholders.push(candidate); + } + return true; + }); + + Object.freeze(this.marker); + Object.freeze(this.placeholders); + } + + offset(marker: Marker): number { + let pos = 0; + let found = false; + walk(this.marker, candidate => { + if (candidate === marker) { + found = true; + return false; + } + pos += candidate.len(); + return true; + }); + + if (!found) { + return -1; + } + return pos; + } + + len(marker: Marker): number { + let ret = 0; + walk([marker], marker => { + ret += marker.len(); + return true; + }); + return ret; + } + + enclosingPlaceholders(placeholder: Placeholder): Placeholder[] { + let ret: Placeholder[] = []; + let { parent } = placeholder; + while (parent) { + if (parent instanceof Placeholder) { + ret.push(parent); + } + parent = parent.parent; + } + return ret; + } + + get text() { + return Marker.toString(this.marker); + } + + resolveVariables(resolver: { resolve(name: string): string }): this { + walk(this.marker, candidate => { + if (candidate instanceof Variable) { + candidate.resolvedValue = resolver.resolve(candidate.name); + if (candidate.isDefined) { + // remove default value from resolved variable + candidate.defaultValue.length = 0; + } + } + return true; + }); + return this; + } +} export class SnippetParser { + static escape(value: string): string { + return value.replace(/\$|}|\\/g, '\\$&'); + } + + static parse(template: string): TextmateSnippet { + const marker = new SnippetParser(true, false).parse(template, true); + return new TextmateSnippet(marker); + } + private _enableTextMate: boolean; private _enableInternal: boolean; private _scanner = new Scanner(); @@ -185,11 +325,11 @@ export class SnippetParser { this._enableInternal = enableInternal; } - escape(value: string): string { + text(value: string): string { return Marker.toString(this.parse(value)); } - parse(value: string): Marker[] { + parse(value: string, insertFinalTabstop?: boolean): Marker[] { const marker: Marker[] = []; this._scanner.text(value); @@ -200,24 +340,26 @@ export class SnippetParser { // * fill in default for empty placeHolders // * compact sibling Text markers - function compact(marker: Marker[], placeholders: { [name: string]: Marker[] }) { + function walk(marker: Marker[], placeholderDefaultValues: Map) { for (let i = 0; i < marker.length; i++) { const thisMarker = marker[i]; if (thisMarker instanceof Placeholder) { - if (placeholders[thisMarker.name] === undefined) { - placeholders[thisMarker.name] = thisMarker.defaultValue; + // fill in default values for repeated placeholders + // like `${1:foo}and$1` becomes ${1:foo}and${1:foo} + if (!placeholderDefaultValues.has(thisMarker.index)) { + placeholderDefaultValues.set(thisMarker.index, thisMarker.defaultValue); } else if (thisMarker.defaultValue.length === 0) { - thisMarker.defaultValue = placeholders[thisMarker.name].slice(0); + thisMarker.defaultValue = placeholderDefaultValues.get(thisMarker.index).slice(0); } if (thisMarker.defaultValue.length > 0) { - compact(thisMarker.defaultValue, placeholders); + walk(thisMarker.defaultValue, placeholderDefaultValues); } } else if (thisMarker instanceof Variable) { - compact(thisMarker.defaultValue, placeholders); + walk(thisMarker.defaultValue, placeholderDefaultValues); } else if (i > 0 && thisMarker instanceof Text && marker[i - 1] instanceof Text) { (marker[i - 1]).string += (marker[i]).string; @@ -227,7 +369,18 @@ export class SnippetParser { } } - compact(marker, Object.create(null)); + const placeholderDefaultValues = new Map(); + walk(marker, placeholderDefaultValues); + + if ( + insertFinalTabstop + && placeholderDefaultValues.size > 0 + && !placeholderDefaultValues.has('0') + ) { + // the snippet uses placeholders but has no + // final tabstop defined -> insert at the end + marker.push(new Placeholder('0', [])); + } return marker; } diff --git a/src/vs/editor/contrib/snippet/browser/snippet.css b/src/vs/editor/contrib/snippet/browser/snippetSession.css similarity index 78% rename from src/vs/editor/contrib/snippet/browser/snippet.css rename to src/vs/editor/contrib/snippet/browser/snippetSession.css index 6f839f10d22..b6c7d72adda 100644 --- a/src/vs/editor/contrib/snippet/browser/snippet.css +++ b/src/vs/editor/contrib/snippet/browser/snippetSession.css @@ -3,10 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-editor.vs .new-snippet { background-color: rgba(10, 50, 150, 0.1); } -.monaco-editor.vs-dark .new-snippet { background-color: rgba(100, 105, 110, 0.1); } -.monaco-editor.hc-black .new-snippet { background-color: rgba(100, 105, 110, 0.1); } - .monaco-editor.vs .snippet-placeholder { background-color: rgba(10, 50, 100, 0.1); } .monaco-editor.vs-dark .snippet-placeholder { background-color: rgba(124, 124, 124, 0.1); } .monaco-editor.hc-black .snippet-placeholder { background-color: rgba(124, 124, 124, 0.1); } diff --git a/src/vs/editor/contrib/snippet/browser/snippetSession.ts b/src/vs/editor/contrib/snippet/browser/snippetSession.ts new file mode 100644 index 00000000000..c4fcdaa3e41 --- /dev/null +++ b/src/vs/editor/contrib/snippet/browser/snippetSession.ts @@ -0,0 +1,361 @@ +/*--------------------------------------------------------------------------------------------- + * 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 'vs/css!./snippetSession'; +import { getLeadingWhitespace } from 'vs/base/common/strings'; +import { ICommonCodeEditor, IModel, TrackedRangeStickiness, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; +import { EditOperation } from 'vs/editor/common/core/editOperation'; +import { TextmateSnippet, Placeholder, SnippetParser } from './snippetParser'; +import { Selection } from 'vs/editor/common/core/selection'; +import { Range } from 'vs/editor/common/core/range'; +import { IPosition } from 'vs/editor/common/core/position'; +import { groupBy } from 'vs/base/common/arrays'; +import { dispose } from 'vs/base/common/lifecycle'; +import { EditorSnippetVariableResolver } from "./snippetVariables"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; + +export class OneSnippet { + + private readonly _editor: ICommonCodeEditor; + private readonly _snippet: TextmateSnippet; + private readonly _offset: number; + + private _placeholderDecorations: Map; + private _placeholderGroups: Placeholder[][]; + private _placeholderGroupsIdx: number; + + private static readonly _decor = { + active: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }), + inactive: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }), + activeFinal: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }), + inactiveFinal: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }), + }; + + constructor(editor: ICommonCodeEditor, snippet: TextmateSnippet, offset: number) { + this._editor = editor; + this._snippet = snippet; + this._offset = offset; + + this._placeholderGroups = groupBy(snippet.placeholders, Placeholder.compareByIndex); + this._placeholderGroupsIdx = -1; + } + + dispose(): void { + if (this._placeholderDecorations) { + this._editor.changeDecorations(accessor => this._placeholderDecorations.forEach(handle => accessor.removeDecoration(handle))); + } + this._placeholderGroups.length = 0; + } + + private _initDecorations(): void { + + if (this._placeholderDecorations) { + // already initialized + return; + } + + this._placeholderDecorations = new Map(); + const model = this._editor.getModel(); + + this._editor.changeDecorations(accessor => { + // create a decoration for each placeholder + for (const placeholder of this._snippet.placeholders) { + const placeholderOffset = this._snippet.offset(placeholder); + const placeholderLen = this._snippet.len(placeholder); + const range = Range.fromPositions( + model.getPositionAt(this._offset + placeholderOffset), + model.getPositionAt(this._offset + placeholderOffset + placeholderLen) + ); + const options = placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive; + const handle = accessor.addDecoration(range, options); + this._placeholderDecorations.set(placeholder, handle); + } + }); + } + + move(fwd: boolean): Selection[] { + + this._initDecorations(); + + if (fwd && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) { + this._placeholderGroupsIdx += 1; + + } else if (!fwd && this._placeholderGroupsIdx > 0) { + this._placeholderGroupsIdx -= 1; + + } else { + // the selection of the current placeholder might + // not acurate any more -> simply restore it + } + + return this._editor.getModel().changeDecorations(accessor => { + + const activePlaceholders = new Set(); + + // change stickiness to always grow when typing at its edges + // because these decorations represent the currently active + // tabstop. + // Special case #1: reaching the final tabstop + // Special case #2: placeholders enclosing active placeholders + const selections: Selection[] = []; + for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { + const id = this._placeholderDecorations.get(placeholder); + const range = this._editor.getModel().getDecorationRange(id); + selections.push(new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)); + + accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active); + activePlaceholders.add(placeholder); + + for (const enclosingPlaceholder of this._snippet.enclosingPlaceholders(placeholder)) { + const id = this._placeholderDecorations.get(enclosingPlaceholder); + accessor.changeDecorationOptions(id, enclosingPlaceholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active); + activePlaceholders.add(enclosingPlaceholder); + } + } + + // change stickness to never grow when typing at its edges + // so that in-active tabstops never grow + this._placeholderDecorations.forEach((id, placeholder) => { + if (!activePlaceholders.has(placeholder)) { + accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive); + } + }); + + return selections; + }); + } + + get isAtFirstPlaceholder() { + return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0; + } + + get isAtLastPlaceholder() { + return this._placeholderGroupsIdx === this._placeholderGroups.length - 1; + } + + get hasPlaceholder() { + return this._snippet.placeholders.length > 0; + } + + get placeholderRanges() { + const ret: Range[] = []; + this._placeholderDecorations.forEach((id, placeholder) => { + if (!placeholder.isFinalTabstop) { + const range = this._editor.getModel().getDecorationRange(id); + if (range) { + ret.push(range); + } + } + }); + return ret; + } +} + +export class SnippetSession { + + static adjustWhitespace(model: IModel, position: IPosition, template: string): string { + + const line = model.getLineContent(position.lineNumber); + const lineLeadingWhitespace = getLeadingWhitespace(line, 0, position.column - 1); + const templateLines = template.split(/\r\n|\r|\n/); + + for (let i = 1; i < templateLines.length; i++) { + let templateLeadingWhitespace = getLeadingWhitespace(templateLines[i]); + templateLines[i] = model.normalizeIndentation(lineLeadingWhitespace + templateLeadingWhitespace) + templateLines[i].substr(templateLeadingWhitespace.length); + } + return templateLines.join(model.getEOL()); + } + + static adjustSelection(model: IModel, selection: Selection, overwriteBefore: number, overwriteAfter: number): Selection { + if (overwriteBefore !== 0 || overwriteAfter !== 0) { + let { startLineNumber, startColumn, endLineNumber, endColumn } = selection; + startColumn -= overwriteBefore; + endColumn += overwriteAfter; + + const range = model.validateRange(Range.plusRange(selection, { + startLineNumber, + startColumn, + endLineNumber, + endColumn, + })); + + selection = Selection.createWithDirection( + range.startLineNumber, range.startColumn, + range.endLineNumber, range.endColumn, + selection.getDirection() + ); + } + return selection; + } + + private readonly _editor: ICommonCodeEditor; + private readonly _template: string; + private readonly _overwriteBefore: number; + private readonly _overwriteAfter: number; + private _snippets: OneSnippet[] = []; + + constructor(editor: ICommonCodeEditor, template: string, overwriteBefore: number = 0, overwriteAfter: number = 0) { + this._editor = editor; + this._template = template; + this._overwriteBefore = overwriteBefore; + this._overwriteAfter = overwriteAfter; + } + + dispose(): void { + dispose(this._snippets); + } + + insert(ignoreFinalTabstops: boolean = false): void { + + const model = this._editor.getModel(); + const edits: IIdentifiedSingleEditOperation[] = []; + + let delta = 0; + + // know what text the overwrite[Before|After] extensions + // of the primary curser have selected because only when + // secondary selections extend to the same text we can grow them + let firstBeforeText = model.getValueInRange(SnippetSession.adjustSelection(model, this._editor.getSelection(), this._overwriteBefore, 0)); + let firstAfterText = model.getValueInRange(SnippetSession.adjustSelection(model, this._editor.getSelection(), 0, this._overwriteAfter)); + + // sort selections by their start position but remeber + // the original index. that allows you to create correct + // offset-based selection logic without changing the + // primary selection + const indexedSelection = this._editor.getSelections() + .map((selection, idx) => ({ selection, idx })) + .sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); + + for (const { selection, idx } of indexedSelection) { + + // extend selection with the `overwriteBefore` and `overwriteAfter` and then + // compare if this matches the extensions of the primary selection + let extensionBefore = SnippetSession.adjustSelection(model, selection, this._overwriteBefore, 0); + let extensionAfter = SnippetSession.adjustSelection(model, selection, 0, this._overwriteAfter); + if (firstBeforeText !== model.getValueInRange(extensionBefore)) { + extensionBefore = selection; + } + if (firstAfterText !== model.getValueInRange(extensionAfter)) { + extensionAfter = selection; + } + + // merge the before and after selection into one + const snippetSelection = selection + .setStartPosition(extensionBefore.startLineNumber, extensionBefore.startColumn) + .setEndPosition(extensionAfter.endLineNumber, extensionAfter.endColumn); + + // adjust the template string to match the indentation and + // whitespace rules of this insert location (can be different for each cursor) + const start = snippetSelection.getStartPosition(); + const adjustedTemplate = SnippetSession.adjustWhitespace(model, start, this._template); + + const snippet = SnippetParser.parse(adjustedTemplate).resolveVariables(new EditorSnippetVariableResolver(model, snippetSelection)); + + // rewrite final-tabstop to some other placeholder because this + // snippet sits inside another snippet + if (ignoreFinalTabstops) { + for (const placeholder of snippet.placeholders) { + if (placeholder.isFinalTabstop) { + placeholder.index = String(snippet.placeholders.length); + } + } + } + + const offset = model.getOffsetAt(start) + delta; + delta += snippet.text.length - model.getValueLengthInRange(snippetSelection); + + // store snippets with the index of their originating selection. + // that ensures the primiary cursor stays primary despite not being + // the one with lowest start position + edits[idx] = EditOperation.replaceMove(snippetSelection, snippet.text); + this._snippets[idx] = new OneSnippet(this._editor, snippet, offset); + } + + // make insert edit and start with first selections + + this._editor.setSelections(model.pushEditOperations(this._editor.getSelections(), edits, undoEdits => { + if (this._snippets[0].hasPlaceholder) { + return this._move(true); + } else { + return undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition())); + } + })); + } + + next(): void { + const newSelections = this._move(true); + this._editor.setSelections(newSelections); + } + + prev(): void { + const newSelections = this._move(false); + this._editor.setSelections(newSelections); + } + + private _move(fwd: boolean): Selection[] { + const selections: Selection[] = []; + for (const snippet of this._snippets) { + const oneSelection = snippet.move(fwd); + selections.push(...oneSelection); + } + return selections; + } + + get isAtFirstPlaceholder() { + return this._snippets[0].isAtFirstPlaceholder; + } + + get isAtLastPlaceholder() { + return this._snippets[0].isAtLastPlaceholder; + } + + get hasPlaceholder() { + return this._snippets[0].hasPlaceholder; + } + + isSelectionWithinPlaceholders(): boolean { + + if (!this.hasPlaceholder) { + return false; + } + + const selections = this._editor.getSelections(); + if (selections.length < this._snippets.length) { + // this means we started snippet mode with N + // selections and have M (N > M) selections. + // So one snippet is without selection -> cancel + return false; + } + + const ranges: Range[] = []; + for (const snippet of this._snippets) { + ranges.push(...snippet.placeholderRanges); + } + + if (selections.length > ranges.length) { + return false; + } + + // sort selections and ranges by their start position + // and then make sure each selection is contained by + // a placeholder range + selections.sort(Range.compareRangesUsingStarts); + ranges.sort(Range.compareRangesUsingStarts); + + outer: for (const selection of selections) { + let range: Range; + while (range = ranges.shift()) { + if (range.containsRange(selection)) { + continue outer; + } + } + return false; + } + + return true; + } +} diff --git a/src/vs/editor/contrib/snippet/browser/snippetVariables.ts b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts new file mode 100644 index 00000000000..ab345893eac --- /dev/null +++ b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { basename, dirname } from 'vs/base/common/paths'; +import { IModel } from 'vs/editor/common/editorCommon'; +import { Selection } from 'vs/editor/common/core/selection'; + +export class EditorSnippetVariableResolver { + + static readonly VariableNames = Object.freeze({ + 'SELECTION': true, + 'TM_SELECTED_TEXT': true, + 'TM_CURRENT_LINE': true, + 'TM_CURRENT_WORD': true, + 'TM_LINE_INDEX': true, + 'TM_LINE_NUMBER': true, + 'TM_FILENAME': true, + 'TM_DIRECTORY': true, + 'TM_FILEPATH': true, + }); + + constructor( + private readonly _model: IModel, + private readonly _selection: Selection + ) { + // + } + + resolve(name: string): string { + if (name === 'SELECTION' || name === 'TM_SELECTED_TEXT') { + return this._model.getValueInRange(this._selection); + + } else if (name === 'TM_CURRENT_LINE') { + return this._model.getLineContent(this._selection.positionLineNumber); + + } else if (name === 'TM_CURRENT_WORD') { + const info = this._model.getWordAtPosition({ + lineNumber: this._selection.positionLineNumber, + column: this._selection.positionColumn + }); + return info ? info.word : ''; + + } else if (name === 'TM_LINE_INDEX') { + return String(this._selection.positionLineNumber - 1); + + } else if (name === 'TM_LINE_NUMBER') { + return String(this._selection.positionLineNumber); + + } else if (name === 'TM_FILENAME') { + return basename(this._model.uri.fsPath); + + } else if (name === 'TM_DIRECTORY') { + const dir = dirname(this._model.uri.fsPath); + return dir !== '.' ? dir : ''; + + } else if (name === 'TM_FILEPATH') { + return this._model.uri.fsPath; + + } else { + return undefined; + } + } +} diff --git a/src/vs/editor/contrib/snippet/common/snippet.ts b/src/vs/editor/contrib/snippet/common/snippet.ts deleted file mode 100644 index ea0b628e953..00000000000 --- a/src/vs/editor/contrib/snippet/common/snippet.ts +++ /dev/null @@ -1,345 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 strings from 'vs/base/common/strings'; -import { Range } from 'vs/editor/common/core/range'; -import { Marker, Variable, Placeholder, Text, SnippetParser } from 'vs/editor/contrib/snippet/common/snippetParser'; - -export interface IIndentationNormalizer { - normalizeIndentation(str: string): string; -} - -export interface IPlaceHolder { - id: string; - value: string; - occurences: Range[]; -} - -export interface ICodeSnippet { - lines: string[]; - placeHolders: IPlaceHolder[]; - finishPlaceHolderIndex: number; -} - -export interface ISnippetVariableResolver { - resolve(name: string): string; -} - -export class CodeSnippet implements ICodeSnippet { - - static fromTextmate(template: string, variableResolver?: ISnippetVariableResolver): CodeSnippet { - const marker = new SnippetParser(true, false).parse(template); - const snippet = new CodeSnippet(); - _resolveSnippetVariables(marker, variableResolver); - _fillCodeSnippetFromMarker(snippet, marker); - return snippet; - } - - static fromInternal(template: string): CodeSnippet { - const marker = new SnippetParser(false, true).parse(template); - const snippet = new CodeSnippet(); - _fillCodeSnippetFromMarker(snippet, marker); - return snippet; - } - - static none(template: string): CodeSnippet { - const snippet = new CodeSnippet(); - snippet.lines = template.split(/\r\n|\n|\r/); - return snippet; - } - - static fromEmmet(template: string): CodeSnippet { - let matchFinalStops = template.match(/\$\{0\}|\$0/g); - if (!matchFinalStops || matchFinalStops.length === 1) { - return CodeSnippet.fromTextmate(template); - } - - // Emmet sometimes returns snippets with multiple ${0} - // In such cases, replace ${0} with incremental tab stops - - const snippetMarkers: Marker[] = new SnippetParser(true, false).parse(template) || []; - let getMaxTabStop = (markers: Marker[]): number => { - let currentMaxTabStop = -1; - markers.forEach(marker => { - if (marker instanceof Placeholder && /^\d+$/.test(marker['name'])) { - let currentTabStop = Number(marker['name']); - let nestedMaxTabStop = getMaxTabStop(marker['defaultValue'] || []); - currentMaxTabStop = Math.max(currentMaxTabStop, currentTabStop, nestedMaxTabStop); - } - }); - return currentMaxTabStop; - }; - - let maxTabStop = getMaxTabStop(snippetMarkers); - - let setNextTabStop = (markers: Marker[]) => { - markers.forEach(marker => { - if (marker instanceof Placeholder) { - if (marker['name'] === '0') { - marker['name'] = ++maxTabStop + ''; - } - setNextTabStop(marker['defaultValue'] || []); - } - }); - }; - - setNextTabStop(snippetMarkers); - - const snippet = new CodeSnippet(); - _fillCodeSnippetFromMarker(snippet, snippetMarkers); - return snippet; - } - - public lines: string[] = []; - public placeHolders: IPlaceHolder[] = []; - public finishPlaceHolderIndex: number = -1; - - get isInsertOnly(): boolean { - return this.placeHolders.length === 0; - } - - get isSingleTabstopOnly(): boolean { - if (this.placeHolders.length !== 1) { - return false; - } - - const [placeHolder] = this.placeHolders; - if (placeHolder.value !== '' || placeHolder.occurences.length !== 1) { - return false; - } - - const [placeHolderRange] = placeHolder.occurences; - if (!Range.isEmpty(placeHolderRange)) { - return false; - } - return true; - } - - private extractLineIndentation(str: string, maxColumn: number = Number.MAX_VALUE): string { - var fullIndentation = strings.getLeadingWhitespace(str); - - if (fullIndentation.length > maxColumn - 1) { - return fullIndentation.substring(0, maxColumn - 1); - } - - return fullIndentation; - } - - public bind(referenceLine: string, deltaLine: number, firstLineDeltaColumn: number, config: IIndentationNormalizer): ICodeSnippet { - const resultLines: string[] = []; - const resultPlaceHolders: IPlaceHolder[] = []; - - const referenceIndentation = this.extractLineIndentation(referenceLine, firstLineDeltaColumn + 1); - - // Compute resultLines & keep deltaColumns as a reference for adjusting placeholders - const deltaColumns: number[] = []; - - for (let i = 0, len = this.lines.length; i < len; i++) { - let originalLine = this.lines[i]; - if (i === 0) { - deltaColumns[i + 1] = firstLineDeltaColumn; - resultLines[i] = originalLine; - } else { - let originalLineIndentation = this.extractLineIndentation(originalLine); - let remainingLine = originalLine.substr(originalLineIndentation.length); - let indentation = config.normalizeIndentation(referenceIndentation + originalLineIndentation); - deltaColumns[i + 1] = indentation.length - originalLineIndentation.length; - resultLines[i] = indentation + remainingLine; - } - } - - // Compute resultPlaceHolders - for (const originalPlaceHolder of this.placeHolders) { - let resultOccurences = []; - - for (let { startLineNumber, startColumn, endLineNumber, endColumn } of originalPlaceHolder.occurences) { - - if (startColumn > 1 || startLineNumber === 1) { - // placeholders that aren't at the beginning of new snippet lines - // will be moved by how many characters the indentation has been - // adjusted - startColumn = startColumn + deltaColumns[startLineNumber]; - endColumn = endColumn + deltaColumns[endLineNumber]; - - } else { - // placeholders at the beginning of new snippet lines - // will be indented by the reference indentation - startColumn += referenceIndentation.length; - endColumn += referenceIndentation.length; - } - - resultOccurences.push({ - startLineNumber: startLineNumber + deltaLine, - startColumn, - endLineNumber: endLineNumber + deltaLine, - endColumn, - }); - } - - resultPlaceHolders.push({ - id: originalPlaceHolder.id, - value: originalPlaceHolder.value, - occurences: resultOccurences - }); - } - - return { - lines: resultLines, - placeHolders: resultPlaceHolders, - finishPlaceHolderIndex: this.finishPlaceHolderIndex - }; - } -} - - -// --- parsing - - -interface ISnippetParser { - parse(input: string): CodeSnippet; -} - -interface IParsedLinePlaceHolderInfo { - id: string; - value: string; - startColumn: number; - endColumn: number; -} - -interface IParsedLine { - line: string; - placeHolders: IParsedLinePlaceHolderInfo[]; -} - -function _resolveSnippetVariables(marker: Marker[], resolver: ISnippetVariableResolver) { - if (resolver) { - const stack = [...marker]; - - while (stack.length > 0) { - const marker = stack.shift(); - if (marker instanceof Variable) { - - try { - marker.resolvedValue = resolver.resolve(marker.name); - } catch (e) { - // - } - if (marker.isDefined) { - continue; - } - } - - if (marker instanceof Variable || marker instanceof Placeholder) { - // 'recurse' - stack.unshift(...marker.defaultValue); - } - } - } -} - -function _isFinishPlaceHolder(v: IPlaceHolder) { - return (v.id === '' && v.value === '') || v.id === '0'; -} - -function _fillCodeSnippetFromMarker(snippet: CodeSnippet, marker: Marker[]) { - - let placeHolders: { [id: string]: IPlaceHolder } = Object.create(null); - let hasFinishPlaceHolder = false; - - const stack = [...marker]; - snippet.lines = ['']; - while (stack.length > 0) { - const marker = stack.shift(); - if (marker instanceof Text) { - // simple text - let lines = marker.string.split(/\r\n|\n|\r/); - snippet.lines[snippet.lines.length - 1] += lines.shift(); - snippet.lines.push(...lines); - - } else if (marker instanceof Placeholder) { - - let placeHolder = placeHolders[marker.name]; - if (!placeHolder) { - placeHolders[marker.name] = placeHolder = { - id: marker.name, - value: Marker.toString(marker.defaultValue), - occurences: [] - }; - snippet.placeHolders.push(placeHolder); - } - hasFinishPlaceHolder = hasFinishPlaceHolder || _isFinishPlaceHolder(placeHolder); - - const line = snippet.lines.length; - const column = snippet.lines[line - 1].length + 1; - - placeHolder.occurences.push(new Range( - line, - column, - line, - column + Marker.toString(marker.defaultValue).length // TODO multiline placeholders! - )); - - stack.unshift(...marker.defaultValue); - - } else if (marker instanceof Variable) { - - if (!marker.isDefined) { - // contine as placeholder - // THIS is because of us having falsy - // advertised ${foo} as placeholder syntax - stack.unshift(new Placeholder(marker.name, marker.defaultValue.length === 0 - ? [new Text(marker.name)] - : marker.defaultValue)); - - } else if (marker.resolvedValue) { - // contine with the value - stack.unshift(new Text(marker.resolvedValue)); - - } else { - // continue with default values - stack.unshift(...marker.defaultValue); - } - } - - if (stack.length === 0 && !hasFinishPlaceHolder) { - stack.push(new Placeholder('0', [])); - } - } - - // Named variables (e.g. {greeting} and {greeting:Hello}) are sorted first, followed by - // tab-stops and numeric variables (e.g. $1, $2, ${3:foo}) which are sorted in ascending order - snippet.placeHolders.sort((a, b) => { - let nonIntegerId = (v: IPlaceHolder) => !(/^\d+$/).test(v.id); - - // Sort finish placeholder last - if (_isFinishPlaceHolder(a)) { - return 1; - } else if (_isFinishPlaceHolder(b)) { - return -1; - } - - // Sort named placeholders first - if (nonIntegerId(a) && nonIntegerId(b)) { - return 0; - } else if (nonIntegerId(a)) { - return -1; - } else if (nonIntegerId(b)) { - return 1; - } - - if (a.id === b.id) { - return 0; - } - - return Number(a.id) < Number(b.id) ? -1 : 1; - }); - - if (snippet.placeHolders.length > 0) { - snippet.finishPlaceHolderIndex = snippet.placeHolders.length - 1; - snippet.placeHolders[snippet.finishPlaceHolderIndex].id = ''; - } -} diff --git a/src/vs/editor/contrib/snippet/common/snippetController.ts b/src/vs/editor/contrib/snippet/common/snippetController.ts deleted file mode 100644 index e5cdde2bb38..00000000000 --- a/src/vs/editor/contrib/snippet/common/snippetController.ts +++ /dev/null @@ -1,762 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { binarySearch } from 'vs/base/common/arrays'; -import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CommonEditorRegistry, commonEditorContribution, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { ISnippetVariableResolver, ICodeSnippet, CodeSnippet } from './snippet'; -import { SnippetVariablesResolver } from './snippetVariables'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { Position } from 'vs/editor/common/core/position'; -import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; - -export class InsertSnippetController { - - private editor: editorCommon.ICommonCodeEditor; - private model: editorCommon.IModel; - private finishPlaceHolderIndex: number; - - private listenersToRemove: IDisposable[]; - private trackedPlaceHolders: ITrackedPlaceHolder[]; - private placeHolderDecorations: string[]; - private currentPlaceHolderIndex: number; - private highlightDecorationId: string; - private isFinished: boolean; - - private _onStop: () => void; - private _initialAlternativeVersionId: number; - - constructor(editor: editorCommon.ICommonCodeEditor, adaptedSnippet: ICodeSnippet, startLineNumber: number, initialAlternativeVersionId: number, onStop: () => void) { - this.editor = editor; - this._onStop = onStop; - this.model = editor.getModel(); - this.finishPlaceHolderIndex = adaptedSnippet.finishPlaceHolderIndex; - - this.trackedPlaceHolders = []; - this.placeHolderDecorations = []; - this.currentPlaceHolderIndex = 0; - this.highlightDecorationId = null; - this.isFinished = false; - - this._initialAlternativeVersionId = initialAlternativeVersionId; - - this.initialize(adaptedSnippet, startLineNumber); - } - - public dispose(): void { - this.stopAll(); - } - - private initialize(adaptedSnippet: ICodeSnippet, startLineNumber: number): void { - - // sorted list of all placeholder occurences for subsequent lockups - const sortedOccurrences: Range[] = []; - for (const { occurences } of adaptedSnippet.placeHolders) { - for (const range of occurences) { - sortedOccurrences.push(range); - } - } - sortedOccurrences.sort(Range.compareRangesUsingStarts); - - // track each occurence - this.model.changeDecorations((changeAccessor) => { - - for (let i = 0; i < adaptedSnippet.placeHolders.length; i++) { - const { occurences } = adaptedSnippet.placeHolders[i]; - const trackedRanges: string[] = []; - - for (const range of occurences) { - let stickiness = editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges; - - if (i === adaptedSnippet.finishPlaceHolderIndex) { - // final tab stop decoration never grows - stickiness = editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges; - - } else { - // Check if the previous range ends exactly where this range starts - // and iff so change the stickiness to avoid conflicts - let idx = binarySearch(sortedOccurrences, range, Range.compareRangesUsingStarts); - if (idx > 0 - && sortedOccurrences[idx - 1].endLineNumber === range.startLineNumber - && sortedOccurrences[idx - 1].endColumn === range.startColumn) { - - stickiness = editorCommon.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter; - } - } - - trackedRanges.push(changeAccessor.addDecoration(range, { - stickiness: stickiness - })); - } - - this.trackedPlaceHolders.push({ - ranges: trackedRanges - }); - } - }); - - this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { - let newDecorations: editorCommon.IModelDeltaDecoration[] = []; - - let endLineNumber = startLineNumber + adaptedSnippet.lines.length - 1; - let endLineNumberMaxColumn = this.model.getLineMaxColumn(endLineNumber); - newDecorations.push({ - range: new Range(startLineNumber, 1, endLineNumber, endLineNumberMaxColumn), - options: { - className: 'new-snippet', - isWholeLine: true - } - }); - - for (let i = 0, len = this.trackedPlaceHolders.length; i < len; i++) { - let className = (i === this.finishPlaceHolderIndex) ? 'finish-snippet-placeholder' : 'snippet-placeholder'; - newDecorations.push({ - range: this.model.getDecorationRange(this.trackedPlaceHolders[i].ranges[0]), - options: { - stickiness: this.model.getDecorationOptions(this.trackedPlaceHolders[i].ranges[0]).stickiness, - className: className - } - }); - } - - let decorations = changeAccessor.deltaDecorations([], newDecorations); - this.highlightDecorationId = decorations[0]; - this.placeHolderDecorations = decorations.slice(1); - }); - - // let print = () => { - // console.log('trackedPlaceHolders: ' + this.trackedPlaceHolders.map((placeholder, index) => 'placeHolder index ' + index + ': ' + placeholder.ranges.map(id => id + '(' + this.model.getDecorationRange(id) + ')').join(', ')).join('\n')); - // console.log('highlightDecoration: ' + this.highlightDecorationId + '(' + this.model.getDecorationRange(this.highlightDecorationId) + ')'); - // console.log('placeHolderDecorations: ' + this.placeHolderDecorations.map(id => id + '(' + this.model.getDecorationRange(id) + ')').join(', ')); - // }; - // print(); - - let _highlightRange = this.model.getDecorationRange(this.highlightDecorationId); - - this.listenersToRemove = []; - this.listenersToRemove.push(this.editor.onDidChangeModelContent((e) => { - // console.log('-------MODEL CHANGED'); - // print(); - if (this.isFinished) { - return; - } - - if (e.isFlush) { - // a model.setValue() was called - this.stopAll(); - return; - } - - const newAlternateVersionId = this.editor.getModel().getAlternativeVersionId(); - if (this._initialAlternativeVersionId === newAlternateVersionId) { - // We executed undo until we reached the same version we started with - this.stopAll(); - return; - } - - for (let i = 0, len = e.changes.length; i < len; i++) { - const change = e.changes[i]; - const intersection = _highlightRange.intersectRanges(change.range); - if (intersection === null) { - // Did an edit outside of the snippet - this.stopAll(); - return; - } - } - - // Keep the highlightRange for the next round of model change events - _highlightRange = this.model.getDecorationRange(this.highlightDecorationId); - })); - - this.listenersToRemove.push(this.editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { - if (this.isFinished) { - return; - } - var highlightRange = this.model.getDecorationRange(this.highlightDecorationId); - if (!highlightRange) { - this.stopAll(); - return; - } - var lineNumber = e.position.lineNumber; - if (lineNumber < highlightRange.startLineNumber || lineNumber > highlightRange.endLineNumber) { - this.stopAll(); - } - })); - - this.listenersToRemove.push(this.editor.onDidChangeModel(() => { - this.stopAll(); - })); - - var blurTimeout = -1; - this.listenersToRemove.push(this.editor.onDidBlurEditor(() => { - // Blur if within 100ms we do not focus back - blurTimeout = setTimeout(() => { - this.stopAll(); - }, 100); - })); - - this.listenersToRemove.push(this.editor.onDidFocusEditor(() => { - // Cancel the blur timeout (if any) - if (blurTimeout !== -1) { - clearTimeout(blurTimeout); - blurTimeout = -1; - } - })); - - this.listenersToRemove.push(this.model.onDidChangeDecorations((e) => { - if (this.isFinished) { - return; - } - - var modelEditableRange = this.model.getEditableRange(), - previousRange: Range = null, - allCollapsed = true, - allEqualToEditableRange = true; - - for (var i = 0; (allCollapsed || allEqualToEditableRange) && i < this.trackedPlaceHolders.length; i++) { - var ranges = this.trackedPlaceHolders[i].ranges; - - for (var j = 0; (allCollapsed || allEqualToEditableRange) && j < ranges.length; j++) { - var range = this.model.getDecorationRange(ranges[j]); - - if (allCollapsed) { - if (!range.isEmpty()) { - allCollapsed = false; - } else if (previousRange === null) { - previousRange = range; - } else if (!previousRange.equalsRange(range)) { - allCollapsed = false; - } - } - - if (allEqualToEditableRange && !modelEditableRange.equalsRange(range)) { - allEqualToEditableRange = false; - } - } - } - - - if (allCollapsed || allEqualToEditableRange) { - this.stopAll(); - } else { - if (this.finishPlaceHolderIndex !== -1) { - var finishPlaceHolderDecorationId = this.placeHolderDecorations[this.finishPlaceHolderIndex]; - var finishPlaceHolderRange = this.model.getDecorationRange(finishPlaceHolderDecorationId); - var finishPlaceHolderOptions = this.model.getDecorationOptions(finishPlaceHolderDecorationId); - - var finishPlaceHolderRangeIsEmpty = finishPlaceHolderRange.isEmpty(); - var finishPlaceHolderClassNameIsForEmpty = (finishPlaceHolderOptions.className === 'finish-snippet-placeholder'); - - // Remember xor? :) - var needsChanging = Number(finishPlaceHolderRangeIsEmpty) ^ Number(finishPlaceHolderClassNameIsForEmpty); - - if (needsChanging) { - this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { - var className = finishPlaceHolderRangeIsEmpty ? 'finish-snippet-placeholder' : 'snippet-placeholder'; - changeAccessor.changeDecorationOptions(finishPlaceHolderDecorationId, { - className: className - }); - }); - } - } - } - })); - - this.doLinkEditing(); - } - - public onNextPlaceHolder(): boolean { - return this.changePlaceHolder(true); - } - - public onPrevPlaceHolder(): boolean { - return this.changePlaceHolder(false); - } - - private changePlaceHolder(goToNext: boolean): boolean { - if (this.isFinished) { - return false; - } - - var oldPlaceHolderIndex = this.currentPlaceHolderIndex; - var oldRange = this.model.getDecorationRange(this.trackedPlaceHolders[oldPlaceHolderIndex].ranges[0]); - var sameRange = true; - do { - if (goToNext) { - this.currentPlaceHolderIndex = (this.currentPlaceHolderIndex + 1) % this.trackedPlaceHolders.length; - } else { - this.currentPlaceHolderIndex = (this.trackedPlaceHolders.length + this.currentPlaceHolderIndex - 1) % this.trackedPlaceHolders.length; - } - - var newRange = this.model.getDecorationRange(this.trackedPlaceHolders[this.currentPlaceHolderIndex].ranges[0]); - - sameRange = oldRange.equalsRange(newRange); - - } while (this.currentPlaceHolderIndex !== oldPlaceHolderIndex && sameRange); - - this.doLinkEditing(); - return true; - } - - public onAccept(): boolean { - if (this.isFinished) { - return false; - } - if (this.finishPlaceHolderIndex !== -1) { - var finishRange = this.model.getDecorationRange(this.trackedPlaceHolders[this.finishPlaceHolderIndex].ranges[0]); - // Let's just position cursor at the end of the finish range - this.editor.setPosition({ - lineNumber: finishRange.endLineNumber, - column: finishRange.endColumn - }); - } - this.stopAll(); - return true; - } - - public onEscape(): boolean { - if (this.isFinished) { - return false; - } - this.stopAll(); - // Cancel multi-cursor - this.editor.setSelections([this.editor.getSelections()[0]]); - return true; - } - - private doLinkEditing(): void { - const selections: Selection[] = []; - for (let i = 0, len = this.trackedPlaceHolders[this.currentPlaceHolderIndex].ranges.length; i < len; i++) { - const range = this.model.getDecorationRange(this.trackedPlaceHolders[this.currentPlaceHolderIndex].ranges[i]); - selections.push(new Selection( - range.startLineNumber, - range.startColumn, - range.endLineNumber, - range.endColumn - )); - } - this.editor.setSelections(selections); - this.editor.revealRangeInCenterIfOutsideViewport(this.editor.getSelection()); - } - - private stopAll(): void { - if (this.isFinished) { - return; - } - this.isFinished = true; - - this._onStop(); - - this.listenersToRemove = dispose(this.listenersToRemove); - - this.model.changeDecorations((changeAccessor) => { - for (var i = 0; i < this.trackedPlaceHolders.length; i++) { - var ranges = this.trackedPlaceHolders[i].ranges; - for (var j = 0; j < ranges.length; j++) { - changeAccessor.removeDecoration(ranges[j]); - } - } - }); - this.trackedPlaceHolders = []; - - this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { - let toRemove: string[] = []; - toRemove.push(this.highlightDecorationId); - for (let i = 0; i < this.placeHolderDecorations.length; i++) { - toRemove.push(this.placeHolderDecorations[i]); - } - changeAccessor.deltaDecorations(toRemove, []); - this.placeHolderDecorations = []; - this.highlightDecorationId = null; - }); - } -} - -export interface ITrackedPlaceHolder { - ranges: string[]; -} - -interface IPreparedSnippet { - typeRange: Range; - adaptedSnippet: ICodeSnippet; -} - -class BeforeAfterData { - - static create(model: editorCommon.IModel, selection: Selection, overwriteBefore: number, overwriteAfter: number) { - - let contentBefore = ''; - if (overwriteBefore > 0) { - contentBefore = model.getLineContent(selection.startLineNumber).substring(selection.startColumn - 1 - overwriteBefore, selection.startColumn - 1); - } - - let contentAfter = ''; - if (overwriteAfter > 0) { - contentAfter = model.getLineContent(selection.endLineNumber).substring(selection.endColumn - 1, selection.endColumn - 1 + overwriteAfter); - } - - return new BeforeAfterData(model, contentBefore, contentAfter, overwriteBefore, overwriteAfter); - } - - constructor(private readonly _model: editorCommon.IModel, - private readonly _contentBefore: string, - private readonly _contentAfter: string, - public readonly overwriteBefore: number, - public readonly overwriteAfter: number - ) { - // - } - - next(selection: Selection) { - const data = BeforeAfterData.create(this._model, selection, this.overwriteBefore, this.overwriteAfter); - let { overwriteBefore, overwriteAfter } = data; - if (data._contentBefore !== this._contentBefore) { - overwriteBefore = 0; - } - if (data._contentAfter !== this._contentAfter) { - overwriteAfter = 0; - } - return new BeforeAfterData(this._model, null, null, overwriteBefore, overwriteAfter); - } -} - -@commonEditorContribution -export class SnippetController { - - private static ID = 'editor.contrib.snippetController'; - - public static get(editor: editorCommon.ICommonCodeEditor): SnippetController { - return editor.getContribution(SnippetController.ID); - } - - private _editor: editorCommon.ICommonCodeEditor; - private _variableResolver: ISnippetVariableResolver; - protected _currentController: InsertSnippetController; - private _inSnippetMode: IContextKey; - - constructor(editor: editorCommon.ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { - this._editor = editor; - this._variableResolver = new SnippetVariablesResolver(editor); - this._currentController = null; - this._inSnippetMode = CONTEXT_SNIPPET_MODE.bindTo(contextKeyService); - } - - public dispose(): void { - if (this._currentController) { - this._currentController.dispose(); - this._currentController = null; - } - } - - public getId(): string { - return SnippetController.ID; - } - - public insertSnippet(template: string, overwriteBefore: number, overwriteAfter: number): void { - const snippet = CodeSnippet.fromTextmate(template, this._variableResolver); - this.run(snippet, overwriteBefore, overwriteAfter); - } - - public run(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number): void { - this._runAndRestoreController(() => { - if (snippet.isInsertOnly || snippet.isSingleTabstopOnly) { - // Only inserts text, not placeholders, tabstops etc - // Only cursor endposition - this._runForAllSelections(snippet, overwriteBefore, overwriteAfter); - - } else { - let prepared = SnippetController._prepareSnippet(this._editor, this._editor.getSelection(), snippet, overwriteBefore, overwriteAfter); - this._runPreparedSnippetForPrimarySelection(prepared, true); - } - }); - } - - /** - * Inserts once `snippet` at the start of `replaceRange`, after deleting `replaceRange`. - */ - public runWithReplaceRange(snippet: CodeSnippet, replaceRange: Range): void { - this._runAndRestoreController(() => { - this._runPreparedSnippetForPrimarySelection({ - typeRange: replaceRange, - adaptedSnippet: SnippetController._getAdaptedSnippet(this._editor.getModel(), snippet, replaceRange) - }, false); - }); - } - - private _runAndRestoreController(callback: () => void): void { - let prevController = this._currentController; - this._currentController = null; - - callback(); - - if (!this._currentController) { - // we didn't end up in snippet mode again => restore previous controller - this._currentController = prevController; - } else { - // we ended up in snippet mode => dispose previous controller if necessary - if (prevController) { - prevController.dispose(); - } - } - } - - private static _addCommandForSnippet(model: editorCommon.ITextModel, adaptedSnippet: ICodeSnippet, typeRange: Range, out: editorCommon.IIdentifiedSingleEditOperation[]): void { - let insertText = adaptedSnippet.lines.join('\n'); - let currentText = model.getValueInRange(typeRange, editorCommon.EndOfLinePreference.LF); - if (insertText !== currentText) { - out.push(EditOperation.replaceMove(typeRange, insertText)); - } - } - - private _runPreparedSnippetForPrimarySelection(prepared: IPreparedSnippet, undoStops: boolean): void { - let initialAlternativeVersionId = this._editor.getModel().getAlternativeVersionId(); - - let edits: editorCommon.IIdentifiedSingleEditOperation[] = []; - - SnippetController._addCommandForSnippet(this._editor.getModel(), prepared.adaptedSnippet, prepared.typeRange, edits); - - if (edits.length > 0) { - if (undoStops) { - this._editor.pushUndoStop(); - } - this._editor.executeEdits('editor.contrib.insertSnippetHelper', edits); - if (undoStops) { - this._editor.pushUndoStop(); - } - } - - let cursorOnly = SnippetController._getSnippetCursorOnly(prepared.adaptedSnippet); - if (cursorOnly) { - this._editor.setSelection(new Selection(cursorOnly.lineNumber, cursorOnly.column, cursorOnly.lineNumber, cursorOnly.column)); - } else if (prepared.adaptedSnippet.placeHolders.length > 0) { - this._inSnippetMode.set(true); - this._currentController = new InsertSnippetController(this._editor, prepared.adaptedSnippet, prepared.typeRange.startLineNumber, initialAlternativeVersionId, () => { - this._inSnippetMode.reset(); - if (this._currentController) { - this._currentController.dispose(); - this._currentController = null; - } - }); - } - } - - private _runForAllSelections(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number): void { - - const edits: editorCommon.IIdentifiedSingleEditOperation[] = []; - const selections = this._editor.getSelections(); - const model = this._editor.getModel(); - const primaryBeforeAfter = BeforeAfterData.create(model, selections[0], overwriteBefore, overwriteAfter); - - let totalDelta = 0; - const newSelections: { offset: number; i: number }[] = []; - - // sort selections by start position but remember where - // each selection came from - const selectionEntries = selections - .map((selection, i) => ({ selection, i })) - .sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); - - for (const { selection, i } of selectionEntries) { - - // only use overwrite[Before|After] for secondary cursors - // when the same text as with the primary cursor is selected - const beforeAfter = i !== 0 ? primaryBeforeAfter.next(selection) : primaryBeforeAfter; - - let { adaptedSnippet, typeRange } = SnippetController._prepareSnippet( - this._editor, - selection, - snippet, - beforeAfter.overwriteBefore, - beforeAfter.overwriteAfter - ); - - SnippetController._addCommandForSnippet(this._editor.getModel(), adaptedSnippet, typeRange, edits); - - // compute new selection offset - // * get current offset - // * get length of snippet that we insert - // * get final cursor position of snippet that we insert (might not exist) - // * NEW selection offset is current + final cursor pos + inserts_until_here - - let offset = model.getOffsetAt(typeRange.getStartPosition()); - - // inserts until here - offset += totalDelta; - - // each snippet has a different length (because of whitespace changes) - let snippetLength = (adaptedSnippet.lines.length - 1) * model.getEOL().length; - for (const line of adaptedSnippet.lines) { - snippetLength += line.length; - } - - // each snippet has a different cursor offset - const finalCursorPos = SnippetController._getSnippetCursorOnly(adaptedSnippet); - if (finalCursorPos) { - let finalCursorOffset: number; - if (finalCursorPos.lineNumber === typeRange.startLineNumber) { - finalCursorOffset = finalCursorPos.column - typeRange.startColumn; - } else { - finalCursorOffset = finalCursorPos.column - 1; - for (let i = 0, lineNumber = typeRange.startLineNumber; lineNumber < finalCursorPos.lineNumber; i++ , lineNumber++) { - finalCursorOffset += adaptedSnippet.lines[i].length + model.getEOL().length; - } - } - offset += finalCursorOffset; - - } else { - offset += snippetLength; - } - - newSelections.push({ offset, i }); - totalDelta += (snippetLength - model.getValueLengthInRange(typeRange)); - } - - if (edits.length === 0) { - return; - } - - const cursorStateComputer: editorCommon.ICursorStateComputer = function () { - // create new selections from the new selection offsets - // and restore the order we had at the beginning - const result: Selection[] = []; - for (const { offset, i } of newSelections) { - const pos = model.getPositionAt(offset); - result[i] = new Selection(pos.lineNumber, pos.column, pos.lineNumber, pos.column); - } - return result; - }; - - model.pushStackElement(); - this._editor.setSelections(model.pushEditOperations(selections, edits, cursorStateComputer)); - model.pushStackElement(); - } - - private static _prepareSnippet(editor: editorCommon.ICommonCodeEditor, selection: Selection, snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number): { typeRange: Range; adaptedSnippet: ICodeSnippet; } { - const model = editor.getModel(); - const typeRange = SnippetController._getTypeRangeForSelection(model, selection, overwriteBefore, overwriteAfter); - const adaptedSnippet = SnippetController._getAdaptedSnippet(model, snippet, typeRange); - - return { typeRange, adaptedSnippet }; - } - - private static _getTypeRangeForSelection(model: editorCommon.IModel, selection: Selection, overwriteBefore: number, overwriteAfter: number): Range { - var typeRange: Range; - if (overwriteBefore || overwriteAfter) { - typeRange = model.validateRange(Range.plusRange(selection, { - startLineNumber: selection.positionLineNumber, - startColumn: selection.positionColumn - overwriteBefore, - endLineNumber: selection.positionLineNumber, - endColumn: selection.positionColumn + overwriteAfter - })); - } else { - typeRange = selection; - } - return typeRange; - } - - private static _getAdaptedSnippet(model: editorCommon.IModel, snippet: CodeSnippet, typeRange: Range): ICodeSnippet { - return snippet.bind(model.getLineContent(typeRange.startLineNumber), typeRange.startLineNumber - 1, typeRange.startColumn - 1, model); - } - - private static _getSnippetCursorOnly(snippet: ICodeSnippet): Position { - - if (snippet.placeHolders.length !== 1) { - return null; - } - - var placeHolder = snippet.placeHolders[0]; - if (placeHolder.value !== '' || placeHolder.occurences.length !== 1) { - return null; - } - - var placeHolderRange = placeHolder.occurences[0]; - if (!Range.isEmpty(placeHolderRange)) { - return null; - } - - return new Position( - placeHolderRange.startLineNumber, - placeHolderRange.startColumn - ); - } - - public jumpToNextPlaceholder(): void { - if (this._currentController) { - this._currentController.onNextPlaceHolder(); - } - } - - public jumpToPrevPlaceholder(): void { - if (this._currentController) { - this._currentController.onPrevPlaceHolder(); - } - } - - public acceptSnippet(): void { - if (this._currentController) { - this._currentController.onAccept(); - } - } - - public leaveSnippet(): void { - if (this._currentController) { - this._currentController.onEscape(); - } - } -} - -export var CONTEXT_SNIPPET_MODE = new RawContextKey('inSnippetMode', false); - -const SnippetCommand = EditorCommand.bindToContribution(SnippetController.get); - -CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ - id: 'jumpToNextSnippetPlaceholder', - precondition: CONTEXT_SNIPPET_MODE, - handler: x => x.jumpToNextPlaceholder(), - kbOpts: { - weight: CommonEditorRegistry.commandWeight(30), - kbExpr: EditorContextKeys.textFocus, - primary: KeyCode.Tab - } -})); -CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ - id: 'jumpToPrevSnippetPlaceholder', - precondition: CONTEXT_SNIPPET_MODE, - handler: x => x.jumpToPrevPlaceholder(), - kbOpts: { - weight: CommonEditorRegistry.commandWeight(30), - kbExpr: EditorContextKeys.textFocus, - primary: KeyMod.Shift | KeyCode.Tab - } -})); -CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ - id: 'acceptSnippet', - precondition: CONTEXT_SNIPPET_MODE, - handler: x => x.acceptSnippet(), - kbOpts: { - weight: CommonEditorRegistry.commandWeight(30), - kbExpr: EditorContextKeys.textFocus, - primary: KeyCode.Enter - } -})); -CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ - id: 'leaveSnippet', - precondition: CONTEXT_SNIPPET_MODE, - handler: x => x.leaveSnippet(), - kbOpts: { - weight: CommonEditorRegistry.commandWeight(30), - kbExpr: EditorContextKeys.textFocus, - primary: KeyCode.Escape, - secondary: [KeyMod.Shift | KeyCode.Escape] - } -})); diff --git a/src/vs/editor/contrib/snippet/common/snippetVariables.ts b/src/vs/editor/contrib/snippet/common/snippetVariables.ts deleted file mode 100644 index 1a8e0a39604..00000000000 --- a/src/vs/editor/contrib/snippet/common/snippetVariables.ts +++ /dev/null @@ -1,73 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { basename, dirname, normalize } from 'vs/base/common/paths'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { ISnippetVariableResolver } from './snippet'; - -export class SnippetVariablesResolver implements ISnippetVariableResolver { - - private _editor: editorCommon.ICommonCodeEditor; - - constructor(editor: editorCommon.ICommonCodeEditor) { - this._editor = editor; - } - - resolve(name: string): string { - const model = this._editor.getModel(); - if (!model) { - throw new Error(); - } - switch (name) { - case 'SELECTION': - case 'TM_SELECTED_TEXT': return this._tmSelectedText(); - case 'TM_CURRENT_LINE': return this._tmCurrentLine(); - case 'TM_CURRENT_WORD': return this._tmCurrentWord(); - case 'TM_LINE_INDEX': return this._tmLineIndex(); - case 'TM_LINE_NUMBER': return this._tmLineNumber(); - case 'TM_FILENAME': return this._tmFilename(); - case 'TM_DIRECTORY': return this._tmDirectory(); - case 'TM_FILEPATH': return this._tmFilepath(); - } - return undefined; - } - - private _tmCurrentLine(): string { - const { positionLineNumber } = this._editor.getSelection(); - return this._editor.getModel().getValueInRange({ startLineNumber: positionLineNumber, startColumn: 1, endLineNumber: positionLineNumber, endColumn: Number.MAX_VALUE }); - } - - private _tmCurrentWord(): string { - const word = this._editor.getModel().getWordAtPosition(this._editor.getPosition()); - return word ? word.word : ''; - } - - private _tmFilename(): string { - return basename(this._editor.getModel().uri.fsPath); - } - - private _tmDirectory(): string { - const dir = dirname(normalize(this._editor.getModel().uri.fsPath)); - return dir !== '.' ? dir : ''; - } - - private _tmFilepath(): string { - return this._editor.getModel().uri.fsPath; - } - - private _tmLineIndex(): string { - return String(this._editor.getSelection().positionLineNumber - 1); - } - - private _tmLineNumber(): string { - return String(this._editor.getSelection().positionLineNumber); - } - - private _tmSelectedText(): string { - return this._editor.getModel().getValueInRange(this._editor.getSelection()); - } -} diff --git a/src/vs/editor/contrib/snippet/test/common/snippetController.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts similarity index 67% rename from src/vs/editor/contrib/snippet/test/common/snippetController.test.ts rename to src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts index 75ddf1777cf..1efa1b1a8c1 100644 --- a/src/vs/editor/contrib/snippet/test/common/snippetController.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts @@ -5,25 +5,32 @@ 'use strict'; import * as assert from 'assert'; -import { Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; -import { CodeSnippet } from 'vs/editor/contrib/snippet/common/snippet'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { MockCodeEditor, withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import { Cursor } from 'vs/editor/common/controller/cursor'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; -class TestSnippetController extends SnippetController { +class TestSnippetController extends SnippetController2 { + + constructor( + editor: ICommonCodeEditor, + @IContextKeyService private _contextKeyService: IContextKeyService + ) { + super(editor, _contextKeyService); + } isInSnippetMode(): boolean { - return !!this._currentController; + return SnippetController2.InSnippetMode.getValue(this._contextKeyService); } } suite('SnippetController', () => { - function snippetTest(cb: (editor: MockCodeEditor, cursor: Cursor, codeSnippet: CodeSnippet, snippetController: TestSnippetController) => void, lines?: string[]): void { + function snippetTest(cb: (editor: MockCodeEditor, cursor: Cursor, template: string, snippetController: TestSnippetController) => void, lines?: string[]): void { if (!lines) { lines = [ @@ -40,24 +47,23 @@ suite('SnippetController', () => { insertSpaces: false }); let snippetController = editor.registerAndInstantiateContribution(TestSnippetController); - let codeSnippet = CodeSnippet.fromInternal([ - 'for (var {{index}}; {{index}} < {{array}}.length; {{index}}++) {', - '\tvar element = {{array}}[{{index}}];', - '\t{{}}', + let template = [ + 'for (var ${1:index}; $1 < ${2:array}.length; $1++) {', + '\tvar element = $2[$1];', + '\t$0', '}' - ].join('\n')); - - cb(editor, cursor, codeSnippet, snippetController); + ].join('\n'); + cb(editor, cursor, template, snippetController); snippetController.dispose(); }); } test('Simple accepted', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { + snippetTest((editor, cursor, template, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(template, 0, 0); assert.equal(editor.getModel().getLineContent(4), '\tfor (var index; index < array.length; index++) {'); assert.equal(editor.getModel().getLineContent(5), '\t\tvar element = array[index];'); assert.equal(editor.getModel().getLineContent(6), '\t\t'); @@ -69,112 +75,113 @@ suite('SnippetController', () => { assert.equal(editor.getModel().getLineContent(6), '\t\t'); assert.equal(editor.getModel().getLineContent(7), '\t}'); - snippetController.jumpToNextPlaceholder(); + snippetController.next(); editor.trigger('test', 'type', { text: 'arr' }); assert.equal(editor.getModel().getLineContent(4), '\tfor (var i; i < arr.length; i++) {'); assert.equal(editor.getModel().getLineContent(5), '\t\tvar element = arr[i];'); assert.equal(editor.getModel().getLineContent(6), '\t\t'); assert.equal(editor.getModel().getLineContent(7), '\t}'); - snippetController.jumpToPrevPlaceholder(); + snippetController.prev(); editor.trigger('test', 'type', { text: 'j' }); assert.equal(editor.getModel().getLineContent(4), '\tfor (var j; j < arr.length; j++) {'); assert.equal(editor.getModel().getLineContent(5), '\t\tvar element = arr[j];'); assert.equal(editor.getModel().getLineContent(6), '\t\t'); assert.equal(editor.getModel().getLineContent(7), '\t}'); - snippetController.acceptSnippet(); + snippetController.next(); + snippetController.next(); assert.deepEqual(editor.getPosition(), new Position(6, 3)); }); }); test('Simple canceled', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { + snippetTest((editor, cursor, template, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(template, 0, 0); assert.equal(editor.getModel().getLineContent(4), '\tfor (var index; index < array.length; index++) {'); assert.equal(editor.getModel().getLineContent(5), '\t\tvar element = array[index];'); assert.equal(editor.getModel().getLineContent(6), '\t\t'); assert.equal(editor.getModel().getLineContent(7), '\t}'); - snippetController.leaveSnippet(); + snippetController.cancel(); assert.deepEqual(editor.getPosition(), new Position(4, 16)); }); }); - test('Stops when deleting lines above', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { - editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + // test('Stops when deleting lines above', () => { + // snippetTest((editor, cursor, codeSnippet, snippetController) => { + // editor.setPosition({ lineNumber: 4, column: 2 }); + // snippetController.insert(codeSnippet, 0, 0); - editor.getModel().applyEdits([{ - forceMoveMarkers: false, - identifier: null, - isAutoWhitespaceEdit: false, - range: new Range(1, 1, 3, 1), - text: null - }]); + // editor.getModel().applyEdits([{ + // forceMoveMarkers: false, + // identifier: null, + // isAutoWhitespaceEdit: false, + // range: new Range(1, 1, 3, 1), + // text: null + // }]); - assert.equal(snippetController.isInSnippetMode(), false); - }); - }); + // assert.equal(snippetController.isInSnippetMode(), false); + // }); + // }); - test('Stops when deleting lines below', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { - editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + // test('Stops when deleting lines below', () => { + // snippetTest((editor, cursor, codeSnippet, snippetController) => { + // editor.setPosition({ lineNumber: 4, column: 2 }); + // snippetController.run(codeSnippet, 0, 0); - editor.getModel().applyEdits([{ - forceMoveMarkers: false, - identifier: null, - isAutoWhitespaceEdit: false, - range: new Range(8, 1, 8, 100), - text: null - }]); + // editor.getModel().applyEdits([{ + // forceMoveMarkers: false, + // identifier: null, + // isAutoWhitespaceEdit: false, + // range: new Range(8, 1, 8, 100), + // text: null + // }]); - assert.equal(snippetController.isInSnippetMode(), false); - }); - }); + // assert.equal(snippetController.isInSnippetMode(), false); + // }); + // }); - test('Stops when inserting lines above', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { - editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + // test('Stops when inserting lines above', () => { + // snippetTest((editor, cursor, codeSnippet, snippetController) => { + // editor.setPosition({ lineNumber: 4, column: 2 }); + // snippetController.run(codeSnippet, 0, 0); - editor.getModel().applyEdits([{ - forceMoveMarkers: false, - identifier: null, - isAutoWhitespaceEdit: false, - range: new Range(1, 100, 1, 100), - text: '\nHello' - }]); + // editor.getModel().applyEdits([{ + // forceMoveMarkers: false, + // identifier: null, + // isAutoWhitespaceEdit: false, + // range: new Range(1, 100, 1, 100), + // text: '\nHello' + // }]); - assert.equal(snippetController.isInSnippetMode(), false); - }); - }); + // assert.equal(snippetController.isInSnippetMode(), false); + // }); + // }); - test('Stops when inserting lines below', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { - editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + // test('Stops when inserting lines below', () => { + // snippetTest((editor, cursor, codeSnippet, snippetController) => { + // editor.setPosition({ lineNumber: 4, column: 2 }); + // snippetController.run(codeSnippet, 0, 0); - editor.getModel().applyEdits([{ - forceMoveMarkers: false, - identifier: null, - isAutoWhitespaceEdit: false, - range: new Range(8, 100, 8, 100), - text: '\nHello' - }]); + // editor.getModel().applyEdits([{ + // forceMoveMarkers: false, + // identifier: null, + // isAutoWhitespaceEdit: false, + // range: new Range(8, 100, 8, 100), + // text: '\nHello' + // }]); - assert.equal(snippetController.isInSnippetMode(), false); - }); - }); + // assert.equal(snippetController.isInSnippetMode(), false); + // }); + // }); test('Stops when calling model.setValue()', () => { snippetTest((editor, cursor, codeSnippet, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(codeSnippet, 0, 0); editor.getModel().setValue('goodbye'); @@ -182,21 +189,21 @@ suite('SnippetController', () => { }); }); - test('Stops when undoing', () => { - snippetTest((editor, cursor, codeSnippet, snippetController) => { - editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + // test('Stops when undoing', () => { + // snippetTest((editor, cursor, codeSnippet, snippetController) => { + // editor.setPosition({ lineNumber: 4, column: 2 }); + // snippetController.run(codeSnippet, 0, 0); - editor.getModel().undo(); + // editor.getModel().undo(); - assert.equal(snippetController.isInSnippetMode(), false); - }); - }); + // assert.equal(snippetController.isInSnippetMode(), false); + // }); + // }); test('Stops when moving cursor outside', () => { snippetTest((editor, cursor, codeSnippet, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(codeSnippet, 0, 0); editor.setPosition({ lineNumber: 1, column: 1 }); @@ -207,7 +214,7 @@ suite('SnippetController', () => { test('Stops when disconnecting editor model', () => { snippetTest((editor, cursor, codeSnippet, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(codeSnippet, 0, 0); editor.setModel(null); @@ -218,7 +225,7 @@ suite('SnippetController', () => { test('Stops when disposing editor', () => { snippetTest((editor, cursor, codeSnippet, snippetController) => { editor.setPosition({ lineNumber: 4, column: 2 }); - snippetController.run(codeSnippet, 0, 0); + snippetController.insert(codeSnippet, 0, 0); snippetController.dispose(); @@ -233,8 +240,8 @@ suite('SnippetController', () => { new Selection(2, 1, 2, 1), ]); - codeSnippet = CodeSnippet.fromInternal('foo{{}}'); - snippetController.run(codeSnippet, 0, 0); + codeSnippet = 'foo$0'; + snippetController.insert(codeSnippet, 0, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -248,8 +255,8 @@ suite('SnippetController', () => { new Selection(2, 1, 2, 1), ]); - codeSnippet = CodeSnippet.fromInternal('foo{{}}bar'); - snippetController.run(codeSnippet, 0, 0); + codeSnippet = 'foo$0bar'; + snippetController.insert(codeSnippet, 0, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -263,8 +270,8 @@ suite('SnippetController', () => { new Selection(1, 5, 1, 5), ]); - codeSnippet = CodeSnippet.fromInternal('foo{{}}bar'); - snippetController.run(codeSnippet, 0, 0); + codeSnippet = 'foo$0bar'; + snippetController.insert(codeSnippet, 0, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -278,8 +285,8 @@ suite('SnippetController', () => { new Selection(1, 5, 1, 5), ]); - codeSnippet = CodeSnippet.fromInternal('foo\n{{}}\nbar'); - snippetController.run(codeSnippet, 0, 0); + codeSnippet = 'foo\n$0\nbar'; + snippetController.insert(codeSnippet, 0, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -293,8 +300,8 @@ suite('SnippetController', () => { new Selection(1, 5, 1, 5), ]); - codeSnippet = CodeSnippet.fromInternal('foo\n{{}}\nbar'); - snippetController.run(codeSnippet, 0, 0); + codeSnippet = 'foo\n$0\nbar'; + snippetController.insert(codeSnippet, 0, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -307,8 +314,8 @@ suite('SnippetController', () => { new Selection(2, 7, 2, 7), ]); - codeSnippet = CodeSnippet.fromInternal('xo{{}}r'); - snippetController.run(codeSnippet, 1, 0); + codeSnippet = 'xo$0r'; + snippetController.insert(codeSnippet, 1, 0); assert.equal(editor.getSelections().length, 1); assert.ok(editor.getSelection().equalsRange({ startLineNumber: 2, startColumn: 8, endColumn: 8, endLineNumber: 2 })); @@ -320,8 +327,8 @@ suite('SnippetController', () => { editor.setSelection(new Selection(1, 19, 1, 19)); - codeSnippet = CodeSnippet.fromTextmate('{{% url_**$1** %}}'); - controller.run(codeSnippet, 2, 0); + codeSnippet = '{{% url_**$1** %}}'; + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getSelections().length, 1); assert.ok(editor.getSelection().equalsRange({ startLineNumber: 1, startColumn: 27, endLineNumber: 1, endColumn: 27 })); @@ -333,13 +340,13 @@ suite('SnippetController', () => { editor.setSelection(new Selection(1, 3, 1, 3)); - codeSnippet = CodeSnippet.fromTextmate([ + codeSnippet = [ 'afterEach((done) => {', '\t${1}test', '});' - ].join('\n')); + ].join('\n'); - controller.run(codeSnippet, 2, 0); + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getSelections().length, 1); assert.ok(editor.getSelection().equalsRange({ startLineNumber: 2, startColumn: 2, endLineNumber: 2, endColumn: 2 }), editor.getSelection().toString()); @@ -351,13 +358,13 @@ suite('SnippetController', () => { editor.setSelection(new Selection(1, 3, 1, 3)); - codeSnippet = CodeSnippet.fromTextmate([ + codeSnippet = [ 'afterEach((done) => {', '${1}\ttest', '});' - ].join('\n')); + ].join('\n'); - controller.run(codeSnippet, 2, 0); + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getSelections().length, 1); assert.ok(editor.getSelection().equalsRange({ startLineNumber: 2, startColumn: 1, endLineNumber: 2, endColumn: 1 }), editor.getSelection().toString()); @@ -369,11 +376,11 @@ suite('SnippetController', () => { editor.setSelection(new Selection(1, 9, 1, 9)); - codeSnippet = CodeSnippet.fromTextmate([ + codeSnippet = [ 'aft${1}er' - ].join('\n')); + ].join('\n'); - controller.run(codeSnippet, 8, 0); + controller.insert(codeSnippet, 8, 0); assert.equal(editor.getModel().getValue(), 'after'); assert.equal(editor.getSelections().length, 1); @@ -391,13 +398,13 @@ suite('SnippetController', () => { new Selection(1, 3, 1, 3) ]); - codeSnippet = CodeSnippet.fromTextmate([ + codeSnippet = [ 'afterEach((done) => {', '\t${0}test', '});' - ].join('\n')); + ].join('\n'); - controller.run(codeSnippet, 2, 0); + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getSelections().length, 2); const [first, second] = editor.getSelections(); @@ -416,13 +423,13 @@ suite('SnippetController', () => { new Selection(1, 5, 1, 5) ]); - codeSnippet = CodeSnippet.fromTextmate([ + codeSnippet = [ 'afterEach((done) => {', '${1}\ttest', '});' - ].join('\n')); + ].join('\n'); - controller.run(codeSnippet, 2, 0); + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getSelections().length, 1); const [first] = editor.getSelections(); @@ -440,9 +447,9 @@ suite('SnippetController', () => { new Selection(1, 3, 1, 3) ]); - codeSnippet = CodeSnippet.fromTextmate('afterEach'); + codeSnippet = 'afterEach'; - controller.run(codeSnippet, 2, 0); + controller.insert(codeSnippet, 2, 0); assert.ok(editor.getSelection().equalsRange({ startLineNumber: 1, startColumn: 10, endLineNumber: 1, endColumn: 10 })); @@ -458,8 +465,8 @@ suite('SnippetController', () => { new Selection(2, 4, 2, 4) ]); - codeSnippet = CodeSnippet.fromTextmate('_foo'); - controller.run(codeSnippet, 1, 0); + codeSnippet = '_foo'; + controller.insert(codeSnippet, 1, 0); assert.equal(editor.getModel().getValue(), 'this._foo\nabc_foo'); }, ['this._', 'abc']); @@ -471,8 +478,8 @@ suite('SnippetController', () => { new Selection(2, 4, 2, 4) ]); - codeSnippet = CodeSnippet.fromTextmate('XX'); - controller.run(codeSnippet, 1, 0); + codeSnippet = 'XX'; + controller.insert(codeSnippet, 1, 0); assert.equal(editor.getModel().getValue(), 'this.XX\nabcXX'); }, ['this._', 'abc']); @@ -485,8 +492,8 @@ suite('SnippetController', () => { new Selection(3, 5, 3, 5) ]); - codeSnippet = CodeSnippet.fromTextmate('_foo'); - controller.run(codeSnippet, 1, 0); + codeSnippet = '_foo'; + controller.insert(codeSnippet, 1, 0); assert.equal(editor.getModel().getValue(), 'this._foo\nabc_foo\ndef_foo'); }, ['this._', 'abc', 'def_']); @@ -494,17 +501,45 @@ suite('SnippetController', () => { snippetTest((editor, cursor, codeSnippet, controller) => { editor.setSelections([ - new Selection(1, 7, 1, 7), + new Selection(1, 7, 1, 7), // primary at `this._` new Selection(2, 4, 2, 4), new Selection(3, 6, 3, 6) ]); - codeSnippet = CodeSnippet.fromTextmate('._foo'); - controller.run(codeSnippet, 2, 0); + codeSnippet = '._foo'; + controller.insert(codeSnippet, 2, 0); assert.equal(editor.getModel().getValue(), 'this._foo\nabc._foo\ndef._foo'); }, ['this._', 'abc', 'def._']); + snippetTest((editor, cursor, codeSnippet, controller) => { + + editor.setSelections([ + new Selection(3, 6, 3, 6), // primary at `def._` + new Selection(1, 7, 1, 7), + new Selection(2, 4, 2, 4), + ]); + + codeSnippet = '._foo'; + controller.insert(codeSnippet, 2, 0); + assert.equal(editor.getModel().getValue(), 'this._foo\nabc._foo\ndef._foo'); + + }, ['this._', 'abc', 'def._']); + + snippetTest((editor, cursor, codeSnippet, controller) => { + + editor.setSelections([ + new Selection(2, 4, 2, 4), // primary at `abc` + new Selection(3, 6, 3, 6), + new Selection(1, 7, 1, 7), + ]); + + codeSnippet = '._foo'; + controller.insert(codeSnippet, 2, 0); + assert.equal(editor.getModel().getValue(), 'this._._foo\na._foo\ndef._._foo'); + + }, ['this._', 'abc', 'def._']); + }); test('Multiple cursor and overwriteBefore/After, #16277', () => { @@ -515,8 +550,8 @@ suite('SnippetController', () => { new Selection(2, 5, 2, 5), ]); - codeSnippet = CodeSnippet.fromTextmate('document'); - controller.run(codeSnippet, 3, 0); + codeSnippet = 'document'; + controller.insert(codeSnippet, 3, 0); assert.equal(editor.getModel().getValue(), '{document}\n{document && true}'); }, ['{foo}', '{foo && true}']); @@ -530,8 +565,8 @@ suite('SnippetController', () => { new Selection(1, 1, 1, 1) ]); - codeSnippet = CodeSnippet.fromTextmate('for (var ${1:i}=0; ${1:i} { new Selection(1, 1, 1, 1) ]); - codeSnippet = CodeSnippet.fromTextmate('for (let ${1:i}=0; ${1:i} expected=${actual.toString()}`); + } + assert.equal(s.length, 0); + } + + function assertContextKeys(service: MockContextKeyService, inSnippet: boolean, hasPrev: boolean, hasNext: boolean): void { + assert.equal(SnippetController2.InSnippetMode.getValue(service), inSnippet, `inSnippetMode`); + assert.equal(SnippetController2.HasPrevTabstop.getValue(service), hasPrev, `HasPrevTabstop`); + assert.equal(SnippetController2.HasNextTabstop.getValue(service), hasNext, `HasNextTabstop`); + } + + let editor: ICommonCodeEditor; + let model: Model; + let contextKeys: MockContextKeyService; + + setup(function () { + contextKeys = new MockContextKeyService(); + model = Model.createFromString('if\n $state\nfi'); + editor = mockCodeEditor([], { model }); + editor.setSelections([new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)]); + assert.equal(model.getEOL(), '\n'); + }); + + teardown(function () { + model.dispose(); + }); + + test('creation', function () { + const ctrl = new SnippetController2(editor, contextKeys); + assertContextKeys(contextKeys, false, false, false); + ctrl.dispose(); + }); + + test('insert, insert -> abort', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('foo${1:bar}foo$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + + ctrl.cancel(); + assertContextKeys(contextKeys, false, false, false); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + }); + + test('insert, insert -> tab, tab, done', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('${1:one}${2:two}$0'); + assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); + assertContextKeys(contextKeys, true, true, true); + + ctrl.next(); + assertContextKeys(contextKeys, false, false, false); + + editor.trigger('test', 'type', { text: '\t' }); + assert.equal(SnippetController2.InSnippetMode.getValue(contextKeys), false); + assert.equal(SnippetController2.HasNextTabstop.getValue(contextKeys), false); + assert.equal(SnippetController2.HasPrevTabstop.getValue(contextKeys), false); + }); + + test('insert, insert -> cursor moves out (left/right)', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('foo${1:bar}foo$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + + // bad selection change + editor.setSelections([new Selection(1, 12, 1, 12), new Selection(2, 16, 2, 16)]); + assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, insert -> cursor moves out (up/down)', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('foo${1:bar}foo$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + + // bad selection change + editor.setSelections([new Selection(2, 4, 2, 7), new Selection(3, 8, 3, 11)]); + assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, insert -> cursors collapse', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('foo${1:bar}foo$0'); + assert.equal(SnippetController2.InSnippetMode.getValue(contextKeys), true); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + + // bad selection change + editor.setSelections([new Selection(1, 4, 1, 7)]); + assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, insert plain text -> no snippet mode', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('foobar'); + assertContextKeys(contextKeys, false, false, false); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + }); + + test('insert, delete snippet text', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('${1:foobar}$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); + + editor.trigger('test', 'cut', {}); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + editor.trigger('test', 'type', { text: 'abc' }); + assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); + assertContextKeys(contextKeys, false, false, false); + + editor.trigger('test', 'tab', {}); + assertContextKeys(contextKeys, false, false, false); + + // editor.trigger('test', 'type', { text: 'abc' }); + // assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, nested snippet', function () { + const ctrl = new SnippetController2(editor, contextKeys); + ctrl.insert('${1:foobar}$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); + + ctrl.insert('far$1boo$0'); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, true, true, true); + + ctrl.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, nested plain text', function () { + const ctrl = new SnippetController2(editor, contextKeys); + ctrl.insert('${1:foobar}$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); + + ctrl.insert('farboo'); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, false, false, false); + }); +}); diff --git a/src/vs/editor/contrib/snippet/test/common/snippetParser.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts similarity index 55% rename from src/vs/editor/contrib/snippet/test/common/snippetParser.test.ts rename to src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts index 100c4be8679..66e204e9da2 100644 --- a/src/vs/editor/contrib/snippet/test/common/snippetParser.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts @@ -5,7 +5,7 @@ 'use strict'; import * as assert from 'assert'; -import { Scanner, TokenType, SnippetParser, Text, Placeholder, Variable, Marker } from 'vs/editor/contrib/snippet/common/snippetParser'; +import { Scanner, TokenType, SnippetParser, Text, Placeholder, Variable, Marker, walk } from 'vs/editor/contrib/snippet/browser/snippetParser'; suite('SnippetParser', () => { @@ -78,14 +78,12 @@ suite('SnippetParser', () => { assert.equal(scanner.next().type, TokenType.CurlyClose); }); - function assertEscape(value: string, expected: string) { + function assertText(value: string, expected: string) { const p = new SnippetParser(); - const actual = p.escape(value); + const actual = p.text(value); assert.equal(actual, expected); } - function assertMarker(marker: Marker[], ...ctors: Function[]); - function assertMarker(value: string, ...ctors: Function[]); function assertMarker(valueOrMarker: Marker[] | string, ...ctors: Function[]) { let marker: Marker[]; if (typeof valueOrMarker === 'string') { @@ -103,48 +101,61 @@ suite('SnippetParser', () => { assert.equal(marker.length, 0); } - function assertEscapeAndMarker(value: string, escaped: string, ...ctors: Function[]) { - assertEscape(value, escaped); + function assertTextAndMarker(value: string, escaped: string, ...ctors: Function[]) { + assertText(value, escaped); assertMarker(value, ...ctors); } - test('Parser, escaping', () => { - assertEscape('$', '$'); - assertEscape('\\\\$', '\\$'); - assertEscape('{', '{'); - assertEscape('\\}', '}'); - assertEscape('\\abc', '\\abc'); - assertEscape('foo${f:\\}}bar', 'foo}bar'); - assertEscape('\\{', '{'); - assertEscape('I need \\\\\\$', 'I need \\$'); - assertEscape('\\', '\\'); - assertEscape('\\{{', '{{'); - assertEscape('{{', '{{'); - assertEscape('{{dd', '{{dd'); - assertEscape('}}', '}}'); - assertEscape('ff}}', 'ff}}'); - - assertEscape('farboo', 'farboo'); - assertEscape('far{{}}boo', 'farboo'); - assertEscape('far{{123}}boo', 'far123boo'); - assertEscape('far\\{{123}}boo', 'far{{123}}boo'); - assertEscape('far{{id:bern}}boo', 'farbernboo'); - assertEscape('far{{id:bern {{basel}}}}boo', 'farbern baselboo'); - assertEscape('far{{id:bern {{id:basel}}}}boo', 'farbern baselboo'); - assertEscape('far{{id:bern {{id2:basel}}}}boo', 'farbern baselboo'); + function assertEscaped(value: string, expected: string) { + const actual = SnippetParser.escape(value); + assert.equal(actual, expected); + } + test('Parser, escaped', function () { + assertEscaped('foo$0', 'foo\\$0'); + assertEscaped('foo\\$0', 'foo\\\\\\$0'); + assertEscaped('f$1oo$0', 'f\\$1oo\\$0'); + assertEscaped('${1:foo}$0', '\\${1:foo\\}\\$0'); + assertEscaped('$', '\\$'); }); - test('Parser, TM escaping', () => { - assertEscapeAndMarker('foo${1:bar}}', 'foobar}', Text, Placeholder, Text); - assertEscapeAndMarker('foo${1:bar}${2:foo}}', 'foobarfoo}', Text, Placeholder, Placeholder, Text); + test('Parser, text', () => { + assertText('$', '$'); + assertText('\\\\$', '\\$'); + assertText('{', '{'); + assertText('\\}', '}'); + assertText('\\abc', '\\abc'); + assertText('foo${f:\\}}bar', 'foo}bar'); + assertText('\\{', '{'); + assertText('I need \\\\\\$', 'I need \\$'); + assertText('\\', '\\'); + assertText('\\{{', '{{'); + assertText('{{', '{{'); + assertText('{{dd', '{{dd'); + assertText('}}', '}}'); + assertText('ff}}', 'ff}}'); - assertEscapeAndMarker('foo${1:bar\\}${2:foo}}', 'foobar}foo', Text, Placeholder); + assertText('farboo', 'farboo'); + assertText('far{{}}boo', 'farboo'); + assertText('far{{123}}boo', 'far123boo'); + assertText('far\\{{123}}boo', 'far{{123}}boo'); + assertText('far{{id:bern}}boo', 'farbernboo'); + assertText('far{{id:bern {{basel}}}}boo', 'farbern baselboo'); + assertText('far{{id:bern {{id:basel}}}}boo', 'farbern baselboo'); + assertText('far{{id:bern {{id2:basel}}}}boo', 'farbern baselboo'); + }); + + + test('Parser, TM text', () => { + assertTextAndMarker('foo${1:bar}}', 'foobar}', Text, Placeholder, Text); + assertTextAndMarker('foo${1:bar}${2:foo}}', 'foobarfoo}', Text, Placeholder, Placeholder, Text); + + assertTextAndMarker('foo${1:bar\\}${2:foo}}', 'foobar}foo', Text, Placeholder); let [, placeholder] = new SnippetParser(true, false).parse('foo${1:bar\\}${2:foo}}'); let { defaultValue } = (placeholder); - assert.equal((placeholder).name, '1'); + assert.equal((placeholder).index, '1'); assert.ok(defaultValue[0] instanceof Text); assert.equal(defaultValue[0].toString(), 'bar}'); assert.ok(defaultValue[1] instanceof Placeholder); @@ -152,34 +163,34 @@ suite('SnippetParser', () => { }); test('Parser, placeholder', () => { - assertEscapeAndMarker('farboo', 'farboo', Text); - assertEscapeAndMarker('far{{}}boo', 'farboo', Text, Placeholder, Text); - assertEscapeAndMarker('far{{123}}boo', 'far123boo', Text, Placeholder, Text); - assertEscapeAndMarker('far\\{{123}}boo', 'far{{123}}boo', Text); + assertTextAndMarker('farboo', 'farboo', Text); + assertTextAndMarker('far{{}}boo', 'farboo', Text, Placeholder, Text); + assertTextAndMarker('far{{123}}boo', 'far123boo', Text, Placeholder, Text); + assertTextAndMarker('far\\{{123}}boo', 'far{{123}}boo', Text); }); test('Parser, literal code', () => { - assertEscapeAndMarker('far`123`boo', 'far`123`boo', Text); - assertEscapeAndMarker('far\\`123\\`boo', 'far\\`123\\`boo', Text); + assertTextAndMarker('far`123`boo', 'far`123`boo', Text); + assertTextAndMarker('far\\`123\\`boo', 'far\\`123\\`boo', Text); }); test('Parser, variables/tabstop', () => { - assertEscapeAndMarker('$far-boo', '-boo', Variable, Text); - assertEscapeAndMarker('\\$far-boo', '$far-boo', Text); - assertEscapeAndMarker('far$farboo', 'far', Text, Variable); - assertEscapeAndMarker('far${farboo}', 'far', Text, Variable); - assertEscapeAndMarker('$123', '', Placeholder); - assertEscapeAndMarker('$farboo', '', Variable); - assertEscapeAndMarker('$far12boo', '', Variable); + assertTextAndMarker('$far-boo', '-boo', Variable, Text); + assertTextAndMarker('\\$far-boo', '$far-boo', Text); + assertTextAndMarker('far$farboo', 'far', Text, Variable); + assertTextAndMarker('far${farboo}', 'far', Text, Variable); + assertTextAndMarker('$123', '', Placeholder); + assertTextAndMarker('$farboo', '', Variable); + assertTextAndMarker('$far12boo', '', Variable); }); test('Parser, variables/placeholder with defaults', () => { - assertEscapeAndMarker('${name:value}', 'value', Variable); - assertEscapeAndMarker('${1:value}', 'value', Placeholder); - assertEscapeAndMarker('${1:bar${2:foo}bar}', 'barfoobar', Placeholder); + assertTextAndMarker('${name:value}', 'value', Variable); + assertTextAndMarker('${1:value}', 'value', Placeholder); + assertTextAndMarker('${1:bar${2:foo}bar}', 'barfoobar', Placeholder); - assertEscapeAndMarker('${name:value', '${name:value', Text); - assertEscapeAndMarker('${1:bar${2:foobar}', '${1:barfoobar', Text, Placeholder); + assertTextAndMarker('${name:value', '${name:value', Text); + assertTextAndMarker('${1:bar${2:foobar}', '${1:barfoobar', Text, Placeholder); }); test('Parser, only textmate', () => { @@ -213,7 +224,7 @@ suite('SnippetParser', () => { const placeholder = marker[1]; assert.equal(placeholder, false); - assert.equal(placeholder.name, '1'); + assert.equal(placeholder.index, '1'); assert.equal(placeholder.defaultValue.length, 3); assert.ok(placeholder.defaultValue[0] instanceof Text); assert.ok(placeholder.defaultValue[1] instanceof Variable); @@ -233,14 +244,14 @@ suite('SnippetParser', () => { test('Parser, real world, mixed', () => { - assertEscapeAndMarker( + assertTextAndMarker( 'finished:{{}}, second:{{2:name}}, first:{{1:}}, third:{{3:}}', 'finished:, second:name, first:, third:', Text, Placeholder, Text, Placeholder, Text, Placeholder, Text, Placeholder ); - assertEscapeAndMarker( + assertTextAndMarker( 'begin\\{{{1:enumerate}}\\}\n\t{{}}\nend\\{{{1:}}\\}', 'begin{enumerate}\n\t\nend{enumerate}', Text, Placeholder, Text, Placeholder, Text, Placeholder, Text @@ -249,20 +260,20 @@ suite('SnippetParser', () => { }); test('Parser, default name/value', () => { - assertEscapeAndMarker( + assertTextAndMarker( '{{first}}-{{2:}}-{{second}}-{{1:}}', 'first--second-', Placeholder, Text, Placeholder, Text, Placeholder, Text, Placeholder ); const [p1, , p2, , p3] = new SnippetParser().parse('{{first}}-{{2:}}-{{second}}-{{1:}}'); - assert.equal((p1).name, 'first'); + assert.equal((p1).index, 'first'); assert.equal(Marker.toString((p1).defaultValue), 'first'); - assert.equal((p2).name, '2'); + assert.equal((p2).index, '2'); assert.equal(Marker.toString((p2).defaultValue), ''); - assert.equal((p3).name, 'second'); + assert.equal((p3).index, 'second'); assert.equal(Marker.toString((p3).defaultValue), 'second'); }); @@ -272,26 +283,107 @@ suite('SnippetParser', () => { const [, p1, , p2] = new SnippetParser().parse('errorContext: `${1:err}`, error:$1'); - assert.equal((p1).name, '1'); + assert.equal((p1).index, '1'); assert.equal((p1).defaultValue.length, '1'); assert.equal(((p1).defaultValue[0]), 'err'); - assert.equal((p2).name, '1'); + assert.equal((p2).index, '1'); assert.equal((p2).defaultValue.length, '1'); assert.equal(((p2).defaultValue[0]), 'err'); }); test('backspace esapce in TM only, #16212', () => { - const actual = new SnippetParser(true, false).escape('Foo \\\\${abc}bar'); + const actual = new SnippetParser(true, false).text('Foo \\\\${abc}bar'); assert.equal(actual, 'Foo \\bar'); }); test('colon as variable/placeholder value, #16717', () => { - let actual = new SnippetParser(true, false).escape('${TM_SELECTED_TEXT:foo:bar}'); + let actual = new SnippetParser(true, false).text('${TM_SELECTED_TEXT:foo:bar}'); assert.equal(actual, 'foo:bar'); - actual = new SnippetParser(true, false).escape('${1:foo:bar}'); + actual = new SnippetParser(true, false).text('${1:foo:bar}'); assert.equal(actual, 'foo:bar'); }); + + test('marker#len', () => { + + function assertLen(template: string, ...lengths: number[]): void { + const { marker } = SnippetParser.parse(template); + walk(marker, m => { + const expected = lengths.shift(); + assert.equal(m.len(), expected); + return true; + }); + assert.equal(lengths.length, 0); + } + + assertLen('text$0', 4, 0); + assertLen('$1text$0', 0, 4, 0); + assertLen('te$1xt$0', 2, 0, 2, 0); + assertLen('errorContext: `${1:err}`, error: $0', 15, 0, 3, 10, 0); + assertLen('errorContext: `${1:err}`, error: $1$0', 15, 0, 3, 10, 0, 3, 0); + assertLen('$TM_SELECTED_TEXT$0', 0, 0); + assertLen('${TM_SELECTED_TEXT:def}$0', 0, 3, 0); + }); + + test('parser, parent node', function () { + let snippet = SnippetParser.parse('This ${1:is ${2:nested}}$0'); + + assert.equal(snippet.placeholders.length, 3); + let [first, second] = snippet.placeholders; + assert.equal(first.index, '1'); + assert.equal(second.index, '2'); + assert.ok(second.parent === first); + assert.ok(first.parent === undefined); + + snippet = SnippetParser.parse('${VAR:default${1:value}}$0'); + assert.equal(snippet.placeholders.length, 2); + [first] = snippet.placeholders; + assert.equal(first.index, '1'); + + assert.ok(snippet.marker[0] instanceof Variable); + assert.ok(first.parent === snippet.marker[0]); + }); + + test('TextmateSnippet#enclosingPlaceholders', function () { + let snippet = SnippetParser.parse('This ${1:is ${2:nested}}$0'); + let [first, second] = snippet.placeholders; + + assert.deepEqual(snippet.enclosingPlaceholders(first), []); + assert.deepEqual(snippet.enclosingPlaceholders(second), [first]); + }); + + test('TextmateSnippet#offset', () => { + let snippet = SnippetParser.parse('te$1xt'); + assert.equal(snippet.offset(snippet.marker[0]), 0); + assert.equal(snippet.offset(snippet.marker[1]), 2); + assert.equal(snippet.offset(snippet.marker[2]), 2); + + snippet = SnippetParser.parse('${TM_SELECTED_TEXT:def}'); + assert.equal(snippet.offset(snippet.marker[0]), 0); + assert.equal(snippet.offset((snippet.marker[0]).defaultValue[0]), 0); + + // forgein marker + assert.equal(snippet.offset(new Text('foo')), -1); + }); + + test('TextmateSnippet#placeholder', () => { + let snippet = SnippetParser.parse('te$1xt$0'); + let placeholders = snippet.placeholders; + assert.equal(placeholders.length, 2); + + snippet = SnippetParser.parse('te$1xt$1$0'); + placeholders = snippet.placeholders; + assert.equal(placeholders.length, 3); + + + snippet = SnippetParser.parse('te$1xt$2$0'); + placeholders = snippet.placeholders; + assert.equal(placeholders.length, 3); + + snippet = SnippetParser.parse('${1:bar${2:foo}bar}$0'); + placeholders = snippet.placeholders; + assert.equal(placeholders.length, 3); + }); }); diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts new file mode 100644 index 00000000000..4691eaad476 --- /dev/null +++ b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts @@ -0,0 +1,407 @@ +/*--------------------------------------------------------------------------------------------- + * 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 assert from 'assert'; +import { Selection } from 'vs/editor/common/core/selection'; +import { Range } from 'vs/editor/common/core/range'; +import { IPosition, Position } from 'vs/editor/common/core/position'; +import { SnippetSession } from 'vs/editor/contrib/snippet/browser/snippetSession'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { mockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; +import { Model } from 'vs/editor/common/model/model'; + +suite('SnippetSession', function () { + + let editor: ICommonCodeEditor; + let model: Model; + + function assertSelections(editor: ICommonCodeEditor, ...s: Selection[]) { + for (const selection of editor.getSelections()) { + const actual = s.shift(); + assert.ok(selection.equalsSelection(actual), `actual=${selection.toString()} <> expected=${actual.toString()}`); + } + assert.equal(s.length, 0); + } + + setup(function () { + model = Model.createFromString('function foo() {\n console.log(a);\n}'); + editor = mockCodeEditor([], { model }); + editor.setSelections([new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)]); + assert.equal(model.getEOL(), '\n'); + }); + + teardown(function () { + model.dispose(); + editor.dispose(); + }); + + test('normalize whitespace', function () { + + function assertNormalized(position: IPosition, input: string, expected: string): void { + const actual = SnippetSession.adjustWhitespace(model, position, input); + assert.equal(actual, expected); + } + + assertNormalized(new Position(1, 1), 'foo', 'foo'); + assertNormalized(new Position(1, 1), 'foo\rbar', 'foo\nbar'); + assertNormalized(new Position(1, 1), 'foo\rbar', 'foo\nbar'); + assertNormalized(new Position(2, 5), 'foo\r\tbar', 'foo\n bar'); + assertNormalized(new Position(2, 3), 'foo\r\tbar', 'foo\n bar'); + assertNormalized(new Position(2, 5), 'foo\r\tbar\nfoo', 'foo\n bar\n foo'); + }); + + test('adjust selection (overwrite[Before|After])', function () { + + let range = SnippetSession.adjustSelection(model, new Selection(1, 2, 1, 2), 1, 0); + assert.ok(range.equalsRange(new Range(1, 1, 1, 2))); + range = SnippetSession.adjustSelection(model, new Selection(1, 2, 1, 2), 1111, 0); + assert.ok(range.equalsRange(new Range(1, 1, 1, 2))); + range = SnippetSession.adjustSelection(model, new Selection(1, 2, 1, 2), 0, 10); + assert.ok(range.equalsRange(new Range(1, 2, 1, 12))); + range = SnippetSession.adjustSelection(model, new Selection(1, 2, 1, 2), 0, 10111); + assert.ok(range.equalsRange(new Range(1, 2, 1, 17))); + + }); + + test('text edits & selection', function () { + const session = new SnippetSession(editor, 'foo${1:bar}foo$0'); + session.insert(); + assert.equal(editor.getModel().getValue(), 'foobarfoofunction foo() {\n foobarfooconsole.log(a);\n}'); + + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + session.next(); + assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); + }); + + test('text edit with reversed selection', function () { + + const session = new SnippetSession(editor, '${1:bar}$0'); + editor.setSelections([new Selection(2, 5, 2, 5), new Selection(1, 1, 1, 1)]); + + session.insert(); + assert.equal(model.getValue(), 'barfunction foo() {\n barconsole.log(a);\n}'); + assertSelections(editor, new Selection(2, 5, 2, 8), new Selection(1, 1, 1, 4)); + }); + + test('snippets, repeated tabstops', function () { + const session = new SnippetSession(editor, '${1:abc}foo${1:abc}$0'); + session.insert(); + assertSelections(editor, + new Selection(1, 1, 1, 4), new Selection(1, 7, 1, 10), + new Selection(2, 5, 2, 8), new Selection(2, 11, 2, 14), + ); + session.next(); + assertSelections(editor, + new Selection(1, 10, 1, 10), + new Selection(2, 14, 2, 14), + ); + }); + + test('snippets, just text', function () { + const session = new SnippetSession(editor, 'foobar'); + session.insert(); + assert.equal(model.getValue(), 'foobarfunction foo() {\n foobarconsole.log(a);\n}'); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + }); + + test('snippets, selections and new text with newlines', () => { + + const session = new SnippetSession(editor, 'foo\n\t${1:bar}\n$0'); + session.insert(); + + assert.equal(editor.getModel().getValue(), 'foo\n bar\nfunction foo() {\n foo\n bar\n console.log(a);\n}'); + + assertSelections(editor, new Selection(2, 5, 2, 8), new Selection(5, 9, 5, 12)); + + session.next(); + assertSelections(editor, new Selection(3, 1, 3, 1), new Selection(6, 5, 6, 5)); + }); + + test('snippets, selections -> next/prev', () => { + + const session = new SnippetSession(editor, 'f$1oo${2:bar}foo$0'); + session.insert(); + + // @ $2 + assertSelections(editor, new Selection(1, 2, 1, 2), new Selection(2, 6, 2, 6)); + // @ $1 + session.next(); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + // @ $2 + session.prev(); + assertSelections(editor, new Selection(1, 2, 1, 2), new Selection(2, 6, 2, 6)); + // @ $1 + session.next(); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + // @ $0 + session.next(); + assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); + }); + + test('snippets, selections & typing', function () { + const session = new SnippetSession(editor, 'f${1:oo}_$2_$0'); + session.insert(); + + editor.trigger('test', 'type', { text: 'X' }); + session.next(); + editor.trigger('test', 'type', { text: 'bar' }); + + // go back to ${2:oo} which is now just 'X' + session.prev(); + assertSelections(editor, new Selection(1, 2, 1, 3), new Selection(2, 6, 2, 7)); + + // go forward to $1 which is now 'bar' + session.next(); + assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); + + // go to final tabstop + session.next(); + assert.equal(model.getValue(), 'fX_bar_function foo() {\n fX_bar_console.log(a);\n}'); + assertSelections(editor, new Selection(1, 8, 1, 8), new Selection(2, 12, 2, 12)); + }); + + test('snippets, insert shorter snippet into non-empty selection', function () { + model.setValue('foo_bar_foo'); + editor.setSelections([new Selection(1, 1, 1, 4), new Selection(1, 9, 1, 12)]); + + new SnippetSession(editor, 'x$0').insert(); + assert.equal(model.getValue(), 'x_bar_x'); + assertSelections(editor, new Selection(1, 2, 1, 2), new Selection(1, 8, 1, 8)); + }); + + test('snippets, insert longer snippet into non-empty selection', function () { + model.setValue('foo_bar_foo'); + editor.setSelections([new Selection(1, 1, 1, 4), new Selection(1, 9, 1, 12)]); + + new SnippetSession(editor, 'LONGER$0').insert(); + assert.equal(model.getValue(), 'LONGER_bar_LONGER'); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(1, 18, 1, 18)); + }); + + test('snippets, don\'t grow final tabstop', function () { + model.setValue('foo_zzz_foo'); + editor.setSelection(new Selection(1, 5, 1, 8)); + const session = new SnippetSession(editor, '$1bar$0'); + session.insert(); + + assertSelections(editor, new Selection(1, 5, 1, 5)); + editor.trigger('test', 'type', { text: 'foo-' }); + + session.next(); + assert.equal(model.getValue(), 'foo_foo-bar_foo'); + assertSelections(editor, new Selection(1, 12, 1, 12)); + + editor.trigger('test', 'type', { text: 'XXX' }); + assert.equal(model.getValue(), 'foo_foo-barXXX_foo'); + session.prev(); + assertSelections(editor, new Selection(1, 5, 1, 9)); + session.next(); + assertSelections(editor, new Selection(1, 15, 1, 15)); + }); + + test('snippets, don\'t merge touching tabstops 1/2', function () { + + const session = new SnippetSession(editor, '$1$2$3$0'); + session.insert(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + session.next(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + session.next(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + session.next(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + session.prev(); + session.prev(); + session.prev(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + editor.trigger('test', 'type', { text: '111' }); + + session.next(); + editor.trigger('test', 'type', { text: '222' }); + + session.next(); + editor.trigger('test', 'type', { text: '333' }); + + session.next(); + assert.equal(model.getValue(), '111222333function foo() {\n 111222333console.log(a);\n}'); + assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); + + session.prev(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + session.prev(); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + session.prev(); + assertSelections(editor, new Selection(1, 1, 1, 4), new Selection(2, 5, 2, 8)); + }); + test('snippets, don\'t merge touching tabstops 2/2', function () { + + const session = new SnippetSession(editor, '$1$2$3$0'); + session.insert(); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + editor.trigger('test', 'type', { text: '111' }); + + session.next(); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + editor.trigger('test', 'type', { text: '222' }); + + session.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + editor.trigger('test', 'type', { text: '333' }); + + session.next(); + assert.equal(session.isAtLastPlaceholder, true); + }); + + test('snippets, gracefully move over final tabstop', function () { + const session = new SnippetSession(editor, '${1}bar$0'); + session.insert(); + + assert.equal(session.isAtLastPlaceholder, false); + assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); + + session.next(); + assert.equal(session.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + + session.next(); + assert.equal(session.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + }); + + test('snippets, overwriting nested placeholder', function () { + const session = new SnippetSession(editor, 'log(${1:"$2"});$0'); + session.insert(); + assertSelections(editor, new Selection(1, 5, 1, 7), new Selection(2, 9, 2, 11)); + + editor.trigger('test', 'type', { text: 'XXX' }); + assert.equal(model.getValue(), 'log(XXX);function foo() {\n log(XXX);console.log(a);\n}'); + + session.next(); + assert.equal(session.isAtLastPlaceholder, false); + // assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + + session.next(); + assert.equal(session.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); + }); + + test('snippets, selections and snippet ranges', function () { + const session = new SnippetSession(editor, '${1:foo}farboo${2:bar}$0'); + session.insert(); + assert.equal(model.getValue(), 'foofarboobarfunction foo() {\n foofarboobarconsole.log(a);\n}'); + assertSelections(editor, new Selection(1, 1, 1, 4), new Selection(2, 5, 2, 8)); + + assert.equal(session.isSelectionWithinPlaceholders(), true); + + editor.setSelections([new Selection(1, 1, 1, 1)]); + assert.equal(session.isSelectionWithinPlaceholders(), false); + + editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10)]); + assert.equal(session.isSelectionWithinPlaceholders(), false); // in snippet, outside placeholder + + editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10), new Selection(1, 1, 1, 1)]); + assert.equal(session.isSelectionWithinPlaceholders(), false); // in snippet, outside placeholder + + editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10), new Selection(2, 20, 2, 21)]); + assert.equal(session.isSelectionWithinPlaceholders(), false); + + // reset selection to placeholder + session.next(); + assert.equal(session.isSelectionWithinPlaceholders(), true); + assertSelections(editor, new Selection(1, 10, 1, 13), new Selection(2, 14, 2, 17)); + + // reset selection to placeholder + session.next(); + assert.equal(session.isSelectionWithinPlaceholders(), true); + assert.equal(session.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 13, 1, 13), new Selection(2, 17, 2, 17)); + }); + + test('snippets, nested sessions', function () { + + model.setValue(''); + editor.setSelection(new Selection(1, 1, 1, 1)); + + const first = new SnippetSession(editor, 'foo${2:bar}foo$0'); + first.insert(); + assert.equal(model.getValue(), 'foobarfoo'); + assertSelections(editor, new Selection(1, 4, 1, 7)); + + const second = new SnippetSession(editor, 'ba${1:zzzz}$0'); + second.insert(); + assert.equal(model.getValue(), 'foobazzzzfoo'); + assertSelections(editor, new Selection(1, 6, 1, 10)); + + second.next(); + assert.equal(second.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 10, 1, 10)); + + first.next(); + assert.equal(first.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 13, 1, 13)); + }); + + test('snippets, typing at final tabstop', function () { + + const session = new SnippetSession(editor, 'farboo$0'); + session.insert(); + assert.equal(session.isAtLastPlaceholder, true); + assert.equal(session.isSelectionWithinPlaceholders(), false); + + editor.trigger('test', 'type', { text: 'XXX' }); + assert.equal(session.isSelectionWithinPlaceholders(), false); + }); + + test('snippets, typing at beginning', function () { + + editor.setSelection(new Selection(1, 2, 1, 2)); + const session = new SnippetSession(editor, 'farboo$0'); + session.insert(); + + editor.setSelection(new Selection(1, 2, 1, 2)); + assert.equal(session.isSelectionWithinPlaceholders(), false); + assert.equal(session.isAtLastPlaceholder, true); + + editor.trigger('test', 'type', { text: 'XXX' }); + assert.equal(model.getLineContent(1), 'fXXXfarboounction foo() {'); + assert.equal(session.isSelectionWithinPlaceholders(), false); + + session.next(); + assertSelections(editor, new Selection(1, 11, 1, 11)); + }); + + test('snippets, typing with nested placeholder', function () { + + editor.setSelection(new Selection(1, 1, 1, 1)); + const session = new SnippetSession(editor, 'This ${1:is ${2:nested}}.$0'); + session.insert(); + assertSelections(editor, new Selection(1, 6, 1, 15)); + + session.next(); + assertSelections(editor, new Selection(1, 9, 1, 15)); + + editor.trigger('test', 'cut', {}); + assertSelections(editor, new Selection(1, 9, 1, 9)); + + editor.trigger('test', 'type', { text: 'XXX' }); + session.prev(); + assertSelections(editor, new Selection(1, 6, 1, 12)); + }); + + test('snippets, snippet with variables', function () { + const session = new SnippetSession(editor, '@line=$TM_LINE_NUMBER$0'); + session.insert(); + + assert.equal(model.getValue(), '@line=1function foo() {\n @line=2console.log(a);\n}'); + assertSelections(editor, new Selection(1, 8, 1, 8), new Selection(2, 12, 2, 12)); + }); +}); + diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts new file mode 100644 index 00000000000..fa0bb4034f9 --- /dev/null +++ b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts @@ -0,0 +1,104 @@ +/*--------------------------------------------------------------------------------------------- + * 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 assert from 'assert'; +import { isWindows } from 'vs/base/common/platform'; +import URI from 'vs/base/common/uri'; +import { Selection } from 'vs/editor/common/core/selection'; +import { EditorSnippetVariableResolver } from 'vs/editor/contrib/snippet/browser/snippetVariables'; +import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; +import { Model } from 'vs/editor/common/model/model'; + +suite('Snippet Variables Resolver', function () { + + let model: Model; + let resolver: EditorSnippetVariableResolver; + + setup(function () { + model = Model.createFromString([ + 'this is line one', + 'this is line two', + ' this is line three' + ].join('\n'), undefined, undefined, URI.parse('file:///foo/files/text.txt')); + + resolver = new EditorSnippetVariableResolver(model, new Selection(1, 1, 1, 1)); + }); + + teardown(function () { + model.dispose(); + }); + + test('editor variables, basics', function () { + assert.equal(resolver.resolve('TM_FILENAME'), 'text.txt'); + assert.equal(resolver.resolve('something'), undefined); + }); + + test('editor variables, file/dir', function () { + + assert.equal(resolver.resolve('TM_FILENAME'), 'text.txt'); + if (!isWindows) { + assert.equal(resolver.resolve('TM_DIRECTORY'), '/foo/files'); + assert.equal(resolver.resolve('TM_FILEPATH'), '/foo/files/text.txt'); + } + + resolver = new EditorSnippetVariableResolver( + Model.createFromString('', undefined, undefined, URI.parse('http://www.pb.o/abc/def/ghi')), + new Selection(1, 1, 1, 1) + ); + assert.equal(resolver.resolve('TM_FILENAME'), 'ghi'); + if (!isWindows) { + assert.equal(resolver.resolve('TM_DIRECTORY'), '/abc/def'); + assert.equal(resolver.resolve('TM_FILEPATH'), '/abc/def/ghi'); + } + + resolver = new EditorSnippetVariableResolver( + Model.createFromString('', undefined, undefined, URI.parse('mem:fff.ts')), + new Selection(1, 1, 1, 1) + ); + assert.equal(resolver.resolve('TM_DIRECTORY'), ''); + assert.equal(resolver.resolve('TM_FILEPATH'), 'fff.ts'); + + }); + + test('editor variables, selection', function () { + + resolver = new EditorSnippetVariableResolver(model, new Selection(1, 2, 2, 3)); + assert.equal(resolver.resolve('TM_SELECTED_TEXT'), 'his is line one\nth'); + assert.equal(resolver.resolve('TM_CURRENT_LINE'), 'this is line two'); + assert.equal(resolver.resolve('TM_LINE_INDEX'), '1'); + assert.equal(resolver.resolve('TM_LINE_NUMBER'), '2'); + + resolver = new EditorSnippetVariableResolver(model, new Selection(2, 3, 1, 2)); + assert.equal(resolver.resolve('TM_SELECTED_TEXT'), 'his is line one\nth'); + assert.equal(resolver.resolve('TM_CURRENT_LINE'), 'this is line one'); + assert.equal(resolver.resolve('TM_LINE_INDEX'), '0'); + assert.equal(resolver.resolve('TM_LINE_NUMBER'), '1'); + + resolver = new EditorSnippetVariableResolver(model, new Selection(1, 2, 1, 2)); + assert.equal(resolver.resolve('TM_SELECTED_TEXT'), ''); + + assert.equal(resolver.resolve('TM_CURRENT_WORD'), 'this'); + + resolver = new EditorSnippetVariableResolver(model, new Selection(3, 1, 3, 1)); + assert.equal(resolver.resolve('TM_CURRENT_WORD'), ''); + + }); + + test('TextmateSnippet, resolve variable', function () { + const snippet = SnippetParser.parse('"$TM_CURRENT_WORD"'); + assert.equal(snippet.text, '""'); + snippet.resolveVariables(resolver); + assert.equal(snippet.text, '"this"'); + + }); + + test('TextmateSnippet, resolve variable with default', function () { + const snippet = SnippetParser.parse('"${TM_CURRENT_WORD:foo}"'); + assert.equal(snippet.text, '"foo"'); + snippet.resolveVariables(resolver); + assert.equal(snippet.text, '"this"'); + }); +}); diff --git a/src/vs/editor/contrib/snippet/test/common/snippet.test.ts b/src/vs/editor/contrib/snippet/test/common/snippet.test.ts deleted file mode 100644 index 256d778fdaa..00000000000 --- a/src/vs/editor/contrib/snippet/test/common/snippet.test.ts +++ /dev/null @@ -1,351 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { Range } from 'vs/editor/common/core/range'; -import { CodeSnippet, ICodeSnippet, ISnippetVariableResolver } from 'vs/editor/contrib/snippet/common/snippet'; - -suite('Editor Contrib - Snippets', () => { - - function assertInternalAndTextmate(internal: string, textmate: string, callback: (snippet: ICodeSnippet) => any) { - callback(CodeSnippet.fromInternal(internal)); - callback(CodeSnippet.fromTextmate(textmate)); - } - - test('Support tab stop order', () => { - - assertInternalAndTextmate( - 'finished:{{}}, second:{{2:name}}, first:{{1:}}, third:{{3:}}', - 'finished:$0, second:${2:name}, first:$1, third:$3', - snippet => { - assert.deepEqual(snippet.lines, ['finished:, second:name, first:, third:']); - assert.equal(snippet.placeHolders.length, 4); - assert.equal(snippet.placeHolders[0].id, '1'); - assert.equal(snippet.placeHolders[0].value, ''); - assert.equal(snippet.placeHolders[1].id, '2'); - assert.equal(snippet.placeHolders[1].value, 'name'); - assert.equal(snippet.placeHolders[2].id, '3'); - assert.equal(snippet.placeHolders[2].value, ''); - assert.equal(snippet.placeHolders[3].id, ''); - assert.equal(snippet.placeHolders[3].value, ''); - assert.equal(snippet.finishPlaceHolderIndex, 3); - }); - }); - - test('Support tab stop order with implicit finish', () => { - - assertInternalAndTextmate( - 't2:{{2:}}, t1:{{1:}}', - 't2:$2, t1:$1', - snippet => { - assert.deepEqual(snippet.lines, ['t2:, t1:']); - assert.equal(snippet.placeHolders.length, 3); - assert.equal(snippet.placeHolders[0].id, '1'); - assert.equal(snippet.placeHolders[0].value, ''); - assert.equal(snippet.placeHolders[1].id, '2'); - assert.equal(snippet.placeHolders[1].value, ''); - assert.equal(snippet.finishPlaceHolderIndex, 2); - }); - }); - - test('Support tab stop order with no finish', () => { - - assertInternalAndTextmate( - 't2:{{2:second}}, t3:{{3:last}}, t1:{{1:first}}', - 't2:${2:second}, t3:${3:last}, t1:${1:first}', - snippet => { - assert.deepEqual(snippet.lines, ['t2:second, t3:last, t1:first']); - assert.equal(snippet.placeHolders.length, 4); - assert.equal(snippet.placeHolders[0].id, '1'); - assert.equal(snippet.placeHolders[0].value, 'first'); - assert.equal(snippet.placeHolders[1].id, '2'); - assert.equal(snippet.placeHolders[1].value, 'second'); - assert.equal(snippet.placeHolders[2].id, '3'); - assert.equal(snippet.placeHolders[2].value, 'last'); - assert.equal(snippet.finishPlaceHolderIndex, 3); - }); - }); - - test('Support tab stop order which does not affect named variable id\'s', () => { - - assertInternalAndTextmate( - '{{first}}-{{2:}}-{{second}}-{{1:}}', - '${first}-${2}-${second}-${1}', - snippet => { - assert.deepEqual(snippet.lines, ['first--second-']); - assert.equal(snippet.placeHolders.length, 5); - assert.equal(snippet.placeHolders[0].id, 'first'); - assert.equal(snippet.placeHolders[1].id, 'second'); - assert.equal(snippet.placeHolders[2].id, '1'); - assert.equal(snippet.placeHolders[3].id, '2'); - } - ); - }); - - test('nested placeholder', () => { - let snippet = CodeSnippet.fromTextmate([ - '', - '\t$0', - '
' - ].join('\n')); - - assert.equal(snippet.placeHolders.length, 3); - assert.equal(snippet.finishPlaceHolderIndex, 2); - let [first, second, third] = snippet.placeHolders; - - assert.equal(third.id, 0); - assert.equal(third.occurences.length, 1); - assert.deepEqual(third.occurences[0], new Range(2, 2, 2, 2)); - - assert.equal(second.id, 2); - assert.equal(second.occurences.length, 1); - assert.deepEqual(second.occurences[0], new Range(1, 10, 1, 17)); - - assert.equal(first.id, '1'); - assert.equal(first.occurences.length, 1); - assert.deepEqual(first.occurences[0], new Range(1, 5, 1, 18)); - }); - - test('bug #17541:[snippets] Support default text in mirrors', () => { - - var external = [ - 'begin{${1:enumerate}}', - '\t$0', - 'end{$1}' - ].join('\n'); - - var internal = [ - 'begin\\{{{1:enumerate}}\\}', - '\t{{}}', - 'end\\{{{1:}}\\}' - ].join('\n'); - - assertInternalAndTextmate(internal, external, snippet => { - assert.deepEqual(snippet.lines, [ - 'begin{enumerate}', - '\t', - 'end{enumerate}' - ]); - assert.equal(snippet.placeHolders.length, 2); - assert.equal(snippet.placeHolders[0].id, '1'); - assert.equal(snippet.placeHolders[0].occurences.length, 2); - assert.deepEqual(snippet.placeHolders[0].occurences[0], new Range(1, 7, 1, 16)); - assert.deepEqual(snippet.placeHolders[0].occurences[1], new Range(3, 5, 3, 14)); - assert.equal(snippet.placeHolders[1].id, ''); - assert.equal(snippet.placeHolders[1].occurences.length, 1); - assert.deepEqual(snippet.placeHolders[1].occurences[0], new Range(2, 2, 2, 2)); - }); - }); - - test('bug #7093: Snippet default value is only populated for first variable reference', () => { - var internal = 'logger.error({ logContext: lc, errorContext: `{{1:err}}`, error: {{1:}} });'; - var external = 'logger.error({ logContext: lc, errorContext: `${1:err}`, error: $1 });'; - - assertInternalAndTextmate(internal, external, snippet => { - assert.equal(snippet.lines.length, 1); - assert.equal(snippet.lines[0], 'logger.error({ logContext: lc, errorContext: `err`, error: err });'); - }); - }); - - test('bug #17487:[snippets] four backslashes are required to get one backslash in the inserted text', () => { - - var external = [ - '\\begin{${1:enumerate}}', - '\t$0', - '\\end{$1}' - ].join('\n'); - - var internal = [ - '\\begin\\{{{1:enumerate}}\\}', - '\t{{}}', - '\\end\\{{{1:}}\\}' - ].join('\n'); - - assertInternalAndTextmate(internal, external, snippet => { - assert.deepEqual(snippet.lines, [ - '\\begin{enumerate}', - '\t', - '\\end{enumerate}' - ]); - assert.equal(snippet.placeHolders.length, 2); - assert.equal(snippet.placeHolders[0].id, '1'); - assert.equal(snippet.placeHolders[0].occurences.length, 2); - assert.deepEqual(snippet.placeHolders[0].occurences[0], new Range(1, 8, 1, 17)); - assert.deepEqual(snippet.placeHolders[0].occurences[1], new Range(3, 6, 3, 15)); - assert.equal(snippet.placeHolders[1].id, ''); - assert.equal(snippet.placeHolders[1].occurences.length, 1); - assert.deepEqual(snippet.placeHolders[1].occurences[0], new Range(2, 2, 2, 2)); - }); - }); - - test('issue #3552: Snippet Converted Not Working for literal Dollar Sign', () => { - - let external = '\n\\$scope.\\$broadcast(\'scroll.infiniteScrollComplete\');\n'; - let snippet = CodeSnippet.fromTextmate(external); - assert.equal(snippet.placeHolders.length, 1); - assert.equal(snippet.finishPlaceHolderIndex, 0); - assert.deepEqual(snippet.lines, ['', '$scope.$broadcast(\'scroll.infiniteScrollComplete\');', '']); - }); - - test('bind, adjust indentation', () => { - - // don't move placeholder at the beginning of the line - let snippet = CodeSnippet.fromTextmate([ - 'afterEach((done) => {', - '\t${1}test${2}', - '})' - ].join('\n')); - - // replace tab-stop with two spaces - let boundSnippet = snippet.bind('', 0, 0, { - normalizeIndentation(str: string): string { - return str.replace(/\t/g, ' '); - } - }); - let [first, second] = boundSnippet.placeHolders; - assert.equal(first.occurences.length, 1); - assert.equal(first.occurences[0].startColumn, 3); - assert.equal(second.occurences.length, 1); - assert.equal(second.occurences[0].startColumn, 7); - - // keep tab-stop, identity - boundSnippet = snippet.bind('', 0, 0, { - normalizeIndentation(str: string): string { - return str; - } - }); - [first, second] = boundSnippet.placeHolders; - assert.equal(first.occurences.length, 1); - assert.equal(first.occurences[0].startColumn, 2); - assert.equal(second.occurences.length, 1); - assert.equal(second.occurences[0].startColumn, 6); - }); - - - test('issue #11890: Bad cursor position 1/2', () => { - - let snippet = CodeSnippet.fromTextmate([ - 'afterEach((done) => {', - '${1}\ttest${2}', - '})' - ].join('\n')); - - let boundSnippet = snippet.bind('', 0, 0, { - normalizeIndentation(str: string): string { - return str.replace(/\t/g, ' '); - } - }); - - assert.equal(boundSnippet.lines[1], ' test'); - assert.equal(boundSnippet.placeHolders.length, 3); - assert.equal(boundSnippet.finishPlaceHolderIndex, 2); - - let [first, second] = boundSnippet.placeHolders; - assert.equal(first.occurences.length, 1); - assert.equal(first.occurences[0].startColumn, 1); - assert.equal(second.occurences.length, 1); - assert.equal(second.occurences[0].startColumn, 7); - }); - - test('issue #11890: Bad cursor position 2/2', () => { - - let snippet = CodeSnippet.fromTextmate('${1}\ttest'); - - let boundSnippet = snippet.bind('abc abc abc prefix3', 0, 12, { - normalizeIndentation(str: string): string { - return str.replace(/\t/g, ' '); - } - }); - - assert.equal(boundSnippet.lines[0], '\ttest'); - assert.equal(boundSnippet.placeHolders.length, 2); - assert.equal(boundSnippet.finishPlaceHolderIndex, 1); - - let [first, second] = boundSnippet.placeHolders; - assert.equal(first.occurences.length, 1); - assert.equal(first.occurences[0].startColumn, 13); - assert.equal(second.occurences.length, 1); - assert.equal(second.occurences[0].startColumn, 18); - }); - - test('issue #17989: Bad selection', () => { - - let snippet = CodeSnippet.fromTextmate('${1:HoldMeTight}'); - - let boundSnippet = snippet.bind('abc abc abc prefix3', 0, 12, { - normalizeIndentation(str: string): string { - return str.replace(/\t/g, ' '); - } - }); - - assert.equal(boundSnippet.lines[0], 'HoldMeTight'); - assert.equal(boundSnippet.placeHolders.length, 2); - assert.equal(boundSnippet.finishPlaceHolderIndex, 1); - let [first, second] = boundSnippet.placeHolders; - assert.equal(first.occurences.length, 1); - assert.equal(first.occurences[0].startColumn, 13); - - assert.equal(second.occurences.length, 1); - assert.equal(second.occurences[0].startColumn, 24); - - }); - - test('variables, simple', () => { - - const resolver: ISnippetVariableResolver = { - resolve(name) { - return name.split('').reverse().join(''); - } - }; - - // simple - let snippet = CodeSnippet.fromTextmate('$FOO', resolver); - assert.equal(snippet.lines[0], 'OOF'); - assert.equal(snippet.placeHolders.length, 1); - assert.equal(snippet.placeHolders[0].occurences[0].endColumn, 4); - - snippet = CodeSnippet.fromTextmate('${FOO:BAR}', resolver); - assert.equal(snippet.lines[0], 'OOF'); - assert.equal(snippet.placeHolders.length, 1); - assert.equal(snippet.placeHolders[0].occurences[0].endColumn, 4); - - // placeholder - snippet = CodeSnippet.fromTextmate('${1:$FOO}bar$1', resolver); - assert.equal(snippet.lines[0], 'OOFbarOOF'); - assert.equal(snippet.placeHolders.length, 2); - assert.equal(snippet.placeHolders[0].occurences.length, 2); - assert.equal(snippet.placeHolders[0].occurences[0].startColumn, 1); - assert.equal(snippet.placeHolders[0].occurences[0].endColumn, 4); - assert.equal(snippet.placeHolders[0].occurences[1].startColumn, 7); - assert.equal(snippet.placeHolders[0].occurences[1].endColumn, 10); - assert.equal(snippet.placeHolders[1].occurences.length, 1); - - snippet = CodeSnippet.fromTextmate('${1:${FOO:abc}}bar$1', resolver); - assert.equal(snippet.lines[0], 'OOFbarOOF'); - }); - - test('variables, evil resolver', () => { - - let snippet = CodeSnippet.fromTextmate('$FOO', { resolve(): string { throw new Error(); } }); - assert.equal(snippet.lines[0], 'FOO'); - }); - - test('variables, default', () => { - - let snippet = CodeSnippet.fromTextmate('$FOO', { resolve(): string { return undefined; } }); - assert.equal(snippet.lines[0], 'FOO'); - - snippet = CodeSnippet.fromTextmate('$FOO', { resolve(): string { return ''; } }); - assert.equal(snippet.lines[0], ''); - - snippet = CodeSnippet.fromTextmate('${FOO:BAR}', { resolve(): string { return undefined; } }); - assert.equal(snippet.lines[0], 'BAR'); - - snippet = CodeSnippet.fromTextmate('${FOO:BAR}', { resolve(): string { return ''; } }); - assert.equal(snippet.lines[0], 'BAR'); - }); -}); - diff --git a/src/vs/editor/contrib/snippet/test/common/snippetVariables.test.ts b/src/vs/editor/contrib/snippet/test/common/snippetVariables.test.ts deleted file mode 100644 index 0c72e96b318..00000000000 --- a/src/vs/editor/contrib/snippet/test/common/snippetVariables.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { isWindows } from 'vs/base/common/platform'; -import URI from 'vs/base/common/uri'; -import { Selection } from 'vs/editor/common/core/selection'; -import { SnippetVariablesResolver } from 'vs/editor/contrib/snippet/common/snippetVariables'; -import { MockCodeEditor, withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; -import { Model } from 'vs/editor/common/model/model'; - -suite('Snippet Variables Resolver', function () { - - const model = Model.createFromString('', undefined, undefined, URI.parse('file:///foo/files/text.txt')); - - function variablesTest(callback: (editor: MockCodeEditor, resolver: SnippetVariablesResolver) => any) { - - - const lines: string[] = [ - 'this is line one', - 'this is line two', - ' this is line three' - ]; - - model.setValue(lines.join('\n')); - - withMockCodeEditor(lines, { model }, editor => { - callback(editor, new SnippetVariablesResolver(editor)); - }); - } - - test('editor variables, basics', function () { - - variablesTest((editor, resolver) => { - assert.equal(resolver.resolve('TM_FILENAME'), 'text.txt'); - assert.equal(resolver.resolve('something'), undefined); - - editor.setModel(null); - assert.throws(() => resolver.resolve('TM_FILENAME')); - }); - }); - - test('editor variables, file/dir', function () { - - variablesTest((editor, resolver) => { - assert.equal(resolver.resolve('TM_FILENAME'), 'text.txt'); - if (!isWindows) { - assert.equal(resolver.resolve('TM_DIRECTORY'), '/foo/files'); - assert.equal(resolver.resolve('TM_FILEPATH'), '/foo/files/text.txt'); - } - - editor.setModel(Model.createFromString('', undefined, undefined, URI.parse('http://www.pb.o/abc/def/ghi'))); - assert.equal(resolver.resolve('TM_FILENAME'), 'ghi'); - if (!isWindows) { - assert.equal(resolver.resolve('TM_DIRECTORY'), '/abc/def'); - assert.equal(resolver.resolve('TM_FILEPATH'), '/abc/def/ghi'); - } - - editor.setModel(Model.createFromString('', undefined, undefined, URI.parse('mem:fff.ts'))); - assert.equal(resolver.resolve('TM_DIRECTORY'), ''); - assert.equal(resolver.resolve('TM_FILEPATH'), 'fff.ts'); - }); - }); - - test('editor variables, selection', function () { - - variablesTest((editor, resolver) => { - - editor.setSelection(new Selection(1, 2, 2, 3)); - assert.equal(resolver.resolve('TM_SELECTED_TEXT'), 'his is line one\nth'); - assert.equal(resolver.resolve('TM_CURRENT_LINE'), 'this is line two'); - assert.equal(resolver.resolve('TM_LINE_INDEX'), '1'); - assert.equal(resolver.resolve('TM_LINE_NUMBER'), '2'); - - editor.setSelection(new Selection(2, 3, 1, 2)); - assert.equal(resolver.resolve('TM_SELECTED_TEXT'), 'his is line one\nth'); - assert.equal(resolver.resolve('TM_CURRENT_LINE'), 'this is line one'); - assert.equal(resolver.resolve('TM_LINE_INDEX'), '0'); - assert.equal(resolver.resolve('TM_LINE_NUMBER'), '1'); - - editor.setSelection(new Selection(1, 2, 1, 2)); - assert.equal(resolver.resolve('TM_SELECTED_TEXT'), ''); - - assert.equal(resolver.resolve('TM_CURRENT_WORD'), 'this'); - - editor.setSelection(new Selection(3, 1, 3, 1)); - assert.equal(resolver.resolve('TM_CURRENT_WORD'), ''); - }); - }); - -}); diff --git a/src/vs/editor/contrib/suggest/browser/completionModel.ts b/src/vs/editor/contrib/suggest/browser/completionModel.ts index dd84990104e..7bae1f39781 100644 --- a/src/vs/editor/contrib/suggest/browser/completionModel.ts +++ b/src/vs/editor/contrib/suggest/browser/completionModel.ts @@ -124,20 +124,40 @@ export class CompletionModel { word = wordLen === 0 ? '' : leadingLineContent.slice(-wordLen); } - let match = fuzzyScore(word, suggestion.label); - if (match) { - item.score = match[0]; - item.matches = match[1]; - } else { - if (typeof suggestion.filterText === 'string') { - match = fuzzyScore(word, suggestion.filterText); - } + if (wordLen === 0) { + // when there is nothing to score against, don't + // event try to do. Use a const rank and rely on + // the fallback-sort using the initial sort order. + // use a score of `-100` because that is out of the + // bound of values `fuzzyScore` will return + item.score = -100; + + } else if (typeof suggestion.filterText === 'string') { + // when there is a `filterText` it must match the `word`. + // if it matches we check with the label to compute highlights + // and if that doesn't yield a result we have no highlights, + // despite having the match + let match = fuzzyScore(word, suggestion.filterText); if (!match) { continue; } item.score = match[0]; - item.matches = []; // don't use the filterText-matches + item.matches = []; + match = fuzzyScore(word, suggestion.label); + if (match) { + item.matches = match[1]; + } + } else { + // by default match `word` against the `label` + let match = fuzzyScore(word, suggestion.label); + if (match) { + item.score = match[0]; + item.matches = match[1]; + } else { + continue; + } } + item.idx = i; this._filteredItems.push(item); diff --git a/src/vs/editor/contrib/suggest/browser/media/back.svg b/src/vs/editor/contrib/suggest/browser/media/back.svg deleted file mode 100644 index 487340cd69a..00000000000 --- a/src/vs/editor/contrib/suggest/browser/media/back.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/browser/media/close-dark.svg b/src/vs/editor/contrib/suggest/browser/media/close-dark.svg new file mode 100644 index 00000000000..751e89b3b02 --- /dev/null +++ b/src/vs/editor/contrib/suggest/browser/media/close-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/browser/media/close.svg b/src/vs/editor/contrib/suggest/browser/media/close.svg new file mode 100644 index 00000000000..fde34404d4e --- /dev/null +++ b/src/vs/editor/contrib/suggest/browser/media/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/editor/contrib/suggest/browser/media/suggest.css b/src/vs/editor/contrib/suggest/browser/media/suggest.css index 3714be6e58f..7ca54b83969 100644 --- a/src/vs/editor/contrib/suggest/browser/media/suggest.css +++ b/src/vs/editor/contrib/suggest/browser/media/suggest.css @@ -3,29 +3,83 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/* Suggest */ +/* Suggest widget*/ .monaco-editor .suggest-widget { z-index: 40; - width: 438px; } -.monaco-editor .suggest-widget.visible { - -webkit-transition: left .05s ease-in-out; - -moz-transition: left .05s ease-in-out; - -o-transition: left .05s ease-in-out; - transition: left .05s ease-in-out; +/** Initial widths **/ + +.monaco-editor .suggest-widget { + width: 430px; } +.monaco-editor .suggest-widget > .tree, +.monaco-editor .suggest-widget > .details { + width: 428px; + border-style: solid; + border-width: 1px; +} + +.monaco-editor.hc-black .suggest-widget > .tree, +.monaco-editor.hc-black .suggest-widget > .details { + width: 426px; + border-width: 2px; +} + +/** Adjust width when docs are expanded to the side **/ +.monaco-editor .suggest-widget.docs-side { + width: 660px; +} + +.monaco-editor .suggest-widget.docs-side > .tree, +.monaco-editor .suggest-widget.docs-side > .details { + /* subtract 2px for border, and another 2 for the Chromium zoom issue + where the children get slightly bigger width than what is set + which makes the docs go below the list */ + width: calc(50% - 4px); + float: left; + +} + +.monaco-editor .suggest-widget.docs-side.list-right > .tree, +.monaco-editor .suggest-widget.docs-side.list-right > .details { + float: right; +} + +.monaco-editor.hc-black .suggest-widget.docs-side > .tree, +.monaco-editor.hc-black .suggest-widget.docs-side > .details { + width: 326px; +} + +.monaco-editor .suggest-widget.docs-side .empty-left-border { + border-left-width: 0px; +} + +.monaco-editor .suggest-widget.docs-side .empty-right-border { + border-right-width: 0px; +} + +/* Styles for Message element for when widget is loading or is empty */ .monaco-editor .suggest-widget > .message { padding-left: 22px; - opacity: 0.7; + border-style: solid; + border-width: 1px; } +.monaco-editor.hc-black .suggest-widget > .message { + border-width: 2px; +} + +/** Styles for the list element **/ .monaco-editor .suggest-widget > .tree { height: 100%; - width: 100%; } + + +/** Styles for each row in the list element **/ + .monaco-editor .suggest-widget .monaco-list .monaco-list-row { display: flex; -mox-box-sizing: border-box; @@ -49,47 +103,38 @@ text-overflow: ellipsis; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs { - display: none; - overflow: hidden; -} - -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs > .docs-text { - flex: 2; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - opacity: 0.85; -} - -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs > .docs-text.no-docs { - opacity: 0.5; - font-style: italic; -} - -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs > .docs-details { - opacity: 0.6; - background-image: url('./info.svg'); - background-position: center center; - background-repeat: no-repeat; - background-size: 70%; -} - -.monaco-editor .suggest-widget .details > .header > .go-back, -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs > .docs-details { - color: #0035DD; -} - -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .docs > .docs-details:hover { - opacity: 1; -} - .monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight { font-weight: bold; } +/** Icon styles **/ + +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore { + opacity: 0.6; + background-position: center center; + background-repeat: no-repeat; + background-size: 70%; + cursor: pointer; +} + +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close { + background-image: url('./close.svg'); + float: right; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore { + background-image: url('./info.svg'); +} + +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close:hover, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore:hover { + opacity: 1; +} + +/** Type Info and icon next to the label in the focused completion item **/ + .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .type-label { - display: none; margin-left: 0.8em; flex: 1; text-align: right; @@ -102,17 +147,20 @@ display: inline; } +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .type-label, +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .readMore, +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .type-label, +.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row.focused > .contents > .main > .readMore { + display: none; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .readMore, .monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .type-label { display: inline; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .type-label { - display: inline; -} - -.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .docs { - display: flex; -} +/** Styles for each row in the list **/ .monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon { display: block; @@ -159,38 +207,20 @@ display: inline-block; } +/** Styles for the docs of the completion item in focus **/ .monaco-editor .suggest-widget .details { - height: 100%; - box-sizing: border-box; + max-height: 216px; display: flex; flex-direction: column; cursor: default; } -.monaco-editor .suggest-widget .details > .header { - padding: 4px 5px; - display: flex; - box-sizing: border-box; - border-bottom: 1px solid rgba(204, 204, 204, 0.5); +.monaco-editor .suggest-widget .details.no-docs { + display: none; } -.monaco-editor .suggest-widget .details > .header > .title { - flex: 2; - overflow: hidden; - text-overflow: ellipsis; -} - -.monaco-editor .suggest-widget .details > .header > .go-back { - cursor: pointer; - opacity: 0.6; - background-image: url('./back.svg'); - background-size: 70%; - background-position: center center; - background-repeat: no-repeat; -} - -.monaco-editor .suggest-widget .details > .header > .go-back:hover { - opacity: 1; +.monaco-editor .suggest-widget.docs-below .details { + border-top-width: 0px; } .monaco-editor .suggest-widget .details > .monaco-scrollable-element { @@ -206,7 +236,12 @@ } .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .type { + flex: 2; + overflow: hidden; + text-overflow: ellipsis; opacity: 0.7; + word-break: break-all; + margin: 0; } .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > p { @@ -218,28 +253,12 @@ display: none; } -/* Dark theme */ -.monaco-editor.vs-dark .suggest-widget .details > .header { - border-color: rgba(85,85,85,0.5); -} +/* High Contrast and Dark Theming */ -.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .docs > .docs-details, -.monaco-editor.vs-dark .suggest-widget .details > .header > .go-back { - color: #4E94CE; -} - - -/* High Contrast Theming */ - -.monaco-editor.hc-black .suggest-widget .details > .monaco-scrollable-element > .body > .docs, -.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .docs { - color: #C07A7A; -} - -.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .docs > .docs-details, -.monaco-editor.hc-black .suggest-widget .details > .header > .go-back { - color: #4E94CE; +.monaco-editor.vs-dark .suggest-widget .details > .monaco-scrollable-element > .body > .close, +.monaco-editor.hc-black .suggest-widget .details > .monaco-scrollable-element > .body > .close { + background-image: url('./close-dark.svg'); } .monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .icon, diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index 6ca956304cf..7c2db1e7321 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -15,14 +15,13 @@ import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; import { ISuggestResult, ISuggestSupport, ISuggestion, SuggestRegistry } from 'vs/editor/common/modes'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; export const Context = { Visible: new RawContextKey('suggestWidgetVisible', false), MultipleSuggestions: new RawContextKey('suggestWidgetMultipleSuggestions', false), MakesTextEdit: new RawContextKey('suggestionMakesTextEdit', true), AcceptOnKey: new RawContextKey('suggestionSupportsAcceptOnKey', true), - AcceptSuggestionsOnEnter: new RawContextKey('acceptSuggestionOnEnter', DefaultConfig.editor.acceptSuggestionOnEnter) + AcceptSuggestionsOnEnter: new RawContextKey('acceptSuggestionOnEnter', true) }; export interface ISuggestionItem { diff --git a/src/vs/editor/contrib/suggest/browser/suggestController.ts b/src/vs/editor/contrib/suggest/browser/suggestController.ts index 241c5141a18..add8b9df096 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestController.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestController.ts @@ -21,8 +21,8 @@ import { alert } from 'vs/base/browser/ui/aria/aria'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; -import { CodeSnippet } from 'vs/editor/contrib/snippet/common/snippet'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { Context as SuggestContext } from './suggest'; import { SuggestModel, State } from './suggestModel'; import { ICompletionItem } from './completionModel'; @@ -102,7 +102,11 @@ export class SuggestController implements IEditorContribution { // Manage the acceptSuggestionsOnEnter context key let acceptSuggestionsOnEnter = SuggestContext.AcceptSuggestionsOnEnter.bindTo(_contextKeyService); let updateFromConfig = () => { - acceptSuggestionsOnEnter.set(this._editor.getConfiguration().contribInfo.acceptSuggestionOnEnter); + const { acceptSuggestionOnEnter } = this._editor.getConfiguration().contribInfo; + acceptSuggestionsOnEnter.set( + acceptSuggestionOnEnter === 'on' || acceptSuggestionOnEnter === 'smart' + || (acceptSuggestionOnEnter) === true + ); }; this._toDispose.push(this._editor.onDidChangeConfiguration((e) => updateFromConfig())); updateFromConfig(); @@ -129,7 +133,11 @@ export class SuggestController implements IEditorContribution { const endColumn = position.column; let value = true; if ( - this._model.state === State.Auto + this._editor.getConfiguration().contribInfo.acceptSuggestionOnEnter === 'smart' + && this._model.state === State.Auto + && !item.suggestion.command + && !item.suggestion.additionalTextEdits + && item.suggestion.snippetType !== 'textmate' && endColumn - startColumn === item.suggestion.insertText.length ) { const oldText = this._editor.getModel().getValueInRange({ @@ -174,19 +182,18 @@ export class SuggestController implements IEditorContribution { this._editor.pushUndoStop(); } - if (suggestion.snippetType === 'textmate') { - SnippetController.get(this._editor).insertSnippet( - suggestion.insertText, - suggestion.overwriteBefore + columnDelta, - suggestion.overwriteAfter); - } else { - SnippetController.get(this._editor).run( - CodeSnippet.fromInternal(suggestion.insertText), - suggestion.overwriteBefore + columnDelta, - suggestion.overwriteAfter - ); + let { insertText } = suggestion; + if (suggestion.snippetType !== 'textmate') { + insertText = SnippetParser.escape(insertText); } + SnippetController2.get(this._editor).insert( + insertText, + suggestion.overwriteBefore + columnDelta, + suggestion.overwriteAfter + ); + + if (suggestion.command) { this._commandService.executeCommand(suggestion.command.id, ...suggestion.command.arguments).done(undefined, onUnexpectedError); } @@ -219,7 +226,7 @@ export class SuggestController implements IEditorContribution { cancelSuggestWidget(): void { if (this._widget) { this._model.cancel(); - this._widget.hideDetailsOrHideWidget(); + this._widget.hideWidget(); } } @@ -264,6 +271,12 @@ export class SuggestController implements IEditorContribution { this._widget.toggleDetails(); } } + + toggleSuggestionFocus(): void { + if (this._widget) { + this._widget.toggleDetailsFocus(); + } + } } @editorAction @@ -312,11 +325,11 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'acceptSelectedSuggestionOnEnter', - precondition: ContextKeyExpr.and(SuggestContext.Visible, SuggestContext.MakesTextEdit), + precondition: SuggestContext.Visible, handler: x => x.acceptSelectedSuggestion(), kbOpts: { weight: weight, - kbExpr: ContextKeyExpr.and(EditorContextKeys.textFocus, SuggestContext.AcceptSuggestionsOnEnter), + kbExpr: ContextKeyExpr.and(EditorContextKeys.textFocus, SuggestContext.AcceptSuggestionsOnEnter, SuggestContext.MakesTextEdit), primary: KeyCode.Enter } })); @@ -341,8 +354,8 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ weight: weight, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.DownArrow, - secondary: [KeyMod.Alt | KeyCode.DownArrow], - mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.Alt | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KEY_N] } + secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow], + mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.CtrlCmd | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KEY_N] } } })); @@ -354,7 +367,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ weight: weight, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.PageDown, - secondary: [KeyMod.Alt | KeyCode.PageDown] + secondary: [KeyMod.CtrlCmd | KeyCode.PageDown] } })); @@ -372,8 +385,8 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ weight: weight, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.UpArrow, - secondary: [KeyMod.Alt | KeyCode.UpArrow], - mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] } + secondary: [KeyMod.CtrlCmd | KeyCode.UpArrow], + mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.CtrlCmd | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] } } })); @@ -385,7 +398,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ weight: weight, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.PageUp, - secondary: [KeyMod.Alt | KeyCode.PageUp] + secondary: [KeyMod.CtrlCmd | KeyCode.PageUp] } })); @@ -406,3 +419,15 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ mac: { primary: KeyMod.WinCtrl | KeyCode.Space } } })); + +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ + id: 'toggleSuggestionFocus', + precondition: SuggestContext.Visible, + handler: x => x.toggleSuggestionFocus(), + kbOpts: { + weight: weight, + kbExpr: EditorContextKeys.textFocus, + primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Space, + mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Space } + } +})); diff --git a/src/vs/editor/contrib/suggest/browser/suggestModel.ts b/src/vs/editor/contrib/suggest/browser/suggestModel.ts index 1bb4c209b18..428a3199fdc 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestModel.ts @@ -68,7 +68,7 @@ export class LineContext { readonly column: number; readonly leadingLineContent: string; readonly leadingWord: IWordAtPosition; - readonly auto; + readonly auto: boolean; constructor(model: IModel, position: Position, auto: boolean) { this.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1); @@ -199,7 +199,7 @@ export class SuggestModel implements IDisposable { } } } - this.trigger(true, false, supports, items); + this.trigger(true, Boolean(this.completionModel), supports, items); } }); } @@ -248,6 +248,12 @@ export class SuggestModel implements IDisposable { || e.source !== 'keyboard' || e.reason !== CursorChangeReason.NotSet) { + if (this._state === State.Idle) { + // Early exit if nothing needs to be done! + // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) + return; + } + this.cancel(); return; } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index cb72555451c..c5559659a7f 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -13,7 +13,7 @@ import Event, { Emitter, chain } from 'vs/base/common/event'; import { TPromise } from 'vs/base/common/winjs.base'; import { isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; -import { addClass, append, $, hide, removeClass, show, toggleClass } from 'vs/base/browser/dom'; +import { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass } from 'vs/base/browser/dom'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; import { IDelegate, IListEvent, IRenderer } from 'vs/base/browser/ui/list/list'; import { List } from 'vs/base/browser/ui/list/listWidget'; @@ -29,9 +29,11 @@ import { alert } from 'vs/base/browser/ui/aria/aria'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { registerColor, editorWidgetBackground, contrastBorder, listFocusBackground, activeContrastBorder, listHighlightForeground, editorForeground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, editorWidgetBackground, listFocusBackground, activeContrastBorder, listHighlightForeground, editorForeground, editorWidgetBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; const sticky = false; // for development purposes +const expandSuggestionDocsByDefault = false; interface ISuggestionTemplateData { root: HTMLElement; @@ -39,8 +41,7 @@ interface ISuggestionTemplateData { colorspan: HTMLElement; highlightedLabel: HighlightedLabel; typeLabel: HTMLElement; - documentationDetails: HTMLElement; - documentation: HTMLElement; + readMore: HTMLElement; disposables: IDisposable[]; } @@ -48,7 +49,7 @@ interface ISuggestionTemplateData { * Suggest widget colors */ export const editorSuggestWidgetBackground = registerColor('editorSuggestWidget.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('editorSuggestWidgetBackground', 'Background color of the suggest widget.')); -export const editorSuggestWidgetBorder = registerColor('editorSuggestWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.')); +export const editorSuggestWidgetBorder = registerColor('editorSuggestWidget.border', { dark: editorWidgetBorder, light: editorWidgetBorder, hc: editorWidgetBorder }, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.')); export const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', { dark: editorForeground, light: editorForeground, hc: editorForeground }, nls.localize('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.')); export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: listFocusBackground, light: listFocusBackground, hc: listFocusBackground }, nls.localize('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.')); export const editorSuggestWidgetHighlightForeground = registerColor('editorSuggestWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hc: listHighlightForeground }, nls.localize('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.')); @@ -64,20 +65,17 @@ function canExpandCompletionItem(item: ICompletionItem) { if (suggestion.documentation) { return true; } - return (suggestion.detail || '').indexOf('\n') >= 0; + return (suggestion.detail && suggestion.detail !== suggestion.label); } class Renderer implements IRenderer { - private triggerKeybindingLabel: string; - constructor( private widget: SuggestWidget, private editor: ICodeEditor, - @IKeybindingService keybindingService: IKeybindingService + private triggerKeybindingLabel: string ) { - const kb = keybindingService.lookupKeybinding('editor.action.triggerSuggest'); - this.triggerKeybindingLabel = !kb ? '' : ` (${kb.getLabel()})`; + } get templateId(): string { @@ -98,10 +96,8 @@ class Renderer implements IRenderer { data.disposables.push(data.highlightedLabel); data.typeLabel = append(main, $('span.type-label')); - const docs = append(text, $('.docs')); - data.documentation = append(docs, $('span.docs-text')); - data.documentationDetails = append(docs, $('span.docs-details')); - data.documentationDetails.title = nls.localize('readMore', "Read More...{0}", this.triggerKeybindingLabel); + data.readMore = append(main, $('span.readMore')); + data.readMore.title = nls.localize('readMore', "Read More...{0}", this.triggerKeybindingLabel); const configureFont = () => { const configuration = this.editor.getConfiguration(); @@ -116,8 +112,8 @@ class Renderer implements IRenderer { main.style.lineHeight = lineHeightPx; data.icon.style.height = lineHeightPx; data.icon.style.width = lineHeightPx; - data.documentationDetails.style.height = lineHeightPx; - data.documentationDetails.style.width = lineHeightPx; + data.readMore.style.height = lineHeightPx; + data.readMore.style.width = lineHeightPx; }; configureFont(); @@ -153,24 +149,23 @@ class Renderer implements IRenderer { data.highlightedLabel.set(suggestion.label, createMatches(element.matches)); data.typeLabel.textContent = (suggestion.detail || '').replace(/\n.*$/m, ''); - data.documentation.textContent = suggestion.documentation || ''; - if (canExpandCompletionItem(element)) { - show(data.documentationDetails); - data.documentationDetails.onmousedown = e => { + show(data.readMore); + data.readMore.onmousedown = e => { e.stopPropagation(); e.preventDefault(); }; - data.documentationDetails.onclick = e => { + data.readMore.onclick = e => { e.stopPropagation(); e.preventDefault(); this.widget.toggleDetails(); }; } else { - hide(data.documentationDetails); - data.documentationDetails.onmousedown = null; - data.documentationDetails.onclick = null; + hide(data.readMore); + data.readMore.onmousedown = null; + data.readMore.onclick = null; } + } disposeTemplate(templateData: ISuggestionTemplateData): void { @@ -191,9 +186,7 @@ const enum State { class SuggestionDetails { private el: HTMLElement; - private title: HTMLElement; - private titleLabel: HighlightedLabel; - private back: HTMLElement; + private close: HTMLElement; private scrollbar: DomScrollableElement; private body: HTMLElement; private type: HTMLElement; @@ -204,27 +197,25 @@ class SuggestionDetails { constructor( container: HTMLElement, private widget: SuggestWidget, - private editor: ICodeEditor + private editor: ICodeEditor, + private triggerKeybindingLabel: string ) { this.disposables = []; this.el = append(container, $('.details')); this.disposables.push(toDisposable(() => container.removeChild(this.el))); - const header = append(this.el, $('.header')); - this.title = append(header, $('span.title')); - this.titleLabel = new HighlightedLabel(this.title); - this.disposables.push(this.titleLabel); - - this.back = append(header, $('span.go-back')); - this.back.title = nls.localize('goback', "Go back"); this.body = $('.body'); this.scrollbar = new DomScrollableElement(this.body, { canUseTranslate3d: false }); append(this.el, this.scrollbar.getDomNode()); this.disposables.push(this.scrollbar); + this.close = append(this.body, $('span.close')); + this.close.title = nls.localize('readLess', "Read less...{0}", triggerKeybindingLabel); this.type = append(this.body, $('p.type')); + + this.docs = append(this.body, $('p.docs')); this.ariaLabel = null; @@ -240,22 +231,24 @@ class SuggestionDetails { } render(item: ICompletionItem): void { - if (!item) { - this.titleLabel.set(''); + if (!item || !canExpandCompletionItem(item)) { this.type.textContent = ''; this.docs.textContent = ''; + addClass(this.el, 'no-docs'); this.ariaLabel = null; return; } - - this.titleLabel.set(item.suggestion.label, createMatches(item.matches)); + removeClass(this.el, 'no-docs'); this.type.innerText = item.suggestion.detail || ''; this.docs.textContent = item.suggestion.documentation; - this.back.onmousedown = e => { + + this.el.style.height = this.type.offsetHeight + this.docs.offsetHeight + 'px'; + + this.close.onmousedown = e => { e.preventDefault(); e.stopPropagation(); }; - this.back.onclick = e => { + this.close.onclick = e => { e.preventDefault(); e.stopPropagation(); this.widget.toggleDetails(); @@ -304,10 +297,9 @@ class SuggestionDetails { const lineHeightPx = `${lineHeight}px`; this.el.style.fontSize = fontSizePx; - this.title.style.fontFamily = fontFamily; this.type.style.fontFamily = fontFamily; - this.back.style.height = lineHeightPx; - this.back.style.width = lineHeightPx; + this.close.style.height = lineHeightPx; + this.close.style.width = lineHeightPx; } dispose(): void { @@ -359,16 +351,27 @@ export class SuggestWidget implements IContentWidget, IDelegate readonly onDidHide: Event = this.onDidHideEmitter.event; readonly onDidShow: Event = this.onDidShowEmitter.event; + private readonly maxWidgetWidth = 660; + private readonly listWidth = 330; + private storageService: IStorageService; + private detailsFocusBorderColor: string; + private detailsBorderColor: string; + constructor( private editor: ICodeEditor, @ITelemetryService private telemetryService: ITelemetryService, @IContextKeyService contextKeyService: IContextKeyService, @IInstantiationService instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IStorageService storageService: IStorageService, + @IKeybindingService keybindingService: IKeybindingService ) { + const kb = keybindingService.lookupKeybinding('editor.action.triggerSuggest'); + const triggerKeybindingLabel = !kb ? '' : ` (${kb.getLabel()})`; + this.isAuto = false; this.focusedItem = null; - + this.storageService = storageService; this.element = $('.editor-widget.suggest-widget'); if (!this.editor.getConfiguration().contribInfo.iconsInSuggestions) { @@ -377,9 +380,9 @@ export class SuggestWidget implements IContentWidget, IDelegate this.messageElement = append(this.element, $('.message')); this.listElement = append(this.element, $('.tree')); - this.details = new SuggestionDetails(this.element, this, this.editor); + this.details = new SuggestionDetails(this.element, this, this.editor, triggerKeybindingLabel); - let renderer: IRenderer = instantiationService.createInstance(Renderer, this, this.editor); + let renderer: IRenderer = instantiationService.createInstance(Renderer, this, this.editor, triggerKeybindingLabel); this.list = new List(this.listElement, this, [renderer], { useShadows: false, @@ -477,12 +480,20 @@ export class SuggestWidget implements IContentWidget, IDelegate private onThemeChange(theme: ITheme) { let backgroundColor = theme.getColor(editorSuggestWidgetBackground); if (backgroundColor) { - this.element.style.backgroundColor = backgroundColor.toString(); + this.listElement.style.backgroundColor = backgroundColor.toString(); + this.details.element.style.backgroundColor = backgroundColor.toString(); + this.messageElement.style.backgroundColor = backgroundColor.toString(); } let borderColor = theme.getColor(editorSuggestWidgetBorder); if (borderColor) { - let borderWidth = theme.type === 'hc' ? 2 : 1; - this.element.style.border = `${borderWidth}px solid ${borderColor}`; + this.listElement.style.borderColor = borderColor.toString(); + this.details.element.style.borderColor = borderColor.toString(); + this.messageElement.style.borderColor = borderColor.toString(); + this.detailsBorderColor = borderColor.toString(); + } + let focusBorderColor = theme.getColor(focusBorder); + if (focusBorderColor) { + this.detailsFocusBorderColor = focusBorderColor.toString(); } } @@ -538,7 +549,7 @@ export class SuggestWidget implements IContentWidget, IDelegate this.ignoreFocusEvents = false; } - this.updateWidgetHeight(); + this.updateListHeight(); this.list.reveal(index); this.currentSuggestionDetails = item.resolve() @@ -548,10 +559,15 @@ export class SuggestWidget implements IContentWidget, IDelegate this.ignoreFocusEvents = false; this.list.setFocus([index]); - this.updateWidgetHeight(); this.list.reveal(index); - this._ariaAlert(this._getSuggestionAriaAlertLabel(item)); + if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + this.showDetails(); + + this._ariaAlert(this.details.getAriaLabel()); + } else { + removeClass(this.element, 'docs-side'); + } }) .then(null, err => !isPromiseCanceledError(err) && onUnexpectedError(err)) .then(() => this.currentSuggestionDetails = null); @@ -583,17 +599,25 @@ export class SuggestWidget implements IContentWidget, IDelegate this.messageElement.textContent = SuggestWidget.LOADING_MESSAGE; hide(this.listElement, this.details.element); show(this.messageElement); + removeClass(this.element, 'docs-side'); this.show(); break; case State.Empty: this.messageElement.textContent = SuggestWidget.NO_SUGGESTIONS_MESSAGE; hide(this.listElement, this.details.element); show(this.messageElement); + removeClass(this.element, 'docs-side'); this.show(); break; case State.Open: - hide(this.messageElement, this.details.element); + hide(this.messageElement); show(this.listElement); + if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + show(this.details.element); + this.expandSideOrBelow(); + } else { + hide(this.details.element); + } this.show(); break; case State.Frozen: @@ -602,8 +626,8 @@ export class SuggestWidget implements IContentWidget, IDelegate this.show(); break; case State.Details: - hide(this.messageElement, this.listElement); - show(this.details.element); + hide(this.messageElement); + show(this.details.element, this.listElement); this.show(); this._ariaAlert(this.details.getAriaLabel()); break; @@ -637,7 +661,7 @@ export class SuggestWidget implements IContentWidget, IDelegate this.completionModel = completionModel; - if (isFrozen && this.state !== State.Empty) { + if (isFrozen && this.state !== State.Empty && this.state !== State.Hidden) { this.setState(State.Frozen); return; } @@ -667,7 +691,11 @@ export class SuggestWidget implements IContentWidget, IDelegate this.list.setFocus([0]); this.list.reveal(0, 0); - this.setState(State.Open); + if (isFrozen) { + this.setState(State.Frozen); + } else { + this.setState(State.Open); + } } } @@ -690,10 +718,6 @@ export class SuggestWidget implements IContentWidget, IDelegate switch (this.state) { case State.Hidden: return false; - case State.Details: - this.list.focusNext(1, true); - this.renderDetails(); - return true; case State.Loading: return !this.isAuto; default: @@ -736,10 +760,6 @@ export class SuggestWidget implements IContentWidget, IDelegate switch (this.state) { case State.Hidden: return false; - case State.Details: - this.list.focusPrevious(1, true); - this.renderDetails(); - return true; case State.Loading: return !this.isAuto; default: @@ -773,32 +793,61 @@ export class SuggestWidget implements IContentWidget, IDelegate return undefined; } - toggleDetails(): void { + toggleDetailsFocus(): void { if (this.state === State.Details) { this.setState(State.Open); - this.editor.focus(); + if (this.detailsBorderColor) { + this.details.element.style.borderColor = this.detailsBorderColor; + } + } else if (this.state === State.Open + && this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + this.setState(State.Details); + if (this.detailsFocusBorderColor) { + this.details.element.style.borderColor = this.detailsFocusBorderColor; + } + } + } + + toggleDetails(): void { + + if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + this.storageService.store('expandSuggestionDocs', false, StorageScope.GLOBAL); + hide(this.details.element); + removeClass(this.element, 'docs-side'); + removeClass(this.element, 'docs-below'); + this.editor.layoutContentWidget(this); + } else { + this.storageService.store('expandSuggestionDocs', true, StorageScope.GLOBAL); + + this.expandSideOrBelow(); + + this.showDetails(); + } + } + + showDetails(): void { + if (this.state !== State.Open && this.state !== State.Details) { return; } - if (this.state !== State.Open) { - return; - } + show(this.details.element); + this.renderDetails(); - const item = this.list.getFocusedElements()[0]; + // With docs showing up, list might need adjustments to keep it close to the cursor + this.adjustListPosition(); - if (!item || !canExpandCompletionItem(item)) { - return; - } + // with docs showing up widget width/height may change, so reposition the widget + this.editor.layoutContentWidget(this); + + this.adjustDocsPosition(); - this.setState(State.Details); this.editor.focus(); - this.telemetryService.publicLog('suggestWidget:toggleDetails', this.editor.getTelemetryData()); } private show(): void { - this.updateWidgetHeight(); + this.updateListHeight(); this.suggestWidgetVisible.set(true); - this.renderDetails(); + this.showTimeout = TPromise.timeout(100).then(() => { addClass(this.element, 'visible'); this.onDidShowEmitter.fire(this); @@ -817,14 +866,6 @@ export class SuggestWidget implements IContentWidget, IDelegate this.onDidHideEmitter.fire(this); } - hideDetailsOrHideWidget(): void { - if (this.state === State.Details) { - this.toggleDetails(); - } else { - this.hideWidget(); - } - } - getPosition(): IContentWidgetPosition { if (this.state === State.Hidden) { return null; @@ -844,35 +885,117 @@ export class SuggestWidget implements IContentWidget, IDelegate return SuggestWidget.ID; } - private updateWidgetHeight(): number { + private updateListHeight(): number { let height = 0; + let maxSuggestionsToShow = 11; if (this.state === State.Empty || this.state === State.Loading) { height = this.unfocusedHeight; - } else if (this.state === State.Details) { - height = 12 * this.unfocusedHeight; } else { const focus = this.list.getFocusedElements()[0]; const focusHeight = focus ? this.getHeight(focus) : this.unfocusedHeight; height = focusHeight; const suggestionCount = (this.list.contentHeight - focusHeight) / this.unfocusedHeight; - height += Math.min(suggestionCount, 11) * this.unfocusedHeight; + height += Math.min(suggestionCount, maxSuggestionsToShow) * this.unfocusedHeight; } this.element.style.lineHeight = `${this.unfocusedHeight}px`; - this.element.style.height = `${height}px`; + this.listElement.style.height = `${height}px`; this.list.layout(height); + this.editor.layoutContentWidget(this); return height; } - private renderDetails(): void { - if (this.state !== State.Details) { - this.details.render(null); + private adjustDocsPosition() { + const cursorCoords = this.editor.getScrolledVisiblePosition(this.editor.getPosition()); + const editorCoords = getDomNodePagePosition(this.editor.getDomNode()); + const cursorX = editorCoords.left + cursorCoords.left; + const cursorY = editorCoords.top + cursorCoords.top + cursorCoords.height; + const widgetX = this.element.offsetLeft; + const widgetY = this.element.offsetTop; + + if (widgetX < cursorX - this.listWidth) { + // Widget is too far to the left of cursor, swap list and docs + addClass(this.element, 'list-right'); } else { + removeClass(this.element, 'list-right'); + } + + if (cursorY > widgetY) { + if (!hasClass(this.element, 'widget-above')) { + addClass(this.element, 'widget-above'); + // Since the widget was previously not above the cursor, + // the list needs to be adjusted to keep it close to the cursor + this.adjustListPosition(); + } + } else { + removeClass(this.element, 'widget-above'); + } + } + + private expandSideOrBelow() { + let matches = this.element.style.maxWidth.match(/(\d+)px/); + if (!matches || Number(matches[1]) < this.maxWidgetWidth) { + addClass(this.element, 'docs-below'); + removeClass(this.element, 'docs-side'); + } else { + addClass(this.element, 'docs-side'); + removeClass(this.element, 'docs-below'); + } + } + + private adjustListPosition(): void { + + + if (hasClass(this.element, 'docs-side')) { + + if (this.details.element.offsetHeight > this.listElement.offsetHeight) { + + // Fix for #26416 + // Docs is bigger than list and widget is above cursor, apply margin-top so that list appears right above cursor + if (hasClass(this.element, 'widget-above')) { + this.listElement.style.marginTop = `${this.details.element.offsetHeight - this.listElement.offsetHeight}px`; + } + + // Fix for #26244 + if (hasClass(this.element, 'list-right')) { + addClass(this.listElement, 'empty-left-border'); + removeClass(this.listElement, 'empty-right-border'); + } else { + addClass(this.listElement, 'empty-right-border'); + removeClass(this.listElement, 'empty-left-border'); + } + + removeClass(this.details.element, 'empty-left-border'); + removeClass(this.details.element, 'empty-right-border'); + return; + } else { + // Fix for #26244 + if (hasClass(this.element, 'list-right')) { + addClass(this.details.element, 'empty-right-border'); + removeClass(this.details.element, 'empty-left-border'); + } else { + addClass(this.details.element, 'empty-left-border'); + removeClass(this.details.element, 'empty-right-border'); + } + + removeClass(this.listElement, 'empty-right-border'); + removeClass(this.listElement, 'empty-left-border'); + } + } + + // Reset margin-top that was set as Fix for #26416 + this.listElement.style.marginTop = '0px'; + } + + private renderDetails(): void { + if (this.state === State.Details || this.state === State.Open) { this.details.render(this.list.getFocusedElements()[0]); + } else { + this.details.render(null); } } @@ -890,10 +1013,6 @@ export class SuggestWidget implements IContentWidget, IDelegate // IDelegate getHeight(element: ICompletionItem): number { - if (canExpandCompletionItem(element) && element === this.focusedItem) { - return this.focusHeight; - } - return this.unfocusedHeight; } @@ -934,10 +1053,10 @@ export class SuggestWidget implements IContentWidget, IDelegate registerThemingParticipant((theme, collector) => { let matchHighlight = theme.getColor(editorSuggestWidgetHighlightForeground); if (matchHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`); + collector.addRule(`.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`); } let foreground = theme.getColor(editorSuggestWidgetForeground); if (foreground) { - collector.addRule(`.monaco-editor.${theme.selector} .suggest-widget { color: ${foreground}; }`); + collector.addRule(`.monaco-editor .suggest-widget { color: ${foreground}; }`); } }); diff --git a/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts b/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts index c5f80a483cb..fd3f85b3235 100644 --- a/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts @@ -6,9 +6,10 @@ import * as assert from 'assert'; import { ISuggestion, ISuggestResult, ISuggestSupport, SuggestionType } from 'vs/editor/common/modes'; -import { ISuggestionItem } from 'vs/editor/contrib/suggest/browser/suggest'; +import { ISuggestionItem, getSuggestionComparator } from 'vs/editor/contrib/suggest/browser/suggest'; import { CompletionModel } from 'vs/editor/contrib/suggest/browser/completionModel'; import { IPosition } from 'vs/editor/common/core/position'; +import { TPromise } from "vs/base/common/winjs.base"; suite('CompletionModel', function () { @@ -36,7 +37,7 @@ suite('CompletionModel', function () { } }; - resolve() { + resolve(): TPromise { return null; } }; @@ -181,4 +182,50 @@ suite('CompletionModel', function () { assert.equal(b.suggestion.label, 'Semver'); assert.ok(a.score > b.score); // snippet really demoted }); + + test('filterText seems ignored in autocompletion, #26874', function () { + + const item1 = createSuggestItem('Map - java.util', 1, 'property'); + item1.suggestion.filterText = 'Map'; + const item2 = createSuggestItem('Map - java.util', 1, 'property'); + + model = new CompletionModel([item1, item2], 1, { + leadingLineContent: 'M', + characterCountDelta: 0 + }); + + assert.equal(model.items.length, 2); + + model.lineContext = { + leadingLineContent: 'Map ', + characterCountDelta: 3 + }; + assert.equal(model.items.length, 1); + }); + + test('Vscode 1.12 no longer obeys \'sortText\' in completion items (from language server), #26096', function () { + + const item1 = createSuggestItem('<- groups', 2, 'property', false, { lineNumber: 1, column: 3 }); + item1.suggestion.filterText = ' groups'; + item1.suggestion.sortText = '00002'; + + const item2 = createSuggestItem('source', 0, 'property', false, { lineNumber: 1, column: 3 }); + item2.suggestion.filterText = 'source'; + item2.suggestion.sortText = '00001'; + + const items = [item1, item2].sort(getSuggestionComparator('inline')); + + model = new CompletionModel(items, 3, { + leadingLineContent: ' ', + characterCountDelta: 0 + }); + + assert.equal(model.items.length, 2); + + const [first, second] = model.items; + assert.equal(first.suggestion.label, 'source'); + assert.equal(second.suggestion.label, '<- groups'); + + }); + }); diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index 720a2871a70..896e593b005 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -18,6 +18,7 @@ import { Position } from 'vs/editor/common/core/position'; import { registerColor, editorSelectionHighlight, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.')); export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable.')); @@ -77,6 +78,13 @@ class WordHighlighter { this.model = this.editor.getModel(); this.toUnhook = []; this.toUnhook.push(editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { + + if (!this.occurrencesHighlight) { + // Early exit if nothing needs to be done! + // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) + return; + } + this._onPositionChanged(e); })); this.toUnhook.push(editor.onDidChangeModel((e) => { @@ -262,34 +270,55 @@ class WordHighlighter { var decorations: editorCommon.IModelDeltaDecoration[] = []; for (var i = 0, len = this.workerRequestValue.length; i < len; i++) { var info = this.workerRequestValue[i]; - var color = '#A0A0A0'; - - let className: string; - if (info.kind === DocumentHighlightKind.Write) { - className = 'wordHighlightStrong'; - } else if (info.kind === DocumentHighlightKind.Text) { - className = 'selectionHighlight'; - } else { - className = 'wordHighlight'; - } - decorations.push({ range: info.range, - options: { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: className, - overviewRuler: { - color: color, - darkColor: color, - position: editorCommon.OverviewRulerLane.Center - } - } + options: WordHighlighter._getDecorationOptions(info.kind) }); } this._decorationIds = this.editor.deltaDecorations(this._decorationIds, decorations); } + private static _getDecorationOptions(kind: DocumentHighlightKind): ModelDecorationOptions { + if (kind === DocumentHighlightKind.Write) { + return this._WRITE_OPTIONS; + } else if (kind === DocumentHighlightKind.Text) { + return this._TEXT_OPTIONS; + } else { + return this._REGULAR_OPTIONS; + } + } + + private static _WRITE_OPTIONS = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'wordHighlightStrong', + overviewRuler: { + color: '#A0A0A0', + darkColor: '#A0A0A0', + position: editorCommon.OverviewRulerLane.Center + } + }); + + private static _TEXT_OPTIONS = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'selectionHighlight', + overviewRuler: { + color: '#A0A0A0', + darkColor: '#A0A0A0', + position: editorCommon.OverviewRulerLane.Center + } + }); + + private static _REGULAR_OPTIONS = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'wordHighlight', + overviewRuler: { + color: '#A0A0A0', + darkColor: '#A0A0A0', + position: editorCommon.OverviewRulerLane.Center + } + }); + public dispose(): void { this._stopAll(); this.toUnhook = dispose(this.toUnhook); @@ -319,22 +348,22 @@ class WordHighlighterContribution implements editorCommon.IEditorContribution { registerThemingParticipant((theme, collector) => { let selectionHighlight = theme.getColor(editorSelectionHighlight); if (selectionHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .focused .selectionHighlight { background-color: ${selectionHighlight}; }`); - collector.addRule(`.monaco-editor.${theme.selector} .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); + collector.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${selectionHighlight}; }`); + collector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); } let wordHighlight = theme.getColor(editorWordHighlight); if (wordHighlight) { - collector.addRule(`.monaco-editor.${theme.selector} .wordHighlight { background-color: ${wordHighlight}; }`); + collector.addRule(`.monaco-editor .wordHighlight { background-color: ${wordHighlight}; }`); } let wordHighlightStrong = theme.getColor(editorWordHighlightStrong); if (wordHighlightStrong) { - collector.addRule(`.monaco-editor.${theme.selector} .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`); + collector.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`); } let hcOutline = theme.getColor(activeContrastBorder); if (hcOutline) { - collector.addRule(`.monaco-editor.${theme.selector} .selectionHighlight { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor.${theme.selector} .wordHighlight { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor.${theme.selector} .wordHighlightStrong { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .selectionHighlight { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .wordHighlight { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .wordHighlightStrong { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); } }); \ No newline at end of file diff --git a/src/vs/editor/contrib/wordOperations/common/wordOperations.ts b/src/vs/editor/contrib/wordOperations/common/wordOperations.ts index 0b1d96ee992..a2da8517ce5 100644 --- a/src/vs/editor/contrib/wordOperations/common/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/common/wordOperations.ts @@ -12,8 +12,11 @@ import { Selection } from 'vs/editor/common/core/selection'; import { editorCommand, ServicesAccessor, EditorCommand, ICommandOptions } from 'vs/editor/common/editorCommonExtensions'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { WordNavigationType, WordOperations, getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/common/controller/cursorWordOperations'; +import { WordNavigationType, WordOperations } from 'vs/editor/common/controller/cursorWordOperations'; import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; +import { getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/common/controller/wordCharacterClassifier'; +import { CursorState } from 'vs/editor/common/controller/cursorCommon'; +import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; export interface MoveWordOptions extends ICommandOptions { inSelectionMode: boolean; @@ -43,7 +46,7 @@ export abstract class MoveWordCommand extends EditorCommand { return this._moveTo(sel, outPosition, this._inSelectionMode); }); - editor.setSelections(result); + editor._getCursors().setStates('moveWordCommand', CursorChangeReason.NotSet, result.map(r => CursorState.fromModelSelection(r))); if (result.length === 1) { const pos = new Position(result[0].positionLineNumber, result[0].positionColumn); editor.revealPosition(pos, false, true); @@ -275,7 +278,9 @@ export abstract class DeleteWordCommand extends EditorCommand { return new ReplaceCommand(deleteRange, ''); }); + editor.pushUndoStop(); editor.executeCommands(this.id, commands); + editor.pushUndoStop(); } protected abstract _delete(wordSeparators: WordCharacterClassifier, model: IModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range; diff --git a/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts index ab99938740b..40c303f0bec 100644 --- a/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts @@ -17,7 +17,7 @@ import { DeleteWordLeft, DeleteWordStartLeft, DeleteWordEndLeft, DeleteWordRight, DeleteWordStartRight, DeleteWordEndRight } from 'vs/editor/contrib/wordOperations/common/wordOperations'; -import { EditorCommand } from 'vs/editor/common/config/config'; +import { EditorCommand } from 'vs/editor/common/editorCommonExtensions'; suite('WordOperations', () => { diff --git a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts index c994fda89fb..97a76078bba 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts @@ -37,7 +37,7 @@ export interface IPeekViewService { isActive: boolean; } -export function getOuterEditor(accessor: ServicesAccessor, args: any): ICommonCodeEditor { +export function getOuterEditor(accessor: ServicesAccessor): ICommonCodeEditor { let editor = accessor.get(ICodeEditorService).getFocusedCodeEditor(); if (editor instanceof EmbeddedCodeEditorWidget) { return editor.getParentEditor(); diff --git a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts index b4441f6b13a..dc599a468bf 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts @@ -16,6 +16,7 @@ import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZo import { Color, RGBA } from 'vs/base/common/color'; import { EditorLayoutInfo } from 'vs/editor/common/config/editorOptions'; import { Position, IPosition } from 'vs/editor/common/core/position'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IOptions { showFrame?: boolean; @@ -228,7 +229,7 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout this._isShowing = true; this._showImpl(range, heightInLines); this._isShowing = false; - this._positionMarkerId = this.editor.deltaDecorations(this._positionMarkerId, [{ range, options: {} }]); + this._positionMarkerId = this.editor.deltaDecorations(this._positionMarkerId, [{ range, options: ModelDecorationOptions.EMPTY }]); } public hide(): void { @@ -275,6 +276,7 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout // Render the widget as zone (rendering) and widget (lifecycle) const viewZoneDomNode = document.createElement('div'); + viewZoneDomNode.style.overflow = 'hidden'; const lineHeight = this.editor.getConfiguration().lineHeight; // adjust heightInLines to viewport diff --git a/src/vs/editor/editor.main.ts b/src/vs/editor/editor.main.ts index a0cf669373a..012e073ff51 100644 --- a/src/vs/editor/editor.main.ts +++ b/src/vs/editor/editor.main.ts @@ -14,17 +14,24 @@ import 'vs/editor/contrib/inspectTokens/browser/inspectTokens'; import { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase'; import { createMonacoEditorAPI } from 'vs/editor/browser/standalone/standaloneEditor'; import { createMonacoLanguagesAPI } from 'vs/editor/browser/standalone/standaloneLanguages'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_DEFAULTS, WrappingIndent } from 'vs/editor/common/config/editorOptions'; // Set defaults for standalone editor -DefaultConfig.editor.wrappingIndent = 'none'; -DefaultConfig.editor.folding = false; -DefaultConfig.editor.glyphMargin = false; +(EDITOR_DEFAULTS).wrappingIndent = WrappingIndent.None; +(EDITOR_DEFAULTS.contribInfo).folding = false; +(EDITOR_DEFAULTS.viewInfo).glyphMargin = false; + +let base = createMonacoBaseAPI(); +for (let prop in base) { + if (base.hasOwnProperty(prop)) { + exports[prop] = base[prop]; + } +} +exports.editor = createMonacoEditorAPI(); +exports.languages = createMonacoLanguagesAPI(); var global: any = self; -global.monaco = createMonacoBaseAPI(); -global.monaco.editor = createMonacoEditorAPI(); -global.monaco.languages = createMonacoLanguagesAPI(); +global.monaco = exports; if (typeof global.require !== 'undefined' && typeof global.require.config === 'function') { global.require.config({ diff --git a/src/vs/editor/node/languageConfigurationExtensionPoint.ts b/src/vs/editor/node/languageConfigurationExtensionPoint.ts index 81c0add5dcb..ee24733bf1b 100644 --- a/src/vs/editor/node/languageConfigurationExtensionPoint.ts +++ b/src/vs/editor/node/languageConfigurationExtensionPoint.ts @@ -5,7 +5,7 @@ 'use strict'; import * as nls from 'vs/nls'; -import { parse } from 'vs/base/common/json'; +import { parse, ParseError } from 'vs/base/common/json'; import { readFile } from 'vs/base/node/pfs'; import { CharacterPair, LanguageConfiguration, IAutoClosingPair, IAutoClosingPairConditional, CommentRule } from 'vs/editor/common/modes/languageConfiguration'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -16,11 +16,17 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { LanguageIdentifier } from 'vs/editor/common/modes'; import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; +interface IRegExp { + pattern: string; + flags?: string; +} + interface ILanguageConfiguration { comments?: CommentRule; brackets?: CharacterPair[]; autoClosingPairs?: (CharacterPair | IAutoClosingPairConditional)[]; surroundingPairs?: (CharacterPair | IAutoClosingPair)[]; + wordPattern?: string | IRegExp; } export class LanguageConfigurationFileHandler { @@ -54,7 +60,7 @@ export class LanguageConfigurationFileHandler { private _handleConfigFile(languageIdentifier: LanguageIdentifier, configFilePath: string): void { readFile(configFilePath).then((fileContents) => { - var errors = []; + var errors: ParseError[] = []; var configuration = parse(fileContents.toString(), errors); if (errors.length) { console.error(nls.localize('parseErrors', "Errors parsing {0}: {1}", configFilePath, errors.join('\n'))); @@ -85,6 +91,26 @@ export class LanguageConfigurationFileHandler { richEditConfig.surroundingPairs = this._mapCharacterPairs(configuration.surroundingPairs); } + if (configuration.wordPattern) { + let pattern = ''; + let flags = ''; + + if (typeof configuration.wordPattern === 'string') { + pattern = configuration.wordPattern; + } else if (typeof configuration.wordPattern === 'object') { + pattern = configuration.wordPattern.pattern; + flags = configuration.wordPattern.flags; + } + + if (pattern) { + try { + richEditConfig.wordPattern = new RegExp(pattern, flags); + } catch (error) { + // Malformed regexes are ignored + } + } + } + LanguageConfigurationRegistry.register(languageIdentifier, richEditConfig); } @@ -208,6 +234,25 @@ const schema: IJSONSchema = { }] } }, + wordPattern: { + default: '', + description: nls.localize('schema.wordPattern', 'The word definition for the language.'), + type: ['string', 'object'], + properties: { + pattern: { + type: 'string', + description: nls.localize('schema.wordPattern.pattern', 'The RegExp pattern used to match words.'), + default: '', + }, + flags: { + type: 'string', + description: nls.localize('schema.wordPattern.flags', 'The RegExp flags used to match words.'), + default: 'g', + pattern: '^([gimuy]+)$', + patternErrorMessage: nls.localize('schema.wordPattern.flags.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') + } + } + } } }; let schemaRegistry = Registry.as(Extensions.JSONContribution); diff --git a/src/vs/editor/test/browser/controller/imeTester.ts b/src/vs/editor/test/browser/controller/imeTester.ts index 456f6f0a8fd..6f8ad840fa8 100644 --- a/src/vs/editor/test/browser/controller/imeTester.ts +++ b/src/vs/editor/test/browser/controller/imeTester.ts @@ -4,14 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { TextAreaHandler } from 'vs/editor/common/controller/textAreaHandler'; -import * as browser from 'vs/base/browser/browser'; -import { TextAreaStrategy, ISimpleModel } from 'vs/editor/common/controller/textAreaState'; +import { TextAreaInput, ITextAreaInputHost } from 'vs/editor/browser/controller/textAreaInput'; +import { ISimpleModel, TextAreaState, PagedScreenReaderStrategy } from 'vs/editor/browser/controller/textAreaState'; import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { TextAreaWrapper } from 'vs/editor/browser/controller/input/textAreaWrapper'; -import { Position } from 'vs/editor/common/core/position'; import { createFastDomNode } from 'vs/base/browser/fastDomNode'; +import * as browser from 'vs/base/browser/browser'; // To run this test, open imeTester.html @@ -20,18 +18,12 @@ class SingleLineTestModel implements ISimpleModel { private _line: string; private _eol: string; - public coordinatesConverter = { - convertViewPositionToModelPosition: (viewPosition: Position): Position => { - return viewPosition; - } - }; - constructor(line: string) { this._line = line; this._eol = '\n'; } - setText(text: string) { + _setText(text: string) { this._line = text; } @@ -39,10 +31,6 @@ class SingleLineTestModel implements ISimpleModel { return this._line.length + 1; } - getEOL(): string { - return this._eol; - } - getValueInRange(range: IRange, eol: editorCommon.EndOfLinePreference): string { return this._line.substring(range.startColumn - 1, range.endColumn - 1); } @@ -54,14 +42,6 @@ class SingleLineTestModel implements ISimpleModel { getLineCount(): number { return 1; } - - public getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string { - return ''; - } - - public getHTMLToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string { - return ''; - } } class TestView { @@ -82,13 +62,17 @@ class TestView { } } -function doCreateTest(strategy: TextAreaStrategy, description: string, inputStr: string, expectedStr: string): HTMLElement { +function doCreateTest(description: string, inputStr: string, expectedStr: string): HTMLElement { + let cursorOffset: number = 0; + let cursorLength: number = 0; + let container = document.createElement('div'); container.className = 'container'; let title = document.createElement('div'); title.className = 'title'; - title.innerHTML = TextAreaStrategy[strategy] + ' strategy: ' + description + '. Type ' + inputStr + ''; + + title.innerHTML = description + '. Type ' + inputStr + ''; container.appendChild(title); let startBtn = document.createElement('button'); @@ -101,19 +85,26 @@ function doCreateTest(strategy: TextAreaStrategy, description: string, inputStr: input.setAttribute('cols', '40'); container.appendChild(input); - let textAreaWrapper = new TextAreaWrapper(createFastDomNode(input)); - let model = new SingleLineTestModel('some text'); - let handler = new TextAreaHandler(browser, strategy, textAreaWrapper, model); + const textAreaInputHost: ITextAreaInputHost = { + getPlainTextToCopy: (): string => '', + getHTMLToCopy: (): string => '', + getScreenReaderContent: (currentState: TextAreaState): TextAreaState => { - input.onfocus = () => { - handler.setHasFocus(true); - }; - input.onblur = () => { - handler.setHasFocus(false); + if (browser.isIPad) { + // Do not place anything in the textarea for the iPad + return TextAreaState.EMPTY; + } + + const selection = new Range(1, 1 + cursorOffset, 1, 1 + cursorOffset + cursorLength); + + return PagedScreenReaderStrategy.fromEditorSelection(currentState, model, selection); + } }; + let handler = new TextAreaInput(textAreaInputHost, createFastDomNode(input)); + let output = document.createElement('pre'); output.className = 'output'; container.appendChild(output); @@ -128,18 +119,15 @@ function doCreateTest(strategy: TextAreaStrategy, description: string, inputStr: let view = new TestView(model); - - let cursorOffset: number; - let cursorLength: number; let updatePosition = (off: number, len: number) => { cursorOffset = off; cursorLength = len; - handler.setCursorSelections(new Range(1, 1 + cursorOffset, 1, 1 + cursorOffset + cursorLength), []); + handler.writeScreenReaderContent('selection changed'); handler.focusTextArea(); }; let updateModelAndPosition = (text: string, off: number, len: number) => { - model.setText(text); + model._setText(text); updatePosition(off, len); view.paint(output); @@ -187,6 +175,5 @@ const TESTS = [ ]; TESTS.forEach((t) => { - document.body.appendChild(doCreateTest(TextAreaStrategy.NVDA, t.description, t.in, t.out)); - document.body.appendChild(doCreateTest(TextAreaStrategy.IENarrator, t.description, t.in, t.out)); -}); \ No newline at end of file + document.body.appendChild(doCreateTest(t.description, t.in, t.out)); +}); diff --git a/src/vs/editor/test/browser/controller/textAreaState.test.ts b/src/vs/editor/test/browser/controller/textAreaState.test.ts new file mode 100644 index 00000000000..59552e7542e --- /dev/null +++ b/src/vs/editor/test/browser/controller/textAreaState.test.ts @@ -0,0 +1,638 @@ +/*--------------------------------------------------------------------------------------------- + * 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 assert from 'assert'; +import { ISimpleModel, TextAreaState, ITextAreaWrapper, PagedScreenReaderStrategy } from 'vs/editor/browser/controller/textAreaState'; +import { Range } from 'vs/editor/common/core/range'; +import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { Model } from 'vs/editor/common/model/model'; +import { Selection } from 'vs/editor/common/core/selection'; + +export class MockTextAreaWrapper extends Disposable implements ITextAreaWrapper { + + public _value: string; + public _selectionStart: number; + public _selectionEnd: number; + + constructor() { + super(); + this._value = ''; + this._selectionStart = 0; + this._selectionEnd = 0; + } + + public getValue(): string { + return this._value; + } + + public setValue(reason: string, value: string): void { + this._value = value; + this._selectionStart = this._value.length; + this._selectionEnd = this._value.length; + } + + public getSelectionStart(): number { + return this._selectionStart; + } + + public getSelectionEnd(): number { + return this._selectionEnd; + } + + public setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void { + if (selectionStart < 0) { + selectionStart = 0; + } + if (selectionStart > this._value.length) { + selectionStart = this._value.length; + } + if (selectionEnd < 0) { + selectionEnd = 0; + } + if (selectionEnd > this._value.length) { + selectionEnd = this._value.length; + } + this._selectionStart = selectionStart; + this._selectionEnd = selectionEnd; + } +} + +suite('TextAreaState', () => { + + function assertTextAreaState(actual: TextAreaState, value: string, selectionStart: number, selectionEnd: number): void { + let desired = new TextAreaState(value, selectionStart, selectionEnd); + assert.ok(desired.equals(actual), desired.toString() + ' == ' + actual.toString()); + } + + test('fromTextArea', () => { + let textArea = new MockTextAreaWrapper(); + textArea._value = 'Hello world!'; + textArea._selectionStart = 1; + textArea._selectionEnd = 12; + let actual = TextAreaState.EMPTY.readFromTextArea(textArea); + + assertTextAreaState(actual, 'Hello world!', 1, 12); + assert.equal(actual.value, 'Hello world!'); + assert.equal(actual.selectionStart, 1); + + actual = actual.collapseSelection(); + assertTextAreaState(actual, 'Hello world!', 12, 12); + + textArea.dispose(); + }); + + test('applyToTextArea', () => { + let textArea = new MockTextAreaWrapper(); + textArea._value = 'Hello world!'; + textArea._selectionStart = 1; + textArea._selectionEnd = 12; + + let state = new TextAreaState('Hi world!', 2, 2); + state.writeToTextArea('test', textArea, false); + + assert.equal(textArea._value, 'Hi world!'); + assert.equal(textArea._selectionStart, 9); + assert.equal(textArea._selectionEnd, 9); + + state = new TextAreaState('Hi world!', 3, 3); + state.writeToTextArea('test', textArea, false); + + assert.equal(textArea._value, 'Hi world!'); + assert.equal(textArea._selectionStart, 9); + assert.equal(textArea._selectionEnd, 9); + + state = new TextAreaState('Hi world!', 0, 2); + state.writeToTextArea('test', textArea, true); + + assert.equal(textArea._value, 'Hi world!'); + assert.equal(textArea._selectionStart, 0); + assert.equal(textArea._selectionEnd, 2); + + textArea.dispose(); + }); + + function testDeduceInput(prevState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, expected: string, expectedCharReplaceCnt: number): void { + prevState = prevState || TextAreaState.EMPTY; + + let textArea = new MockTextAreaWrapper(); + textArea._value = value; + textArea._selectionStart = selectionStart; + textArea._selectionEnd = selectionEnd; + + let newState = prevState.readFromTextArea(textArea); + let actual = TextAreaState.deduceInput(prevState, newState, true); + + assert.equal(actual.text, expected); + assert.equal(actual.replaceCharCnt, expectedCharReplaceCnt); + + textArea.dispose(); + } + + test('deduceInput - Japanese typing sennsei and accepting', () => { + // manual test: + // - choose keyboard layout: Japanese -> Hiragama + // - type sennsei + // - accept with Enter + // - expected: ã›ã‚“ã›ã„ + + // s + // PREVIOUS STATE: [ <>, selectionStart: 0, selectionEnd: 0, selectionToken: 0] + // CURRENT STATE: [ <s>, selectionStart: 0, selectionEnd: 1, selectionToken: 0] + testDeduceInput( + TextAreaState.EMPTY, + 's', + 0, 1, + 's', 0 + ); + + // e + // PREVIOUS STATE: [ <s>, selectionStart: 0, selectionEnd: 1, selectionToken: 0] + // CURRENT STATE: [ <ã›>, selectionStart: 0, selectionEnd: 1, selectionToken: 0] + testDeduceInput( + new TextAreaState('s', 0, 1), + 'ã›', + 0, 1, + 'ã›', 1 + ); + + // n + // PREVIOUS STATE: [ <ã›>, selectionStart: 0, selectionEnd: 1, selectionToken: 0] + // CURRENT STATE: [ <ã›ï½Ž>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›', 0, 1), + 'ã›ï½Ž', + 0, 2, + 'ã›ï½Ž', 1 + ); + + // n + // PREVIOUS STATE: [ <ã›ï½Ž>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ï½Ž', 0, 2), + 'ã›ã‚“', + 0, 2, + 'ã›ã‚“', 2 + ); + + // s + // PREVIOUS STATE: [ <ã›ã‚“>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“s>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“', 0, 2), + 'ã›ã‚“s', + 0, 3, + 'ã›ã‚“s', 2 + ); + + // e + // PREVIOUS STATE: [ <ã›ã‚“s>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“s', 0, 3), + 'ã›ã‚“ã›', + 0, 3, + 'ã›ã‚“ã›', 3 + ); + + // no-op? [was recorded] + // PREVIOUS STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“ã›', 0, 3), + 'ã›ã‚“ã›', + 0, 3, + 'ã›ã‚“ã›', 3 + ); + + // i + // PREVIOUS STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“ã›', 0, 3), + 'ã›ã‚“ã›ã„', + 0, 4, + 'ã›ã‚“ã›ã„', 3 + ); + + // ENTER (accept) + // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 4, selectionEnd: 4, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“ã›ã„', 0, 4), + 'ã›ã‚“ã›ã„', + 4, 4, + '', 0 + ); + }); + + test('deduceInput - Japanese typing sennsei and choosing different suggestion', () => { + // manual test: + // - choose keyboard layout: Japanese -> Hiragama + // - type sennsei + // - arrow down (choose next suggestion) + // - accept with Enter + // - expected: ã›ã‚“ã›ã„ + + // sennsei + // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, selectionToken: 0] + // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“ã›ã„', 0, 4), + 'ã›ã‚“ã›ã„', + 0, 4, + 'ã›ã‚“ã›ã„', 4 + ); + + // arrow down + // CURRENT STATE: [ <先生>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, selectionToken: 0] + testDeduceInput( + new TextAreaState('ã›ã‚“ã›ã„', 0, 4), + '先生', + 0, 2, + '先生', 4 + ); + + // ENTER (accept) + // PREVIOUS STATE: [ <先生>, selectionStart: 0, selectionEnd: 2, selectionToken: 0] + // CURRENT STATE: [ <先生>, selectionStart: 2, selectionEnd: 2, selectionToken: 0] + testDeduceInput( + new TextAreaState('先生', 0, 2), + '先生', + 2, 2, + '', 0 + ); + }); + + test('extractNewText - no previous state with selection', () => { + testDeduceInput( + null, + 'a', + 0, 1, + 'a', 0 + ); + }); + + test('issue #2586: Replacing selected end-of-line with newline locks up the document', () => { + testDeduceInput( + new TextAreaState(']\n', 1, 2), + ']\n', + 2, 2, + '\n', 0 + ); + }); + + test('extractNewText - no previous state without selection', () => { + testDeduceInput( + null, + 'a', + 1, 1, + 'a', 0 + ); + }); + + test('extractNewText - typing does not cause a selection', () => { + testDeduceInput( + TextAreaState.EMPTY, + 'a', + 0, 1, + 'a', 0 + ); + }); + + test('extractNewText - had the textarea empty', () => { + testDeduceInput( + TextAreaState.EMPTY, + 'a', + 1, 1, + 'a', 0 + ); + }); + + test('extractNewText - had the entire line selected', () => { + testDeduceInput( + new TextAreaState('Hello world!', 0, 12), + 'H', + 1, 1, + 'H', 0 + ); + }); + + test('extractNewText - had previous text 1', () => { + testDeduceInput( + new TextAreaState('Hello world!', 12, 12), + 'Hello world!a', + 13, 13, + 'a', 0 + ); + }); + + test('extractNewText - had previous text 2', () => { + testDeduceInput( + new TextAreaState('Hello world!', 0, 0), + 'aHello world!', + 1, 1, + 'a', 0 + ); + }); + + test('extractNewText - had previous text 3', () => { + testDeduceInput( + new TextAreaState('Hello world!', 6, 11), + 'Hello other!', + 11, 11, + 'other', 0 + ); + }); + + test('extractNewText - IME', () => { + testDeduceInput( + TextAreaState.EMPTY, + 'ã“れã¯', + 3, 3, + 'ã“れã¯', 0 + ); + }); + + test('extractNewText - isInOverwriteMode', () => { + testDeduceInput( + new TextAreaState('Hello world!', 0, 0), + 'Aello world!', + 1, 1, + 'A', 0 + ); + }); + + test('extractMacReplacedText - does nothing if there is selection', () => { + testDeduceInput( + new TextAreaState('Hello world!', 5, 5), + 'Hellö world!', + 4, 5, + 'ö', 0 + ); + }); + + test('extractMacReplacedText - does nothing if there is more than one extra char', () => { + testDeduceInput( + new TextAreaState('Hello world!', 5, 5), + 'Hellöö world!', + 5, 5, + 'öö', 1 + ); + }); + + test('extractMacReplacedText - does nothing if there is more than one changed char', () => { + testDeduceInput( + new TextAreaState('Hello world!', 5, 5), + 'Helöö world!', + 5, 5, + 'öö', 2 + ); + }); + + test('extractMacReplacedText', () => { + testDeduceInput( + new TextAreaState('Hello world!', 5, 5), + 'Hellö world!', + 5, 5, + 'ö', 1 + ); + }); + + test('issue #25101 - First key press ignored', () => { + testDeduceInput( + new TextAreaState('a', 0, 1), + 'a', + 1, 1, + 'a', 0 + ); + }); + + test('issue #16520 - Cmd-d of single character followed by typing same character as has no effect', () => { + testDeduceInput( + new TextAreaState('x x', 0, 1), + 'x x', + 1, 1, + 'x', 0 + ); + }); + + test('issue #4271 (example 1) - When inserting an emoji on OSX, it is placed two spaces left of the cursor', () => { + // The OSX emoji inserter inserts emojis at random positions in the text, unrelated to where the cursor is. + testDeduceInput( + new TextAreaState( + [ + 'some1 text', + 'some2 text', + 'some3 text', + 'some4 text', // cursor is here in the middle of the two spaces + 'some5 text', + 'some6 text', + 'some7 text' + ].join('\n'), + 42, 42 + ), + [ + 'so📅me1 text', + 'some2 text', + 'some3 text', + 'some4 text', + 'some5 text', + 'some6 text', + 'some7 text' + ].join('\n'), + 4, 4, + '📅', 0 + ); + }); + + test('issue #4271 (example 2) - When inserting an emoji on OSX, it is placed two spaces left of the cursor', () => { + // The OSX emoji inserter inserts emojis at random positions in the text, unrelated to where the cursor is. + testDeduceInput( + new TextAreaState( + 'some1 text', + 6, 6 + ), + 'some💊1 text', + 6, 6, + '💊', 0 + ); + }); + + test('issue #4271 (example 3) - When inserting an emoji on OSX, it is placed two spaces left of the cursor', () => { + // The OSX emoji inserter inserts emojis at random positions in the text, unrelated to where the cursor is. + testDeduceInput( + new TextAreaState( + 'qwertyu\nasdfghj\nzxcvbnm', + 12, 12 + ), + 'qwertyu\nasdfghj\nzxcvbnm🎈', + 25, 25, + '🎈', 0 + ); + }); + + // an example of an emoji missed by the regex but which has the FE0F variant 16 hint + test('issue #4271 (example 4) - When inserting an emoji on OSX, it is placed two spaces left of the cursor', () => { + // The OSX emoji inserter inserts emojis at random positions in the text, unrelated to where the cursor is. + testDeduceInput( + new TextAreaState( + 'some1 text', + 6, 6 + ), + 'some⌨ï¸1 text', + 6, 6, + '⌨ï¸', 0 + ); + }); + + suite('PagedScreenReaderStrategy', () => { + + function testPagedScreenReaderStrategy(lines: string[], selection: Selection, expected: TextAreaState): void { + const model = Model.createFromString(lines.join('\n')); + const actual = PagedScreenReaderStrategy.fromEditorSelection(TextAreaState.EMPTY, model, selection); + assert.ok(actual.equals(expected)); + model.dispose(); + } + + test('simple', () => { + testPagedScreenReaderStrategy( + [ + 'Hello world!' + ], + new Selection(1, 13, 1, 13), + new TextAreaState('Hello world!', 12, 12) + ); + + testPagedScreenReaderStrategy( + [ + 'Hello world!' + ], + new Selection(1, 1, 1, 1), + new TextAreaState('Hello world!', 0, 0) + ); + + testPagedScreenReaderStrategy( + [ + 'Hello world!' + ], + new Selection(1, 1, 1, 6), + new TextAreaState('Hello world!', 0, 5) + ); + }); + + test('multiline', () => { + testPagedScreenReaderStrategy( + [ + 'Hello world!', + 'How are you?' + ], + new Selection(1, 1, 1, 1), + new TextAreaState('Hello world!\nHow are you?', 0, 0) + ); + + testPagedScreenReaderStrategy( + [ + 'Hello world!', + 'How are you?' + ], + new Selection(2, 1, 2, 1), + new TextAreaState('Hello world!\nHow are you?', 13, 13) + ); + }); + + test('page', () => { + testPagedScreenReaderStrategy( + [ + 'L1\nL2\nL3\nL4\nL5\nL6\nL7\nL8\nL9\nL10\nL11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\nL21' + ], + new Selection(1, 1, 1, 1), + new TextAreaState('L1\nL2\nL3\nL4\nL5\nL6\nL7\nL8\nL9\nL10\n', 0, 0) + ); + + testPagedScreenReaderStrategy( + [ + 'L1\nL2\nL3\nL4\nL5\nL6\nL7\nL8\nL9\nL10\nL11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\nL21' + ], + new Selection(11, 1, 11, 1), + new TextAreaState('L11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\n', 0, 0) + ); + + testPagedScreenReaderStrategy( + [ + 'L1\nL2\nL3\nL4\nL5\nL6\nL7\nL8\nL9\nL10\nL11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\nL21' + ], + new Selection(12, 1, 12, 1), + new TextAreaState('L11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\n', 4, 4) + ); + + testPagedScreenReaderStrategy( + [ + 'L1\nL2\nL3\nL4\nL5\nL6\nL7\nL8\nL9\nL10\nL11\nL12\nL13\nL14\nL15\nL16\nL17\nL18\nL19\nL20\nL21' + ], + new Selection(21, 1, 21, 1), + new TextAreaState('L21', 0, 0) + ); + }); + + }); +}); + +class SimpleModel implements ISimpleModel { + + private _lines: string[]; + private _eol: string; + + constructor(lines: string[], eol: string) { + this._lines = lines; + this._eol = eol; + } + + public getLineMaxColumn(lineNumber: number): number { + return this._lines[lineNumber - 1].length + 1; + } + + private _getEndOfLine(eol: EndOfLinePreference): string { + switch (eol) { + case EndOfLinePreference.LF: + return '\n'; + case EndOfLinePreference.CRLF: + return '\r\n'; + case EndOfLinePreference.TextDefined: + return this._eol; + } + throw new Error('Unknown EOL preference'); + } + + public getValueInRange(range: Range, eol: EndOfLinePreference): string { + if (Range.isEmpty(range)) { + return ''; + } + + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); + } + + var lineEnding = this._getEndOfLine(eol), + startLineIndex = range.startLineNumber - 1, + endLineIndex = range.endLineNumber - 1, + resultLines: string[] = []; + + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); + } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + + return resultLines.join(lineEnding); + } + + public getLineCount(): number { + return this._lines.length; + } +} diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts index 2b904a5dd3f..d68266803a7 100644 --- a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -9,8 +9,11 @@ import URI from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl'; import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; +import { TestThemeService, TestTheme } from 'vs/workbench/test/workbenchTestServices'; -suite('Browser Services - EditorLayoutProvider', () => { +const themeServiceMock = new TestThemeService(); + +suite('Decoration Render Options', () => { var options: IDecorationRenderOptions = { gutterIconPath: URI.parse('https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png'), gutterIconSize: 'contain', @@ -18,12 +21,12 @@ suite('Browser Services - EditorLayoutProvider', () => { borderColor: 'yellow' }; test('register and resolve decoration type', () => { - var s = new CodeEditorServiceImpl(); + var s = new CodeEditorServiceImpl(themeServiceMock); s.registerDecorationType('example', options); assert.notEqual(s.resolveDecorationOptions('example', false), undefined); }); test('remove decoration type', () => { - var s = new CodeEditorServiceImpl(); + var s = new CodeEditorServiceImpl(themeServiceMock); s.registerDecorationType('example', options); assert.notEqual(s.resolveDecorationOptions('example', false), undefined); s.removeDecorationType('example'); @@ -32,14 +35,14 @@ suite('Browser Services - EditorLayoutProvider', () => { function readStyleSheet(styleSheet: HTMLStyleElement): string { if ((styleSheet.sheet).rules) { - return Array.prototype.map.call((styleSheet.sheet).rules, r => r.cssText).join('\n'); + return Array.prototype.map.call((styleSheet.sheet).rules, (r: { cssText: string }) => r.cssText).join('\n'); } return styleSheet.sheet.toString(); } test('css properties', () => { var styleSheet = dom.createStyleSheet(); - var s = new CodeEditorServiceImpl(styleSheet); + var s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', options); var sheet = readStyleSheet(styleSheet); assert( @@ -50,11 +53,76 @@ suite('Browser Services - EditorLayoutProvider', () => { assert(sheet.indexOf('background-color: red;') > 0); }); + test('theme color', () => { + var options: IDecorationRenderOptions = { + backgroundColor: { id: 'editorBackground' }, + borderColor: { id: 'editorBorder' }, + }; + var colors: { [key: string]: string } = { + editorBackground: '#FF0000' + }; + + var styleSheet = dom.createStyleSheet(); + let themeService = new TestThemeService(new TestTheme(colors)); + var s = new CodeEditorServiceImpl(themeService, styleSheet); + s.registerDecorationType('example', options); + var sheet = readStyleSheet(styleSheet); + assert.equal(sheet, '.monaco-editor .ced-example-0 { background-color: rgb(255, 0, 0); }'); + + colors = { + editorBackground: '#EE0000', + editorBorder: '#00FFFF' + }; + themeService.setTheme(new TestTheme(colors)); + sheet = readStyleSheet(styleSheet); + assert.equal(sheet, '.monaco-editor .ced-example-0 { background-color: rgb(238, 0, 0); border-color: rgb(0, 255, 255); box-sizing: border-box; }'); + + s.removeDecorationType('example'); + sheet = readStyleSheet(styleSheet); + assert.equal(sheet, ''); + + }); + + test('theme overrides', () => { + var options: IDecorationRenderOptions = { + color: { id: 'editorBackground' }, + light: { + color: '#FF00FF' + }, + dark: { + color: '#000000', + after: { + color: { id: 'infoForeground' } + } + } + }; + var colors: { [key: string]: string } = { + editorBackground: '#FF0000', + infoForeground: '#444444' + }; + + var styleSheet = dom.createStyleSheet(); + let themeService = new TestThemeService(new TestTheme(colors)); + var s = new CodeEditorServiceImpl(themeService, styleSheet); + s.registerDecorationType('example', options); + var sheet = readStyleSheet(styleSheet); + let expected = + '.vs-dark.monaco-editor .ced-example-4::after, .hc-black.monaco-editor .ced-example-4::after { color: rgb(68, 68, 68) !important; }\n' + + '.vs-dark.monaco-editor .ced-example-1, .hc-black.monaco-editor .ced-example-1 { color: rgb(0, 0, 0) !important; }\n' + + '.vs.monaco-editor .ced-example-1 { color: rgb(255, 0, 255) !important; }\n' + + '.monaco-editor .ced-example-1 { color: rgb(255, 0, 0) !important; }'; + assert.equal(sheet, expected); + + s.removeDecorationType('example'); + sheet = readStyleSheet(styleSheet); + assert.equal(sheet, ''); + }); + test('css properties, gutterIconPaths', () => { var styleSheet = dom.createStyleSheet(); // unix file path (used as string) - var s = new CodeEditorServiceImpl(styleSheet); + var s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: '/Users/foo/bar.png' }); var sheet = readStyleSheet(styleSheet);//.innerHTML || styleSheet.sheet.toString(); assert( @@ -63,7 +131,7 @@ suite('Browser Services - EditorLayoutProvider', () => { ); // windows file path (used as string) - s = new CodeEditorServiceImpl(styleSheet); + s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: 'c:\\files\\miles\\more.png' }); sheet = readStyleSheet(styleSheet); // TODO@Alex test fails @@ -73,7 +141,7 @@ suite('Browser Services - EditorLayoutProvider', () => { // ); // URI, only minimal encoding - s = new CodeEditorServiceImpl(styleSheet); + s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: URI.parse('data:image/svg+xml;base64,PHN2ZyB4b+') }); sheet = readStyleSheet(styleSheet); assert( @@ -82,7 +150,7 @@ suite('Browser Services - EditorLayoutProvider', () => { ); // single quote must always be escaped/encoded - s = new CodeEditorServiceImpl(styleSheet); + s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: '/Users/foo/b\'ar.png' }); sheet = readStyleSheet(styleSheet); assert( @@ -90,7 +158,7 @@ suite('Browser Services - EditorLayoutProvider', () => { || sheet.indexOf('background: url("file:///Users/foo/b%27ar.png") center center no-repeat;') > 0 ); - s = new CodeEditorServiceImpl(styleSheet); + s = new CodeEditorServiceImpl(themeServiceMock, styleSheet); s.registerDecorationType('example', { gutterIconPath: URI.parse('http://test/pa\'th') }); sheet = readStyleSheet(styleSheet); assert( diff --git a/src/vs/editor/test/browser/view/viewLayer.test.ts b/src/vs/editor/test/browser/view/viewLayer.test.ts index 51344c85c73..a71138fc3b7 100644 --- a/src/vs/editor/test/browser/view/viewLayer.test.ts +++ b/src/vs/editor/test/browser/view/viewLayer.test.ts @@ -51,7 +51,7 @@ suite('RenderedLinesCollection onLinesDeleted', () => { new TestLine('old9') ]); let actualDeleted1 = col.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber); - let actualDeleted = []; + let actualDeleted: string[] = []; if (actualDeleted1) { actualDeleted = actualDeleted1.map(line => line.id); } @@ -407,7 +407,7 @@ suite('RenderedLinesCollection onLinesInserted', () => { new TestLine('old9') ]); let actualDeleted1 = col.onLinesInserted(insertFromLineNumber, insertToLineNumber); - let actualDeleted = []; + let actualDeleted: string[] = []; if (actualDeleted1) { actualDeleted = actualDeleted1.map(line => line.id); } diff --git a/src/vs/editor/test/common/commands/commandTestUtils.ts b/src/vs/editor/test/common/commands/commandTestUtils.ts index 1e9c6202c59..184f5e8d99b 100644 --- a/src/vs/editor/test/common/commands/commandTestUtils.ts +++ b/src/vs/editor/test/common/commands/commandTestUtils.ts @@ -5,14 +5,12 @@ 'use strict'; import * as assert from 'assert'; -import { Cursor } from 'vs/editor/common/controller/cursor'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; import { LanguageIdentifier } from 'vs/editor/common/modes'; -import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { viewModelHelper } from 'vs/editor/test/common/editorTestUtils'; +import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; export function testCommand( lines: string[], @@ -22,22 +20,19 @@ export function testCommand( expectedLines: string[], expectedSelection: Selection ): void { - let model = Model.createFromString(lines.join('\n'), undefined, languageIdentifier); - let config = new TestConfiguration(null); - let cursor = new Cursor(config, model, viewModelHelper(model), false); + withMockCodeEditor(null, { model: model }, (editor, cursor) => { - cursor.setSelections('tests', [selection]); + cursor.setSelections('tests', [selection]); - cursor.trigger('tests', editorCommon.Handler.ExecuteCommand, commandFactory(cursor.getSelection())); + cursor.trigger('tests', editorCommon.Handler.ExecuteCommand, commandFactory(cursor.getSelection())); - assert.deepEqual(model.getLinesContent(), expectedLines); + assert.deepEqual(model.getLinesContent(), expectedLines); - let actualSelection = cursor.getSelection(); - assert.deepEqual(actualSelection.toString(), expectedSelection.toString()); + let actualSelection = cursor.getSelection(); + assert.deepEqual(actualSelection.toString(), expectedSelection.toString()); - cursor.dispose(); - config.dispose(); + }); model.dispose(); } diff --git a/src/vs/editor/test/common/commands/sideEditing.test.ts b/src/vs/editor/test/common/commands/sideEditing.test.ts index 7ddf9c91729..af17bee84a2 100644 --- a/src/vs/editor/test/common/commands/sideEditing.test.ts +++ b/src/vs/editor/test/common/commands/sideEditing.test.ts @@ -5,36 +5,30 @@ 'use strict'; import * as assert from 'assert'; -import { Cursor } from 'vs/editor/common/controller/cursor'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; -import { Model } from 'vs/editor/common/model/model'; import { ILineEdit, ModelLine, LineMarker, MarkersTracker } from 'vs/editor/common/model/modelLine'; -import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { viewModelHelper } from 'vs/editor/test/common/editorTestUtils'; +import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; const NO_TAB_SIZE = 0; function testCommand(lines: string[], selections: Selection[], edits: IIdentifiedSingleEditOperation[], expectedLines: string[], expectedSelections: Selection[]): void { - let model = Model.createFromString(lines.join('\n')); - let config = new TestConfiguration(null); - let cursor = new Cursor(config, model, viewModelHelper(model), false); + withMockCodeEditor(lines, {}, (editor, cursor) => { + const model = editor.getModel(); - cursor.setSelections('tests', selections); + cursor.setSelections('tests', selections); - model.applyEdits(edits); + model.applyEdits(edits); - assert.deepEqual(model.getLinesContent(), expectedLines); + assert.deepEqual(model.getLinesContent(), expectedLines); - let actualSelections = cursor.getSelections(); - assert.deepEqual(actualSelections.map(s => s.toString()), expectedSelections.map(s => s.toString())); + let actualSelections = cursor.getSelections(); + assert.deepEqual(actualSelections.map(s => s.toString()), expectedSelections.map(s => s.toString())); - cursor.dispose(); - config.dispose(); - model.dispose(); + }); } function testLineEditMarker(text: string, column: number, stickToPreviousCharacter: boolean, edit: ILineEdit, expectedColumn: number): void { diff --git a/src/vs/editor/test/common/config/commonEditorConfig.test.ts b/src/vs/editor/test/common/config/commonEditorConfig.test.ts index bda2f542ccb..2e2f47b16aa 100644 --- a/src/vs/editor/test/common/config/commonEditorConfig.test.ts +++ b/src/vs/editor/test/common/config/commonEditorConfig.test.ts @@ -7,6 +7,8 @@ import * as assert from 'assert'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; +import { IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; +import { AccessibilitySupport } from 'vs/base/common/platform'; suite('Common Editor Config', () => { test('Zoom Level', () => { @@ -52,8 +54,17 @@ suite('Common Editor Config', () => { }); class TestWrappingConfiguration extends TestConfiguration { - protected getOuterWidth(): number { - return 1000; + protected _getEnvConfiguration(): IEnvConfiguration { + return { + extraEditorClassName: '', + outerWidth: 1000, + outerHeight: 100, + canUseTranslate3d: true, + emptySelectionClipboard: true, + pixelRatio: 1, + zoomLevel: 0, + accessibilitySupport: AccessibilitySupport.Unknown + }; } } @@ -78,13 +89,23 @@ suite('Common Editor Config', () => { let config = new TestWrappingConfiguration({ wordWrap: true }); - assertWrapping(config, true, 89); + assertWrapping(config, true, 81); }); test('wordWrap on', () => { let config = new TestWrappingConfiguration({ wordWrap: 'on' }); + assertWrapping(config, true, 81); + }); + + test('wordWrap on without minimap', () => { + let config = new TestWrappingConfiguration({ + wordWrap: 'on', + minimap: { + enabled: false + } + }); assertWrapping(config, true, 89); }); @@ -93,7 +114,7 @@ suite('Common Editor Config', () => { wordWrap: 'on', wordWrapColumn: 10 }); - assertWrapping(config, true, 89); + assertWrapping(config, true, 81); }); test('wordWrap off', () => { diff --git a/src/vs/editor/test/common/controller/cursor.test.ts b/src/vs/editor/test/common/controller/cursor.test.ts index 59ea9aa805c..b3d15acc035 100644 --- a/src/vs/editor/test/common/controller/cursor.test.ts +++ b/src/vs/editor/test/common/controller/cursor.test.ts @@ -5,7 +5,7 @@ 'use strict'; import * as assert from 'assert'; -import { Cursor } from 'vs/editor/common/controller/cursor'; +import { Cursor, CursorStateChangedEvent } from 'vs/editor/common/controller/cursor'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; @@ -13,7 +13,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { EndOfLinePreference, Handler, DefaultEndOfLine, ITextModelCreationOptions, ICommand, - ITokenizedModel, IEditOperationBuilder, ICursorStateComputerData + ITokenizedModel, IEditOperationBuilder, ICursorStateComputerData, EndOfLineSequence, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; import { IndentAction, IndentationRule } from 'vs/editor/common/modes/languageConfiguration'; @@ -21,11 +21,17 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageIdentifier } from 'vs/editor/common/modes'; -import { viewModelHelper } from 'vs/editor/test/common/editorTestUtils'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { CoreCommands } from 'vs/editor/common/controller/coreCommands'; - +import { CoreNavigationCommands, CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; +import { withMockCodeEditor, MockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; +import { TextModel } from 'vs/editor/common/model/textModel'; +import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; +import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import { ScreenReaderMessageGenerator } from 'vs/editor/common/controller/accGenerator'; +import { + CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect +} from 'vs/editor/contrib/wordOperations/common/wordOperations'; +import { EditorCommand } from 'vs/editor/common/editorCommonExtensions'; let H = Handler; // --------- utils @@ -36,11 +42,11 @@ function cursorCommand(cursor: Cursor, command: string, extraData?: any, overwri function moveTo(cursor: Cursor, lineNumber: number, column: number, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.MoveToSelect.runCoreEditorCommand(cursor, { + CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(cursor, { position: new Position(lineNumber, column) }); } else { - CoreCommands.MoveTo.runCoreEditorCommand(cursor, { + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(lineNumber, column) }); } @@ -48,65 +54,65 @@ function moveTo(cursor: Cursor, lineNumber: number, column: number, inSelectionM function moveLeft(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorLeftSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorLeftSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorLeft.runCoreEditorCommand(cursor, {}); } } function moveRight(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorRightSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorRightSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorRight.runCoreEditorCommand(cursor, {}); } } function moveDown(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorDownSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorDownSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorDown.runCoreEditorCommand(cursor, {}); } } function moveUp(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorUpSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorUpSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorUp.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorUp.runCoreEditorCommand(cursor, {}); } } function moveToBeginningOfLine(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorHomeSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorHomeSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorHome.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorHome.runCoreEditorCommand(cursor, {}); } } function moveToEndOfLine(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorEndSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorEndSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorEnd.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorEnd.runCoreEditorCommand(cursor, {}); } } function moveToBeginningOfBuffer(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorTopSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorTopSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorTop.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorTop.runCoreEditorCommand(cursor, {}); } } function moveToEndOfBuffer(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorBottomSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorBottomSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorBottom.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorBottom.runCoreEditorCommand(cursor, {}); } } @@ -134,6 +140,7 @@ suite('Editor Controller - Cursor', () => { let thisModel: Model; let thisConfiguration: TestConfiguration; + let thisViewModel: ViewModel; let thisCursor: Cursor; setup(() => { @@ -146,11 +153,14 @@ suite('Editor Controller - Cursor', () => { thisModel = Model.createFromString(text); thisConfiguration = new TestConfiguration(null); - thisCursor = new Cursor(thisConfiguration, thisModel, viewModelHelper(thisModel), false); + thisViewModel = new ViewModel(0, thisConfiguration, thisModel); + + thisCursor = new Cursor(thisConfiguration, thisModel, thisViewModel); }); teardown(() => { thisCursor.dispose(); + thisViewModel.dispose(); thisModel.dispose(); thisConfiguration.dispose(); }); @@ -590,7 +600,7 @@ suite('Editor Controller - Cursor', () => { // --------- misc test('select all', () => { - CoreCommands.SelectAll.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.SelectAll.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 5, LINE5.length + 1)); }); @@ -599,47 +609,44 @@ suite('Editor Controller - Cursor', () => { // 01234 56789012345678 0 // let LINE1 = ' \tMy First Line\t '; moveTo(thisCursor, 1, 1); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); moveTo(thisCursor, 1, 2); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); moveTo(thisCursor, 1, 5); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); moveTo(thisCursor, 1, 19); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); moveTo(thisCursor, 1, 20); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); moveTo(thisCursor, 1, 21); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 2, 1)); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 3, 1)); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 4, 1)); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 5, 1)); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 5, LINE5.length + 1)); - CoreCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); + CoreNavigationCommands.ExpandLineSelection.runCoreEditorCommand(thisCursor, {}); assertCursor(thisCursor, new Selection(1, 1, 5, LINE5.length + 1)); }); // --------- eventing test('no move doesn\'t trigger event', () => { - thisCursor.onDidChangePosition((e) => { - assert.ok(false, 'was not expecting event'); - }); - thisCursor.onDidChangeSelection((e) => { + thisCursor.onDidChange((e) => { assert.ok(false, 'was not expecting event'); }); moveTo(thisCursor, 1, 1); @@ -647,30 +654,22 @@ suite('Editor Controller - Cursor', () => { test('move eventing', () => { let events = 0; - thisCursor.onDidChangePosition((e: ICursorPositionChangedEvent) => { + thisCursor.onDidChange((e: CursorStateChangedEvent) => { events++; - assert.deepEqual(e.position, new Position(1, 2)); - }); - thisCursor.onDidChangeSelection((e: ICursorSelectionChangedEvent) => { - events++; - assert.deepEqual(e.selection, new Selection(1, 2, 1, 2)); + assert.deepEqual(e.selections, [new Selection(1, 2, 1, 2)]); }); moveTo(thisCursor, 1, 2); - assert.equal(events, 2, 'receives 2 events'); + assert.equal(events, 1, 'receives 1 event'); }); test('move in selection mode eventing', () => { let events = 0; - thisCursor.onDidChangePosition((e: ICursorPositionChangedEvent) => { + thisCursor.onDidChange((e: CursorStateChangedEvent) => { events++; - assert.deepEqual(e.position, new Position(1, 2)); - }); - thisCursor.onDidChangeSelection((e: ICursorSelectionChangedEvent) => { - events++; - assert.deepEqual(e.selection, new Selection(1, 1, 1, 2)); + assert.deepEqual(e.selections, [new Selection(1, 1, 1, 2)]); }); moveTo(thisCursor, 1, 2, true); - assert.equal(events, 2, 'receives 2 events'); + assert.equal(events, 1, 'receives 1 event'); }); // --------- state save & restore @@ -698,39 +697,37 @@ suite('Editor Controller - Cursor', () => { }); test('column select 1', () => { - let model = Model.createFromString([ + withMockCodeEditor([ '\tprivate compute(a:number): boolean {', '\t\tif (a + 3 === 0 || a + 5 === 0) {', '\t\t\treturn false;', '\t\t}', '\t}' - ].join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + ], {}, (editor, cursor) => { - moveTo(cursor, 1, 7, false); - assertCursor(cursor, new Position(1, 7)); + moveTo(cursor, 1, 7, false); + assertCursor(cursor, new Position(1, 7)); + + CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(cursor, { + position: new Position(4, 4), + viewPosition: new Position(4, 4), + mouseColumn: 15 + }); + + let expectedSelections = [ + new Selection(1, 7, 1, 12), + new Selection(2, 4, 2, 9), + new Selection(3, 3, 3, 6), + new Selection(4, 4, 4, 4), + ]; + + assertCursor(cursor, expectedSelections); - CoreCommands.ColumnSelect.runCoreEditorCommand(cursor, { - position: new Position(4, 4), - viewPosition: new Position(4, 4), - mouseColumn: 15 }); - - let expectedSelections = [ - new Selection(1, 7, 1, 12), - new Selection(2, 4, 2, 9), - new Selection(3, 3, 3, 6), - new Selection(4, 4, 4, 4), - ]; - - assertCursor(cursor, expectedSelections); - - cursor.dispose(); - model.dispose(); }); test('issue #4905 - column select is biased to the right', () => { - let model = Model.createFromString([ + const model = Model.createFromString([ 'var gulp = require("gulp");', 'var path = require("path");', 'var rimraf = require("rimraf");', @@ -739,12 +736,14 @@ suite('Editor Controller - Cursor', () => { 'var concat = require("gulp-concat");', 'var newer = require("gulp-newer");', ].join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + const config = new TestConfiguration(null); + const viewModel = new ViewModel(0, config, model); + const cursor = new Cursor(config, model, viewModel); moveTo(cursor, 1, 4, false); assertCursor(cursor, new Position(1, 4)); - CoreCommands.ColumnSelect.runCoreEditorCommand(cursor, { + CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(cursor, { position: new Position(4, 1), viewPosition: new Position(4, 1), mouseColumn: 1 @@ -758,11 +757,13 @@ suite('Editor Controller - Cursor', () => { ]); cursor.dispose(); + viewModel.dispose(); + config.dispose(); model.dispose(); }); test('issue #20087: column select with mouse', () => { - let model = Model.createFromString([ + const model = Model.createFromString([ '', '', '', @@ -774,12 +775,14 @@ suite('Editor Controller - Cursor', () => { '', '', ].join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + const config = new TestConfiguration(null); + const viewModel = new ViewModel(0, config, model); + const cursor = new Cursor(config, model, viewModel); moveTo(cursor, 10, 10, false); assertCursor(cursor, new Position(10, 10)); - CoreCommands.ColumnSelect.runCoreEditorCommand(cursor, { + CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(cursor, { position: new Position(1, 1), viewPosition: new Position(1, 1), mouseColumn: 1 @@ -797,7 +800,7 @@ suite('Editor Controller - Cursor', () => { new Selection(1, 10, 1, 1), ]); - CoreCommands.ColumnSelect.runCoreEditorCommand(cursor, { + CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(cursor, { position: new Position(1, 1), viewPosition: new Position(1, 1), mouseColumn: 1 @@ -816,11 +819,13 @@ suite('Editor Controller - Cursor', () => { ]); cursor.dispose(); + viewModel.dispose(); + config.dispose(); model.dispose(); }); test('issue #20087: column select with keyboard', () => { - let model = Model.createFromString([ + const model = Model.createFromString([ '', '', '', @@ -832,43 +837,47 @@ suite('Editor Controller - Cursor', () => { '', '', ].join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + const config = new TestConfiguration(null); + const viewModel = new ViewModel(0, config, model); + const cursor = new Cursor(config, model, viewModel); moveTo(cursor, 10, 10, false); assertCursor(cursor, new Position(10, 10)); - CoreCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(10, 10, 10, 9) ]); - CoreCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(10, 10, 10, 8) ]); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(10, 10, 10, 9) ]); - CoreCommands.CursorColumnSelectUp.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectUp.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(10, 10, 10, 9), new Selection(9, 10, 9, 9), ]); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(10, 10, 10, 9) ]); cursor.dispose(); + viewModel.dispose(); + config.dispose(); model.dispose(); }); test('column select with keyboard', () => { - let model = Model.createFromString([ + const model = Model.createFromString([ 'var gulp = require("gulp");', 'var path = require("path");', 'var rimraf = require("rimraf");', @@ -877,33 +886,35 @@ suite('Editor Controller - Cursor', () => { 'var concat = require("gulp-concat");', 'var newer = require("gulp-newer");', ].join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + const config = new TestConfiguration(null); + const viewModel = new ViewModel(0, config, model); + const cursor = new Cursor(config, model, viewModel); moveTo(cursor, 1, 4, false); assertCursor(cursor, new Position(1, 4)); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 5) ]); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 5), new Selection(2, 4, 2, 5) ]); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 5), new Selection(2, 4, 2, 5), new Selection(3, 4, 3, 5), ]); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectDown.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 5), new Selection(2, 4, 2, 5), @@ -914,7 +925,7 @@ suite('Editor Controller - Cursor', () => { new Selection(7, 4, 7, 5), ]); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 6), new Selection(2, 4, 2, 6), @@ -926,16 +937,16 @@ suite('Editor Controller - Cursor', () => { ]); // 10 times - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 16), new Selection(2, 4, 2, 16), @@ -947,16 +958,16 @@ suite('Editor Controller - Cursor', () => { ]); // 10 times - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 26), new Selection(2, 4, 2, 26), @@ -968,8 +979,8 @@ suite('Editor Controller - Cursor', () => { ]); // 2 times => reaching the ending of lines 1 and 2 - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -981,10 +992,10 @@ suite('Editor Controller - Cursor', () => { ]); // 4 times => reaching the ending of line 3 - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -996,8 +1007,8 @@ suite('Editor Controller - Cursor', () => { ]); // 2 times => reaching the ending of line 4 - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1009,7 +1020,7 @@ suite('Editor Controller - Cursor', () => { ]); // 1 time => reaching the ending of line 7 - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1021,9 +1032,9 @@ suite('Editor Controller - Cursor', () => { ]); // 3 times => reaching the ending of lines 5 & 6 - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1035,7 +1046,7 @@ suite('Editor Controller - Cursor', () => { ]); // cannot go anywhere anymore - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1047,10 +1058,10 @@ suite('Editor Controller - Cursor', () => { ]); // cannot go anywhere anymore even if we insist - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); - CoreCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectRight.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1062,7 +1073,7 @@ suite('Editor Controller - Cursor', () => { ]); // can easily go back - CoreCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorColumnSelectLeft.runCoreEditorCommand(cursor, {}); assertCursor(cursor, [ new Selection(1, 4, 1, 28), new Selection(2, 4, 2, 28), @@ -1074,6 +1085,8 @@ suite('Editor Controller - Cursor', () => { ]); cursor.dispose(); + viewModel.dispose(); + config.dispose(); model.dispose(); }); }); @@ -1119,22 +1132,24 @@ class IndentRulesMode extends MockMode { suite('Editor Controller - Regression tests', () => { test('Bug 9121: Auto indent + undo + redo is funky', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ '' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: false - } - }, (model, cursor) => { + }, + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); assert.equal(model.getValue(EndOfLinePreference.LF), '\n', 'assert1'); - cursorCommand(cursor, H.Tab, {}); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t', 'assert2'); cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); @@ -1143,19 +1158,19 @@ suite('Editor Controller - Regression tests', () => { cursorCommand(cursor, H.Type, { text: 'x' }); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\n\tx', 'assert4'); - CoreCommands.CursorLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorLeft.runCoreEditorCommand(cursor, {}); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\n\tx', 'assert5'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\nx', 'assert6'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\tx', 'assert7'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert8'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert9'); cursorCommand(cursor, H.Undo, {}); @@ -1176,219 +1191,234 @@ suite('Editor Controller - Regression tests', () => { cursorCommand(cursor, H.Redo, {}); assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert15'); }); + + model.dispose(); }); - - test('bug #16543: Tab should indent to correct indentation spot immediately', () => { let mode = new OnEnterMode(IndentAction.Indent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'function baz() {', '\tfunction hello() { // something here', '\t', '', '\t}', '}' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - languageIdentifier: mode.getLanguageIdentifier(), - }, (model, cursor) => { + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 4, 1, false); assertCursor(cursor, new Selection(4, 1, 4, 1)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(4), '\t\t'); }); + + model.dispose(); mode.dispose(); }); test('bug #2938 (1): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { let mode = new OnEnterMode(IndentAction.Indent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ '\tfunction baz() {', '\t\tfunction hello() { // something here', '\t\t', '\t', '\t\t}', '\t}' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - languageIdentifier: mode.getLanguageIdentifier(), - }, (model, cursor) => { + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 4, 2, false); assertCursor(cursor, new Selection(4, 2, 4, 2)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(4), '\t\t\t'); }); + + model.dispose(); mode.dispose(); }); test('bug #2938 (2): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { let mode = new OnEnterMode(IndentAction.Indent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ '\tfunction baz() {', '\t\tfunction hello() { // something here', '\t\t', ' ', '\t\t}', '\t}' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - languageIdentifier: mode.getLanguageIdentifier(), - }, (model, cursor) => { + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 4, 1, false); assertCursor(cursor, new Selection(4, 1, 4, 1)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(4), '\t\t\t'); }); + + model.dispose(); mode.dispose(); }); test('bug #2938 (3): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { let mode = new OnEnterMode(IndentAction.Indent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ '\tfunction baz() {', '\t\tfunction hello() { // something here', '\t\t', '\t\t\t', '\t\t}', '\t}' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - languageIdentifier: mode.getLanguageIdentifier(), - }, (model, cursor) => { + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 4, 3, false); assertCursor(cursor, new Selection(4, 3, 4, 3)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(4), '\t\t\t\t'); }); + + model.dispose(); mode.dispose(); }); test('bug #2938 (4): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { let mode = new OnEnterMode(IndentAction.Indent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ '\tfunction baz() {', '\t\tfunction hello() { // something here', '\t\t', '\t\t\t\t', '\t\t}', '\t}' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - languageIdentifier: mode.getLanguageIdentifier(), - }, (model, cursor) => { + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 4, 4, false); assertCursor(cursor, new Selection(4, 4, 4, 4)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(4), '\t\t\t\t\t'); }); + + model.dispose(); mode.dispose(); }); - test('Bug 18276:[editor] Indentation broken when selection is empty', () => { - usingCursor({ - text: [ - 'function baz() {' - ], - modelOpts: { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - }, (model, cursor) => { - moveTo(cursor, 1, 2, false); - assertCursor(cursor, new Selection(1, 2, 1, 2)); - - cursorCommand(cursor, H.Indent, null, 'keyboard'); - assert.equal(model.getLineContent(1), '\tfunction baz() {'); - - assertCursor(cursor, new Selection(1, 3, 1, 3)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); - assert.equal(model.getLineContent(1), '\tf\tunction baz() {'); - }); - }); - test('bug #16815:Shift+Tab doesn\'t go back to tabstop', () => { let mode = new OnEnterMode(IndentAction.IndentOutdent); - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' function baz() {' - ], - languageIdentifier: mode.getLanguageIdentifier(), - modelOpts: { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: true, + tabSize: 4, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 1, 6, false); assertCursor(cursor, new Selection(1, 6, 1, 6)); - cursorCommand(cursor, H.Outdent, null, 'keyboard'); + CoreEditingCommands.Outdent.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' function baz() {'); assertCursor(cursor, new Selection(1, 5, 1, 5)); }); + + model.dispose(); mode.dispose(); }); test('Bug #18293:[regression][editor] Can\'t outdent whitespace line', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' ' - ], - modelOpts: { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: true, + tabSize: 4, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 1, 7, false); assertCursor(cursor, new Selection(1, 7, 1, 7)); - cursorCommand(cursor, H.Outdent, null, 'keyboard'); + CoreEditingCommands.Outdent.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' '); assertCursor(cursor, new Selection(1, 5, 1, 5)); }); + + model.dispose(); }); test('Bug #16657: [editor] Tab on empty line of zero indentation moves cursor to position (1,1)', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'function baz() {', '\tfunction hello() { // something here', '\t', @@ -1396,64 +1426,64 @@ suite('Editor Controller - Regression tests', () => { '\t}', '}', '' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true }, - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 7, 1, false); assertCursor(cursor, new Selection(7, 1, 7, 1)); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(7), '\t'); assertCursor(cursor, new Selection(7, 2, 7, 2)); }); + + model.dispose(); }); test('bug #16740: [editor] Cut line doesn\'t quite cut the last line', () => { + // Part 1 => there is text on the last line - let text = [ + withMockCodeEditor([ 'asdasd', 'qwerty' - ]; - let model = Model.createFromString(text.join('\n')); - let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + ], {}, (editor, cursor) => { + const model = editor.getModel(); - moveTo(cursor, 2, 1, false); - assertCursor(cursor, new Selection(2, 1, 2, 1)); + moveTo(cursor, 2, 1, false); + assertCursor(cursor, new Selection(2, 1, 2, 1)); - cursorCommand(cursor, H.Cut, null, 'keyboard'); - assert.equal(model.getLineCount(), 1); - assert.equal(model.getLineContent(1), 'asdasd'); + cursorCommand(cursor, H.Cut, null, 'keyboard'); + assert.equal(model.getLineCount(), 1); + assert.equal(model.getLineContent(1), 'asdasd'); - cursor.dispose(); - model.dispose(); + }); // Part 2 => there is no text on the last line - text = [ + withMockCodeEditor([ 'asdasd', '' - ]; - model = Model.createFromString(text.join('\n')); - cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true); + ], {}, (editor, cursor) => { + const model = editor.getModel(); - moveTo(cursor, 2, 1, false); - assertCursor(cursor, new Selection(2, 1, 2, 1)); + moveTo(cursor, 2, 1, false); + assertCursor(cursor, new Selection(2, 1, 2, 1)); - cursorCommand(cursor, H.Cut, null, 'keyboard'); - assert.equal(model.getLineCount(), 1); - assert.equal(model.getLineContent(1), 'asdasd'); + cursorCommand(cursor, H.Cut, null, 'keyboard'); + assert.equal(model.getLineCount(), 1); + assert.equal(model.getLineContent(1), 'asdasd'); - cursorCommand(cursor, H.Cut, null, 'keyboard'); - assert.equal(model.getLineCount(), 1); - assert.equal(model.getLineContent(1), ''); - - cursor.dispose(); - model.dispose(); + cursorCommand(cursor, H.Cut, null, 'keyboard'); + assert.equal(model.getLineCount(), 1); + assert.equal(model.getLineContent(1), ''); + }); }); test('Bug #11476: Double bracket surrounding + undo is broken', () => { @@ -1480,24 +1510,33 @@ suite('Editor Controller - Regression tests', () => { test('issue #1140: Backspace stops prematurely', () => { let mode = new SurroundingMode(); - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'function baz() {', ' return 1;', '};' - ], - languageIdentifier: mode.getLanguageIdentifier(), - modelOpts: { tabSize: 4, insertSpaces: true, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + tabSize: 4, + insertSpaces: true, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + }, + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 3, 2, false); moveTo(cursor, 1, 14, true); assertCursor(cursor, new Selection(3, 2, 1, 14)); - cursorCommand(cursor, H.DeleteLeft); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assertCursor(cursor, new Selection(1, 14, 1, 14)); assert.equal(model.getLineCount(), 1); assert.equal(model.getLineContent(1), 'function baz(;'); }); + + model.dispose(); mode.dispose(); }); @@ -1520,15 +1559,22 @@ suite('Editor Controller - Regression tests', () => { }); test('issue #3071: Investigate why undo stack gets corrupted', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'some lines', 'and more lines', 'just some text', - ], - languageIdentifier: null, - modelOpts: { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: true, + tabSize: 4, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 1, 1, false); moveTo(cursor, 3, 4, true); @@ -1540,7 +1586,7 @@ suite('Editor Controller - Regression tests', () => { } }); - cursorCommand(cursor, H.Tab); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getValue(), [ '\t just some text' ].join('\n'), '001'); @@ -1559,6 +1605,8 @@ suite('Editor Controller - Regression tests', () => { 'just some text', ].join('\n'), '003'); }); + + model.dispose(); }); test('issue #12950: Cannot Double Click To Insert Emoji Using OSX Emoji Panel', () => { @@ -1584,35 +1632,55 @@ suite('Editor Controller - Regression tests', () => { }); test('issue #3463: pressing tab adds spaces, but not as many as for a tab', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'function a() {', '\tvar a = {', '\t\tx: 3', '\t};', '}', - ], - modelOpts: { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: true, + tabSize: 4, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 3, 2, false); - cursorCommand(cursor, H.Tab); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(3), '\t \tx: 3'); }); + + model.dispose(); }); test('issue #4312: trying to type a tab character over a sequence of spaces results in unexpected behaviour', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'var foo = 123; // this is a comment', 'var bar = 4; // another comment' - ], - modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: false, + tabSize: 4, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 1, 15, false); moveTo(cursor, 1, 22, true); - cursorCommand(cursor, H.Tab); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), 'var foo = 123;\t// this is a comment'); }); + + model.dispose(); }); test('issue #832: word right', () => { @@ -1624,7 +1692,7 @@ suite('Editor Controller - Regression tests', () => { }, (model, cursor) => { moveTo(cursor, 1, 1, false); - function assertWordRight(col, expectedCol) { + function assertWordRight(col: number, expectedCol: number) { let args = { position: { lineNumber: 1, @@ -1632,9 +1700,9 @@ suite('Editor Controller - Regression tests', () => { } }; if (col === 1) { - CoreCommands.WordSelect.runCoreEditorCommand(cursor, args); + CoreNavigationCommands.WordSelect.runCoreEditorCommand(cursor, args); } else { - CoreCommands.WordSelectDrag.runCoreEditorCommand(cursor, args); + CoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(cursor, args); } assert.equal(cursor.getSelection().startColumn, 1, 'TEST FOR ' + col); @@ -1751,6 +1819,42 @@ suite('Editor Controller - Regression tests', () => { assert.equal(cursor.getSelections()[LINE_CNT - 1].startLineNumber, LINE_CNT); }); }); + + test('issue #23983: Calling model.setEOL does not reset cursor position', () => { + usingCursor({ + text: [ + 'first line', + 'second line' + ] + }, (model, cursor) => { + model.setEOL(EndOfLineSequence.CRLF); + + cursor.setSelections('test', [new Selection(2, 2, 2, 2)]); + model.setEOL(EndOfLineSequence.LF); + + assertCursor(cursor, new Selection(2, 2, 2, 2)); + }); + }); + + test('issue #23983: Calling model.setValue() resets cursor position', () => { + usingCursor({ + text: [ + 'first line', + 'second line' + ] + }, (model, cursor) => { + model.setEOL(EndOfLineSequence.CRLF); + + cursor.setSelections('test', [new Selection(2, 2, 2, 2)]); + model.setValue([ + 'different first line', + 'different second line', + 'new third line' + ].join('\n')); + + assertCursor(cursor, new Selection(1, 1, 1, 1)); + }); + }); }); suite('Editor Controller - Cursor Configuration', () => { @@ -1766,7 +1870,7 @@ suite('Editor Controller - Cursor Configuration', () => { ], modelOpts: { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } }, (model, cursor) => { - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(1, 21) }, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(1, 21), source: 'keyboard' }); cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); assert.equal(model.getLineContent(1), ' \tMy First Line\t '); assert.equal(model.getLineContent(2), ' '); @@ -1774,70 +1878,80 @@ suite('Editor Controller - Cursor Configuration', () => { }); test('Cursor honors insertSpaces configuration on tab', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' \tMy First Line\t ', 'My Second Line123', ' Third Line', '', '1' - ], - modelOpts: { insertSpaces: true, tabSize: 13, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ].join('\n'), + { + insertSpaces: true, + tabSize: 13, + detectIndentation: false, + defaultEOL: DefaultEndOfLine.LF, + trimAutoWhitespace: true + } + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { // Tab on column 1 - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 1) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 1) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), ' My Second Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 2 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 2) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 2) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'M y Second Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 3 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 3) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 3) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My Second Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 4 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 4) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 4) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My Second Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 5 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 5) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 5) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My S econd Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 5 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 5) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 5) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My S econd Line123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 13 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 13) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 13) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My Second Li ne123'); cursorCommand(cursor, H.Undo, null, 'keyboard'); // Tab on column 14 assert.equal(model.getLineContent(2), 'My Second Line123'); - cursorCommand(cursor, CoreCommands.MoveTo.id, { position: new Position(2, 14) }, 'keyboard'); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 14) }); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'My Second Lin e123'); }); + + model.dispose(); }); test('Enter auto-indents with insertSpaces setting 1', () => { @@ -1894,90 +2008,6 @@ suite('Editor Controller - Cursor Configuration', () => { mode.dispose(); }); - test('Insert line before', () => { - let testInsertLineBefore = (lineNumber: number, column: number, callback: (model: Model, cursor: Cursor) => void) => { - usingCursor({ - text: [ - 'First line', - 'Second line', - 'Third line' - ], - }, (model, cursor) => { - moveTo(cursor, lineNumber, column, false); - assertCursor(cursor, new Position(lineNumber, column)); - - cursorCommand(cursor, H.LineInsertBefore, null, 'keyboard'); - callback(model, cursor); - }); - }; - - testInsertLineBefore(1, 3, (model, cursor) => { - assertCursor(cursor, new Selection(1, 1, 1, 1)); - assert.equal(model.getLineContent(1), ''); - assert.equal(model.getLineContent(2), 'First line'); - assert.equal(model.getLineContent(3), 'Second line'); - assert.equal(model.getLineContent(4), 'Third line'); - }); - - testInsertLineBefore(2, 3, (model, cursor) => { - assertCursor(cursor, new Selection(2, 1, 2, 1)); - assert.equal(model.getLineContent(1), 'First line'); - assert.equal(model.getLineContent(2), ''); - assert.equal(model.getLineContent(3), 'Second line'); - assert.equal(model.getLineContent(4), 'Third line'); - }); - - testInsertLineBefore(3, 3, (model, cursor) => { - assertCursor(cursor, new Selection(3, 1, 3, 1)); - assert.equal(model.getLineContent(1), 'First line'); - assert.equal(model.getLineContent(2), 'Second line'); - assert.equal(model.getLineContent(3), ''); - assert.equal(model.getLineContent(4), 'Third line'); - }); - }); - - test('Insert line after', () => { - let testInsertLineAfter = (lineNumber: number, column: number, callback: (model: Model, cursor: Cursor) => void) => { - usingCursor({ - text: [ - 'First line', - 'Second line', - 'Third line' - ], - }, (model, cursor) => { - moveTo(cursor, lineNumber, column, false); - assertCursor(cursor, new Position(lineNumber, column)); - - cursorCommand(cursor, H.LineInsertAfter, null, 'keyboard'); - callback(model, cursor); - }); - }; - - testInsertLineAfter(1, 3, (model, cursor) => { - assertCursor(cursor, new Selection(2, 1, 2, 1)); - assert.equal(model.getLineContent(1), 'First line'); - assert.equal(model.getLineContent(2), ''); - assert.equal(model.getLineContent(3), 'Second line'); - assert.equal(model.getLineContent(4), 'Third line'); - }); - - testInsertLineAfter(2, 3, (model, cursor) => { - assertCursor(cursor, new Selection(3, 1, 3, 1)); - assert.equal(model.getLineContent(1), 'First line'); - assert.equal(model.getLineContent(2), 'Second line'); - assert.equal(model.getLineContent(3), ''); - assert.equal(model.getLineContent(4), 'Third line'); - }); - - testInsertLineAfter(3, 3, (model, cursor) => { - assertCursor(cursor, new Selection(4, 1, 4, 1)); - assert.equal(model.getLineContent(1), 'First line'); - assert.equal(model.getLineContent(2), 'Second line'); - assert.equal(model.getLineContent(3), 'Third line'); - assert.equal(model.getLineContent(4), ''); - }); - }); - test('removeAutoWhitespace off', () => { usingCursor({ text: [ @@ -2077,25 +2107,27 @@ suite('Editor Controller - Cursor Configuration', () => { }); test('removeAutoWhitespace on: removes only whitespace the cursor added 2', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' if (a) {', ' ', '', '', ' }' - ], - modelOpts: { + ].join('\n'), + { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { moveTo(cursor, 3, 1); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' if (a) {'); assert.equal(model.getLineContent(2), ' '); assert.equal(model.getLineContent(3), ' '); @@ -2103,7 +2135,7 @@ suite('Editor Controller - Cursor Configuration', () => { assert.equal(model.getLineContent(5), ' }'); moveTo(cursor, 4, 1); - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' if (a) {'); assert.equal(model.getLineContent(2), ' '); assert.equal(model.getLineContent(3), ''); @@ -2118,21 +2150,25 @@ suite('Editor Controller - Cursor Configuration', () => { assert.equal(model.getLineContent(4), ''); assert.equal(model.getLineContent(5), ' }something'); }); + + model.dispose(); }); test('removeAutoWhitespace on: test 1', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' some line abc ' - ], - modelOpts: { + ].join('\n'), + { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { // Move cursor to the end, verify that we do not trim whitespaces if line has values moveTo(cursor, 1, model.getLineContent(1).length + 1); @@ -2147,7 +2183,7 @@ suite('Editor Controller - Cursor Configuration', () => { assert.equal(model.getLineContent(3), ' '); // More whitespaces - cursorCommand(cursor, H.Tab, null, 'keyboard'); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' some line abc '); assert.equal(model.getLineContent(2), ''); assert.equal(model.getLineContent(3), ' '); @@ -2178,63 +2214,65 @@ suite('Editor Controller - Cursor Configuration', () => { assert.equal(model.getLineContent(4), ''); assert.equal(model.getLineContent(5), ''); }); + + model.dispose(); }); test('UseTabStops is off', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' x', ' a ', ' ' - ], - modelOpts: { + ].join('\n'), + { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true - }, - editorOpts: { - useTabStops: false } - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model, useTabStops: false }, (editor, cursor) => { // DeleteLeft removes just one whitespace moveTo(cursor, 2, 9); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), ' a '); }); + + model.dispose(); }); test('Backspace removes whitespaces with tab size', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ ' \t \t x', ' a ', ' ' - ], - modelOpts: { + ].join('\n'), + { insertSpaces: true, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true - }, - editorOpts: { - useTabStops: true } - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model, useTabStops: true }, (editor, cursor) => { // DeleteLeft does not remove tab size, because some text exists before moveTo(cursor, 2, model.getLineContent(2).length + 1); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), ' a '); // DeleteLeft removes tab size = 4 moveTo(cursor, 2, 9); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), ' a '); // DeleteLeft removes tab size = 4 - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), 'a '); // Undo DeleteLeft - get us back to original indentation @@ -2243,57 +2281,61 @@ suite('Editor Controller - Cursor Configuration', () => { // Nothing is broken when cursor is in (1,1) moveTo(cursor, 1, 1); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' \t \t x'); // DeleteLeft stops at tab stops even in mixed whitespace case moveTo(cursor, 1, 10); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' \t \t x'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' \t \tx'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), ' \tx'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(1), 'x'); // DeleteLeft on last line moveTo(cursor, 3, model.getLineContent(3).length + 1); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(3), ''); // DeleteLeft with removing new line symbol - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), 'x\n a '); // In case of selection DeleteLeft only deletes selected text moveTo(cursor, 2, 3); moveTo(cursor, 2, 4, true); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getLineContent(2), ' a '); }); + + model.dispose(); }); test('PR #5423: Auto indent + undo + redo is funky', () => { - usingCursor({ - text: [ + let model = Model.createFromString( + [ '' - ], - modelOpts: { + ].join('\n'), + { defaultEOL: DefaultEndOfLine.LF, detectIndentation: false, insertSpaces: false, tabSize: 4, trimAutoWhitespace: true } - }, (model, cursor) => { + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); assert.equal(model.getValue(EndOfLinePreference.LF), '\n', 'assert1'); - cursorCommand(cursor, H.Tab, {}); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t', 'assert2'); cursorCommand(cursor, H.Type, { text: 'y' }, 'keyboard'); @@ -2305,22 +2347,22 @@ suite('Editor Controller - Cursor Configuration', () => { cursorCommand(cursor, H.Type, { text: 'x' }); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\n\tx', 'assert4'); - CoreCommands.CursorLeft.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorLeft.runCoreEditorCommand(cursor, {}); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\n\tx', 'assert5'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\nx', 'assert6'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\tyx', 'assert7'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\n\tx', 'assert8'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert9'); - cursorCommand(cursor, H.DeleteLeft, {}); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert10'); cursorCommand(cursor, H.Undo, {}); @@ -2341,6 +2383,8 @@ suite('Editor Controller - Cursor Configuration', () => { cursorCommand(cursor, H.Redo, {}); assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert16'); }); + + model.dispose(); }); }); @@ -2719,11 +2763,13 @@ interface ICursorOpts { function usingCursor(opts: ICursorOpts, callback: (model: Model, cursor: Cursor) => void): void { let model = Model.createFromString(opts.text.join('\n'), opts.modelOpts, opts.languageIdentifier); let config = new TestConfiguration(opts.editorOpts); - let cursor = new Cursor(config, model, viewModelHelper(model), false); + let viewModel = new ViewModel(0, config, model); + let cursor = new Cursor(config, model, viewModel); callback(model, cursor); cursor.dispose(); + viewModel.dispose(); config.dispose(); model.dispose(); } @@ -3098,14 +3144,14 @@ suite('autoClosingPairs', () => { }, (model, cursor) => { let autoClosePositions = [ - 'var| a| =| [|];|', - 'var| b| =| |`asd|`;|', - 'var| c| =| !\'asd!\';|', - 'var| d| =| |"asd|";|', - 'var| e| =| /*3*/| 3;|', - 'var| f| =| /**| 3| */3;|', - 'var| g| =| (3+5|);|', - 'var| h| =| {| a:| !\'value!\'| |};|', + 'var a =| [|];|', + 'var b =| |`asd`;|', + 'var c =| !\'asd!\';|', + 'var d =| |"asd";|', + 'var e =| /*3*/| 3;|', + 'var f =| /**| 3 */3;|', + 'var g =| (3+5);|', + 'var h =| {| a:| !\'value!\'| |};|', ]; for (let i = 0, len = autoClosePositions.length; i < len; i++) { const lineNumber = i + 1; @@ -3125,6 +3171,64 @@ suite('autoClosingPairs', () => { mode.dispose(); }); + test('issue #25658 - Do not auto-close single/double quotes after word characters', () => { + let mode = new AutoClosingMode(); + usingCursor({ + text: [ + '', + ], + languageIdentifier: mode.getLanguageIdentifier() + }, (model, cursor) => { + + function typeCharacters(cursor: Cursor, chars: string): void { + for (let i = 0, len = chars.length; i < len; i++) { + cursorCommand(cursor, H.Type, { text: chars[i] }, 'keyboard'); + } + } + + // First gif + typeCharacters(cursor, 'teste1 = teste\' ok'); + assert.equal(model.getLineContent(1), 'teste1 = teste\' ok'); + + cursor.setSelections('test', [new Selection(1, 1000, 1, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste2 = teste \'ok'); + assert.equal(model.getLineContent(2), 'teste2 = teste \'ok\''); + + cursor.setSelections('test', [new Selection(2, 1000, 2, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste3 = teste" ok'); + assert.equal(model.getLineContent(3), 'teste3 = teste" ok'); + + cursor.setSelections('test', [new Selection(3, 1000, 3, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste4 = teste "ok'); + assert.equal(model.getLineContent(4), 'teste4 = teste "ok"'); + + // Second gif + cursor.setSelections('test', [new Selection(4, 1000, 4, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste \''); + assert.equal(model.getLineContent(5), 'teste \'\''); + + cursor.setSelections('test', [new Selection(5, 1000, 5, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste "'); + assert.equal(model.getLineContent(6), 'teste ""'); + + cursor.setSelections('test', [new Selection(6, 1000, 6, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste\''); + assert.equal(model.getLineContent(7), 'teste\''); + + cursor.setSelections('test', [new Selection(7, 1000, 7, 1000)]); + typeCharacters(cursor, '\n'); + typeCharacters(cursor, 'teste"'); + assert.equal(model.getLineContent(8), 'teste"'); + }); + mode.dispose(); + }); + test('issue #15825: accents on mac US intl keyboard', () => { let mode = new AutoClosingMode(); usingCursor({ @@ -3145,6 +3249,32 @@ suite('autoClosingPairs', () => { mode.dispose(); }); + test('issue #2773: Accents (´`¨^, others?) are inserted in the wrong position (Mac)', () => { + let mode = new AutoClosingMode(); + usingCursor({ + text: [ + 'hello', + 'world' + ], + languageIdentifier: mode.getLanguageIdentifier() + }, (model, cursor) => { + assertCursor(cursor, new Position(1, 1)); + + // Typing ` and pressing shift+down on the mac US intl kb layout + // Here we're just replaying what the cursor gets + cursorCommand(cursor, H.CompositionStart, null, 'keyboard'); + cursorCommand(cursor, H.Type, { text: '`' }, 'keyboard'); + moveDown(cursor, true); + cursorCommand(cursor, H.ReplacePreviousChar, { replaceCharCnt: 1, text: '`' }, 'keyboard'); + cursorCommand(cursor, H.ReplacePreviousChar, { replaceCharCnt: 1, text: '`' }, 'keyboard'); + cursorCommand(cursor, H.CompositionEnd, null, 'keyboard'); + + assert.equal(model.getValue(), '`hello\nworld'); + assertCursor(cursor, new Selection(1, 2, 2, 2)); + }); + mode.dispose(); + }); + test('issue #20891: All cursors should do the same thing', () => { let mode = new AutoClosingMode(); usingCursor({ @@ -3169,23 +3299,1014 @@ suite('autoClosingPairs', () => { test('All cursors should do the same thing when deleting left', () => { let mode = new AutoClosingMode(); - usingCursor({ - text: [ + let model = Model.createFromString( + [ 'var a = ()' - ], - languageIdentifier: mode.getLanguageIdentifier() - }, (model, cursor) => { + ].join('\n'), + TextModel.DEFAULT_CREATION_OPTIONS, + mode.getLanguageIdentifier() + ); + withMockCodeEditor(null, { model: model }, (editor, cursor) => { cursor.setSelections('test', [ new Selection(1, 4, 1, 4), new Selection(1, 10, 1, 10), ]); // delete left - cursorCommand(cursor, H.DeleteLeft, null, 'keyboard'); + CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null); assert.equal(model.getValue(), 'va a = )'); }); + model.dispose(); mode.dispose(); }); }); + + +suite('cursor screen reader message', () => { + + const _cursorWordLeft = new CursorWordLeft(); + const _cursorWordLeftSelect = new CursorWordLeftSelect(); + const _cursorWordRight = new CursorWordRight(); + const _cursorWordRightSelect = new CursorWordRightSelect(); + + function runEditorCommand(editor: ICommonCodeEditor, command: EditorCommand): void { + command.runEditorCommand(null, editor, null); + } + function moveWordLeft(editor: ICommonCodeEditor, inSelectionMode: boolean = false): void { + runEditorCommand(editor, inSelectionMode ? _cursorWordLeftSelect : _cursorWordLeft); + } + function moveWordRight(editor: ICommonCodeEditor, inSelectionMode: boolean = false): void { + runEditorCommand(editor, inSelectionMode ? _cursorWordRightSelect : _cursorWordRight); + } + + function assertScreenReaderMessage(lines: string[], initialSelection: Selection, expectedScreenReaderMessage: string, callback: (editor: MockCodeEditor, cursor: Cursor) => void): void { + withMockCodeEditor(lines, {}, (editor, cursor) => { + editor.setSelection(initialSelection); + + let actualScreenReaderMessage: string = null; + cursor.addEventListener((events: viewEvents.ViewEvent[]) => { + for (let i = 0, len = events.length; i < len; i++) { + const event = events[i]; + if (event.type === viewEvents.ViewEventType.ViewCursorStateChanged) { + actualScreenReaderMessage = event.screenReaderMessage; + } + } + }); + + callback(editor, cursor); + + // Disabled for now + assert.equal(actualScreenReaderMessage, null); + // assert.equal(actualScreenReaderMessage, expectedScreenReaderMessage); + }); + } + + suite('move down', () => { + test('start of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + 'How are you?\n', + (editor, cursor) => { + moveDown(cursor, false); + } + ); + }); + test('start of line no selection - last line', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 1, 2, 1), + 'I am good, thanks', + (editor, cursor) => { + moveDown(cursor, false); + } + ); + }); + test('middle of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 3, 1, 3), + 'How are you?\n', + (editor, cursor) => { + moveDown(cursor, false); + } + ); + }); + test('middle of line no selection - last line', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 3, 2, 3), + 'I am good, thanks', + (editor, cursor) => { + moveDown(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + ScreenReaderMessageGenerator.xSelected('Hello world!\n'), + (editor, cursor) => { + moveDown(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 6), + ScreenReaderMessageGenerator.xSelected(' world!\nHow a'), + (editor, cursor) => { + moveDown(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 1, 1), + ScreenReaderMessageGenerator.xUnselected('Hello world!\n'), + (editor, cursor) => { + moveDown(cursor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 1, 1), + 'I am good, thanks\nHello world!\nHow are you?\n\nUnselected', + (editor, cursor) => { + moveDown(cursor, false); + } + ); + }); + }); + + suite('move up', () => { + test('start of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 3, 1), + 'How are you?\n', + (editor, cursor) => { + moveUp(cursor, false); + } + ); + }); + test('start of line no selection - first line', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 1, 2, 1), + 'Hello world!\n', + (editor, cursor) => { + moveUp(cursor, false); + } + ); + }); + test('middle of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 3, 3, 3), + 'How are you?\n', + (editor, cursor) => { + moveUp(cursor, false); + } + ); + }); + test('middle of line no selection - last line', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 3, 2, 3), + 'Hello world!\n', + (editor, cursor) => { + moveUp(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 3, 1), + ScreenReaderMessageGenerator.xSelected('How are you?\n'), + (editor, cursor) => { + moveUp(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 6, 3, 1), + ScreenReaderMessageGenerator.xSelected('How are you?\n'), + (editor, cursor) => { + moveUp(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 3, 1), + ScreenReaderMessageGenerator.xUnselected('How are you?\n'), + (editor, cursor) => { + moveUp(cursor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 3, 1), + ScreenReaderMessageGenerator.xUnselected('Hello world!\nHow are you?\n'), + (editor, cursor) => { + moveUp(cursor, false); + } + ); + }); + }); + + suite('move right', () => { + test('start of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + 'e', + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + test('middle of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 2, 1, 2), + 'l', + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + test('end of line no selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 12), + '\n', + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + test('end of line no selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 13, 1, 13), + 'H', + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + test('end of file no selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 17, 3, 17), + '', + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + test('end of file no selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 18, 3, 18), + null, + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + ScreenReaderMessageGenerator.xSelected('H'), + (editor, cursor) => { + moveRight(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 7), + ScreenReaderMessageGenerator.xSelected('w'), + (editor, cursor) => { + moveRight(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 7, 1, 1), + ScreenReaderMessageGenerator.xUnselected('H'), + (editor, cursor) => { + moveRight(cursor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 8), + ScreenReaderMessageGenerator.xUnselected('Hello w'), + (editor, cursor) => { + moveRight(cursor, false); + } + ); + }); + }); + + suite('move left', () => { + test('end of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 18, 3, 18), + 's', + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + test('middle of line no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 4, 3, 4), + 'a', + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + test('start of line no selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 2, 3, 2), + 'I', + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + test('start of line no selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 3, 1), + '\n', + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + test('start of file no selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 2, 1, 2), + 'H', + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + test('start of file no selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + null, + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 6, 1, 6), + ScreenReaderMessageGenerator.xSelected('o'), + (editor, cursor) => { + moveLeft(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 6, 1, 5), + ScreenReaderMessageGenerator.xSelected('l'), + (editor, cursor) => { + moveLeft(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 6), + ScreenReaderMessageGenerator.xUnselected('o'), + (editor, cursor) => { + moveLeft(cursor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 2, 1, 8), + ScreenReaderMessageGenerator.xUnselected('ello w'), + (editor, cursor) => { + moveLeft(cursor, false); + } + ); + }); + }); + + suite('home', () => { + test('no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 18, 3, 18), + 'I', + (editor, cursor) => { + moveToBeginningOfLine(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 6, 1, 6), + ScreenReaderMessageGenerator.xSelected('Hello'), + (editor, cursor) => { + moveToBeginningOfLine(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 6, 1, 5), + ScreenReaderMessageGenerator.xSelected('Hell'), + (editor, cursor) => { + moveToBeginningOfLine(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 2, 4), + ScreenReaderMessageGenerator.xUnselected('How'), + (editor, cursor) => { + moveToBeginningOfLine(cursor, true); + } + ); + }); + + test('cancel a selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 8), + ScreenReaderMessageGenerator.xUnselected('Hello w'), + (editor, cursor) => { + moveToBeginningOfLine(cursor, false); + } + ); + }); + + test('cancel a selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 7, 1, 12), + ScreenReaderMessageGenerator.xUnselected('H\nworld'), + (editor, cursor) => { + moveToBeginningOfLine(cursor, false); + } + ); + }); + }); + + suite('end', () => { + test('no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + '\n', + (editor, cursor) => { + moveToEndOfLine(cursor, false); + } + ); + }); + + test('no selection at end of file', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 1, 3, 1), + '', + (editor, cursor) => { + moveToEndOfLine(cursor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 7, 1, 7), + ScreenReaderMessageGenerator.xSelected('world!'), + (editor, cursor) => { + moveToEndOfLine(cursor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 7), + ScreenReaderMessageGenerator.xSelected('world!'), + (editor, cursor) => { + moveToEndOfLine(cursor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 13, 1, 1), + ScreenReaderMessageGenerator.xUnselected('Hello world!'), + (editor, cursor) => { + moveToEndOfLine(cursor, true); + } + ); + }); + + test('cancel a selection 1', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 13, 1, 8), + ScreenReaderMessageGenerator.xUnselected('orld!'), + (editor, cursor) => { + moveToEndOfLine(cursor, false); + } + ); + }); + + test('cancel a selection 2', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 6), + ScreenReaderMessageGenerator.xUnselected('\n\nHello'), + (editor, cursor) => { + moveToEndOfLine(cursor, false); + } + ); + }); + }); + + suite('ctrl+right', () => { + test('no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + 'Hello', + (editor, cursor) => { + moveWordRight(editor, false); + } + ); + }); + + test('accross lines', () => { + assertScreenReaderMessage( + [ + 'Hello world', + 'How are you', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 12), + '\nHow', + (editor, cursor) => { + moveWordRight(editor, false); + } + ); + }); + + test('no selection at end of file', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(3, 12, 3, 12), + 'thanks', + (editor, cursor) => { + moveWordRight(editor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 1), + ScreenReaderMessageGenerator.xSelected('Hello'), + (editor, cursor) => { + moveWordRight(editor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 6), + ScreenReaderMessageGenerator.xSelected(' world'), + (editor, cursor) => { + moveWordRight(editor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 1), + ScreenReaderMessageGenerator.xUnselected('Hello'), + (editor, cursor) => { + moveWordRight(editor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 1, 2, 4), + ScreenReaderMessageGenerator.xUnselected(' are\nHow'), + (editor, cursor) => { + moveWordRight(editor, false); + } + ); + }); + }); + + suite('ctrl+left', () => { + test('no selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 12), + 'world', + (editor, cursor) => { + moveWordLeft(editor, false); + } + ); + }); + + test('accross lines', () => { + assertScreenReaderMessage( + [ + 'Hello world', + 'How are you', + 'I am good, thanks' + ], + new Selection(2, 1, 2, 1), + 'world\n', + (editor, cursor) => { + moveWordLeft(editor, false); + } + ); + }); + + test('no selection at start of file', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 6, 1, 6), + 'Hello', + (editor, cursor) => { + moveWordLeft(editor, false); + } + ); + }); + + test('begin a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 12), + ScreenReaderMessageGenerator.xSelected('world'), + (editor, cursor) => { + moveWordLeft(editor, true); + } + ); + }); + + test('increase a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 12, 1, 7), + ScreenReaderMessageGenerator.xSelected('Hello '), + (editor, cursor) => { + moveWordLeft(editor, true); + } + ); + }); + + test('decrease a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(1, 1, 1, 12), + ScreenReaderMessageGenerator.xUnselected('world'), + (editor, cursor) => { + moveWordLeft(editor, true); + } + ); + }); + + test('cancel a selection', () => { + assertScreenReaderMessage( + [ + 'Hello world!', + 'How are you?', + 'I am good, thanks' + ], + new Selection(2, 4, 2, 1), + ScreenReaderMessageGenerator.xUnselected('!\n\nHow'), + (editor, cursor) => { + moveWordLeft(editor, false); + } + ); + }); + }); + + +}); diff --git a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts index c1388ba58e8..2b9ac20069d 100644 --- a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts +++ b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts @@ -7,22 +7,19 @@ import * as assert from 'assert'; import { Cursor } from 'vs/editor/common/controller/cursor'; import { Position } from 'vs/editor/common/core/position'; -import { ITextModelCreationOptions } from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; -import { IMode } from 'vs/editor/common/modes'; import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { viewModelHelper as aViewModelHelper } from 'vs/editor/test/common/editorTestUtils'; import { CursorMove } from 'vs/editor/common/controller/cursorMoveCommands'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IViewModelHelper } from 'vs/editor/common/controller/cursorCommon'; -import { CoreCommands } from 'vs/editor/common/controller/coreCommands'; +import { CoreNavigationCommands } from 'vs/editor/common/controller/coreCommands'; +import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; suite('Cursor move command test', () => { let thisModel: Model; let thisConfiguration: TestConfiguration; + let thisViewModel: ViewModel; let thisCursor: Cursor; setup(() => { @@ -36,16 +33,18 @@ suite('Cursor move command test', () => { thisModel = Model.createFromString(text); thisConfiguration = new TestConfiguration(null); + thisViewModel = new ViewModel(0, thisConfiguration, thisModel); + thisCursor = new Cursor(thisConfiguration, thisModel, thisViewModel); }); teardown(() => { thisCursor.dispose(); + thisViewModel.dispose(); thisModel.dispose(); thisConfiguration.dispose(); }); test('move left should move to left character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveLeft(thisCursor); @@ -54,7 +53,6 @@ suite('Cursor move command test', () => { }); test('move left should move to left by n characters', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveLeft(thisCursor, 3); @@ -63,7 +61,6 @@ suite('Cursor move command test', () => { }); test('move left should move to left by half line', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveLeft(thisCursor, 1, CursorMove.RawUnit.HalfLine); @@ -72,7 +69,6 @@ suite('Cursor move command test', () => { }); test('move left moves to previous line', () => { - thisCursor = aCursor(); moveTo(thisCursor, 2, 3); moveLeft(thisCursor, 10); @@ -81,7 +77,6 @@ suite('Cursor move command test', () => { }); test('move right should move to right character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 5); moveRight(thisCursor); @@ -90,7 +85,6 @@ suite('Cursor move command test', () => { }); test('move right should move to right by n characters', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 2); moveRight(thisCursor, 6); @@ -99,7 +93,6 @@ suite('Cursor move command test', () => { }); test('move right should move to right by half line', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 4); moveRight(thisCursor, 1, CursorMove.RawUnit.HalfLine); @@ -108,7 +101,6 @@ suite('Cursor move command test', () => { }); test('move right moves to next line', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveRight(thisCursor, 100); @@ -117,14 +109,12 @@ suite('Cursor move command test', () => { }); test('move to first character of line from middle', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveToLineStart(thisCursor); cursorEqual(thisCursor, 1, 1); }); test('move to first character of line from first non white space character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 6); moveToLineStart(thisCursor); @@ -133,7 +123,6 @@ suite('Cursor move command test', () => { }); test('move to first character of line from first character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 1); moveToLineStart(thisCursor); @@ -142,7 +131,6 @@ suite('Cursor move command test', () => { }); test('move to first non white space character of line from middle', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveToLineFirstNonWhiteSpaceCharacter(thisCursor); @@ -151,7 +139,6 @@ suite('Cursor move command test', () => { }); test('move to first non white space character of line from first non white space character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 6); moveToLineFirstNonWhiteSpaceCharacter(thisCursor); @@ -160,7 +147,6 @@ suite('Cursor move command test', () => { }); test('move to first non white space character of line from first character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 1); moveToLineFirstNonWhiteSpaceCharacter(thisCursor); @@ -169,7 +155,6 @@ suite('Cursor move command test', () => { }); test('move to end of line from middle', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveToLineEnd(thisCursor); @@ -178,7 +163,6 @@ suite('Cursor move command test', () => { }); test('move to end of line from last non white space character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 19); moveToLineEnd(thisCursor); @@ -187,7 +171,6 @@ suite('Cursor move command test', () => { }); test('move to end of line from line end', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 21); moveToLineEnd(thisCursor); @@ -196,7 +179,6 @@ suite('Cursor move command test', () => { }); test('move to last non white space character from middle', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveToLineLastNonWhiteSpaceCharacter(thisCursor); @@ -205,7 +187,6 @@ suite('Cursor move command test', () => { }); test('move to last non white space character from last non white space character', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 19); moveToLineLastNonWhiteSpaceCharacter(thisCursor); @@ -214,7 +195,6 @@ suite('Cursor move command test', () => { }); test('move to last non white space character from line end', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 21); moveToLineLastNonWhiteSpaceCharacter(thisCursor); @@ -223,7 +203,6 @@ suite('Cursor move command test', () => { }); test('move to center of line not from center', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 8); moveToLineCenter(thisCursor); @@ -232,7 +211,6 @@ suite('Cursor move command test', () => { }); test('move to center of line from center', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 11); moveToLineCenter(thisCursor); @@ -241,7 +219,6 @@ suite('Cursor move command test', () => { }); test('move to center of line from start', () => { - thisCursor = aCursor(); moveToLineStart(thisCursor); moveToLineCenter(thisCursor); @@ -250,7 +227,6 @@ suite('Cursor move command test', () => { }); test('move to center of line from end', () => { - thisCursor = aCursor(); moveToLineEnd(thisCursor); moveToLineCenter(thisCursor); @@ -259,7 +235,6 @@ suite('Cursor move command test', () => { }); test('move up by cursor move command', () => { - thisCursor = aCursor(); moveTo(thisCursor, 3, 5); cursorEqual(thisCursor, 3, 5); @@ -272,7 +247,6 @@ suite('Cursor move command test', () => { }); test('move up by model line cursor move command', () => { - thisCursor = aCursor(); moveTo(thisCursor, 3, 5); cursorEqual(thisCursor, 3, 5); @@ -285,7 +259,6 @@ suite('Cursor move command test', () => { }); test('move down by model line cursor move command', () => { - thisCursor = aCursor(); moveTo(thisCursor, 3, 5); cursorEqual(thisCursor, 3, 5); @@ -298,7 +271,6 @@ suite('Cursor move command test', () => { }); test('move up with selection by cursor move command', () => { - thisCursor = aCursor(); moveTo(thisCursor, 3, 5); cursorEqual(thisCursor, 3, 5); @@ -311,7 +283,6 @@ suite('Cursor move command test', () => { }); test('move up and down with tabs by cursor move command', () => { - thisCursor = aCursor(); moveTo(thisCursor, 1, 5); cursorEqual(thisCursor, 1, 5); @@ -333,7 +304,6 @@ suite('Cursor move command test', () => { }); test('move up and down with end of lines starting from a long one by cursor move command', () => { - thisCursor = aCursor(); moveToEndOfLine(thisCursor); cursorEqual(thisCursor, 1, 21); @@ -355,9 +325,7 @@ suite('Cursor move command test', () => { }); test('move to view top line moves to first visible line if it is first line', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(1, 1, 10, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(1, 1, 10, 1); moveTo(thisCursor, 2, 2); moveToTop(thisCursor); @@ -366,9 +334,7 @@ suite('Cursor move command test', () => { }); test('move to view top line moves to top visible line when first line is not visible', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(2, 1, 10, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(2, 1, 10, 1); moveTo(thisCursor, 4, 1); moveToTop(thisCursor); @@ -377,9 +343,7 @@ suite('Cursor move command test', () => { }); test('move to view top line moves to nth line from top', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(1, 1, 10, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(1, 1, 10, 1); moveTo(thisCursor, 4, 1); moveToTop(thisCursor, 3); @@ -388,9 +352,7 @@ suite('Cursor move command test', () => { }); test('move to view top line moves to last line if n is greater than last visible line number', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(1, 1, 3, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(1, 1, 3, 1); moveTo(thisCursor, 2, 2); moveToTop(thisCursor, 4); @@ -399,9 +361,7 @@ suite('Cursor move command test', () => { }); test('move to view center line moves to the center line', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(3, 1, 3, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(3, 1, 3, 1); moveTo(thisCursor, 2, 2); moveToCenter(thisCursor); @@ -410,9 +370,7 @@ suite('Cursor move command test', () => { }); test('move to view bottom line moves to last visible line if it is last line', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(1, 1, 5, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(1, 1, 5, 1); moveTo(thisCursor, 2, 2); moveToBottom(thisCursor); @@ -421,9 +379,7 @@ suite('Cursor move command test', () => { }); test('move to view bottom line moves to last visible line when last line is not visible', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(2, 1, 3, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(2, 1, 3, 1); moveTo(thisCursor, 2, 2); moveToBottom(thisCursor); @@ -432,9 +388,7 @@ suite('Cursor move command test', () => { }); test('move to view bottom line moves to nth line from bottom', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(1, 1, 5, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(1, 1, 5, 1); moveTo(thisCursor, 4, 1); moveToBottom(thisCursor, 3); @@ -443,33 +397,19 @@ suite('Cursor move command test', () => { }); test('move to view bottom line moves to first line if n is lesser than first visible line number', () => { - let viewModelHelper = aViewModelHelper(thisModel); - viewModelHelper.getCompletelyVisibleViewRange = () => new Range(2, 1, 5, 1); - thisCursor = aCursor(viewModelHelper); + thisViewModel.getCompletelyVisibleViewRange = () => new Range(2, 1, 5, 1); moveTo(thisCursor, 4, 1); moveToBottom(thisCursor, 5); cursorEqual(thisCursor, 2, 2); }); - - function aCursor(viewModelHelper?: IViewModelHelper): Cursor { - return new Cursor(thisConfiguration, thisModel, viewModelHelper || aViewModelHelper(thisModel), false); - } - }); -interface ICursorOpts { - text: string[]; - mode?: IMode; - modelOpts?: ITextModelCreationOptions; - editorOpts?: IEditorOptions; -} - // Move command function move(cursor: Cursor, args: any) { - CoreCommands.CursorMove.runCoreEditorCommand(cursor, args); + CoreNavigationCommands.CursorMove.runCoreEditorCommand(cursor, args); } function moveToLineStart(cursor: Cursor) { @@ -553,11 +493,11 @@ function selectionEqual(selection: Selection, posLineNumber: number, posColumn: function moveTo(cursor: Cursor, lineNumber: number, column: number, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.MoveToSelect.runCoreEditorCommand(cursor, { + CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(cursor, { position: new Position(lineNumber, column) }); } else { - CoreCommands.MoveTo.runCoreEditorCommand(cursor, { + CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(lineNumber, column) }); } @@ -565,8 +505,8 @@ function moveTo(cursor: Cursor, lineNumber: number, column: number, inSelectionM function moveToEndOfLine(cursor: Cursor, inSelectionMode: boolean = false) { if (inSelectionMode) { - CoreCommands.CursorEndSelect.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorEndSelect.runCoreEditorCommand(cursor, {}); } else { - CoreCommands.CursorEnd.runCoreEditorCommand(cursor, {}); + CoreNavigationCommands.CursorEnd.runCoreEditorCommand(cursor, {}); } } diff --git a/src/vs/editor/test/common/controller/textAreaState.test.ts b/src/vs/editor/test/common/controller/textAreaState.test.ts deleted file mode 100644 index 6da10786e1f..00000000000 --- a/src/vs/editor/test/common/controller/textAreaState.test.ts +++ /dev/null @@ -1,483 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { IENarratorTextAreaState, ISimpleModel, TextAreaState } from 'vs/editor/common/controller/textAreaState'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; -import { MockTextAreaWrapper } from 'vs/editor/test/common/mocks/mockTextAreaWrapper'; - -suite('TextAreaState', () => { - - function assertTextAreaState(actual: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean, selectionToken: number): void { - let desired = new IENarratorTextAreaState(null, value, selectionStart, selectionEnd, isInOverwriteMode, selectionToken); - assert.ok(desired.equals(actual), desired.toString() + ' == ' + actual.toString()); - } - - test('fromTextArea', () => { - let textArea = new MockTextAreaWrapper(); - textArea._value = 'Hello world!'; - textArea._selectionStart = 1; - textArea._selectionEnd = 12; - textArea._isInOverwriteMode = false; - let actual = IENarratorTextAreaState.EMPTY.fromTextArea(textArea); - - assertTextAreaState(actual, 'Hello world!', 1, 12, false, 0); - assert.equal(actual.getValue(), 'Hello world!'); - assert.equal(actual.getSelectionStart(), 1); - - actual = actual.resetSelection(); - assertTextAreaState(actual, 'Hello world!', 12, 12, false, 0); - - textArea.dispose(); - }); - - test('applyToTextArea', () => { - let textArea = new MockTextAreaWrapper(); - textArea._value = 'Hello world!'; - textArea._selectionStart = 1; - textArea._selectionEnd = 12; - textArea._isInOverwriteMode = false; - - let state = new IENarratorTextAreaState(null, 'Hi world!', 2, 2, false, 0); - state.applyToTextArea('test', textArea, false); - - assert.equal(textArea._value, 'Hi world!'); - assert.equal(textArea._selectionStart, 9); - assert.equal(textArea._selectionEnd, 9); - - state = new IENarratorTextAreaState(null, 'Hi world!', 3, 3, false, 0); - state.applyToTextArea('test', textArea, false); - - assert.equal(textArea._value, 'Hi world!'); - assert.equal(textArea._selectionStart, 9); - assert.equal(textArea._selectionEnd, 9); - - state = new IENarratorTextAreaState(null, 'Hi world!', 0, 2, false, 0); - state.applyToTextArea('test', textArea, true); - - assert.equal(textArea._value, 'Hi world!'); - assert.equal(textArea._selectionStart, 0); - assert.equal(textArea._selectionEnd, 2); - - textArea.dispose(); - }); - - function testDeduceInput(prevState: TextAreaState, value: string, selectionStart: number, selectionEnd: number, isInOverwriteMode: boolean, expected: string, expectedCharReplaceCnt: number): void { - let textArea = new MockTextAreaWrapper(); - textArea._value = value; - textArea._selectionStart = selectionStart; - textArea._selectionEnd = selectionEnd; - textArea._isInOverwriteMode = isInOverwriteMode; - - let newState = (prevState || IENarratorTextAreaState.EMPTY).fromTextArea(textArea); - - let actual = newState.deduceInput(); - - assert.equal(actual.text, expected); - assert.equal(actual.replaceCharCnt, expectedCharReplaceCnt); - - textArea.dispose(); - } - - test('deduceInput - Japanese typing sennsei and accepting', () => { - // manual test: - // - choose keyboard layout: Japanese -> Hiragama - // - type sennsei - // - accept with Enter - // - expected: ã›ã‚“ã›ã„ - - // s - // PREVIOUS STATE: [ <>, selectionStart: 0, selectionEnd: 0, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <s>, selectionStart: 0, selectionEnd: 1, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, '', 0, 0, false, 0), - 's', - 0, 1, false, - 's', 0 - ); - - // e - // PREVIOUS STATE: [ <s>, selectionStart: 0, selectionEnd: 1, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›>, selectionStart: 0, selectionEnd: 1, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 's', 0, 1, false, 0), - 'ã›', - 0, 1, false, - 'ã›', 1 - ); - - // n - // PREVIOUS STATE: [ <ã›>, selectionStart: 0, selectionEnd: 1, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ï½Ž>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›', 0, 1, false, 0), - 'ã›ï½Ž', - 0, 2, false, - 'ã›ï½Ž', 1 - ); - - // n - // PREVIOUS STATE: [ <ã›ï½Ž>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ï½Ž', 0, 2, false, 0), - 'ã›ã‚“', - 0, 2, false, - 'ã›ã‚“', 2 - ); - - // s - // PREVIOUS STATE: [ <ã›ã‚“>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“s>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“', 0, 2, false, 0), - 'ã›ã‚“s', - 0, 3, false, - 'ã›ã‚“s', 2 - ); - - // e - // PREVIOUS STATE: [ <ã›ã‚“s>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“s', 0, 3, false, 0), - 'ã›ã‚“ã›', - 0, 3, false, - 'ã›ã‚“ã›', 3 - ); - - // no-op? [was recorded] - // PREVIOUS STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“ã›', 0, 3, false, 0), - 'ã›ã‚“ã›', - 0, 3, false, - 'ã›ã‚“ã›', 3 - ); - - // i - // PREVIOUS STATE: [ <ã›ã‚“ã›>, selectionStart: 0, selectionEnd: 3, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“ã›', 0, 3, false, 0), - 'ã›ã‚“ã›ã„', - 0, 4, false, - 'ã›ã‚“ã›ã„', 3 - ); - - // ENTER (accept) - // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 4, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“ã›ã„', 0, 4, false, 0), - 'ã›ã‚“ã›ã„', - 4, 4, false, - '', 0 - ); - }); - - test('deduceInput - Japanese typing sennsei and choosing different suggestion', () => { - // manual test: - // - choose keyboard layout: Japanese -> Hiragama - // - type sennsei - // - arrow down (choose next suggestion) - // - accept with Enter - // - expected: ã›ã‚“ã›ã„ - - // sennsei - // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“ã›ã„', 0, 4, false, 0), - 'ã›ã‚“ã›ã„', - 0, 4, false, - 'ã›ã‚“ã›ã„', 4 - ); - - // arrow down - // CURRENT STATE: [ <先生>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - // PREVIOUS STATE: [ <ã›ã‚“ã›ã„>, selectionStart: 0, selectionEnd: 4, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, 'ã›ã‚“ã›ã„', 0, 4, false, 0), - '先生', - 0, 2, false, - '先生', 4 - ); - - // ENTER (accept) - // PREVIOUS STATE: [ <先生>, selectionStart: 0, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - // CURRENT STATE: [ <先生>, selectionStart: 2, selectionEnd: 2, isInOverwriteMode: false, selectionToken: 0] - testDeduceInput( - new IENarratorTextAreaState(null, '先生', 0, 2, false, 0), - '先生', - 2, 2, false, - '', 0 - ); - }); - - test('extractNewText - no previous state with selection', () => { - testDeduceInput( - null, - 'a', - 0, 1, false, - 'a', 0 - ); - }); - - test('issue #2586: Replacing selected end-of-line with newline locks up the document', () => { - testDeduceInput( - new IENarratorTextAreaState(null, ']\n', 1, 2, false, 0), - ']\n', - 2, 2, false, - '\n', 0 - ); - }); - - test('extractNewText - no previous state without selection', () => { - testDeduceInput( - null, - 'a', - 1, 1, false, - 'a', 0 - ); - }); - - test('extractNewText - typing does not cause a selection', () => { - testDeduceInput( - new IENarratorTextAreaState(null, '', 0, 0, false, 0), - 'a', - 0, 1, false, - 'a', 0 - ); - }); - - test('extractNewText - had the textarea empty', () => { - testDeduceInput( - new IENarratorTextAreaState(null, '', 0, 0, false, 0), - 'a', - 1, 1, false, - 'a', 0 - ); - }); - - test('extractNewText - had the entire line selected', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 0, 12, false, 0), - 'H', - 1, 1, false, - 'H', 0 - ); - }); - - test('extractNewText - had previous text 1', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 12, 12, false, 0), - 'Hello world!a', - 13, 13, false, - 'a', 0 - ); - }); - - test('extractNewText - had previous text 2', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 0, 0, false, 0), - 'aHello world!', - 1, 1, false, - 'a', 0 - ); - }); - - test('extractNewText - had previous text 3', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 6, 11, false, 0), - 'Hello other!', - 11, 11, false, - 'other', 0 - ); - }); - - test('extractNewText - IME', () => { - testDeduceInput( - new IENarratorTextAreaState(null, '', 0, 0, false, 0), - 'ã“れã¯', - 3, 3, false, - 'ã“れã¯', 0 - ); - }); - - test('extractNewText - isInOverwriteMode', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 0, 0, false, 0), - 'Aello world!', - 1, 1, true, - 'A', 0 - ); - }); - - test('extractMacReplacedText - does nothing if there is selection', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 5, 5, false, 0), - 'Hellö world!', - 4, 5, false, - 'ö', 0 - ); - }); - - test('extractMacReplacedText - does nothing if there is more than one extra char', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 5, 5, false, 0), - 'Hellöö world!', - 5, 5, false, - 'öö', 1 - ); - }); - - test('extractMacReplacedText - does nothing if there is more than one changed char', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 5, 5, false, 0), - 'Helöö world!', - 5, 5, false, - 'öö', 2 - ); - }); - - test('extractMacReplacedText', () => { - testDeduceInput( - new IENarratorTextAreaState(null, 'Hello world!', 5, 5, false, 0), - 'Hellö world!', - 5, 5, false, - 'ö', 1 - ); - }); - - function testFromEditorSelectionAndPreviousState(eol: string, lines: string[], range: Range, prevSelectionToken: number): TextAreaState { - let model = new SimpleModel(lines, eol); - let previousState = new IENarratorTextAreaState(null, '', 0, 0, false, prevSelectionToken); - return previousState.fromEditorSelection(model, range); - } - - test('fromEditorSelectionAndPreviousState - no selection on first line', () => { - let actual = testFromEditorSelectionAndPreviousState('\n', [ - 'Just a line', - 'And another line' - ], new Range(1, 1, 1, 1), 0); - assertTextAreaState(actual, 'Just a line', 0, 11, false, 1); - }); - - test('fromEditorSelectionAndPreviousState - no selection on second line', () => { - let actual = testFromEditorSelectionAndPreviousState('\n', [ - 'Just a line', - 'And another line', - 'And yet another line', - ], new Range(2, 1, 2, 1), 0); - assertTextAreaState(actual, 'And another line', 0, 16, false, 2); - }); - - test('fromEditorSelectionAndPreviousState - on a long line with selectionToken mismatch', () => { - let aLongLine = 'a'; - for (let i = 0; i < 10; i++) { - aLongLine = aLongLine + aLongLine; - } - let actual = testFromEditorSelectionAndPreviousState('\n', [ - 'Just a line', - aLongLine, - 'And yet another line', - ], new Range(2, 500, 2, 500), 0); - assertTextAreaState(actual, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 0, 201, false, 2); - }); - - test('fromEditorSelectionAndPreviousState - on a long line with same selectionToken', () => { - let aLongLine = 'a'; - for (let i = 0; i < 10; i++) { - aLongLine = aLongLine + aLongLine; - } - let actual = testFromEditorSelectionAndPreviousState('\n', [ - 'Just a line', - aLongLine, - 'And yet another line', - ], new Range(2, 500, 2, 500), 2); - assertTextAreaState(actual, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 100, 100, false, 2); - }); -}); - -class SimpleModel implements ISimpleModel { - - private _lines: string[]; - private _eol: string; - - public coordinatesConverter = { - convertViewPositionToModelPosition: (viewPosition: Position): Position => { - return viewPosition; - } - }; - - constructor(lines: string[], eol: string) { - this._lines = lines; - this._eol = eol; - } - - public getLineMaxColumn(lineNumber: number): number { - return this._lines[lineNumber - 1].length + 1; - } - - private _getEndOfLine(eol: EndOfLinePreference): string { - switch (eol) { - case EndOfLinePreference.LF: - return '\n'; - case EndOfLinePreference.CRLF: - return '\r\n'; - case EndOfLinePreference.TextDefined: - return this._eol; - } - throw new Error('Unknown EOL preference'); - } - - public getEOL(): string { - return this._eol; - } - - public getValueInRange(range: Range, eol: EndOfLinePreference): string { - if (Range.isEmpty(range)) { - return ''; - } - - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - - var lineEnding = this._getEndOfLine(eol), - startLineIndex = range.startLineNumber - 1, - endLineIndex = range.endLineNumber - 1, - resultLines: string[] = []; - - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - - return resultLines.join(lineEnding); - } - - public getModelLineContent(lineNumber: number): string { - return this._lines[lineNumber - 1]; - } - - public getLineCount(): number { - return this._lines.length; - } - - public getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string { - return ''; - } - - public getHTMLToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string { - return ''; - } -} diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts index 90349d7b7b0..3bb149dcf53 100644 --- a/src/vs/editor/test/common/diff/diffComputer.test.ts +++ b/src/vs/editor/test/common/diff/diffComputer.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import { DiffComputer } from 'vs/editor/common/diff/diffComputer'; import { IChange, ICharChange, ILineChange } from 'vs/editor/common/editorCommon'; -function extractCharChangeRepresentation(change, expectedChange): ICharChange { +function extractCharChangeRepresentation(change: ICharChange, expectedChange: ICharChange): ICharChange { var hasOriginal = expectedChange && expectedChange.originalStartLineNumber > 0; var hasModified = expectedChange && expectedChange.modifiedStartLineNumber > 0; return { @@ -24,7 +24,7 @@ function extractCharChangeRepresentation(change, expectedChange): ICharChange { }; } -function extractLineChangeRepresentation(change, expectedChange): IChange | ILineChange { +function extractLineChangeRepresentation(change: ILineChange, expectedChange: ILineChange): IChange | ILineChange { if (change.charChanges) { let charChanges: ICharChange[] = []; for (let i = 0; i < change.charChanges.length; i++) { @@ -61,12 +61,12 @@ function assertDiff(originalLines: string[], modifiedLines: string[], expectedCh var extracted = []; for (var i = 0; i < changes.length; i++) { - extracted.push(extractLineChangeRepresentation(changes[i], i < expectedChanges.length ? expectedChanges[i] : null)); + extracted.push(extractLineChangeRepresentation(changes[i], (i < expectedChanges.length ? expectedChanges[i] : null))); } assert.deepEqual(extracted, expectedChanges); } -function createLineDeletion(startLineNumber, endLineNumber, modifiedLineNumber): IChange { +function createLineDeletion(startLineNumber: number, endLineNumber: number, modifiedLineNumber: number): IChange { return { originalStartLineNumber: startLineNumber, originalEndLineNumber: endLineNumber, @@ -75,7 +75,7 @@ function createLineDeletion(startLineNumber, endLineNumber, modifiedLineNumber): }; } -function createLineInsertion(startLineNumber, endLineNumber, originalLineNumber): IChange { +function createLineInsertion(startLineNumber: number, endLineNumber: number, originalLineNumber: number): IChange { return { originalStartLineNumber: originalLineNumber, originalEndLineNumber: 0, @@ -84,7 +84,7 @@ function createLineInsertion(startLineNumber, endLineNumber, originalLineNumber) }; } -function createLineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges): ILineChange { +function createLineChange(originalStartLineNumber: number, originalEndLineNumber: number, modifiedStartLineNumber: number, modifiedEndLineNumber: number, charChanges: ICharChange[]): ILineChange { return { originalStartLineNumber: originalStartLineNumber, originalEndLineNumber: originalEndLineNumber, @@ -94,7 +94,7 @@ function createLineChange(originalStartLineNumber, originalEndLineNumber, modifi }; } -function createCharInsertion(startLineNumber, startColumn, endLineNumber, endColumn) { +function createCharInsertion(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) { return { originalStartLineNumber: 0, originalStartColumn: 0, @@ -107,7 +107,7 @@ function createCharInsertion(startLineNumber, startColumn, endLineNumber, endCol }; } -function createCharDeletion(startLineNumber, startColumn, endLineNumber, endColumn) { +function createCharDeletion(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) { return { originalStartLineNumber: startLineNumber, originalStartColumn: startColumn, @@ -120,8 +120,10 @@ function createCharDeletion(startLineNumber, startColumn, endLineNumber, endColu }; } -function createCharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, - modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { +function createCharChange( + originalStartLineNumber: number, originalStartColumn: number, originalEndLineNumber: number, originalEndColumn: number, + modifiedStartLineNumber: number, modifiedStartColumn: number, modifiedEndLineNumber: number, modifiedEndColumn: number +) { return { originalStartLineNumber: originalStartLineNumber, originalStartColumn: originalStartColumn, diff --git a/src/vs/editor/test/common/editorTestUtils.ts b/src/vs/editor/test/common/editorTestUtils.ts index 493a466de87..476e1c4ae26 100644 --- a/src/vs/editor/test/common/editorTestUtils.ts +++ b/src/vs/editor/test/common/editorTestUtils.ts @@ -5,59 +5,9 @@ 'use strict'; import { Model } from 'vs/editor/common/model/model'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IModel } from 'vs/editor/common/editorCommon'; -import { IViewModelHelper } from 'vs/editor/common/controller/cursorCommon'; export function withEditorModel(text: string[], callback: (model: Model) => void): void { var model = Model.createFromString(text.join('\n')); callback(model); model.dispose(); } - -export function viewModelHelper(model: IModel): IViewModelHelper { - return { - viewModel: model, - - coordinatesConverter: { - convertViewPositionToModelPosition: (viewPosition: Position): Position => { - return viewPosition; - }, - convertViewRangeToModelRange: (viewRange: Range): Range => { - return viewRange; - }, - convertViewSelectionToModelSelection: (viewSelection: Selection): Selection => { - return viewSelection; - }, - validateViewPosition: (viewPosition: Position, expectedModelPosition: Position): Position => { - return expectedModelPosition; - }, - validateViewRange: (viewRange: Range, modelRange: Range): Range => { - return modelRange; - }, - convertModelPositionToViewPosition: (modelPosition: Position): Position => { - return modelPosition; - }, - convertModelRangeToViewRange: (modelRange: Range): Range => { - return modelRange; - }, - convertModelSelectionToViewSelection: (modelSelection: Selection): Selection => { - return modelSelection; - }, - modelPositionIsVisible: (modelPosition: Position): boolean => { - return true; - }, - }, - - getScrollTop: (): number => 0, - - getCompletelyVisibleViewRange: () => null, - - getCompletelyVisibleViewRangeAtScrollTop: (scrollTop: number) => null, - - getVerticalOffsetForViewLineNumber: (viewLineNumber: number) => 0 - - }; -} diff --git a/src/vs/editor/test/common/mocks/mockCodeEditor.ts b/src/vs/editor/test/common/mocks/mockCodeEditor.ts index 3a70f211dbc..52e03d79906 100644 --- a/src/vs/editor/test/common/mocks/mockCodeEditor.ts +++ b/src/vs/editor/test/common/mocks/mockCodeEditor.ts @@ -14,30 +14,12 @@ import { Cursor } from 'vs/editor/common/controller/cursor'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { Range } from 'vs/editor/common/core/range'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; export class MockCodeEditor extends CommonCodeEditor { protected _createConfiguration(options: editorOptions.IEditorOptions): CommonEditorConfiguration { return new TestConfiguration(options); } - public getCenteredRangeInViewport(): Range { return null; } - protected _getCompletelyVisibleViewRange(): Range { return null; } - protected _getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range { return null; } - protected _getVerticalOffsetForViewLineNumber(viewLineNumber: number): number { return 0; } - - public getScrollWidth(): number { return 0; } - public getScrollLeft(): number { return 0; } - - public getScrollHeight(): number { return 0; } - public getScrollTop(): number { return 0; } - - public setScrollLeft(newScrollLeft: number): void { } - public setScrollTop(newScrollTop: number): void { } - public setScrollPosition(position: editorCommon.INewScrollPosition): void { } - - public saveViewState(): editorCommon.ICodeEditorViewState { return null; } - public restoreViewState(state: editorCommon.IEditorViewState): void { } public layout(dimension?: editorCommon.IDimension): void { } @@ -85,27 +67,43 @@ export interface MockCodeEditorCreationOptions extends editorOptions.IEditorOpti * The initial model associated with this code editor. */ model?: editorCommon.IModel; + serviceCollection?: ServiceCollection; } export function withMockCodeEditor(text: string[], options: MockCodeEditorCreationOptions, callback: (editor: MockCodeEditor, cursor: Cursor) => void): void { - let editor = mockCodeEditor(text, options); + // create a model if necessary and remember it in order to dispose it. + let modelToDispose: Model = null; + if (!options.model) { + modelToDispose = Model.createFromString(text.join('\n')); + options.model = modelToDispose; + } + + let editor = _mockCodeEditor(options); callback(editor, editor.getCursor()); + + if (modelToDispose) { + modelToDispose.dispose(); + } editor.dispose(); } export function mockCodeEditor(text: string[], options: MockCodeEditorCreationOptions): CommonCodeEditor { + // TODO: who owns this model now? + if (!options.model) { + options.model = Model.createFromString(text.join('\n')); + } + return _mockCodeEditor(options); +} + +function _mockCodeEditor(options: MockCodeEditorCreationOptions): CommonCodeEditor { let contextKeyService = new MockContextKeyService(); - let services = new ServiceCollection(); + let services = options.serviceCollection || new ServiceCollection(); services.set(IContextKeyService, contextKeyService); let instantiationService = new InstantiationService(services); let editor = new MockCodeEditor(new MockScopeLocation(), options, instantiationService, contextKeyService); - let model = options.model || Model.createFromString(text.join('\n')); - if (model) { - editor.setModel(model); - } - + editor.setModel(options.model); return editor; } diff --git a/src/vs/editor/test/common/mocks/mockExtensionService.ts b/src/vs/editor/test/common/mocks/mockExtensionService.ts index 7eb1c1be346..039c9ec9eb6 100644 --- a/src/vs/editor/test/common/mocks/mockExtensionService.ts +++ b/src/vs/editor/test/common/mocks/mockExtensionService.ts @@ -32,7 +32,7 @@ export class MockExtensionService extends AbstractExtensionService()); - public onKeyDown: Event = this._onKeyDown.event; - - private _onKeyUp = this._register(new Emitter()); - public onKeyUp: Event = this._onKeyUp.event; - - private _onKeyPress = this._register(new Emitter()); - public onKeyPress: Event = this._onKeyPress.event; - - private _onCompositionStart = this._register(new Emitter()); - public onCompositionStart: Event = this._onCompositionStart.event; - - private _onCompositionUpdate = this._register(new Emitter()); - public onCompositionUpdate: Event = this._onCompositionUpdate.event; - - private _onCompositionEnd = this._register(new Emitter()); - public onCompositionEnd: Event = this._onCompositionEnd.event; - - private _onInput = this._register(new Emitter()); - public onInput: Event = this._onInput.event; - - private _onCut = this._register(new Emitter()); - public onCut: Event = this._onCut.event; - - private _onCopy = this._register(new Emitter()); - public onCopy: Event = this._onCopy.event; - - private _onPaste = this._register(new Emitter()); - public onPaste: Event = this._onPaste.event; - - public _value: string; - public _selectionStart: number; - public _selectionEnd: number; - public _isInOverwriteMode: boolean; - - constructor() { - super(); - this._value = ''; - this._selectionStart = 0; - this._selectionEnd = 0; - this._isInOverwriteMode = false; - } - - public getValue(): string { - return this._value; - } - - public setValue(reason: string, value: string): void { - this._value = value; - this._selectionStart = this._value.length; - this._selectionEnd = this._value.length; - } - - public getSelectionStart(): number { - return this._selectionStart; - } - - public getSelectionEnd(): number { - return this._selectionEnd; - } - - public setSelectionRange(selectionStart: number, selectionEnd: number): void { - if (selectionStart < 0) { - selectionStart = 0; - } - if (selectionStart > this._value.length) { - selectionStart = this._value.length; - } - if (selectionEnd < 0) { - selectionEnd = 0; - } - if (selectionEnd > this._value.length) { - selectionEnd = this._value.length; - } - this._selectionStart = selectionStart; - this._selectionEnd = selectionEnd; - } - - public isInOverwriteMode(): boolean { - return this._isInOverwriteMode; - } -} diff --git a/src/vs/editor/test/common/mocks/testConfiguration.ts b/src/vs/editor/test/common/mocks/testConfiguration.ts index d8cede0b45b..a8778a6f055 100644 --- a/src/vs/editor/test/common/mocks/testConfiguration.ts +++ b/src/vs/editor/test/common/mocks/testConfiguration.ts @@ -4,34 +4,29 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { CommonEditorConfiguration } from 'vs/editor/common/config/commonEditorConfig'; +import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; +import { AccessibilitySupport } from 'vs/base/common/platform'; export class TestConfiguration extends CommonEditorConfiguration { constructor(opts: IEditorOptions) { super(opts); + this._recomputeOptions(); } - protected _getEditorClassName(theme: string, fontLigatures: boolean): string { - return ''; - } - - protected getOuterWidth(): number { - return 100; - } - - protected getOuterHeight(): number { - return 100; - } - - protected _getCanUseTranslate3d(): boolean { - return true; - } - - protected _getPixelRatio(): number { - return 1; + protected _getEnvConfiguration(): IEnvConfiguration { + return { + extraEditorClassName: '', + outerWidth: 100, + outerHeight: 100, + canUseTranslate3d: true, + emptySelectionClipboard: true, + pixelRatio: 1, + zoomLevel: 0, + accessibilitySupport: AccessibilitySupport.Unknown + }; } protected readConfiguration(styling: BareFontInfo): FontInfo { @@ -41,6 +36,7 @@ export class TestConfiguration extends CommonEditorConfiguration { fontWeight: 'normal', fontSize: 14, lineHeight: 19, + letterSpacing: 1.5, isMonospace: true, typicalHalfwidthCharacterWidth: 10, typicalFullwidthCharacterWidth: 20, @@ -48,8 +44,4 @@ export class TestConfiguration extends CommonEditorConfiguration { maxDigitWidth: 10, }, true); } - - protected getZoomLevel(): number { - return 0; - } } diff --git a/src/vs/editor/test/common/model/model.modes.test.ts b/src/vs/editor/test/common/model/model.modes.test.ts index 053df8fe511..9a891182471 100644 --- a/src/vs/editor/test/common/model/model.modes.test.ts +++ b/src/vs/editor/test/common/model/model.modes.test.ts @@ -13,7 +13,7 @@ import { Model } from 'vs/editor/common/model/model'; import * as modes from 'vs/editor/common/modes'; import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; -import { TokenIterator } from 'vs/editor/common/model/tokenIterator'; +import { TokenIterator, ITokenInfo } from 'vs/editor/common/model/tokenIterator'; // --------- utils @@ -347,7 +347,7 @@ suite('Editor Model - Token Iterator', () => { [1, 4, 4, 7, 7, 10, 10, 13], ]; tokenIterator(thisModel, new Position(1, 1), (iter) => { - var a = [], line = 0; + var a: number[] = [], line = 0; while (iter.hasNext()) { calls++; if (a.length === 0) { @@ -450,7 +450,7 @@ suite('Editor Model - Token Iterator', () => { test('iterator allows next/prev', () => { var n = 0; - var up = [], down = []; + var up: ITokenInfo[] = [], down: ITokenInfo[] = []; tokenIterator(thisModel, new Position(1, 1), (iter) => { while (iter.hasNext()) { var next = iter.next(); @@ -473,7 +473,7 @@ suite('Editor Model - Token Iterator', () => { test('iterator allows prev/next', () => { var n = 0; - var up = [], down = []; + var up: ITokenInfo[] = [], down: ITokenInfo[] = []; tokenIterator(thisModel, new Position(3, 12), (iter) => { while (iter.hasPrev()) { var prev = iter.prev(); @@ -496,7 +496,7 @@ suite('Editor Model - Token Iterator', () => { test('iterator can not be used outside of callback', () => { - var illegalIterReference; + var illegalIterReference: TokenIterator; tokenIterator(thisModel, new Position(3, 12), (iter) => { illegalIterReference = iter; }); diff --git a/src/vs/editor/test/common/model/modelDecorations.test.ts b/src/vs/editor/test/common/model/modelDecorations.test.ts index 12a6c4233d0..b148ac36e17 100644 --- a/src/vs/editor/test/common/model/modelDecorations.test.ts +++ b/src/vs/editor/test/common/model/modelDecorations.test.ts @@ -49,7 +49,7 @@ function addDecoration(model: Model, startLineNumber: number, startColumn: numbe }); } -function lineHasDecorations(model, lineNumber, decorations) { +function lineHasDecorations(model: Model, lineNumber: number, decorations: { start: number; end: number; className: string; }[]) { var lineDecorations = []; var decs = model.getLineDecorations(lineNumber); for (var i = 0, len = decs.length; i < len; i++) { @@ -62,11 +62,11 @@ function lineHasDecorations(model, lineNumber, decorations) { assert.deepEqual(lineDecorations, decorations, 'Line decorations'); } -function lineHasNoDecorations(model, lineNumber) { +function lineHasNoDecorations(model: Model, lineNumber: number) { lineHasDecorations(model, lineNumber, []); } -function lineHasDecoration(model, lineNumber, start, end, className) { +function lineHasDecoration(model: Model, lineNumber: number, start: number, end: number, className: string) { lineHasDecorations(model, lineNumber, [{ start: start, end: end, @@ -542,7 +542,7 @@ suite('deltaDecorations', () => { endColumn: 1 }, options: { - hoverMessage: ['hello1'] + hoverMessage: 'hello1' } }]); @@ -554,13 +554,13 @@ suite('deltaDecorations', () => { endColumn: 1 }, options: { - hoverMessage: ['hello2'] + hoverMessage: 'hello2' } }]); let actualDecoration = model.getDecorationOptions(ids[0]); - assert.equal(actualDecoration.hoverMessage[0], 'hello2'); + assert.equal(actualDecoration.hoverMessage, 'hello2'); model.dispose(); }); diff --git a/src/vs/editor/test/common/model/textModelSearch.test.ts b/src/vs/editor/test/common/model/textModelSearch.test.ts index 278ee1539ca..274ce45b934 100644 --- a/src/vs/editor/test/common/model/textModelSearch.test.ts +++ b/src/vs/editor/test/common/model/textModelSearch.test.ts @@ -10,10 +10,14 @@ import { FindMatch, EndOfLineSequence } from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; import { TextModel } from 'vs/editor/common/model/textModel'; import { TextModelSearch, SearchParams, SearchData } from 'vs/editor/common/model/textModelSearch'; +import { getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; +import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper'; // --------- Find suite('TextModelSearch', () => { + const usualWordSeparators = getMapForWordSeparators(USUAL_WORD_SEPARATORS); + function assertFindMatch(actual: FindMatch, expectedRange: Range, expectedMatches: string[] = null): void { assert.deepEqual(actual, new FindMatch(expectedRange, expectedMatches)); } @@ -43,10 +47,10 @@ suite('TextModelSearch', () => { } } - function assertFindMatches(text: string, searchString: string, isRegex: boolean, matchCase: boolean, wholeWord: boolean, _expected: [number, number, number, number][]): void { + function assertFindMatches(text: string, searchString: string, isRegex: boolean, matchCase: boolean, wordSeparators: string, _expected: [number, number, number, number][]): void { let expectedRanges = _expected.map(entry => new Range(entry[0], entry[1], entry[2], entry[3])); let expectedMatches = expectedRanges.map(entry => new FindMatch(entry, null)); - let searchParams = new SearchParams(searchString, isRegex, matchCase, wholeWord); + let searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators); let model = TextModel.createFromString(text); _assertFindMatches(model, searchParams, expectedMatches); @@ -70,7 +74,7 @@ suite('TextModelSearch', () => { test('Simple find', () => { assertFindMatches( regularText.join('\n'), - 'foo', false, false, false, + 'foo', false, false, null, [ [1, 14, 1, 17], [1, 44, 1, 47], @@ -84,7 +88,7 @@ suite('TextModelSearch', () => { test('Case sensitive find', () => { assertFindMatches( regularText.join('\n'), - 'foo', false, true, false, + 'foo', false, true, null, [ [1, 14, 1, 17], [1, 44, 1, 47], @@ -96,7 +100,7 @@ suite('TextModelSearch', () => { test('Whole words find', () => { assertFindMatches( regularText.join('\n'), - 'foo', false, false, true, + 'foo', false, false, USUAL_WORD_SEPARATORS, [ [1, 14, 1, 17], [1, 44, 1, 47], @@ -108,7 +112,7 @@ suite('TextModelSearch', () => { test('/^/ find', () => { assertFindMatches( regularText.join('\n'), - '^', true, false, false, + '^', true, false, null, [ [1, 1, 1, 1], [2, 1, 2, 1], @@ -122,7 +126,7 @@ suite('TextModelSearch', () => { test('/$/ find', () => { assertFindMatches( regularText.join('\n'), - '$', true, false, false, + '$', true, false, null, [ [1, 74, 1, 74], [2, 69, 2, 69], @@ -136,7 +140,7 @@ suite('TextModelSearch', () => { test('/.*/ find', () => { assertFindMatches( regularText.join('\n'), - '.*', true, false, false, + '.*', true, false, null, [ [1, 1, 1, 74], [2, 1, 2, 69], @@ -156,7 +160,7 @@ suite('TextModelSearch', () => { '', 'Again nothing interesting here' ].join('\n'), - '^$', true, false, false, + '^$', true, false, null, [ [2, 1, 2, 1], [4, 1, 4, 1] @@ -172,7 +176,7 @@ suite('TextModelSearch', () => { 'some text again', 'again some text' ].join('\n'), - 'text\\n', true, false, false, + 'text\\n', true, false, null, [ [1, 16, 2, 1], [2, 16, 3, 1], @@ -188,7 +192,7 @@ suite('TextModelSearch', () => { 'some text again', 'again some text' ].join('\n'), - 'text\\nJust', true, false, false, + 'text\\nJust', true, false, null, [ [1, 16, 2, 5] ] @@ -203,7 +207,7 @@ suite('TextModelSearch', () => { 'some text again', 'again some text' ].join('\n'), - '\\nagain', true, false, false, + '\\nagain', true, false, null, [ [3, 16, 4, 6] ] @@ -218,7 +222,7 @@ suite('TextModelSearch', () => { 'some text again', 'again some text' ].join('\n'), - '.*\\nJust.*\\n', true, false, false, + '.*\\nJust.*\\n', true, false, null, [ [1, 1, 3, 1] ] @@ -234,7 +238,7 @@ suite('TextModelSearch', () => { 'if', 'else' ].join('\n'), - '^if\\nelse', true, false, false, + '^if\\nelse', true, false, null, [ [1, 1, 2, 5], [4, 1, 5, 5] @@ -253,7 +257,7 @@ suite('TextModelSearch', () => { ' ', 'else' ].join('\n'), - '^\\s*$\\n', true, false, false, + '^\\s*$\\n', true, false, null, [ [2, 1, 3, 1], [4, 1, 5, 1], @@ -270,7 +274,7 @@ suite('TextModelSearch', () => { 'ab', 'eb' ].join('\n'), - '^a.*b$', true, false, false, + '^a.*b$', true, false, null, [ [1, 1, 1, 7], [3, 1, 3, 3] @@ -288,7 +292,7 @@ suite('TextModelSearch', () => { 'elseif', 'else' ].join('\n'), - 'if\\nelse$', true, false, false, + 'if\\nelse$', true, false, null, [ [1, 1, 2, 5], [5, 5, 6, 5] @@ -305,7 +309,7 @@ suite('TextModelSearch', () => { '', 'again some text' ].join('\n'), - '^.*$', true, false, false, + '^.*$', true, false, null, [ [1, 1, 1, 20], [2, 1, 2, 1], @@ -325,7 +329,7 @@ suite('TextModelSearch', () => { 'again some text', 'but not some' ].join('\n'), - 'text\nsome', false, false, false, + 'text\nsome', false, false, null, [ [1, 16, 2, 5], [2, 11, 3, 5], @@ -333,10 +337,27 @@ suite('TextModelSearch', () => { ); }); + test('issue #3623: Match whole word does not work for not latin characters', () => { + assertFindMatches( + [ + 'Ñ', + 'компилÑтор', + 'обфуÑкациÑ', + ':Ñ-Ñ' + ].join('\n'), + 'Ñ', false, false, USUAL_WORD_SEPARATORS, + [ + [1, 1, 1, 2], + [4, 2, 4, 3], + [4, 4, 4, 5], + ] + ); + }); + test('findNextMatch without regex', () => { let model = TextModel.createFromString('line line one\nline two\nthree'); - let searchParams = new SearchParams('line', false, false, false); + let searchParams = new SearchParams('line', false, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), false); assertFindMatch(actual, new Range(1, 1, 1, 5)); @@ -359,7 +380,7 @@ suite('TextModelSearch', () => { test('findNextMatch with beginning boundary regex', () => { let model = TextModel.createFromString('line one\nline two\nthree'); - let searchParams = new SearchParams('^line', true, false, false); + let searchParams = new SearchParams('^line', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), false); assertFindMatch(actual, new Range(1, 1, 1, 5)); @@ -379,7 +400,7 @@ suite('TextModelSearch', () => { test('findNextMatch with beginning boundary regex and line has repetitive beginnings', () => { let model = TextModel.createFromString('line line one\nline two\nthree'); - let searchParams = new SearchParams('^line', true, false, false); + let searchParams = new SearchParams('^line', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), false); assertFindMatch(actual, new Range(1, 1, 1, 5)); @@ -399,7 +420,7 @@ suite('TextModelSearch', () => { test('findNextMatch with beginning boundary multiline regex and line has repetitive beginnings', () => { let model = TextModel.createFromString('line line one\nline two\nline three\nline four'); - let searchParams = new SearchParams('^line.*\\nline', true, false, false); + let searchParams = new SearchParams('^line.*\\nline', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), false); assertFindMatch(actual, new Range(1, 1, 2, 5)); @@ -416,7 +437,7 @@ suite('TextModelSearch', () => { test('findNextMatch with ending boundary regex', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('line$', true, false, false); + let searchParams = new SearchParams('line$', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), false); assertFindMatch(actual, new Range(1, 10, 1, 14)); @@ -436,7 +457,7 @@ suite('TextModelSearch', () => { test('findMatches with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)', true, false, false); + let searchParams = new SearchParams('(l(in)e)', true, false, null); let actual = TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 100); assert.deepEqual(actual, [ @@ -451,7 +472,7 @@ suite('TextModelSearch', () => { test('findMatches multiline with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)\\n', true, false, false); + let searchParams = new SearchParams('(l(in)e)\\n', true, false, null); let actual = TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 100); assert.deepEqual(actual, [ @@ -465,7 +486,7 @@ suite('TextModelSearch', () => { test('findNextMatch with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)', true, false, false); + let searchParams = new SearchParams('(l(in)e)', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); assertFindMatch(actual, new Range(1, 5, 1, 9), ['line', 'line', 'in']); @@ -476,7 +497,7 @@ suite('TextModelSearch', () => { test('findNextMatch multiline with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)\\n', true, false, false); + let searchParams = new SearchParams('(l(in)e)\\n', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); assertFindMatch(actual, new Range(1, 10, 2, 1), ['line\n', 'line', 'in']); @@ -487,7 +508,7 @@ suite('TextModelSearch', () => { test('findPreviousMatch with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)', true, false, false); + let searchParams = new SearchParams('(l(in)e)', true, false, null); let actual = TextModelSearch.findPreviousMatch(model, searchParams, new Position(1, 1), true); assertFindMatch(actual, new Range(2, 5, 2, 9), ['line', 'line', 'in']); @@ -498,7 +519,7 @@ suite('TextModelSearch', () => { test('findPreviousMatch multiline with capturing matches', () => { let model = TextModel.createFromString('one line line\ntwo line\nthree'); - let searchParams = new SearchParams('(l(in)e)\\n', true, false, false); + let searchParams = new SearchParams('(l(in)e)\\n', true, false, null); let actual = TextModelSearch.findPreviousMatch(model, searchParams, new Position(1, 1), true); assertFindMatch(actual, new Range(2, 5, 3, 1), ['line\n', 'line', 'in']); @@ -511,17 +532,17 @@ suite('TextModelSearch', () => { assert.equal(model.getEOL(), '\r\n'); - let searchParams = new SearchParams('h\\n', true, false, false); + let searchParams = new SearchParams('h\\n', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); actual = TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 1000)[0]; assertFindMatch(actual, new Range(8, 1, 9, 1), ['h\n']); - searchParams = new SearchParams('g\\nh\\n', true, false, false); + searchParams = new SearchParams('g\\nh\\n', true, false, null); actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); actual = TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 1000)[0]; assertFindMatch(actual, new Range(7, 1, 9, 1), ['g\nh\n']); - searchParams = new SearchParams('\\ni', true, false, false); + searchParams = new SearchParams('\\ni', true, false, null); actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); actual = TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 1000)[0]; assertFindMatch(actual, new Range(8, 2, 9, 2), ['\ni']); @@ -534,7 +555,7 @@ suite('TextModelSearch', () => { assert.equal(model.getEOL(), '\r\n'); - let searchParams = new SearchParams('\\r\\n', true, false, false); + let searchParams = new SearchParams('\\r\\n', true, false, null); let actual = TextModelSearch.findNextMatch(model, searchParams, new Position(1, 1), true); assert.equal(actual, null); assert.deepEqual(TextModelSearch.findMatches(model, searchParams, model.getFullModelRange(), true, 1000), []); @@ -542,37 +563,48 @@ suite('TextModelSearch', () => { model.dispose(); }); - function assertParseSearchResult(searchString: string, isRegex: boolean, matchCase: boolean, wholeWord: boolean, expected: SearchData): void { - let searchParams = new SearchParams(searchString, isRegex, matchCase, wholeWord); + function assertParseSearchResult(searchString: string, isRegex: boolean, matchCase: boolean, wordSeparators: string, expected: SearchData): void { + let searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators); let actual = searchParams.parseSearchRequest(); - assert.deepEqual(actual, expected); + + if (expected === null) { + assert.ok(actual === null); + } else { + assert.deepEqual(actual.regex, expected.regex); + assert.deepEqual(actual.simpleSearch, expected.simpleSearch); + if (wordSeparators) { + assert.ok(actual.wordSeparators !== null); + } else { + assert.ok(actual.wordSeparators === null); + } + } } test('parseSearchRequest invalid', () => { - assertParseSearchResult('', true, true, true, null); - assertParseSearchResult(null, true, true, true, null); - assertParseSearchResult('(', true, false, false, null); + assertParseSearchResult('', true, true, USUAL_WORD_SEPARATORS, null); + assertParseSearchResult(null, true, true, USUAL_WORD_SEPARATORS, null); + assertParseSearchResult('(', true, false, null, null); }); test('parseSearchRequest non regex', () => { - assertParseSearchResult('foo', false, false, false, new SearchData(/foo/gi, null)); - assertParseSearchResult('foo', false, false, true, new SearchData(/\bfoo\b/gi, null)); - assertParseSearchResult('foo', false, true, false, new SearchData(/foo/g, 'foo')); - assertParseSearchResult('foo', false, true, true, new SearchData(/\bfoo\b/g, null)); - assertParseSearchResult('foo\\n', false, false, false, new SearchData(/foo\\n/gi, null)); - assertParseSearchResult('foo\\\\n', false, false, false, new SearchData(/foo\\\\n/gi, null)); - assertParseSearchResult('foo\\r', false, false, false, new SearchData(/foo\\r/gi, null)); - assertParseSearchResult('foo\\\\r', false, false, false, new SearchData(/foo\\\\r/gi, null)); + assertParseSearchResult('foo', false, false, null, new SearchData(/foo/gi, null, null)); + assertParseSearchResult('foo', false, false, USUAL_WORD_SEPARATORS, new SearchData(/foo/gi, usualWordSeparators, null)); + assertParseSearchResult('foo', false, true, null, new SearchData(/foo/g, null, 'foo')); + assertParseSearchResult('foo', false, true, USUAL_WORD_SEPARATORS, new SearchData(/foo/g, usualWordSeparators, 'foo')); + assertParseSearchResult('foo\\n', false, false, null, new SearchData(/foo\\n/gi, null, null)); + assertParseSearchResult('foo\\\\n', false, false, null, new SearchData(/foo\\\\n/gi, null, null)); + assertParseSearchResult('foo\\r', false, false, null, new SearchData(/foo\\r/gi, null, null)); + assertParseSearchResult('foo\\\\r', false, false, null, new SearchData(/foo\\\\r/gi, null, null)); }); test('parseSearchRequest regex', () => { - assertParseSearchResult('foo', true, false, false, new SearchData(/foo/gi, null)); - assertParseSearchResult('foo', true, false, true, new SearchData(/\bfoo\b/gi, null)); - assertParseSearchResult('foo', true, true, false, new SearchData(/foo/g, null)); - assertParseSearchResult('foo', true, true, true, new SearchData(/\bfoo\b/g, null)); - assertParseSearchResult('foo\\n', true, false, false, new SearchData(/foo\n/gim, null)); - assertParseSearchResult('foo\\\\n', true, false, false, new SearchData(/foo\\n/gi, null)); - assertParseSearchResult('foo\\r', true, false, false, new SearchData(/foo\r/gim, null)); - assertParseSearchResult('foo\\\\r', true, false, false, new SearchData(/foo\\r/gi, null)); + assertParseSearchResult('foo', true, false, null, new SearchData(/foo/gi, null, null)); + assertParseSearchResult('foo', true, false, USUAL_WORD_SEPARATORS, new SearchData(/foo/gi, usualWordSeparators, null)); + assertParseSearchResult('foo', true, true, null, new SearchData(/foo/g, null, null)); + assertParseSearchResult('foo', true, true, USUAL_WORD_SEPARATORS, new SearchData(/foo/g, usualWordSeparators, null)); + assertParseSearchResult('foo\\n', true, false, null, new SearchData(/foo\n/gim, null, null)); + assertParseSearchResult('foo\\\\n', true, false, null, new SearchData(/foo\\n/gi, null, null)); + assertParseSearchResult('foo\\r', true, false, null, new SearchData(/foo\r/gim, null, null)); + assertParseSearchResult('foo\\\\r', true, false, null, new SearchData(/foo\\r/gi, null, null)); }); }); diff --git a/src/vs/editor/test/common/model/textModelWithTokens.test.ts b/src/vs/editor/test/common/model/textModelWithTokens.test.ts index 09ac2a2df07..6ac512096dd 100644 --- a/src/vs/editor/test/common/model/textModelWithTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelWithTokens.test.ts @@ -240,7 +240,7 @@ suite('TextModelWithTokens - bracket matching', () => { [new Position(5, 5), new Range(5, 4, 5, 5), new Range(1, 11, 1, 12)], ]; - let isABracket = { 1: {}, 2: {}, 3: {}, 4: {}, 5: {} }; + let isABracket: { [lineNumber: number]: { [col: number]: boolean; }; } = { 1: {}, 2: {}, 3: {}, 4: {}, 5: {} }; for (let i = 0, len = brackets.length; i < len; i++) { let [testPos, b1, b2] = brackets[i]; isBracket2(model, testPos, [b1, b2]); @@ -250,7 +250,7 @@ suite('TextModelWithTokens - bracket matching', () => { for (let i = 1, len = model.getLineCount(); i <= len; i++) { let line = model.getLineContent(i); for (let j = 1, lenJ = line.length + 1; j <= lenJ; j++) { - if (!isABracket[i].hasOwnProperty(j)) { + if (!isABracket[i].hasOwnProperty(j)) { isNotABracket(model, i, j); } } diff --git a/src/vs/editor/test/common/standalone/standaloneBase.test.ts b/src/vs/editor/test/common/standalone/standaloneBase.test.ts index c26df8b28e6..64849eb80cb 100644 --- a/src/vs/editor/test/common/standalone/standaloneBase.test.ts +++ b/src/vs/editor/test/common/standalone/standaloneBase.test.ts @@ -135,6 +135,8 @@ suite('KeyCode', () => { assertKeyCode(StandaloneKeyCode.NUMPAD_DECIMAL, RuntimeKeyCode.NUMPAD_DECIMAL); assertKeyCode(StandaloneKeyCode.NUMPAD_DIVIDE, RuntimeKeyCode.NUMPAD_DIVIDE); assertKeyCode(StandaloneKeyCode.KEY_IN_COMPOSITION, RuntimeKeyCode.KEY_IN_COMPOSITION); + assertKeyCode(StandaloneKeyCode.ABNT_C1, RuntimeKeyCode.ABNT_C1); + assertKeyCode(StandaloneKeyCode.ABNT_C2, RuntimeKeyCode.ABNT_C2); assertKeyCode(StandaloneKeyCode.MAX_VALUE, RuntimeKeyCode.MAX_VALUE); }); }); diff --git a/src/vs/editor/test/common/view/overviewZoneManager.test.ts b/src/vs/editor/test/common/view/overviewZoneManager.test.ts index 2ebe4035af1..1cfc1a4a2b1 100644 --- a/src/vs/editor/test/common/view/overviewZoneManager.test.ts +++ b/src/vs/editor/test/common/view/overviewZoneManager.test.ts @@ -5,8 +5,9 @@ 'use strict'; import * as assert from 'assert'; -import { OverviewRulerLane, ThemeType } from 'vs/editor/common/editorCommon'; +import { OverviewRulerLane } from 'vs/editor/common/editorCommon'; import { OverviewZoneManager, ColorZone, OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; +import { LIGHT } from 'vs/platform/theme/common/themeService'; suite('Editor View - OverviewZoneManager', () => { @@ -16,7 +17,7 @@ suite('Editor View - OverviewZoneManager', () => { let manager = new OverviewZoneManager((lineNumber) => LINE_HEIGHT * lineNumber); manager.setMinimumHeight(6); manager.setMaximumHeight(6); - manager.setThemeType(ThemeType.Light); + manager.setThemeType(LIGHT); manager.setDOMWidth(30); manager.setDOMHeight(600); manager.setOuterHeight(LINE_COUNT * LINE_HEIGHT); @@ -46,7 +47,7 @@ suite('Editor View - OverviewZoneManager', () => { let manager = new OverviewZoneManager((lineNumber) => LINE_HEIGHT * lineNumber); manager.setMinimumHeight(6); manager.setMaximumHeight(6); - manager.setThemeType(ThemeType.Light); + manager.setThemeType(LIGHT); manager.setDOMWidth(30); manager.setDOMHeight(300); manager.setOuterHeight(LINE_COUNT * LINE_HEIGHT); @@ -75,7 +76,7 @@ suite('Editor View - OverviewZoneManager', () => { let manager = new OverviewZoneManager((lineNumber) => LINE_HEIGHT * lineNumber); manager.setMinimumHeight(6); manager.setMaximumHeight(6); - manager.setThemeType(ThemeType.Light); + manager.setThemeType(LIGHT); manager.setDOMWidth(30); manager.setDOMHeight(300); manager.setOuterHeight(LINE_COUNT * LINE_HEIGHT); diff --git a/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts b/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts index 28cd57513c8..53ac8d481a6 100644 --- a/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts +++ b/src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts @@ -5,8 +5,7 @@ 'use strict'; import * as assert from 'assert'; -import { RenderMinimap, EditorLayoutInfo, OverviewRulerPosition } from 'vs/editor/common/config/editorOptions'; -import { EditorLayoutProvider, IEditorLayoutProviderOpts } from 'vs/editor/common/viewLayout/editorLayoutProvider'; +import { RenderMinimap, EditorLayoutInfo, EditorLayoutProvider, IEditorLayoutProviderOpts } from 'vs/editor/common/config/editorOptions'; suite('Editor ViewLayout - EditorLayoutProvider', () => { @@ -35,40 +34,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 1000, - height: 800, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, - - contentLeft: 10, - contentWidth: 990, - contentHeight: 800, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 99, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 1000, height: 800, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, + + contentLeft: 10, + contentWidth: 990, + contentHeight: 800, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 99, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 800, + right: 0 + } + }); }); test('EditorLayoutProvider 1.1', () => { @@ -91,40 +90,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 1000, - height: 800, + }, { + width: 1000, + height: 800, - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, - contentLeft: 10, - contentWidth: 990, - contentHeight: 800, + contentLeft: 10, + contentWidth: 990, + contentHeight: 800, - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 97, + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 97, - verticalScrollbarWidth: 11, - horizontalScrollbarHeight: 12, + verticalScrollbarWidth: 11, + horizontalScrollbarHeight: 12, - overviewRuler: new OverviewRulerPosition({ - top: 13, - width: 11, - height: (800 - 2 * 13), - right: 0 - }) - })); + overviewRuler: { + top: 13, + width: 11, + height: (800 - 2 * 13), + right: 0 + } + }); }); test('EditorLayoutProvider 2', () => { @@ -147,40 +146,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 800, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, - - contentLeft: 10, - contentWidth: 890, - contentHeight: 800, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 89, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 800, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, + + contentLeft: 10, + contentWidth: 890, + contentHeight: 800, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 89, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 800, + right: 0 + } + }); }); test('EditorLayoutProvider 3', () => { @@ -203,40 +202,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 900, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 10, - contentWidth: 890, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 89, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 900, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 10, + contentWidth: 890, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 89, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 4', () => { @@ -259,40 +258,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 900, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 10, - contentWidth: 890, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 89, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 900, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 10, + contentWidth: 890, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 89, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 5', () => { @@ -315,40 +314,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 50, - lineNumbersHeight: 900, - - decorationsLeft: 50, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 60, - contentWidth: 840, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 84, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 50, + lineNumbersHeight: 900, + + decorationsLeft: 50, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 60, + contentWidth: 840, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 84, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 6', () => { @@ -371,40 +370,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 50, - lineNumbersHeight: 900, - - decorationsLeft: 50, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 60, - contentWidth: 840, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 84, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 50, + lineNumbersHeight: 900, + + decorationsLeft: 50, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 60, + contentWidth: 840, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 84, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 7', () => { @@ -427,40 +426,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 60, - lineNumbersHeight: 900, - - decorationsLeft: 60, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 70, - contentWidth: 830, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 83, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 60, + lineNumbersHeight: 900, + + decorationsLeft: 60, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 70, + contentWidth: 830, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 83, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 8', () => { @@ -483,40 +482,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 30, - lineNumbersHeight: 900, - - decorationsLeft: 30, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 40, - contentWidth: 860, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 172, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 30, + lineNumbersHeight: 900, + + decorationsLeft: 30, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 40, + contentWidth: 860, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 172, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 8 - rounds floats', () => { @@ -539,40 +538,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 900, - height: 900, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 900, - - lineNumbersLeft: 0, - lineNumbersWidth: 30, - lineNumbersHeight: 900, - - decorationsLeft: 30, - decorationsWidth: 10, - decorationsHeight: 900, - - contentLeft: 40, - contentWidth: 860, - contentHeight: 900, - - renderMinimap: RenderMinimap.None, - minimapWidth: 0, - viewportColumn: 170, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 900, height: 900, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 900, + + lineNumbersLeft: 0, + lineNumbersWidth: 30, + lineNumbersHeight: 900, + + decorationsLeft: 30, + decorationsWidth: 10, + decorationsHeight: 900, + + contentLeft: 40, + contentWidth: 860, + contentHeight: 900, + + renderMinimap: RenderMinimap.None, + minimapWidth: 0, + viewportColumn: 170, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 900, + right: 0 + } + }); }); test('EditorLayoutProvider 9 - render minimap', () => { @@ -595,40 +594,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 1, - }, new EditorLayoutInfo({ - width: 1000, - height: 800, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, - - contentLeft: 10, - contentWidth: 900, - contentHeight: 800, - - renderMinimap: RenderMinimap.Small, - minimapWidth: 90, - viewportColumn: 90, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 1000, height: 800, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, + + contentLeft: 10, + contentWidth: 900, + contentHeight: 800, + + renderMinimap: RenderMinimap.Small, + minimapWidth: 90, + viewportColumn: 90, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 800, + right: 0 + } + }); }); test('EditorLayoutProvider 9 - render minimap with pixelRatio = 2', () => { @@ -651,40 +650,40 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 2, - }, new EditorLayoutInfo({ - width: 1000, - height: 800, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, - - contentLeft: 10, - contentWidth: 900, - contentHeight: 800, - - renderMinimap: RenderMinimap.Large, - minimapWidth: 90, - viewportColumn: 90, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 1000, height: 800, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, + + contentLeft: 10, + contentWidth: 900, + contentHeight: 800, + + renderMinimap: RenderMinimap.Large, + minimapWidth: 90, + viewportColumn: 90, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 800, + right: 0 + } + }); }); test('EditorLayoutProvider 9 - render minimap with pixelRatio = 4', () => { @@ -707,39 +706,39 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { minimapRenderCharacters: true, minimapMaxColumn: 150, pixelRatio: 4, - }, new EditorLayoutInfo({ - width: 1000, - height: 800, - - glyphMarginLeft: 0, - glyphMarginWidth: 0, - glyphMarginHeight: 800, - - lineNumbersLeft: 0, - lineNumbersWidth: 0, - lineNumbersHeight: 800, - - decorationsLeft: 0, - decorationsWidth: 10, - decorationsHeight: 800, - - contentLeft: 10, - contentWidth: 943, - contentHeight: 800, - - renderMinimap: RenderMinimap.Large, - minimapWidth: 47, - viewportColumn: 94, - - verticalScrollbarWidth: 0, - horizontalScrollbarHeight: 0, - - overviewRuler: new OverviewRulerPosition({ - top: 0, - width: 0, + }, { + width: 1000, height: 800, - right: 0 - }) - })); + + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginHeight: 800, + + lineNumbersLeft: 0, + lineNumbersWidth: 0, + lineNumbersHeight: 800, + + decorationsLeft: 0, + decorationsWidth: 10, + decorationsHeight: 800, + + contentLeft: 10, + contentWidth: 943, + contentHeight: 800, + + renderMinimap: RenderMinimap.Large, + minimapWidth: 47, + viewportColumn: 94, + + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + + overviewRuler: { + top: 0, + width: 0, + height: 800, + right: 0 + } + }); }); }); diff --git a/src/vs/editor/test/common/viewModel/characterHardWrappingLineMapper.test.ts b/src/vs/editor/test/common/viewModel/characterHardWrappingLineMapper.test.ts index 54c7b2b28a6..614295413ff 100644 --- a/src/vs/editor/test/common/viewModel/characterHardWrappingLineMapper.test.ts +++ b/src/vs/editor/test/common/viewModel/characterHardWrappingLineMapper.test.ts @@ -101,4 +101,9 @@ suite('Editor ViewModel - CharacterHardWrappingLineMapper', () => { let factory = new CharacterHardWrappingLineMapperFactory('', ' ', ''); assertLineMapping(factory, 4, 38, ' *123456789012345678901234567890123456|7890', WrappingIndent.Same); }); + + test('issue #16332: Scroll bar overlaying on top of text', () => { + let factory = new CharacterHardWrappingLineMapperFactory('', ' ', ''); + assertLineMapping(factory, 4, 24, 'a/ very/long/line/of/tex|t/that/expands/beyon|d/your/typical/line/|of/code/', WrappingIndent.Indent); + }); }); diff --git a/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts b/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts index 714e0b2c437..cca084b0918 100644 --- a/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts +++ b/src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts @@ -17,7 +17,7 @@ import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ViewLineToken } from 'vs/editor/common/core/viewLineToken'; -import { ViewLineData, ViewEventsCollector } from 'vs/editor/common/viewModel/viewModel'; +import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import { Range } from 'vs/editor/common/core/range'; suite('Editor ViewModel - SplitLinesCollection', () => { @@ -205,7 +205,7 @@ suite('Editor ViewModel - SplitLinesCollection', () => { ].join('\n'); withSplitLinesCollection(text, (model, linesCollection) => { - linesCollection.setHiddenAreas(new ViewEventsCollector(), [ + linesCollection.setHiddenAreas([ new Range(1, 1, 3, 1), new Range(5, 1, 6, 1) ]); @@ -530,7 +530,7 @@ suite('SplitLinesCollection', () => { _expected[7], ]); - splitLinesCollection.setHiddenAreas(new ViewEventsCollector(), [new Range(2, 1, 4, 1)]); + splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.equal(splitLinesCollection.getViewLineCount(), 5); assert.equal(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.equal(splitLinesCollection.modelPositionIsVisible(2, 1), false); @@ -700,7 +700,7 @@ suite('SplitLinesCollection', () => { _expected[11], ]); - splitLinesCollection.setHiddenAreas(new ViewEventsCollector(), [new Range(2, 1, 4, 1)]); + splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.equal(splitLinesCollection.getViewLineCount(), 8); assert.equal(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.equal(splitLinesCollection.modelPositionIsVisible(2, 1), false); diff --git a/src/vs/editor/test/common/viewModel/testViewModel.ts b/src/vs/editor/test/common/viewModel/testViewModel.ts index 7c1e6ed9a77..a041d80037a 100644 --- a/src/vs/editor/test/common/viewModel/testViewModel.ts +++ b/src/vs/editor/test/common/viewModel/testViewModel.ts @@ -5,9 +5,7 @@ 'use strict'; import { Model } from 'vs/editor/common/model/model'; -import { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper'; import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { SplitLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection'; import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; import { MockCodeEditorCreationOptions } from 'vs/editor/test/common/mocks/mockCodeEditor'; @@ -18,27 +16,7 @@ export function testViewModel(text: string[], options: MockCodeEditorCreationOpt let model = Model.createFromString(text.join('\n')); - let factory = new CharacterHardWrappingLineMapperFactory( - configuration.editor.wrappingInfo.wordWrapBreakBeforeCharacters, - configuration.editor.wrappingInfo.wordWrapBreakAfterCharacters, - configuration.editor.wrappingInfo.wordWrapBreakObtrusiveCharacters - ); - - let linesCollection = new SplitLinesCollection( - model, - factory, - model.getOptions().tabSize, - configuration.editor.wrappingInfo.wrappingColumn, - configuration.editor.fontInfo.typicalFullwidthCharacterWidth / configuration.editor.fontInfo.typicalHalfwidthCharacterWidth, - configuration.editor.wrappingInfo.wrappingIndent - ); - - let viewModel = new ViewModel( - linesCollection, - EDITOR_ID, - configuration, - model - ); + let viewModel = new ViewModel(EDITOR_ID, configuration, model); callback(viewModel, model); diff --git a/src/vs/loader.js b/src/vs/loader.js index 93484a427e4..8245e83de2f 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -253,15 +253,21 @@ var AMDLoader; if (typeof options.nodeCachedDataWriteDelay !== 'number' || options.nodeCachedDataWriteDelay < 0) { options.nodeCachedDataWriteDelay = 1000 * 7; } - if (typeof options.onNodeCachedDataError !== 'function') { - options.onNodeCachedDataError = function (err) { - if (err.errorCode === 'cachedDataRejected') { + if (typeof options.onNodeCachedData !== 'function') { + options.onNodeCachedData = function (err, data) { + if (!err) { + // ignore + } + else if (err.errorCode === 'cachedDataRejected') { console.warn('Rejected cached data from file: ' + err.path); } else if (err.errorCode === 'unlink' || err.errorCode === 'writeFile') { console.error('Problems writing cached data file: ' + err.path); console.error(err.detail); } + else { + console.error(err); + } }; } return options; @@ -583,24 +589,86 @@ var AMDLoader; }()); var NodeScriptLoader = (function () { function NodeScriptLoader() { - this._initialized = false; + this._didInitialize = false; + this._didPatchNodeRequire = false; + // js-flags have an impact on cached data + this._jsflags = ''; + for (var _i = 0, _a = process.argv; _i < _a.length; _i++) { + var arg = _a[_i]; + if (arg.indexOf('--js-flags=') === 0) { + this._jsflags = arg; + break; + } + } } NodeScriptLoader.prototype._init = function (nodeRequire) { - if (this._initialized) { + if (this._didInitialize) { return; } - this._initialized = true; + this._didInitialize = true; this._fs = nodeRequire('fs'); this._vm = nodeRequire('vm'); this._path = nodeRequire('path'); this._crypto = nodeRequire('crypto'); }; + // patch require-function of nodejs such that we can manually create a script + // from cached data. this is done by overriding the `Module._compile` function + NodeScriptLoader.prototype._initNodeRequire = function (nodeRequire, moduleManager) { + var nodeCachedDataDir = moduleManager.getConfig().getOptionsLiteral().nodeCachedDataDir; + if (!nodeCachedDataDir || this._didPatchNodeRequire) { + return; + } + this._didPatchNodeRequire = true; + var that = this; + var Module = nodeRequire('module'); + function makeRequireFunction(mod) { + var Module = mod.constructor; + var require = function require(path) { + try { + return mod.require(path); + } + finally { + // nothing + } + }; + require.resolve = function resolve(request) { + return Module._resolveFilename(request, mod); + }; + require.main = process.mainModule; + require.extensions = Module._extensions; + require.cache = Module._cache; + return require; + } + Module.prototype._compile = function (content, filename) { + // remove shebang + content = content.replace(/^#!.*/, ''); + // create wrapper function + var wrapper = Module.wrap(content); + var cachedDataPath = that._getCachedDataPath(nodeCachedDataDir, filename); + var options = { filename: filename }; + try { + options.cachedData = that._fs.readFileSync(cachedDataPath); + } + catch (e) { + options.produceCachedData = true; + } + var script = new that._vm.Script(wrapper, options); + var compileWrapper = script.runInThisContext(options); + var dirname = that._path.dirname(filename); + var require = makeRequireFunction(this); + var args = [this.exports, require, this, filename, dirname, process, AMDLoader.global, Buffer]; + var result = compileWrapper.apply(this.exports, args); + that._processCachedData(moduleManager, script, cachedDataPath); + return result; + }; + }; NodeScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) { var _this = this; var opts = moduleManager.getConfig().getOptionsLiteral(); var nodeRequire = (opts.nodeRequire || AMDLoader.global.nodeRequire); var nodeInstrumenter = (opts.nodeInstrumenter || function (c) { return c; }); this._init(nodeRequire); + this._initNodeRequire(nodeRequire, moduleManager); var recorder = moduleManager.getRecorder(); if (/^node\|/.test(scriptSrc)) { var pieces = scriptSrc.split('|'); @@ -628,9 +696,13 @@ var AMDLoader; if (AMDLoader.isElectronRenderer) { var driveLetterMatch = vmScriptSrc.match(/^([a-z])\:(.*)/i); if (driveLetterMatch) { - vmScriptSrc = driveLetterMatch[1].toUpperCase() + ':' + driveLetterMatch[2]; + // windows + vmScriptSrc = "file:///" + (driveLetterMatch[1].toUpperCase() + ':' + driveLetterMatch[2]).replace(/\\/g, '/'); + } + else { + // nix + vmScriptSrc = "file://" + vmScriptSrc; } - vmScriptSrc = 'file:///' + vmScriptSrc.replace(/\\/g, '/'); } var contents, prefix = '(function (require, define, __filename, __dirname) { ', suffix = '\n});'; if (data.charCodeAt(0) === NodeScriptLoader._BOM) { @@ -646,44 +718,16 @@ var AMDLoader; } else { var cachedDataPath_1 = _this._getCachedDataPath(opts.nodeCachedDataDir, scriptSrc); - _this._fs.readFile(cachedDataPath_1, function (err, data) { + _this._fs.readFile(cachedDataPath_1, function (err, cachedData) { // create script options - var scriptOptions = { + var options = { filename: vmScriptSrc, - produceCachedData: typeof data === 'undefined', - cachedData: data + produceCachedData: typeof cachedData === 'undefined', + cachedData: cachedData }; - var script = _this._loadAndEvalScript(scriptSrc, vmScriptSrc, contents, scriptOptions, recorder); + var script = _this._loadAndEvalScript(scriptSrc, vmScriptSrc, contents, options, recorder); callback(); - // cached code after math - if (script.cachedDataRejected) { - // data rejected => delete cache file - opts.onNodeCachedDataError({ - errorCode: 'cachedDataRejected', - path: cachedDataPath_1 - }); - NodeScriptLoader._runSoon(function () { return _this._fs.unlink(cachedDataPath_1, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().onNodeCachedDataError({ - errorCode: 'unlink', - path: cachedDataPath_1, - detail: err - }); - } - }); }, opts.nodeCachedDataWriteDelay); - } - else if (script.cachedDataProduced) { - // data produced => write cache file - NodeScriptLoader._runSoon(function () { return _this._fs.writeFile(cachedDataPath_1, script.cachedData, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().onNodeCachedDataError({ - errorCode: 'writeFile', - path: cachedDataPath_1, - detail: err - }); - } - }); }, opts.nodeCachedDataWriteDelay); - } + _this._processCachedData(moduleManager, script, cachedDataPath_1); }); } }); @@ -699,10 +743,50 @@ var AMDLoader; recorder.record(AMDLoader.LoaderEventType.NodeEndEvaluatingScript, scriptSrc); return script; }; - NodeScriptLoader.prototype._getCachedDataPath = function (baseDir, filename) { - var hash = this._crypto.createHash('md5').update(filename, 'utf8').digest('hex'); + NodeScriptLoader.prototype._getCachedDataPath = function (basedir, filename) { + var hash = this._crypto.createHash('md5').update(filename, 'utf8').update(this._jsflags, 'utf8').digest('hex'); var basename = this._path.basename(filename).replace(/\.js$/, ''); - return this._path.join(baseDir, hash + "-" + basename + ".code"); + return this._path.join(basedir, basename + "-" + hash + ".code"); + }; + NodeScriptLoader.prototype._processCachedData = function (moduleManager, script, cachedDataPath) { + var _this = this; + if (script.cachedDataRejected) { + // data rejected => delete cache file + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ + errorCode: 'cachedDataRejected', + path: cachedDataPath + }); + NodeScriptLoader._runSoon(function () { + return _this._fs.unlink(cachedDataPath, function (err) { + if (err) { + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ + errorCode: 'unlink', + path: cachedDataPath, + detail: err + }); + } + }); + }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); + } + else if (script.cachedDataProduced) { + // data produced => tell outside world + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData(undefined, { + path: cachedDataPath, + length: script.cachedData.length + }); + // data produced => write cache file + NodeScriptLoader._runSoon(function () { + return _this._fs.writeFile(cachedDataPath, script.cachedData, function (err) { + if (err) { + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ + errorCode: 'writeFile', + path: cachedDataPath, + detail: err + }); + } + }); + }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); + } }; NodeScriptLoader._runSoon = function (callback, minTimeout) { var timeout = minTimeout + Math.ceil(Math.random() * minTimeout); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index aba5742243f..7f3c80b83fa 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -357,11 +357,13 @@ declare module monaco { * Cover all key codes when IME is processing input. */ KEY_IN_COMPOSITION = 109, + ABNT_C1 = 110, + ABNT_C2 = 111, /** * Placed last to cover the length of the enum. * Please do not depend on this value! */ - MAX_VALUE = 110, + MAX_VALUE = 112, } export class KeyMod { @@ -624,6 +626,7 @@ declare module monaco { * Create a new empty range using this range's start position. */ static collapseToStart(range: IRange): Range; + static fromPositions(start: IPosition, end?: IPosition): Range; /** * Create a `Range` from an `IRange`. */ @@ -721,10 +724,18 @@ declare module monaco { * Create a new selection with a different `positionLineNumber` and `positionColumn`. */ setEndPosition(endLineNumber: number, endColumn: number): Selection; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + getPosition(): Position; /** * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. */ setStartPosition(startLineNumber: number, startColumn: number): Selection; + /** + * Create a `Selection` from one or two positions + */ + static fromPositions(start: IPosition, end?: IPosition): Selection; /** * Create a `Selection` from an `ISelection`. */ @@ -885,6 +896,11 @@ declare module monaco.editor { */ export function defineTheme(themeName: string, themeData: IStandaloneThemeData): void; + /** + * Switches to a theme. + */ + export function setTheme(themeName: string): void; + export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black'; export interface IStandaloneThemeData { @@ -958,12 +974,26 @@ declare module monaco.editor { * To not create automatically a model, use `model: null`. */ language?: string; + /** + * Initial theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } /** * The options to create a diff editor. */ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * Initial theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } export interface IStandaloneCodeEditor extends ICodeEditor { @@ -1038,19 +1068,19 @@ declare module monaco.editor { export interface IModelDecorationOverviewRulerOptions { /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - color: string; + color: string | ThemeColor; /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - darkColor: string; + darkColor: string | ThemeColor; /** * CSS color to render in the overview ruler. - * e.g.: rgba(100, 100, 100, 0.5) + * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ - hcColor?: string; + hcColor?: string | ThemeColor; /** * The position in the overview ruler. */ @@ -1082,10 +1112,6 @@ declare module monaco.editor { * Should the decoration expand to encompass a whole line. */ isWholeLine?: boolean; - /** - * @deprecated : Use `overviewRuler` instead - */ - showInOverviewRuler?: string; /** * If set, render this decoration in the overview ruler. */ @@ -1508,46 +1534,46 @@ declare module monaco.editor { * @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if not matches have been found. */ - findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchScope Limit the searching to only search inside this range. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if no matches have been found. */ - findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model for the next match. Loops to the beginning of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the next match is. It is null if no next match has been found. */ - findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): FindMatch; + findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch; /** * Search the model for the previous match. Loops to the end of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. - * @param wholeWord Force the matching to match entire words only. + * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the previous match is. It is null if no previous match has been found. */ - findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean, captureMatches: boolean): FindMatch; + findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch; } export class FindMatch { @@ -2132,6 +2158,10 @@ declare module monaco.editor { restoreViewState?(state: any): void; } + export interface ThemeColor { + id: string; + } + export interface ICommonCodeEditor extends IEditor { /** * An event emitted when the content of the current model has changed. @@ -2268,6 +2298,7 @@ declare module monaco.editor { getAction(id: string): IEditorAction; /** * Execute a command on the editor. + * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. * @param source The source of the call. * @param command The command to execute */ @@ -2278,6 +2309,7 @@ declare module monaco.editor { pushUndoStop(): boolean; /** * Execute edits on the editor. + * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. * @param source The source of the call. * @param edits The edits to execute. * @param endCursoState Cursor state after the edits were applied. @@ -2500,18 +2532,10 @@ declare module monaco.editor { * Primary cursor's position. */ readonly position: Position; - /** - * Primary cursor's view position - */ - readonly viewPosition: Position; /** * Secondary cursors' position. */ readonly secondaryPositions: Position[]; - /** - * Secondary cursors' view position. - */ - readonly secondaryViewPositions: Position[]; /** * Reason. */ @@ -2520,10 +2544,6 @@ declare module monaco.editor { * Source of the call that caused the event. */ readonly source: string; - /** - * Is the primary cursor in the editable range? - */ - readonly isInEditableRange: boolean; } /** @@ -2534,18 +2554,10 @@ declare module monaco.editor { * The primary selection. */ readonly selection: Selection; - /** - * The primary selection in view coordinates. - */ - readonly viewSelection: Selection; /** * The secondary selections. */ readonly secondarySelections: Selection[]; - /** - * The secondary selections in view coordinates. - */ - readonly secondaryViewSelections: Selection[]; /** * Source of the call that caused the event. */ @@ -2619,6 +2631,20 @@ declare module monaco.editor { horizontalSliderSize?: number; } + /** + * Configuration options for editor find widget + */ + export interface IEditorFindOptions { + /** + * Controls if we seed search string in the Find Widget with editor selection. + */ + seedSearchStringFromSelection?: boolean; + /** + * Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor. + */ + autoFindInSelection: boolean; + } + /** * Configuration options for editor minimap */ @@ -2640,17 +2666,10 @@ declare module monaco.editor { maxColumn?: number; } - export type LineNumbersOption = 'on' | 'off' | 'relative' | ((lineNumber: number) => string); - /** * Configuration options for the editor. */ export interface IEditorOptions { - /** - * Enable experimental screen reader support. - * Defaults to `true`. - */ - experimentalScreenReader?: boolean; /** * The aria label for the editor's textarea (when it is focused). */ @@ -2677,7 +2696,7 @@ declare module monaco.editor { * Otherwise, line numbers will not be rendered. * Defaults to true. */ - lineNumbers?: LineNumbersOption; + lineNumbers?: 'on' | 'off' | 'relative' | ((lineNumber: number) => string); /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -2712,11 +2731,9 @@ declare module monaco.editor { */ roundedSelection?: boolean; /** - * Theme to be used for rendering. - * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. - * You can create custom themes via `monaco.editor.defineTheme`. + * Class name to be added to the editor. */ - theme?: string; + extraEditorClassName?: string; /** * Should the editor be read only. * Defaults to false. @@ -2730,6 +2747,10 @@ declare module monaco.editor { * Control the behavior and rendering of the minimap. */ minimap?: IEditorMinimapOptions; + /** + * Control the behavior of the find widget. + */ + find?: IEditorFindOptions; /** * Display overflow widgets as `fixed`. * Defaults to `false`. @@ -2855,6 +2876,11 @@ declare module monaco.editor { * Defaults to 1. */ mouseWheelScrollSensitivity?: number; + /** + * The modifier to be used to add multiple cursors with the mouse. + * Defaults to 'alt' + */ + multicursorModifier?: 'cmd' | 'ctrl' | 'alt'; /** * Enable quick suggestions (shadow suggestions) * Defaults to true. @@ -2905,9 +2931,9 @@ declare module monaco.editor { suggestOnTriggerCharacters?: boolean; /** * Accept suggestions on ENTER. - * Defaults to true. + * Defaults to 'on'. */ - acceptSuggestionOnEnter?: boolean; + acceptSuggestionOnEnter?: 'on' | 'smart' | 'off'; /** * Accept suggestions on provider defined characters. * Defaults to true. @@ -2955,6 +2981,11 @@ declare module monaco.editor { * Defaults to true in vscode and to false in monaco-editor. */ folding?: boolean; + /** + * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. + * Defaults to 'mouseover'. + */ + showFoldingControls?: 'always' | 'mouseover'; /** * Enable highlighting of matching brackets. * Defaults to true. @@ -3000,6 +3031,10 @@ declare module monaco.editor { * The line height */ lineHeight?: number; + /** + * The letter spacing + */ + letterSpacing?: number; } /** @@ -3119,8 +3154,7 @@ declare module monaco.editor { UnderlineThin = 6, } - export class InternalEditorScrollbarOptions { - readonly _internalEditorScrollbarOptionsBrand: void; + export interface InternalEditorScrollbarOptions { readonly arrowSize: number; readonly vertical: ScrollbarVisibility; readonly horizontal: ScrollbarVisibility; @@ -3135,15 +3169,18 @@ declare module monaco.editor { readonly mouseWheelScrollSensitivity: number; } - export class InternalEditorMinimapOptions { - readonly _internalEditorMinimapOptionsBrand: void; + export interface InternalEditorMinimapOptions { readonly enabled: boolean; readonly renderCharacters: boolean; readonly maxColumn: number; } - export class EditorWrappingInfo { - readonly _editorWrappingInfoBrand: void; + export interface InternalEditorFindOptions { + readonly seedSearchStringFromSelection: boolean; + readonly autoFindInSelection: boolean; + } + + export interface EditorWrappingInfo { readonly inDiffEditor: boolean; readonly isDominatedByLongLines: boolean; readonly isWordWrapMinified: boolean; @@ -3155,12 +3192,9 @@ declare module monaco.editor { readonly wordWrapBreakObtrusiveCharacters: string; } - export class InternalEditorViewOptions { - readonly _internalEditorViewOptionsBrand: void; - readonly theme: string; - readonly canUseTranslate3d: boolean; + export interface InternalEditorViewOptions { + readonly extraEditorClassName: string; readonly disableMonospaceOptimizations: boolean; - readonly experimentalScreenReader: boolean; readonly rulers: number[]; readonly ariaLabel: string; readonly renderLineNumbers: boolean; @@ -3177,7 +3211,6 @@ declare module monaco.editor { readonly cursorStyle: TextEditorCursorStyle; readonly hideCursorInOverviewRuler: boolean; readonly scrollBeyondLastLine: boolean; - readonly editorClassName: string; readonly stopRenderingLineAfter: number; readonly renderWhitespace: 'none' | 'boundary' | 'all'; readonly renderControlCharacters: boolean; @@ -3189,7 +3222,7 @@ declare module monaco.editor { readonly fixedOverflowWidgets: boolean; } - export class EditorContribOptions { + export interface EditorContribOptions { readonly selectionClipboard: boolean; readonly hover: boolean; readonly contextmenu: boolean; @@ -3204,10 +3237,9 @@ declare module monaco.editor { readonly formatOnType: boolean; readonly formatOnPaste: boolean; readonly suggestOnTriggerCharacters: boolean; - readonly acceptSuggestionOnEnter: boolean; + readonly acceptSuggestionOnEnter: 'on' | 'smart' | 'off'; readonly acceptSuggestionOnCommitCharacter: boolean; readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none'; - readonly emptySelectionClipboard: boolean; readonly wordBasedSuggestions: boolean; readonly suggestFontSize: number; readonly suggestLineHeight: number; @@ -3215,7 +3247,9 @@ declare module monaco.editor { readonly occurrencesHighlight: boolean; readonly codeLens: boolean; readonly folding: boolean; + readonly showFoldingControls: 'always' | 'mouseover'; readonly matchBrackets: boolean; + readonly find: InternalEditorFindOptions; } /** @@ -3223,13 +3257,18 @@ declare module monaco.editor { */ export class InternalEditorOptions { readonly _internalEditorOptionsBrand: void; + readonly canUseTranslate3d: boolean; + readonly pixelRatio: number; + readonly editorClassName: string; readonly lineHeight: number; readonly readOnly: boolean; + readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; readonly wordSeparators: string; readonly autoClosingBrackets: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; + readonly emptySelectionClipboard: boolean; readonly layoutInfo: EditorLayoutInfo; readonly fontInfo: FontInfo; readonly viewInfo: InternalEditorViewOptions; @@ -3240,8 +3279,7 @@ declare module monaco.editor { /** * A description for the overview ruler position. */ - export class OverviewRulerPosition { - readonly _overviewRulerPositionBrand: void; + export interface OverviewRulerPosition { /** * Width of the overview ruler */ @@ -3263,8 +3301,7 @@ declare module monaco.editor { /** * The internal layout details of the editor. */ - export class EditorLayoutInfo { - readonly _editorLayoutInfoBrand: void; + export interface EditorLayoutInfo { /** * Full editor width. */ @@ -3347,53 +3384,26 @@ declare module monaco.editor { readonly overviewRuler: OverviewRulerPosition; } - export interface IViewConfigurationChangedEvent { - readonly theme: boolean; - readonly canUseTranslate3d: boolean; - readonly disableMonospaceOptimizations: boolean; - readonly experimentalScreenReader: boolean; - readonly rulers: boolean; - readonly ariaLabel: boolean; - readonly renderLineNumbers: boolean; - readonly renderCustomLineNumbers: boolean; - readonly renderRelativeLineNumbers: boolean; - readonly selectOnLineNumbers: boolean; - readonly glyphMargin: boolean; - readonly revealHorizontalRightPadding: boolean; - readonly roundedSelection: boolean; - readonly overviewRulerLanes: boolean; - readonly overviewRulerBorder: boolean; - readonly cursorBlinking: boolean; - readonly mouseWheelZoom: boolean; - readonly cursorStyle: boolean; - readonly hideCursorInOverviewRuler: boolean; - readonly scrollBeyondLastLine: boolean; - readonly editorClassName: boolean; - readonly stopRenderingLineAfter: boolean; - readonly renderWhitespace: boolean; - readonly renderControlCharacters: boolean; - readonly fontLigatures: boolean; - readonly renderIndentGuides: boolean; - readonly renderLineHighlight: boolean; - readonly scrollbar: boolean; - readonly minimap: boolean; - readonly fixedOverflowWidgets: boolean; - } - /** * An event describing that the configuration of the editor has changed. */ export interface IConfigurationChangedEvent { + readonly canUseTranslate3d: boolean; + readonly pixelRatio: boolean; + readonly editorClassName: boolean; readonly lineHeight: boolean; readonly readOnly: boolean; + readonly accessibilitySupport: boolean; + readonly multicursorModifier: boolean; readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; + readonly emptySelectionClipboard: boolean; readonly layoutInfo: boolean; readonly fontInfo: boolean; - readonly viewInfo: IViewConfigurationChangedEvent; + readonly viewInfo: boolean; readonly wrappingInfo: boolean; readonly contribInfo: boolean; } @@ -3831,6 +3841,7 @@ declare module monaco.editor { readonly fontWeight: string; readonly fontSize: number; readonly lineHeight: number; + readonly letterSpacing: number; } } diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index f94c856c72e..84b232e0130 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -51,7 +51,7 @@ export class MenuId { static readonly SCMResourceContext = new MenuId('13'); static readonly CommandPalette = new MenuId('14'); static readonly ViewTitle = new MenuId('15'); - static readonly ViewResource = new MenuId('16'); + static readonly ViewItemContext = new MenuId('16'); constructor(private _id: string) { diff --git a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts index 4896cdea038..0e9b8d4f004 100644 --- a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts +++ b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts @@ -39,7 +39,7 @@ namespace schema { case 'scm/resourceGroup/context': return MenuId.SCMResourceGroupContext; case 'scm/resourceState/context': return MenuId.SCMResourceContext; case 'view/title': return MenuId.ViewTitle; - case 'view/resource': return MenuId.ViewResource; + case 'view/item/context': return MenuId.ViewItemContext; } return void 0; @@ -143,6 +143,16 @@ namespace schema { description: localize('menus.resourceStateContext', "The Source Control resource state context menu"), type: 'array', items: menuItem + }, + 'view/title': { + description: localize('view.viewTitle', "The contributed view title menu"), + type: 'array', + items: menuItem + }, + 'view/item/context': { + description: localize('view.itemContext', "The contributed view item context menu"), + type: 'array', + items: menuItem } } }; diff --git a/src/vs/platform/contextkey/test/common/contextkey.test.ts b/src/vs/platform/contextkey/test/common/contextkey.test.ts index 84562268907..69f8bca0930 100644 --- a/src/vs/platform/contextkey/test/common/contextkey.test.ts +++ b/src/vs/platform/contextkey/test/common/contextkey.test.ts @@ -7,7 +7,13 @@ import * as assert from 'assert'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -const createContext = ctx => ({ getValue: key => ctx[key] }); +function createContext(ctx: any) { + return { + getValue: (key: string) => { + return ctx[key]; + } + }; +} suite('ContextKeyExpr', () => { test('ContextKeyExpr.equals', function () { diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index 8e8fbb81a23..b7aee17d584 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -37,7 +37,7 @@ export interface ParsedArgs { 'uninstall-extension'?: string | string[]; 'enable-proposed-api'?: string | string[]; 'open-url'?: string | string[]; - 'prof-startup-timers': string; + 'skip-getting-started'?: boolean; } export const IEnvironmentService = createDecorator('environmentService'); @@ -78,6 +78,8 @@ export interface IEnvironmentService { performance: boolean; profileStartup: { prefix: string, dir: string } | undefined; + skipGettingStarted: boolean | undefined; + mainIPCHandle: string; sharedIPCHandle: string; diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index b5bd5de2417..b022eb3ce6b 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -22,7 +22,6 @@ const options: minimist.Opts = { 'debugBrkPluginHost', 'debugPluginHost', 'open-url', - 'prof-startup-timers', 'enable-proposed-api' ], boolean: [ @@ -41,7 +40,8 @@ const options: minimist.Opts = { 'disable-extensions', 'list-extensions', 'show-versions', - 'nolazy' + 'nolazy', + 'skip-getting-started' ], alias: { help: 'h', diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 15b2f19951a..34a82d9d571 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -100,6 +100,8 @@ export class EnvironmentService implements IEnvironmentService { get disableExtensions(): boolean { return this._args['disable-extensions']; } + get skipGettingStarted(): boolean { return this._args['skip-getting-started']; } + @memoize get debugExtensionHost(): { port: number; break: boolean; } { return parseExtensionHostPort(this._args, this.isBuilt); } diff --git a/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts index 4d5e0588994..e3f772bb1a0 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts @@ -5,7 +5,8 @@ 'use strict'; -import { ILocalExtension, IGalleryExtension, IExtensionManifest, EXTENSION_IDENTIFIER_REGEX } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ILocalExtension, IGalleryExtension, IExtensionManifest, EXTENSION_IDENTIFIER_REGEX, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; export function areSameExtensions(a: { id: string }, b: { id: string }): boolean { if (a.id === b.id) { @@ -71,4 +72,25 @@ export function getGalleryExtensionTelemetryData(extension: IGalleryExtension): publisherDisplayName: extension.publisherDisplayName, dependencies: extension.properties.dependencies.length > 0 }; +} + + +const BetterMergeCheckKey = 'extensions/bettermergecheck'; +export const BetterMergeDisabledNowKey = 'extensions/bettermergedisablednow'; +export const BetterMergeId = 'pprice.better-merge'; + +/** + * Globally disabled extensions, taking care of disabling obsolete extensions. + */ +export function getGloballyDisabledExtensions(extensionEnablementService: IExtensionEnablementService, storageService: IStorageService, installedExtensions: { id: string; }[]) { + const globallyDisabled = extensionEnablementService.getGloballyDisabledExtensions(); + if (!storageService.getBoolean(BetterMergeCheckKey, StorageScope.GLOBAL, false)) { + storageService.store(BetterMergeCheckKey, true); + if (globallyDisabled.indexOf(BetterMergeId) === -1 && installedExtensions.some(d => d.id === BetterMergeId)) { + globallyDisabled.push(BetterMergeId); + extensionEnablementService.setEnablement(BetterMergeId, false); + storageService.store(BetterMergeDisabledNowKey, true); + } + } + return globallyDisabled; } \ No newline at end of file diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 523bcbda9e9..ccce0192774 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -10,7 +10,6 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as uuid from 'vs/base/common/uuid'; import { distinct } from 'vs/base/common/arrays'; import { getErrorMessage } from 'vs/base/common/errors'; -import { ArraySet } from 'vs/base/common/set'; import { IGalleryExtension, IExtensionGalleryService, IGalleryExtensionAsset, IQueryOptions, SortBy, SortOrder, IExtensionManifest } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId, getGalleryExtensionTelemetryData, adoptToGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { assign, getOrDefault } from 'vs/base/common/objects'; @@ -475,14 +474,15 @@ export class ExtensionGalleryService implements IExtensionGalleryService { return this.loadDependencies(toGet) .then(loadedDependencies => { - const dependenciesSet = new ArraySet(); + const dependenciesSet = new Set(); for (const dep of loadedDependencies) { if (dep.properties.dependencies) { - dep.properties.dependencies.forEach(d => dependenciesSet.set(d)); + dep.properties.dependencies.forEach(d => dependenciesSet.add(d)); } } result = distinct(result.concat(loadedDependencies), d => d.uuid); - const dependencies = dependenciesSet.elements.filter(d => !ExtensionGalleryService.hasExtensionByName(result, d)); + const dependencies: string[] = []; + dependenciesSet.forEach(d => !ExtensionGalleryService.hasExtensionByName(result, d) && dependencies.push(d)); return this.getDependenciesReccursively(dependencies, result, root); }); } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 9f6240ab3b6..43b0fb1ed0c 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -268,26 +268,28 @@ export class ExtensionManagementService implements IExtensionManagementService { private installExtension(zipPath: string, id: string, metadata: IGalleryMetadata = null): TPromise { const extensionPath = path.join(this.extensionsPath, id); - return extract(zipPath, extensionPath, { sourcePath: 'extension', overwrite: true }) - .then(() => readManifest(extensionPath)) - .then(({ manifest }) => { - return pfs.readdir(extensionPath).then(children => { - const readme = children.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0]; - const readmeUrl = readme ? URI.file(path.join(extensionPath, readme)).toString() : null; - const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0]; - const changelogUrl = changelog ? URI.file(path.join(extensionPath, changelog)).toString() : null; - const type = LocalExtensionType.User; + return pfs.rimraf(extensionPath).then(() => { + return extract(zipPath, extensionPath, { sourcePath: 'extension', overwrite: true }) + .then(() => readManifest(extensionPath)) + .then(({ manifest }) => { + return pfs.readdir(extensionPath).then(children => { + const readme = children.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0]; + const readmeUrl = readme ? URI.file(path.join(extensionPath, readme)).toString() : null; + const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0]; + const changelogUrl = changelog ? URI.file(path.join(extensionPath, changelog)).toString() : null; + const type = LocalExtensionType.User; - const local: ILocalExtension = { type, id, manifest, metadata, path: extensionPath, readmeUrl, changelogUrl }; - const manifestPath = path.join(extensionPath, 'package.json'); + const local: ILocalExtension = { type, id, manifest, metadata, path: extensionPath, readmeUrl, changelogUrl }; + const manifestPath = path.join(extensionPath, 'package.json'); - return pfs.readFile(manifestPath, 'utf8') - .then(raw => parseManifest(raw)) - .then(({ manifest }) => assign(manifest, { __metadata: metadata })) - .then(manifest => pfs.writeFile(manifestPath, JSON.stringify(manifest, null, '\t'))) - .then(() => local); + return pfs.readFile(manifestPath, 'utf8') + .then(raw => parseManifest(raw)) + .then(({ manifest }) => assign(manifest, { __metadata: metadata })) + .then(manifest => pfs.writeFile(manifestPath, JSON.stringify(manifest, null, '\t'))) + .then(() => local); + }); }); - }); + }); } uninstall(extension: ILocalExtension, force = false): TPromise { diff --git a/src/vs/platform/extensions/common/abstractExtensionService.ts b/src/vs/platform/extensions/common/abstractExtensionService.ts index 25ae438be94..ed0525f99c0 100644 --- a/src/vs/platform/extensions/common/abstractExtensionService.ts +++ b/src/vs/platform/extensions/common/abstractExtensionService.ts @@ -28,6 +28,8 @@ interface IActivatingExtensionMap { [extensionId: string]: TPromise; } +const NO_OP_VOID_PROMISE = TPromise.as(void 0); + export abstract class AbstractExtensionService implements IExtensionService { public _serviceBrand: any; @@ -38,6 +40,11 @@ export abstract class AbstractExtensionService imp private _isReady: boolean; protected _registry: ExtensionDescriptionRegistry; + /** + * A map of already activated events to speed things up if the same activation event is triggered multiple times. + */ + private _alreadyActivatedEvents: { [activationEvent: string]: boolean; }; + constructor(isReadyByDefault: boolean) { if (isReadyByDefault) { this._isReady = true; @@ -54,6 +61,7 @@ export abstract class AbstractExtensionService imp this._activatingExtensions = {}; this._activatedExtensions = {}; this._registry = new ExtensionDescriptionRegistry(); + this._alreadyActivatedEvents = Object.create(null); } protected _triggerOnReady(): void { @@ -97,6 +105,9 @@ export abstract class AbstractExtensionService imp } public activateByEvent(activationEvent: string): TPromise { + if (this._alreadyActivatedEvents[activationEvent]) { + return NO_OP_VOID_PROMISE; + } if (this._isReady) { return this._activateByEvent(activationEvent); } else { @@ -106,7 +117,9 @@ export abstract class AbstractExtensionService imp private _activateByEvent(activationEvent: string): TPromise { let activateExtensions = this._registry.getExtensionDescriptionsForActivationEvent(activationEvent); - return this._activateExtensions(activateExtensions, 0); + return this._activateExtensions(activateExtensions, 0).then(() => { + this._alreadyActivatedEvents[activationEvent] = true; + }); } public activateById(extensionId: string): TPromise { diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts index 71bcbf60444..72c1f308b74 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts @@ -32,6 +32,8 @@ export interface IMessage { type: Severity; message: string; source: string; + extensionId: string; + extensionPointId: string; } export interface IExtensionsStatus { diff --git a/src/vs/platform/extensions/common/extensionsRegistry.ts b/src/vs/platform/extensions/common/extensionsRegistry.ts index a3b94131189..7edf4f74960 100644 --- a/src/vs/platform/extensions/common/extensionsRegistry.ts +++ b/src/vs/platform/extensions/common/extensionsRegistry.ts @@ -17,19 +17,27 @@ const schemaRegistry = Registry.as(Extensions.JSONCon export class ExtensionMessageCollector { - private _messageHandler: (msg: IMessage) => void; - private _source: string; + private readonly _messageHandler: (msg: IMessage) => void; + private readonly _extension: IExtensionDescription; + private readonly _extensionPointId: string; - constructor(messageHandler: (msg: IMessage) => void, source: string) { + constructor( + messageHandler: (msg: IMessage) => void, + extension: IExtensionDescription, + extensionPointId: string + ) { this._messageHandler = messageHandler; - this._source = source; + this._extension = extension; + this._extensionPointId = extensionPointId; } private _msg(type: Severity, message: string): void { this._messageHandler({ type: type, message: message, - source: this._source + source: this._extension.extensionFolderPath, + extensionId: this._extension.id, + extensionPointId: this._extensionPointId }); } @@ -139,7 +147,7 @@ const schema: IJSONSchema = { uniqueItems: true, items: { type: 'string', - enum: ['Languages', 'Snippets', 'Linters', 'Themes', 'Debuggers', 'Other', 'Keymaps', 'Formatters', 'Extension Packs'] + enum: ['Languages', 'Snippets', 'Linters', 'Themes', 'Debuggers', 'Other', 'Keymaps', 'Formatters', 'Extension Packs', 'SCM Providers'] } }, galleryBanner: { @@ -174,7 +182,7 @@ const schema: IJSONSchema = { type: 'array', items: { type: 'string', - defaultSnippets: [{ label: 'onLanguage', body: 'onLanguage:${1:languageId}' }, { label: 'onCommand', body: 'onCommand:${2:commandId}' }, { label: 'onDebug', body: 'onDebug:${3:type}' }, { label: 'workspaceContains', body: 'workspaceContains:${4:fileName}' }], + defaultSnippets: [{ label: 'onLanguage', body: 'onLanguage:${1:languageId}' }, { label: 'onCommand', body: 'onCommand:${2:commandId}' }, { label: 'onDebug', body: 'onDebug:${3:type}' }, { label: 'workspaceContains', body: 'workspaceContains:${4:fileName}' }, { label: 'onView', body: 'onView:${5:viewId}' }], } }, badges: { diff --git a/src/vs/platform/keybinding/common/keybindingLabels.ts b/src/vs/platform/keybinding/common/keybindingLabels.ts index ef961ee79c5..c9a7cec8e18 100644 --- a/src/vs/platform/keybinding/common/keybindingLabels.ts +++ b/src/vs/platform/keybinding/common/keybindingLabels.ts @@ -23,13 +23,6 @@ export interface Modifiers { readonly metaKey: boolean; } -export const NO_MODIFIERS: Modifiers = { - ctrlKey: false, - shiftKey: false, - altKey: false, - metaKey: false -}; - export class ModifierLabelProvider { public readonly modifierLabels: ModifierLabels[]; diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts index 91440e9307f..46bdac8acc9 100644 --- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts +++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts @@ -180,6 +180,8 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry { || keyCode === KeyCode.US_DOT || keyCode === KeyCode.US_SLASH || keyCode === KeyCode.US_BACKTICK + || keyCode === KeyCode.ABNT_C1 + || keyCode === KeyCode.ABNT_C2 || keyCode === KeyCode.US_OPEN_SQUARE_BRACKET || keyCode === KeyCode.US_BACKSLASH || keyCode === KeyCode.US_CLOSE_SQUARE_BRACKET diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index 5e204fc8be2..08d67882828 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { ResolvedKeybinding, KeyCode, KeyCodeUtils, USER_SETTINGS, Keybinding, KeybindingType, SimpleKeybinding } from 'vs/base/common/keyCodes'; -import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider, NO_MODIFIERS } from 'vs/platform/keybinding/common/keybindingLabels'; +import { ResolvedKeybinding, ResolvedKeybindingPart, KeyCode, KeyCodeUtils, Keybinding, KeybindingType, SimpleKeybinding } from 'vs/base/common/keyCodes'; +import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; import { OperatingSystem } from 'vs/base/common/platform'; /** @@ -64,12 +64,6 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding { return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._os); } - public getLabelWithoutModifiers(): string { - let firstPart = this._getUILabelForKeybinding(this._firstPart); - let chordPart = this._getUILabelForKeybinding(this._chordPart); - return UILabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, this._os); - } - private _getAriaLabelForKeybinding(keybinding: SimpleKeybinding): string { if (!keybinding) { return null; @@ -86,12 +80,6 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding { return AriaLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._os); } - public getAriaLabelWithoutModifiers(): string { - let firstPart = this._getAriaLabelForKeybinding(this._firstPart); - let chordPart = this._getAriaLabelForKeybinding(this._chordPart); - return AriaLabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, this._os); - } - private _keyCodeToElectronAccelerator(keyCode: KeyCode): string { if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { // Electron cannot handle numpad keys @@ -139,7 +127,7 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding { if (keybinding.isDuplicateModifierCase()) { return ''; } - return USER_SETTINGS.fromKeyCode(keybinding.keyCode); + return KeyCodeUtils.toUserSettingsUS(keybinding.keyCode); } public getUserSettingsLabel(): string { @@ -157,36 +145,26 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding { return (this._chordPart ? true : false); } - public hasCtrlModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.ctrlKey; + public getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart] { + return [ + this._toResolvedKeybindingPart(this._firstPart), + this._toResolvedKeybindingPart(this._chordPart) + ]; } - public hasShiftModifier(): boolean { - if (this._chordPart) { - return false; + private _toResolvedKeybindingPart(keybinding: SimpleKeybinding): ResolvedKeybindingPart { + if (!keybinding) { + return null; } - return this._firstPart.shiftKey; - } - public hasAltModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.altKey; - } - - public hasMetaModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.metaKey; - } - - public getParts(): [ResolvedKeybinding, ResolvedKeybinding] { - return [new USLayoutResolvedKeybinding(this._firstPart, this._os), this._chordPart ? new USLayoutResolvedKeybinding(this._chordPart, this._os) : null]; + return new ResolvedKeybindingPart( + keybinding.ctrlKey, + keybinding.shiftKey, + keybinding.altKey, + keybinding.metaKey, + this._getUILabelForKeybinding(keybinding), + this._getAriaLabelForKeybinding(keybinding) + ); } public getDispatchParts(): [string, string] { diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 64be8f6ad36..f5cc9fb7984 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -20,7 +20,13 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe import { OS } from 'vs/base/common/platform'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -const createContext = ctx => ({ getValue: key => ctx[key] }); +function createContext(ctx: any) { + return { + getValue: (key: string) => { + return ctx[key]; + } + }; +} suite('AbstractKeybindingService', () => { diff --git a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts index dacc7a9e157..19f285354cc 100644 --- a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts @@ -16,25 +16,15 @@ suite('KeybindingLabels', () => { assert.equal(usResolvedKeybinding.getLabel(), expected); } - function assertUSLabelWithoutModifiers(OS: OperatingSystem, keybinding: number, expected: string): void { - const usResolvedKeybinding = new USLayoutResolvedKeybinding(createKeybinding(keybinding, OS), OS); - assert.equal(usResolvedKeybinding.getLabelWithoutModifiers(), expected); - } - test('Windows US label', () => { // no modifier assertUSLabel(OperatingSystem.Windows, KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyCode.KEY_A, 'A'); // one modifier assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyCode.KEY_A, 'Ctrl+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.Shift | KeyCode.KEY_A, 'Shift+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.Alt | KeyCode.KEY_A, 'Alt+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.WinCtrl | KeyCode.KEY_A, 'Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // two modifiers assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, 'Ctrl+Shift+A'); @@ -43,46 +33,29 @@ suite('KeybindingLabels', () => { assertUSLabel(OperatingSystem.Windows, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'Shift+Alt+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'Shift+Windows+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // three modifiers assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'Ctrl+Shift+Alt+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Shift+Windows+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Alt+Windows+A'); assertUSLabel(OperatingSystem.Windows, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Shift+Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // four modifiers assertUSLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Shift+Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // chord assertUSLabel(OperatingSystem.Windows, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), 'Ctrl+A Ctrl+B'); - assertUSLabelWithoutModifiers(OperatingSystem.Windows, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), 'A B'); }); test('Linux US label', () => { // no modifier assertUSLabel(OperatingSystem.Linux, KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyCode.KEY_A, 'A'); // one modifier assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyCode.KEY_A, 'Ctrl+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.Shift | KeyCode.KEY_A, 'Shift+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.Alt | KeyCode.KEY_A, 'Alt+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.WinCtrl | KeyCode.KEY_A, 'Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // two modifiers assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, 'Ctrl+Shift+A'); @@ -91,46 +64,29 @@ suite('KeybindingLabels', () => { assertUSLabel(OperatingSystem.Linux, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'Shift+Alt+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'Shift+Windows+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // three modifiers assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'Ctrl+Shift+Alt+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Shift+Windows+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Alt+Windows+A'); assertUSLabel(OperatingSystem.Linux, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Shift+Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // four modifiers assertUSLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Ctrl+Shift+Alt+Windows+A'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // chord assertUSLabel(OperatingSystem.Linux, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), 'Ctrl+A Ctrl+B'); - assertUSLabelWithoutModifiers(OperatingSystem.Linux, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), 'A B'); }); test('Mac US label', () => { // no modifier assertUSLabel(OperatingSystem.Macintosh, KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyCode.KEY_A, 'A'); // one modifier assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyCode.KEY_A, '⌘A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.Shift | KeyCode.KEY_A, '⇧A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.Alt | KeyCode.KEY_A, '⌥A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.WinCtrl | KeyCode.KEY_A, '⌃A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // two modifiers assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, '⇧⌘A'); @@ -139,30 +95,18 @@ suite('KeybindingLabels', () => { assertUSLabel(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, '⇧⌥A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⇧A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⌥A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // three modifiers assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, '⇧⌥⌘A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⇧⌘A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⌥⌘A'); assertUSLabel(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⇧⌥A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // four modifiers assertUSLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, '⌃⇧⌥⌘A'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); // chord assertUSLabel(OperatingSystem.Macintosh, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), '⌘A ⌘B'); - assertUSLabelWithoutModifiers(OperatingSystem.Macintosh, KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_A, KeyMod.CtrlCmd | KeyCode.KEY_B), 'A B'); // special keys assertUSLabel(OperatingSystem.Macintosh, KeyCode.LeftArrow, 'â†'); @@ -176,17 +120,10 @@ suite('KeybindingLabels', () => { const usResolvedKeybinding = new USLayoutResolvedKeybinding(createKeybinding(keybinding, OS), OS); assert.equal(usResolvedKeybinding.getAriaLabel(), expected); } - function assertAriaLabelWithoutModifiers(OS: OperatingSystem, keybinding: number, expected: string): void { - const usResolvedKeybinding = new USLayoutResolvedKeybinding(createKeybinding(keybinding, OS), OS); - assert.equal(usResolvedKeybinding.getAriaLabelWithoutModifiers(), expected); - } assertAriaLabel(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Control+Shift+Alt+Windows+A'); assertAriaLabel(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Control+Shift+Alt+Windows+A'); assertAriaLabel(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'Control+Shift+Alt+Command+A'); - assertAriaLabelWithoutModifiers(OperatingSystem.Windows, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertAriaLabelWithoutModifiers(OperatingSystem.Linux, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); - assertAriaLabelWithoutModifiers(OperatingSystem.Macintosh, KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyMod.WinCtrl | KeyCode.KEY_A, 'A'); }); test('Electron Accelerator label', () => { diff --git a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts index 13088ab90c2..dc22f50d3ce 100644 --- a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts @@ -12,7 +12,13 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OS } from 'vs/base/common/platform'; -const createContext = ctx => ({ getValue: key => ctx[key] }); +function createContext(ctx: any) { + return { + getValue: (key: string) => { + return ctx[key]; + } + }; +} suite('KeybindingResolver', () => { diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index 4c4e03c566c..a050b92656c 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -38,12 +38,17 @@ class MockKeybindingContextKey implements IContextKey { } export class MockContextKeyService implements IContextKeyService { + public _serviceBrand: any; + private _keys = new Map>(); - public dispose(): void { } - + public dispose(): void { + // + } public createKey(key: string, defaultValue: T): IContextKey { - return new MockKeybindingContextKey(key, defaultValue); + let ret = new MockKeybindingContextKey(key, defaultValue); + this._keys.set(key, ret); + return ret; } public contextMatchesRules(rules: ContextKeyExpr): boolean { return false; @@ -52,7 +57,9 @@ export class MockContextKeyService implements IContextKeyService { return Event.None; } public getContextKeyValue(key: string) { - return; + if (this._keys.has(key)) { + return this._keys.get(key).get(); + } } public getContext(domNode: HTMLElement): any { return null; diff --git a/src/vs/platform/lifecycle/common/lifecycle.ts b/src/vs/platform/lifecycle/common/lifecycle.ts index d6fdf34ddb5..1cd1ab93cea 100644 --- a/src/vs/platform/lifecycle/common/lifecycle.ts +++ b/src/vs/platform/lifecycle/common/lifecycle.ts @@ -26,16 +26,22 @@ export interface ShutdownEvent { export enum ShutdownReason { /** Window is closed */ - CLOSE, + CLOSE = 1, /** Application is quit */ - QUIT, + QUIT = 2, /** Window is reloaded */ - RELOAD, + RELOAD = 3, /** Other configuration loaded into window */ - LOAD + LOAD = 4 +} + +export enum StartupKind { + NewWindow = 1, + ReloadedWindow = 3, + ReopenedWindow = 4, } /** @@ -46,17 +52,22 @@ export interface ILifecycleService { _serviceBrand: any; + /** + * Value indicates how this window got loaded. + */ + readonly startupKind: StartupKind; + /** * A flag indicating if the application is in the process of shutting down. This will be true * before the onWillShutdown event is fired and false if the shutdown is being vetoed. */ - willShutdown: boolean; + readonly willShutdown: boolean; /** * Fired before shutdown happens. Allows listeners to veto against the * shutdown. */ - onWillShutdown: Event; + readonly onWillShutdown: Event; /** * Fired when no client is preventing the shutdown from happening. Can be used to dispose heavy resources @@ -64,12 +75,13 @@ export interface ILifecycleService { * * The event carries a shutdown reason that indicates how the shutdown was triggered. */ - onShutdown: Event; + readonly onShutdown: Event; } export const NullLifecycleService: ILifecycleService = { _serviceBrand: null, + startupKind: StartupKind.NewWindow, willShutdown: false, onWillShutdown: () => ({ dispose() { } }), onShutdown: (reason) => ({ dispose() { } }) -}; \ No newline at end of file +}; diff --git a/src/vs/platform/markers/common/problemMatcher.ts b/src/vs/platform/markers/common/problemMatcher.ts index 063c064e1ad..b42f0f2a906 100644 --- a/src/vs/platform/markers/common/problemMatcher.ts +++ b/src/vs/platform/markers/common/problemMatcher.ts @@ -126,12 +126,6 @@ export function isNamedProblemMatcher(value: ProblemMatcher): value is NamedProb return value && Types.isString((value).name) ? true : false; } -let valueMap: { [key: string]: string; } = { - E: 'error', - W: 'warning', - I: 'info', -}; - interface Location { startLineNumber: number; startCharacter: number; @@ -192,7 +186,7 @@ export function createLineMatcher(matcher: ProblemMatcher): ILineMatcher { } } -class AbstractLineMatcher implements ILineMatcher { +abstract class AbstractLineMatcher implements ILineMatcher { private matcher: ProblemMatcher; constructor(matcher: ProblemMatcher) { @@ -207,9 +201,7 @@ class AbstractLineMatcher implements ILineMatcher { return null; } - public get matchLength(): number { - throw new Error('Subclass reponsibility'); - } + public abstract get matchLength(): number; protected fillProblemData(data: ProblemData, pattern: ProblemPattern, matches: RegExpExecArray): void { this.fillProperty(data, 'file', pattern, matches, true); @@ -302,11 +294,21 @@ class AbstractLineMatcher implements ILineMatcher { let result: Severity = null; if (data.severity) { let value = data.severity; - if (value && value.length > 0) { - if (value.length === 1 && valueMap[value[0]]) { - value = valueMap[value[0]]; - } + if (value) { result = Severity.fromValue(value); + if (result === Severity.Ignore) { + if (value === 'E') { + result = Severity.Error; + } else if (value === 'W') { + result = Severity.Warning; + } else if (value === 'I') { + result = Severity.Info; + } else if (Strings.equalsIgnoreCase(value, 'hint')) { + result = Severity.Info; + } else if (Strings.equalsIgnoreCase(value, 'note')) { + result = Severity.Info; + } + } } } if (result === null || result === Severity.Ignore) { @@ -550,7 +552,7 @@ export namespace Config { /** * A description to track the start and end of a watching task. */ - export interface WatchingMatcher { + export interface BackgroundMonitor { /** * If set to true the watcher is in active mode when the task @@ -646,7 +648,11 @@ export namespace Config { */ watchedTaskEndsRegExp?: string; - watching?: WatchingMatcher; + /** + * @deprecated Use background instead. + */ + watching?: BackgroundMonitor; + background?: BackgroundMonitor; } export type ProblemMatcherType = string | ProblemMatcher | (string | ProblemMatcher)[]; @@ -1262,15 +1268,15 @@ export class ProblemMatcherParser extends Parser { }; return; } - if (Types.isUndefinedOrNull(external.watching)) { + let backgroundMonitor = external.background || external.watching; + if (Types.isUndefinedOrNull(backgroundMonitor)) { return; } - let watching = external.watching; - let begins: WatchingPattern = this.createWatchingPattern(watching.beginsPattern); - let ends: WatchingPattern = this.createWatchingPattern(watching.endsPattern); + let begins: WatchingPattern = this.createWatchingPattern(backgroundMonitor.beginsPattern); + let ends: WatchingPattern = this.createWatchingPattern(backgroundMonitor.endsPattern); if (begins && ends) { internal.watching = { - activeOnStart: Types.isBoolean(watching.activeOnStart) ? watching.activeOnStart : false, + activeOnStart: Types.isBoolean(backgroundMonitor.activeOnStart) ? backgroundMonitor.activeOnStart : false, beginsPattern: begins, endsPattern: ends }; @@ -1323,7 +1329,7 @@ export namespace Schemas { properties: { regexp: { type: 'string', - description: localize('WatchingPatternSchema.regexp', 'The regular expression to detect the begin or end of a watching task.') + description: localize('WatchingPatternSchema.regexp', 'The regular expression to detect the begin or end of a background task.') }, file: { type: 'integer', @@ -1383,9 +1389,40 @@ export namespace Schemas { ], description: localize('ProblemMatcherSchema.fileLocation', 'Defines how file names reported in a problem pattern should be interpreted.') }, + background: { + type: 'object', + additionalProperties: false, + description: localize('ProblemMatcherSchema.background', 'Patterns to track the begin and end of a matcher active on a background task.'), + properties: { + activeOnStart: { + type: 'boolean', + description: localize('ProblemMatcherSchema.background.activeOnStart', 'If set to true the background monitor is in active mode when the task starts. This is equals of issuing a line that matches the beginPattern') + }, + beginsPattern: { + oneOf: [ + { + type: 'string' + }, + Schemas.WatchingPattern + ], + description: localize('ProblemMatcherSchema.background.beginsPattern', 'If matched in the output the start of a background task is signaled.') + }, + endsPattern: { + oneOf: [ + { + type: 'string' + }, + Schemas.WatchingPattern + ], + description: localize('ProblemMatcherSchema.background.endsPattern', 'If matched in the output the end of a background task is signaled.') + } + } + }, watching: { type: 'object', additionalProperties: false, + deprecationMessage: localize('ProblemMatcherSchema.watching.deprecated', 'The watching property is deprecated. Use background instead.'), + description: localize('ProblemMatcherSchema.watching', 'Patterns to track the begin and end of a watching matcher.'), properties: { activeOnStart: { type: 'boolean', @@ -1409,8 +1446,7 @@ export namespace Schemas { ], description: localize('ProblemMatcherSchema.watching.endsPattern', 'If matched in the output the end of a watching task is signaled.') } - }, - description: localize('ProblemMatcherSchema.watching', 'Patterns to track the begin and end of a watching pattern.') + } } } }; diff --git a/src/vs/platform/node/product.ts b/src/vs/platform/node/product.ts index 7b30b0bb2f9..43be4247029 100644 --- a/src/vs/platform/node/product.ts +++ b/src/vs/platform/node/product.ts @@ -28,7 +28,10 @@ export interface IProductConfiguration { extensionImportantTips: { [id: string]: { name: string; pattern: string; }; }; extensionKeywords: { [extension: string]: string[]; }; keymapExtensionTips: string[]; - crashReporter: Electron.CrashReporterStartOptions; + crashReporter: { + companyName: string; + productName: string; + }; welcomePage: string; enableTelemetry: boolean; aiConfig: { @@ -50,9 +53,24 @@ export interface IProductConfiguration { licenseUrl: string; privacyStatementUrl: string; npsSurveyUrl: string; + surveys: ISurveyData[]; checksums: { [path: string]: string; }; checksumFailMoreInfoUrl: string; - extraNodeModules: string[]; + hockeyApp: { + 'win32-ia32': string; + 'win32-x64': string; + 'linux-ia32': string; + 'linux-x64': string; + 'darwin': string; + }; +} + +export interface ISurveyData { + surveyId: string; + surveyUrl: string; + languageId: string; + editCount: number; + userProbability: number; } const rootPath = path.dirname(uri.parse(require.toUrl('')).fsPath); diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index 171c91ffb8d..365796b2a32 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -55,6 +55,7 @@ export interface IPatternInfo { pattern: string; isRegExp?: boolean; isWordMatch?: boolean; + wordSeparators?: string; isMultiline?: boolean; isCaseSensitive?: boolean; } @@ -138,6 +139,9 @@ export interface ISearchConfiguration extends IFilesConfiguration { useRipgrep: boolean; useIgnoreFilesByDefault: boolean; }; + editor: { + wordSeparators: string; + }; } export function getExcludes(configuration: ISearchConfiguration): IExpression { diff --git a/src/vs/platform/statusbar/common/statusbar.ts b/src/vs/platform/statusbar/common/statusbar.ts index 6e45f806115..d42f792b801 100644 --- a/src/vs/platform/statusbar/common/statusbar.ts +++ b/src/vs/platform/statusbar/common/statusbar.ts @@ -7,6 +7,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable } from 'vs/base/common/lifecycle'; +import { ThemeColor } from 'vs/editor/common/editorCommon'; export var IStatusbarService = createDecorator('statusbarService'); @@ -34,7 +35,7 @@ export interface IStatusbarEntry { /** * An optional color to use for the entry */ - color?: string; + color?: string | ThemeColor; /** * An optional id of a command that is known to the workbench to execute on click diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index c3f6d2f3650..983743b9205 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -25,7 +25,7 @@ export interface ITelemetryExperiments { showNewUserWatermark: boolean; openUntitledFile: boolean; enableWelcomePage: boolean; - reorderQuickLinks: boolean; + mergeQuickLinks: boolean; } export interface ITelemetryService { diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index 5641a34c4f8..e3370d3d865 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -23,7 +23,7 @@ export const defaultExperiments: ITelemetryExperiments = { showNewUserWatermark: false, openUntitledFile: true, enableWelcomePage: true, - reorderQuickLinks: false, + mergeQuickLinks: false, }; export const NullTelemetryService = { @@ -57,7 +57,7 @@ export function loadExperiments(accessor: ServicesAccessor): ITelemetryExperimen showNewUserWatermark, openUntitledFile, enableWelcomePage, - reorderQuickLinks, + mergeQuickLinks, } = splitExperimentsRandomness(); const newUserDuration = 24 * 60 * 60 * 1000; @@ -72,7 +72,7 @@ export function loadExperiments(accessor: ServicesAccessor): ITelemetryExperimen showNewUserWatermark, openUntitledFile, enableWelcomePage, - reorderQuickLinks, + mergeQuickLinks, }); } @@ -95,13 +95,13 @@ function splitExperimentsRandomness(): ITelemetryExperiments { const random1 = getExperimentsRandomness(); const [random2, showNewUserWatermark] = splitRandom(random1); const [random3, openUntitledFile] = splitRandom(random2); - const [random4, reorderQuickLinks] = splitRandom(random3); + const [random4, mergeQuickLinks] = splitRandom(random3); const [, enableWelcomePage] = splitRandom(random4); return { showNewUserWatermark, openUntitledFile, enableWelcomePage, - reorderQuickLinks, + mergeQuickLinks, }; } @@ -224,6 +224,7 @@ const configurationValueWhitelist = [ 'editor.fontWeight', 'editor.scrollBeyondLastLine', 'editor.lineNumbers', + 'editor.letterSpacing', 'editor.wrappingIndent', 'editor.renderControlCharacters', 'editor.autoClosingBrackets', diff --git a/src/vs/platform/telemetry/node/commonProperties.ts b/src/vs/platform/telemetry/node/commonProperties.ts index 6011ea38641..5e6611497c3 100644 --- a/src/vs/platform/telemetry/node/commonProperties.ts +++ b/src/vs/platform/telemetry/node/commonProperties.ts @@ -19,6 +19,8 @@ export function resolveCommonProperties(commit: string, version: string): TPromi result['version'] = version; result['common.osVersion'] = os.release(); result['common.platform'] = Platform.Platform[Platform.platform]; + result['common.nodePlatform'] = process.platform; + result['common.nodeArch'] = process.arch; // dynamic properties which value differs on each call let seq = 0; diff --git a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts index 95f3e801d35..570bac18d00 100644 --- a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts +++ b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as errors from 'vs/base/common/errors'; import * as uuid from 'vs/base/common/uuid'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { getMachineId, virtualMachineHint } from 'vs/base/node/id'; +import { getMachineId } from 'vs/base/node/id'; import { resolveCommonProperties, machineIdStorageKey } from '../node/commonProperties'; const SQM_KEY: string = '\\Software\\Microsoft\\SQMClient'; @@ -19,7 +19,6 @@ export function resolveWorkbenchCommonProperties(storageService: IStorageService result['common.version.shell'] = process.versions && (process).versions['electron']; result['common.version.renderer'] = process.versions && (process).versions['chrome']; result['common.osVersion'] = os.release(); - result['common.virtualMachineHint'] = virtualMachineHint.value().toString(); const lastSessionDate = storageService.get('telemetry.lastSessionDate'); const firstSessionDate = storageService.get('telemetry.firstSessionDate') || new Date().toUTCString(); diff --git a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts index 2525949ec97..54bd6cb5618 100644 --- a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts @@ -33,6 +33,8 @@ suite('Telemetry - common properties', function () { assert.ok('sessionID' in props); assert.ok('timestamp' in props); assert.ok('common.platform' in props); + assert.ok('common.nodePlatform' in props); + assert.ok('common.nodeArch' in props); assert.ok('common.timesincesessionstart' in props); assert.ok('common.sequence' in props); @@ -53,7 +55,6 @@ suite('Telemetry - common properties', function () { assert.ok('common.sqm.machineid' in props, 'machineid'); } - assert.equal(Object.keys(props).length, process.platform === 'win32' ? 18 : 16); }); }); diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index d988f479831..5f3a474f034 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -6,7 +6,7 @@ import platform = require('vs/platform/platform'); import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { Color } from 'vs/base/common/color'; +import { Color, RGBA } from 'vs/base/common/color'; import { ITheme } from 'vs/platform/theme/common/themeService'; import nls = require('vs/nls'); @@ -105,7 +105,16 @@ class ColorRegistry implements IColorRegistry { } public toString() { - return Object.keys(this.colorsById).sort().map(k => `- \`${k}\`: ${this.colorsById[k].description}`).join('\n'); + let sorter = (a: string, b: string) => { + let cat1 = a.indexOf('.') === -1 ? 0 : 1; + let cat2 = b.indexOf('.') === -1 ? 0 : 1; + if (cat1 !== cat2) { + return cat1 - cat2; + } + return a.localeCompare(b); + }; + + return Object.keys(this.colorsById).sort(sorter).map(k => `- \`${k}\`: ${this.colorsById[k].description}`).join('\n'); } } @@ -120,11 +129,26 @@ export function registerColor(id: string, defaults: ColorDefaults, description: // ----- base colors export const foreground = registerColor('foreground', { dark: '#CCCCCC', light: '#6C6C6C', hc: '#FFFFFF' }, nls.localize('foreground', "Overall foreground color. This color is only used if not overridden by a component.")); +export const errorForeground = registerColor('errorForeground', { dark: '#F48771', light: '#A1260D', hc: '#F48771' }, nls.localize('errorForeground', "Overall foreground color for error messages. This color is only used if not overridden by a component.")); +export const descriptionForeground = registerColor('descriptionForeground', { light: transparent(foreground, 0.7), dark: transparent(foreground, 0.7), hc: transparent(foreground, 0.7) }, nls.localize('descriptionForeground', "Foreground color for description text providing additional information, for example for a label.")); + export const focusBorder = registerColor('focusBorder', { dark: Color.fromHex('#0E639C').transparent(0.6), light: Color.fromHex('#007ACC').transparent(0.4), hc: '#F38518' }, nls.localize('focusBorder', "Overall border color for focused elements. This color is only used if not overridden by a component.")); export const contrastBorder = registerColor('contrastBorder', { light: null, dark: null, hc: '#6FC3DF' }, nls.localize('contrastBorder', "An extra border around elements to separate them from others for greater contrast.")); export const activeContrastBorder = registerColor('contrastActiveBorder', { light: null, dark: null, hc: focusBorder }, nls.localize('activeContrastBorder', "An extra border around active elements to separate them from others for greater contrast.")); +export const selectionBackground = registerColor('selection.background', { light: null, dark: null, hc: null }, nls.localize('selectionBackground', "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor and the terminal.")); + +// ------ text colors + +export const textSeparatorForeground = registerColor('textSeparator.foreground', { light: '#0000002e', dark: '#ffffff2e', hc: Color.black }, nls.localize('textSeparatorForeground', "Color for text separators.")); +export const textLinkForeground = registerColor('textLink.foreground', { light: '#4080D0', dark: '#4080D0', hc: '#4080D0' }, nls.localize('textLinkForeground', "Foreground color for links in text.")); +export const textLinkActiveForeground = registerColor('textLink.activeForeground', { light: '#4080D0', dark: '#4080D0', hc: '#4080D0' }, nls.localize('textLinkActiveForeground', "Foreground color for active links in text.")); +export const textPreformatForeground = registerColor('textPreformat.foreground', { light: '#A31515', dark: '#D7BA7D', hc: '#D7BA7D' }, nls.localize('textPreformatForeground', "Foreground color for preformatted text segments.")); +export const textBlockQuoteBackground = registerColor('textBlockQuote.background', { light: '#7f7f7f1a', dark: '#7f7f7f1a', hc: null }, nls.localize('textBlockQuoteBackground', "Background color for block quotes in text.")); +export const textBlockQuoteBorder = registerColor('textBlockQuote.border', { light: '#007acc80', dark: '#007acc80', hc: Color.white }, nls.localize('textBlockQuoteBorder', "Border color for block quotes in text.")); +export const textCodeBlockBackground = registerColor('textCodeBlock.background', { light: '#dcdcdc66', dark: '#0a0a0a66', hc: Color.black }, nls.localize('textCodeBlockBackground', "Background color for code blocks in text.")); + // ----- widgets export const widgetShadow = registerColor('widget.shadow', { dark: '#000000', light: '#A8A8A8', hc: null }, nls.localize('widgetShadow', 'Shadow color of widgets such as find/replace inside the editor.')); @@ -132,22 +156,27 @@ export const inputBackground = registerColor('input.background', { dark: '#3C3C3 export const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hc: foreground }, nls.localize('inputBoxForeground', "Input box foreground.")); export const inputBorder = registerColor('input.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('inputBoxBorder', "Input box border.")); export const inputActiveOptionBorder = registerColor('inputOption.activeBorder', { dark: '#007ACC', light: '#007ACC', hc: activeContrastBorder }, nls.localize('inputBoxActiveOptionBorder', "Border color of activated options in input fields.")); +export const inputPlaceholderForeground = registerColor('input.placeholderForeground', { dark: null, light: null, hc: null }, nls.localize('inputPlaceholderForeground', "Input box foreground color for placeholder text.")); + export const inputValidationInfoBackground = registerColor('inputValidation.infoBackground', { dark: '#063B49', light: '#D6ECF2', hc: Color.black }, nls.localize('inputValidationInfoBackground', "Input validation background color for information severity.")); -export const inputValidationInfoBorder = registerColor('inputValidation.infoBorder', { dark: '#55AAFF', light: '#009CCC', hc: '#6FC3DF' }, nls.localize('inputValidationInfoBorder', "Input validation border color for information severity.")); +export const inputValidationInfoBorder = registerColor('inputValidation.infoBorder', { dark: '#007acc', light: '#007acc', hc: contrastBorder }, nls.localize('inputValidationInfoBorder', "Input validation border color for information severity.")); export const inputValidationWarningBackground = registerColor('inputValidation.warningBackground', { dark: '#352A05', light: '#F6F5D2', hc: Color.black }, nls.localize('inputValidationWarningBackground', "Input validation background color for information warning.")); -export const inputValidationWarningBorder = registerColor('inputValidation.warningBorder', { dark: '#B89500', light: '#F2CB1D', hc: '#B89500' }, nls.localize('inputValidationWarningBorder', "Input validation border color for warning severity.")); +export const inputValidationWarningBorder = registerColor('inputValidation.warningBorder', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('inputValidationWarningBorder', "Input validation border color for warning severity.")); export const inputValidationErrorBackground = registerColor('inputValidation.errorBackground', { dark: '#5A1D1D', light: '#F2DEDE', hc: Color.black }, nls.localize('inputValidationErrorBackground', "Input validation background color for error severity.")); -export const inputValidationErrorBorder = registerColor('inputValidation.errorBorder', { dark: '#BE1100', light: '#E51400', hc: '#BE1100' }, nls.localize('inputValidationErrorBorder', "Input validation border color for error severity.")); +export const inputValidationErrorBorder = registerColor('inputValidation.errorBorder', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, nls.localize('inputValidationErrorBorder', "Input validation border color for error severity.")); export const selectBackground = registerColor('dropdown.background', { dark: '#3C3C3C', light: Color.white, hc: Color.black }, nls.localize('dropdownBackground', "Dropdown background.")); export const selectForeground = registerColor('dropdown.foreground', { dark: '#F0F0F0', light: null, hc: Color.white }, nls.localize('dropdownForeground', "Dropdown foreground.")); export const selectBorder = registerColor('dropdown.border', { dark: selectBackground, light: '#CECECE', hc: contrastBorder }, nls.localize('dropdownBorder', "Dropdown border.")); export const listFocusBackground = registerColor('list.focusBackground', { dark: '#073655', light: '#DCEBFC', hc: null }, nls.localize('listFocusBackground', "List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); +export const listFocusForeground = registerColor('list.focusForeground', { dark: null, light: null, hc: null }, nls.localize('listFocusForeground', "List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listActiveSelectionBackground = registerColor('list.activeSelectionBackground', { dark: '#094771', light: '#3399FF', hc: null }, nls.localize('listActiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); +export const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: Color.white, light: Color.white, hc: null }, nls.localize('listActiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#3F3F46', light: '#CCCEDB', hc: null }, nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); -export const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('listActiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); +export const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hc: null }, nls.localize('listHoverBackground', "List/Tree background when hovering over items using the mouse.")); +export const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hc: null }, nls.localize('listHoverForeground', "List/Tree foreground when hovering over items using the mouse.")); export const listDropBackground = registerColor('list.dropBackground', { dark: listFocusBackground, light: listFocusBackground, hc: null }, nls.localize('listDropBackground', "List/Tree drag and drop background when moving items around using the mouse.")); export const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#0097fb', light: '#007acc', hc: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.')); @@ -158,11 +187,16 @@ export const buttonForeground = registerColor('button.foreground', { dark: Color export const buttonBackground = registerColor('button.background', { dark: '#0E639C', light: '#007ACC', hc: null }, nls.localize('buttonBackground', "Button background color.")); export const buttonHoverBackground = registerColor('button.hoverBackground', { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hc: null }, nls.localize('buttonHoverBackground', "Button background color when hovering.")); +export const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#BEBEBE', hc: Color.black }, nls.localize('badgeBackground', "Badge background color. Badges are small information labels, e.g. for search results count.")); +export const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('badgeForeground', "Badge foreground color. Badges are small information labels, e.g. for search results count.")); + export const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hc: null }, nls.localize('scrollbarShadow', "Scrollbar shadow to indicate that the view is scrolled.")); export const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hc: transparent(contrastBorder, 0.6) }, nls.localize('scrollbarSliderBackground', "Slider background color.")); export const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hc: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', "Slider background color when hovering.")); export const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.activeBackground', { dark: Color.fromHex('#BFBFBF').transparent(0.4), light: Color.fromHex('#000000').transparent(0.6), hc: contrastBorder }, nls.localize('scrollbarSliderActiveBackground', "Slider background color when active.")); +export const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hc: contrastBorder }, nls.localize('progressBarBackground', "Background color of the progress bar that can show for long running operations.")); + /** * Editor background color. * Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254 @@ -175,6 +209,13 @@ export const editorBackground = registerColor('editor.background', { light: '#ff */ export const editorForeground = registerColor('editor.foreground', { light: '#333333', dark: '#BBBBBB', hc: Color.white }, nls.localize('editorForeground', "Editor default foreground color.")); +/** + * Editor widgets + */ +export const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#2D2D30', light: '#EFEFF2', hc: '#0C141F' }, nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.')); +export const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, nls.localize('editorWidgetBorder', 'Border color of the editor widget.')); + + /** * Editor selection colors. */ @@ -190,15 +231,46 @@ export const editorFindMatchHighlight = registerColor('editor.findMatchHighlight export const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground', { dark: '#3a3d4166', light: '#b4b4b44d', hc: null }, nls.localize('findRangeHighlight', "Color the range limiting the search.")); /** - * Editor link colors + * Editor hover */ -export const editorActiveLinkForeground = registerColor('editorLink.activeForeground', { dark: '#4E94CE', light: Color.black, hc: Color.cyan }, nls.localize('activeLinkForeground', 'Color of active links.')); +export const editorHoverHighlight = registerColor('editor.hoverHighlightBackground', { light: '#ADD6FF26', dark: '#264f7840', hc: '#ADD6FF26' }, nls.localize('hoverHighlight', 'Highlight below the word for which a hover is shown.')); +export const editorHoverBackground = registerColor('editorHoverWidget.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('hoverBackground', 'Background color of the editor hover.')); +export const editorHoverBorder = registerColor('editorHoverWidget.border', { light: editorWidgetBorder, dark: editorWidgetBorder, hc: editorWidgetBorder }, nls.localize('hoverBorder', 'Border color of the editor hover.')); /** - * Find widget + * Editor link colors */ -export const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#2D2D30', light: '#EFEFF2', hc: '#0C141F' }, nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.')); +export const editorActiveLinkForeground = registerColor('editorLink.activeForeground', { dark: '#4E94CE', light: Color.blue, hc: Color.cyan }, nls.localize('activeLinkForeground', 'Color of active links.')); +/** + * Diff Editor Colors + */ +export const defaultInsertColor = Color.fromRGBA(new RGBA(155, 185, 85, 255 * 0.2)); +export const defaultRemoveColor = Color.fromRGBA(new RGBA(255, 0, 0, 255 * 0.2)); + +export const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: defaultInsertColor, light: defaultInsertColor, hc: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted.')); +export const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hc: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed.')); + +export const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hc: '#33ff2eff' }, nls.localize('diffEditorInsertedOutline', 'Outline color for the text that got inserted.')); +export const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hc: '#FF008F' }, nls.localize('diffEditorRemovedOutline', 'Outline color for text that got removed.')); + +/** + * Merge-conflict colors + */ + +const headerTransparency = 0.5; +const currentBaseColor = Color.fromHex('#40C8AE').transparent(headerTransparency); +const incomingBaseColor = Color.fromHex('#40A6FF').transparent(headerTransparency); +const contentTransparency = 0.4; +const rulerTransparency = 1; + +export const mergeCurrentHeaderBackground = registerColor('merge.currentHeaderBackground', { dark: currentBaseColor, light: currentBaseColor, hc: currentBaseColor }, nls.localize('mergeCurrentHeaderBackground', 'Current header background in inline merge-conflict.')); +export const mergeCurrentContentBackground = registerColor('merge.currentContentBackground', { dark: transparent(mergeCurrentHeaderBackground, contentTransparency), light: transparent(mergeCurrentHeaderBackground, contentTransparency), hc: transparent(mergeCurrentHeaderBackground, contentTransparency) }, nls.localize('mergeCurrentContentBackground', 'Current content background in inline merge-conflict.')); +export const mergeIncomingHeaderBackground = registerColor('merge.incomingHeaderBackground', { dark: incomingBaseColor, light: incomingBaseColor, hc: incomingBaseColor }, nls.localize('mergeIncomingHeaderBackground', 'Incoming header background in inline merge-conflict.')); +export const mergeIncomingContentBackground = registerColor('merge.incomingContentBackground', { dark: transparent(mergeIncomingHeaderBackground, contentTransparency), light: transparent(mergeIncomingHeaderBackground, contentTransparency), hc: transparent(mergeIncomingHeaderBackground, contentTransparency) }, nls.localize('mergeIncomingContentBackground', 'Incoming content background in inline merge-conflict.')); + +export const overviewRulerCurrentContentForeground = registerColor('overviewRuler.currentContentForeground', { dark: transparent(mergeCurrentHeaderBackground, rulerTransparency), light: transparent(mergeCurrentHeaderBackground, rulerTransparency), hc: transparent(mergeCurrentHeaderBackground, rulerTransparency) }, nls.localize('overviewRulerCurrentContentForeground', 'Current overview ruler foreground for inline merge-conflict.')); +export const overviewRulerIncomingContentForeground = registerColor('overviewRuler.incomingContentForeground', { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hc: transparent(mergeIncomingHeaderBackground, rulerTransparency) }, nls.localize('overviewRulerIncomingContentForeground', 'Incoming overview ruler foreground for inline merge-conflict.')); // ----- color functions @@ -270,7 +342,7 @@ function resolveColorValue(colorValue: ColorValue, theme: ITheme): Color { return null; } -//setTimeout(_ => console.log(colorRegistry.toString()), 5000); +// setTimeout(_ => console.log(colorRegistry.toString()), 5000); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index 796b99a6131..35d4baee887 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -6,15 +6,17 @@ 'use strict'; import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionBackground, listHoverBackground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten } from 'vs/platform/theme/common/colorRegistry'; +import { inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten, badgeBackground, badgeForeground, progressBarBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { SIDE_BAR_SECTION_HEADER_BACKGROUND } from 'vs/workbench/common/theme'; +import { SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND } from 'vs/workbench/common/theme'; + +export type styleFn = (colors: { [name: string]: ColorIdentifier }) => void; export interface IThemable { - style(colors: { [name: string]: ColorIdentifier }): void; + style: styleFn; } -export function attachStyler(themeService: IThemeService, widget: IThemable, optionsMapping: { [optionsKey: string]: ColorIdentifier | ColorFunction }): IDisposable { +function doAttachStyler(themeService: IThemeService, optionsMapping: { [optionsKey: string]: ColorIdentifier | ColorFunction }, widgetOrCallback: IThemable | styleFn): IDisposable { function applyStyles(theme: ITheme): void { const styles = Object.create(null); for (let key in optionsMapping) { @@ -26,7 +28,11 @@ export function attachStyler(themeService: IThemeService, widget: IThemable, opt } } - widget.style(styles); + if (typeof widgetOrCallback === 'function') { + widgetOrCallback(styles); + } else { + widgetOrCallback.style(styles); + } } applyStyles(themeService.getTheme()); @@ -35,9 +41,21 @@ export function attachStyler(themeService: IThemeService, widget: IThemable, opt } export function attachCheckboxStyler(widget: IThemable, themeService: IThemeService, style?: { inputActiveOptionBorderColor?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { inputActiveOptionBorder: (style && style.inputActiveOptionBorderColor) || inputActiveOptionBorder - }); + }, widget); +} + +export function attachBadgeStyler(widget: IThemable, themeService: IThemeService, style?: + { + badgeBackground?: ColorIdentifier, + badgeForeground?: ColorIdentifier + }): IDisposable { + return doAttachStyler(themeService, { + badgeBackground: (style && style.badgeBackground) || badgeBackground, + badgeForeground: (style && style.badgeForeground) || badgeForeground, + badgeBorder: contrastBorder + }, widget); } export function attachInputBoxStyler(widget: IThemable, themeService: IThemeService, style?: @@ -52,7 +70,7 @@ export function attachInputBoxStyler(widget: IThemable, themeService: IThemeServ inputValidationErrorBorder?: ColorIdentifier, inputValidationErrorBackground?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { inputBackground: (style && style.inputBackground) || inputBackground, inputForeground: (style && style.inputForeground) || inputForeground, inputBorder: (style && style.inputBorder) || inputBorder, @@ -62,15 +80,15 @@ export function attachInputBoxStyler(widget: IThemable, themeService: IThemeServ inputValidationWarningBackground: (style && style.inputValidationWarningBackground) || inputValidationWarningBackground, inputValidationErrorBorder: (style && style.inputValidationErrorBorder) || inputValidationErrorBorder, inputValidationErrorBackground: (style && style.inputValidationErrorBackground) || inputValidationErrorBackground - }); + }, widget); } export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeService, style?: { selectBackground?: ColorIdentifier, selectForeground?: ColorIdentifier, selectBorder?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { selectBackground: (style && style.selectBackground) || selectBackground, selectForeground: (style && style.selectForeground) || selectForeground, selectBorder: (style && style.selectBorder) || selectBorder - }); + }, widget); } export function attachFindInputBoxStyler(widget: IThemable, themeService: IThemeService, style?: @@ -86,7 +104,7 @@ export function attachFindInputBoxStyler(widget: IThemable, themeService: ITheme inputValidationErrorBorder?: ColorIdentifier, inputValidationErrorBackground?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { inputBackground: (style && style.inputBackground) || inputBackground, inputForeground: (style && style.inputForeground) || inputForeground, inputBorder: (style && style.inputBorder) || inputBorder, @@ -97,7 +115,7 @@ export function attachFindInputBoxStyler(widget: IThemable, themeService: ITheme inputValidationWarningBackground: (style && style.inputValidationWarningBackground) || inputValidationWarningBackground, inputValidationErrorBorder: (style && style.inputValidationErrorBorder) || inputValidationErrorBorder, inputValidationErrorBackground: (style && style.inputValidationErrorBackground) || inputValidationErrorBackground - }); + }, widget); } export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeService, style?: { @@ -105,6 +123,7 @@ export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeSer background?: ColorIdentifier, borderColor?: ColorIdentifier, widgetShadow?: ColorIdentifier, + progressBarBackground?: ColorIdentifier, inputBackground?: ColorIdentifier, inputForeground?: ColorIdentifier, inputBorder?: ColorIdentifier, @@ -117,22 +136,26 @@ export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeSer pickerGroupForeground?: ColorIdentifier, pickerGroupBorder?: ColorIdentifier, listFocusBackground?: ColorIdentifier, + listFocusForeground?: ColorIdentifier, listActiveSelectionBackground?: ColorIdentifier, listActiveSelectionForeground?: ColorIdentifier, listFocusAndSelectionBackground?: ColorIdentifier, listFocusAndSelectionForeground?: ColorIdentifier, listInactiveSelectionBackground?: ColorIdentifier, + listInactiveSelectionForeground?: ColorIdentifier, listHoverBackground?: ColorIdentifier, + listHoverForeground?: ColorIdentifier, listDropBackground?: ColorIdentifier, listFocusOutline?: ColorIdentifier, listSelectionOutline?: ColorIdentifier, listHoverOutline?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { foreground: (style && style.foreground) || foreground, background: (style && style.background) || editorBackground, borderColor: style && style.borderColor || contrastBorder, widgetShadow: style && style.widgetShadow || widgetShadow, + progressBarBackground: style && style.progressBarBackground || progressBarBackground, pickerGroupForeground: style && style.pickerGroupForeground || pickerGroupForeground, pickerGroupBorder: style && style.pickerGroupBorder || pickerGroupBorder, inputBackground: (style && style.inputBackground) || inputBackground, @@ -145,62 +168,83 @@ export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeSer inputValidationErrorBorder: (style && style.inputValidationErrorBorder) || inputValidationErrorBorder, inputValidationErrorBackground: (style && style.inputValidationErrorBackground) || inputValidationErrorBackground, listFocusBackground: (style && style.listFocusBackground) || listFocusBackground, + listFocusForeground: (style && style.listFocusForeground) || listFocusForeground, listActiveSelectionBackground: (style && style.listActiveSelectionBackground) || lighten(listActiveSelectionBackground, 0.1), listActiveSelectionForeground: (style && style.listActiveSelectionForeground) || listActiveSelectionForeground, listFocusAndSelectionBackground: style && style.listFocusAndSelectionBackground || listActiveSelectionBackground, listFocusAndSelectionForeground: (style && style.listFocusAndSelectionForeground) || listActiveSelectionForeground, listInactiveSelectionBackground: (style && style.listInactiveSelectionBackground) || listInactiveSelectionBackground, + listInactiveSelectionForeground: (style && style.listInactiveSelectionForeground) || listInactiveSelectionForeground, listHoverBackground: (style && style.listHoverBackground) || listHoverBackground, + listHoverForeground: (style && style.listHoverForeground) || listHoverForeground, listDropBackground: (style && style.listDropBackground) || listDropBackground, listFocusOutline: (style && style.listFocusOutline) || activeContrastBorder, listSelectionOutline: (style && style.listSelectionOutline) || activeContrastBorder, listHoverOutline: (style && style.listHoverOutline) || activeContrastBorder - }); + }, widget); } export function attachListStyler(widget: IThemable, themeService: IThemeService, style?: { listFocusBackground?: ColorIdentifier, + listFocusForeground?: ColorIdentifier, listActiveSelectionBackground?: ColorIdentifier, listActiveSelectionForeground?: ColorIdentifier, listFocusAndSelectionBackground?: ColorIdentifier, listFocusAndSelectionForeground?: ColorIdentifier, listInactiveFocusBackground?: ColorIdentifier, listInactiveSelectionBackground?: ColorIdentifier, + listInactiveSelectionForeground?: ColorIdentifier, listHoverBackground?: ColorIdentifier, + listHoverForeground?: ColorIdentifier, listDropBackground?: ColorIdentifier, listFocusOutline?: ColorIdentifier, listInactiveFocusOutline?: ColorIdentifier, listSelectionOutline?: ColorIdentifier, listHoverOutline?: ColorIdentifier, }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { listFocusBackground: (style && style.listFocusBackground) || listFocusBackground, + listFocusForeground: (style && style.listFocusForeground) || listFocusForeground, listActiveSelectionBackground: (style && style.listActiveSelectionBackground) || lighten(listActiveSelectionBackground, 0.1), listActiveSelectionForeground: (style && style.listActiveSelectionForeground) || listActiveSelectionForeground, listFocusAndSelectionBackground: style && style.listFocusAndSelectionBackground || listActiveSelectionBackground, listFocusAndSelectionForeground: (style && style.listFocusAndSelectionForeground) || listActiveSelectionForeground, listInactiveFocusBackground: (style && style.listInactiveFocusBackground), listInactiveSelectionBackground: (style && style.listInactiveSelectionBackground) || listInactiveSelectionBackground, + listInactiveSelectionForeground: (style && style.listInactiveSelectionForeground) || listInactiveSelectionForeground, listHoverBackground: (style && style.listHoverBackground) || listHoverBackground, + listHoverForeground: (style && style.listHoverForeground) || listHoverForeground, listDropBackground: (style && style.listDropBackground) || listDropBackground, listFocusOutline: (style && style.listFocusOutline) || activeContrastBorder, listSelectionOutline: (style && style.listSelectionOutline) || activeContrastBorder, listHoverOutline: (style && style.listHoverOutline) || activeContrastBorder, listInactiveFocusOutline: style && style.listInactiveFocusOutline // not defined by default, only opt-in - }); + }, widget); } -export function attachHeaderViewStyler(widget: IThemable, themeService: IThemeService, style?: { headerBackground?: ColorIdentifier, contrastBorder?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { - headerBackground: (style && style.headerBackground) || SIDE_BAR_SECTION_HEADER_BACKGROUND, - headerHighContrastBorder: (style && style.contrastBorder) || contrastBorder - }); +export function attachHeaderViewStyler(widget: IThemable, themeService: IThemeService, options?: { noContrastBorder?: boolean }): IDisposable { + return doAttachStyler(themeService, { + headerForeground: SIDE_BAR_SECTION_HEADER_FOREGROUND, + headerBackground: SIDE_BAR_SECTION_HEADER_BACKGROUND, + headerHighContrastBorder: (options && options.noContrastBorder) ? null : contrastBorder + }, widget); } export function attachButtonStyler(widget: IThemable, themeService: IThemeService, style?: { buttonForeground?: ColorIdentifier, buttonBackground?: ColorIdentifier, buttonHoverBackground?: ColorIdentifier }): IDisposable { - return attachStyler(themeService, widget, { + return doAttachStyler(themeService, { buttonForeground: (style && style.buttonForeground) || buttonForeground, buttonBackground: (style && style.buttonBackground) || buttonBackground, - buttonHoverBackground: (style && style.buttonHoverBackground) || buttonHoverBackground - }); + buttonHoverBackground: (style && style.buttonHoverBackground) || buttonHoverBackground, + buttonBorder: contrastBorder + }, widget); +} + +export function attachProgressBarStyler(widget: IThemable, themeService: IThemeService, style?: { progressBarBackground?: ColorIdentifier }): IDisposable { + return doAttachStyler(themeService, { + progressBarBackground: (style && style.progressBarBackground) || progressBarBackground + }, widget); +} + +export function attachStylerCallback(themeService: IThemeService, colors: { [name: string]: ColorIdentifier }, callback: styleFn): IDisposable { + return doAttachStyler(themeService, colors, callback); } \ No newline at end of file diff --git a/src/vs/platform/theme/common/themeService.ts b/src/vs/platform/theme/common/themeService.ts index ff9f54c95f5..10305538863 100644 --- a/src/vs/platform/theme/common/themeService.ts +++ b/src/vs/platform/theme/common/themeService.ts @@ -14,13 +14,20 @@ import Event, { Emitter } from 'vs/base/common/event'; export let IThemeService = createDecorator('themeService'); // base themes -export const DARK = 'dark'; -export const LIGHT = 'light'; -export const HIGH_CONTRAST = 'hc'; +export const DARK: ThemeType = 'dark'; +export const LIGHT: ThemeType = 'light'; +export const HIGH_CONTRAST: ThemeType = 'hc'; export type ThemeType = 'light' | 'dark' | 'hc'; +export function getThemeTypeSelector(type: ThemeType): string { + switch (type) { + case DARK: return 'vs-dark'; + case HIGH_CONTRAST: return 'hc-black'; + default: return 'vs'; + } +} + export interface ITheme { - readonly selector: string; readonly type: ThemeType; /** @@ -32,9 +39,10 @@ export interface ITheme { getColor(color: ColorIdentifier, useDefault?: boolean): Color; /** - * Returns wheter the current color matches the default color + * Returns wheter the theme defines a value for the color. If not, that means the + * default color will be used. */ - isDefault(color: ColorIdentifier): boolean; + defines(color: ColorIdentifier): boolean; } export interface ICssStyleCollector { diff --git a/src/vs/platform/update/common/updateIpc.ts b/src/vs/platform/update/common/updateIpc.ts index 2076719e98a..0dd76ca51f6 100644 --- a/src/vs/platform/update/common/updateIpc.ts +++ b/src/vs/platform/update/common/updateIpc.ts @@ -7,7 +7,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; -import Event from 'vs/base/common/event'; +import Event, { Emitter } from 'vs/base/common/event'; +import { onUnexpectedError } from 'vs/base/common/errors'; import { IUpdateService, IRawUpdate, State, IUpdate } from './update'; export interface IUpdateChannel extends IChannel { @@ -18,6 +19,7 @@ export interface IUpdateChannel extends IChannel { call(command: 'event:onStateChange'): TPromise; call(command: 'checkForUpdates', arg: boolean): TPromise; call(command: 'quitAndInstall'): TPromise; + call(command: '_getInitialState'): TPromise; call(command: string, arg?: any): TPromise; } @@ -34,6 +36,7 @@ export class UpdateChannel implements IUpdateChannel { case 'event:onStateChange': return eventToCall(this.service.onStateChange); case 'checkForUpdates': return this.service.checkForUpdates(arg); case 'quitAndInstall': return this.service.quitAndInstall(); + case '_getInitialState': return TPromise.as(this.service.state); } return undefined; } @@ -55,14 +58,24 @@ export class UpdateChannelClient implements IUpdateService { private _onUpdateReady = eventFromCall(this.channel, 'event:onUpdateReady'); get onUpdateReady(): Event { return this._onUpdateReady; } - private _onStateChange = eventFromCall(this.channel, 'event:onStateChange'); - get onStateChange(): Event { return this._onStateChange; } + private _onRemoteStateChange = eventFromCall(this.channel, 'event:onStateChange'); + private _onStateChange = new Emitter(); + get onStateChange(): Event { return this._onStateChange.event; } private _state: State = State.Uninitialized; get state(): State { return this._state; }; - constructor(private channel: IChannel) { + constructor(private channel: IUpdateChannel) { + // always set this._state as the state changes this.onStateChange(state => this._state = state); + + channel.call('_getInitialState').done(state => { + // fire initial state + this._onStateChange.fire(state); + + // fire subsequent states as they come in from remote + this._onRemoteStateChange(state => this._onStateChange.fire(state)); + }, onUnexpectedError); } checkForUpdates(explicit: boolean): TPromise { diff --git a/src/vs/platform/update/electron-main/updateService.ts b/src/vs/platform/update/electron-main/updateService.ts index 77ef33d20fe..aa3f75c6d51 100644 --- a/src/vs/platform/update/electron-main/updateService.ts +++ b/src/vs/platform/update/electron-main/updateService.ts @@ -177,6 +177,7 @@ export class UpdateService implements IUpdateService { this._availableUpdate = data; this._onUpdateAvailable.fire({ url: update.url, version: update.version }); this.state = State.UpdateAvailable; + this.telemetryService.publicLog('update:available', { explicit, version: update.version, currentVersion: product.commit }); } else { const data: IUpdate = { diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 296f757f9c6..b4ff59ddacf 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -37,6 +37,7 @@ export interface IWindowsService { isMaximized(windowId: number): TPromise; maximizeWindow(windowId: number): TPromise; unmaximizeWindow(windowId: number): TPromise; + onWindowTitleDoubleClick(windowId: number): TPromise; setDocumentEdited(windowId: number, flag: boolean): TPromise; quit(): TPromise; relaunch(options: { addArgs?: string[], removeArgs?: string[] }): TPromise; @@ -89,6 +90,7 @@ export interface IWindowService { isMaximized(): TPromise; maximizeWindow(): TPromise; unmaximizeWindow(): TPromise; + onWindowTitleDoubleClick(): TPromise; } export type MenuBarVisibility = 'default' | 'visible' | 'toggle' | 'hidden'; @@ -104,4 +106,5 @@ export interface IWindowSettings { menuBarVisibility: MenuBarVisibility; newWindowDimensions: 'default' | 'inherit' | 'maximized' | 'fullscreen'; nativeTabs: boolean; + enableMenuBarMnemonics: boolean; } diff --git a/src/vs/platform/windows/common/windowsIpc.ts b/src/vs/platform/windows/common/windowsIpc.ts index 2d9e9d36506..01840d84f1e 100644 --- a/src/vs/platform/windows/common/windowsIpc.ts +++ b/src/vs/platform/windows/common/windowsIpc.ts @@ -31,6 +31,7 @@ export interface IWindowsChannel extends IChannel { call(command: 'isMaximized', arg: number): TPromise; call(command: 'maximizeWindow', arg: number): TPromise; call(command: 'unmaximizeWindow', arg: number): TPromise; + call(command: 'onWindowTitleDoubleClick', arg: number): TPromise; call(command: 'setDocumentEdited', arg: [number, boolean]): TPromise; call(command: 'quit'): TPromise; call(command: 'openWindow', arg: [string[], { forceNewWindow?: boolean, forceReuseWindow?: boolean }]): TPromise; @@ -81,6 +82,7 @@ export class WindowsChannel implements IWindowsChannel { case 'isMaximized': return this.service.isMaximized(arg); case 'maximizeWindow': return this.service.maximizeWindow(arg); case 'unmaximizeWindow': return this.service.unmaximizeWindow(arg); + case 'onWindowTitleDoubleClick': return this.service.onWindowTitleDoubleClick(arg); case 'setDocumentEdited': return this.service.setDocumentEdited(arg[0], arg[1]); case 'openWindow': return this.service.openWindow(arg[0], arg[1]); case 'openNewWindow': return this.service.openNewWindow(); @@ -185,6 +187,10 @@ export class WindowsChannelClient implements IWindowsService { return this.channel.call('unmaximizeWindow', windowId); } + onWindowTitleDoubleClick(windowId: number): TPromise { + return this.channel.call('onWindowTitleDoubleClick', windowId); + } + setDocumentEdited(windowId: number, flag: boolean): TPromise { return this.channel.call('setDocumentEdited', [windowId, flag]); } diff --git a/src/vs/platform/windows/electron-browser/windowService.ts b/src/vs/platform/windows/electron-browser/windowService.ts index c5d2e5c7e8a..1247697fd17 100644 --- a/src/vs/platform/windows/electron-browser/windowService.ts +++ b/src/vs/platform/windows/electron-browser/windowService.ts @@ -90,6 +90,10 @@ export class WindowService implements IWindowService { return this.windowsService.unmaximizeWindow(this.windowId); } + onWindowTitleDoubleClick(): TPromise { + return this.windowsService.onWindowTitleDoubleClick(this.windowId); + } + setDocumentEdited(flag: boolean): TPromise { return this.windowsService.setDocumentEdited(this.windowId, flag); } diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index f74c4e5af39..5cef01c60f5 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -209,6 +209,16 @@ export class WindowsService implements IWindowsService, IDisposable { return TPromise.as(null); } + onWindowTitleDoubleClick(windowId: number): TPromise { + const vscodeWindow = this.windowsMainService.getWindowById(windowId); + + if (vscodeWindow) { + vscodeWindow.onWindowTitleDoubleClick(); + } + + return TPromise.as(null); + } + setDocumentEdited(windowId: number, flag: boolean): TPromise { const vscodeWindow = this.windowsMainService.getWindowById(windowId); diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index ac030fc7434..53f8ad3ee63 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -201,7 +201,9 @@ declare module 'vscode' { * Get a word-range at the given position. By default words are defined by * common separators, like space, -, _, etc. In addition, per languge custom * [word definitions](#LanguageConfiguration.wordPattern) can be defined. It - * is also possible to provide a custom regular expression. + * is also possible to provide a custom regular expression. *Note* that a + * custom regular expression must not match the empty string and that it will + * be ignored if it does. * * The position will be [adjusted](#TextDocument.validatePosition). * @@ -731,6 +733,19 @@ declare module 'vscode' { preview?: boolean; } + /** + * A reference to one of the workbench colors as defined in https://code.visualstudio.com/docs/getstarted/theme-color-reference. + * Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color. + */ + export class ThemeColor { + + /** + * Creates a reference to a theme color. + * @param id of the color. The available colors are listed in https://code.visualstudio.com/docs/getstarted/theme-color-reference. + */ + constructor(id: string); + } + /** * Represents theme specific rendering styles for a [text editor decoration](#TextEditorDecorationType). */ @@ -743,8 +758,9 @@ declare module 'vscode' { /** * Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations. + * Alternativly a color from the color registry an be [referenced](#ColorIdentifier). */ - backgroundColor?: string; + backgroundColor?: string | ThemeColor; /** * CSS styling property that will be applied to text enclosed by a decoration. @@ -755,7 +771,7 @@ declare module 'vscode' { * CSS styling property that will be applied to text enclosed by a decoration. * Better use 'outline' for setting one or more of the individual outline properties. */ - outlineColor?: string; + outlineColor?: string | ThemeColor; /** * CSS styling property that will be applied to text enclosed by a decoration. @@ -778,7 +794,7 @@ declare module 'vscode' { * CSS styling property that will be applied to text enclosed by a decoration. * Better use 'border' for setting one or more of the individual border properties. */ - borderColor?: string; + borderColor?: string | ThemeColor; /** * CSS styling property that will be applied to text enclosed by a decoration. @@ -817,7 +833,7 @@ declare module 'vscode' { /** * CSS styling property that will be applied to text enclosed by a decoration. */ - color?: string; + color?: string | ThemeColor; /** * CSS styling property that will be applied to text enclosed by a decoration. @@ -839,7 +855,7 @@ declare module 'vscode' { /** * The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations. */ - overviewRulerColor?: string; + overviewRulerColor?: string | ThemeColor; /** * Defines the rendering options of the attachment that is inserted before the decorated text @@ -866,6 +882,10 @@ declare module 'vscode' { * CSS styling property that will be applied to the decoration attachment. */ border?: string; + /** + * CSS styling property that will be applied to text enclosed by a decoration. + */ + borderColor?: string | ThemeColor; /** * CSS styling property that will be applied to the decoration attachment. */ @@ -873,11 +893,11 @@ declare module 'vscode' { /** * CSS styling property that will be applied to the decoration attachment. */ - color?: string; + color?: string | ThemeColor; /** * CSS styling property that will be applied to the decoration attachment. */ - backgroundColor?: string; + backgroundColor?: string | ThemeColor; /** * CSS styling property that will be applied to the decoration attachment. */ @@ -1395,7 +1415,7 @@ declare module 'vscode' { * Provide textual content for a given uri. * * The editor will use the returned string-content to create a readonly - * [document](TextDocument). Resources allocated should be released when + * [document](#TextDocument). Resources allocated should be released when * the corresponding document has been [closed](#workspace.onDidCloseTextDocument). * * @param uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for. @@ -3299,7 +3319,7 @@ declare module 'vscode' { /** * The foreground color for this entry. */ - color: string | undefined; + color: string | ThemeColor | undefined; /** * The identifier of a command to run on click. The command must be @@ -3505,6 +3525,328 @@ declare module 'vscode' { update(key: string, value: any): Thenable; } + /** + * Controls the behaviour of the terminal's visibility. + */ + export enum RevealKind { + /** + * Always brings the terminal to front if the task is executed. + */ + Always = 1, + + /** + * Only brings the terminal to front if a problem is detected executing the task + * (e.g. the task couldn't be started because). + */ + Silent = 2, + + /** + * The terminal never comes to front when the task is executed. + */ + Never = 3 + } + + /** + * Controls terminal specific behaviour. + */ + export interface TerminalBehaviour { + /** + * Controls whether the terminal executing a task is brought to front or not. + * Defaults to `RevealKind.Always`. + */ + reveal?: RevealKind; + + /** + * Controls whether the command is echoed in the terminal or not. + */ + echo?: boolean; + } + + export interface ProcessOptions { + /** + * The current working directory of the executed program or shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed program or shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env?: { [key: string]: string }; + } + + export namespace TaskGroup { + /** + * The clean task group + */ + export const Clean: 'clean'; + /** + * The build task group + */ + export const Build: 'build'; + /** + * The rebuild all task group + */ + export const RebuildAll: 'rebuildAll'; + /** + * The test task group + */ + export const Test: 'test'; + } + + /** + * The ProblemMatchers type definition. + */ + export type ProblemMatchers = string | string[]; + + /** + * A task that starts an external process. + */ + export class ProcessTask { + + /** + * Creates a process task. + * + * @param name the task's name. Is presented in the user interface. + * @param process the process to start. + * @param problemMatchers the problem matchers to use. + */ + constructor(name: string, process: string, problemMatchers?: ProblemMatchers); + + /** + * Creates a process task. + * + * @param name the task's name. Is presented in the user interface. + * @param process the process to start. + * @param args arguments to be passed to the process. + * @param problemMatchers the problem matchers to use. + */ + constructor(name: string, process: string, args: string[], problemMatchers?: ProblemMatchers); + + /** + * Creates a process task. + * + * @param name the task's name. Is presented in the user interface. + * @param process the process to start. + * @param args arguments to be passed to the process. + * @param options additional options for the started process. + * @param problemMatchers the problem matchers to use. + */ + constructor(name: string, process: string, args: string[], options: ProcessOptions, problemMatchers?: ProblemMatchers); + + /** + * The task's name + */ + readonly name: string; + + /** + * The task's identifier. If omitted the internal identifier will + * be `${extensionName}:${name}` + */ + identifier: string | undefined; + + /** + * Whether the task is a background task or not. + */ + isBackground: boolean; + + /** + * The process to be executed. + */ + readonly process: string; + + /** + * The arguments passed to the process. Defaults to an empty array. + */ + args: string[]; + + /** + * A human-readable string describing the source of this + * shell task, e.g. 'gulp' or 'npm'. + */ + source: string | undefined; + + /** + * The task group this tasks belongs to. See TaskGroup + * for a predefined set of available groups. + * Defaults to undefined meaning that the task doesn't + * belong to any special group. + */ + group: string | undefined; + + /** + * The process options used when the process is executed. + * Defaults to an empty object literal. + */ + options: ProcessOptions; + + /** + * The terminal options. Defaults to an empty object literal. + */ + terminal: TerminalBehaviour; + + /** + * The problem matchers attached to the task. Defaults to an empty + * array. + */ + problemMatchers: string[]; + } + + export type ShellOptions = { + /** + * The shell executable. + */ + executable: string; + + /** + * The arguments to be passed to the shell executable used to run the task. + */ + shellArgs?: string[]; + + /** + * The current working directory of the executed shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env?: { [key: string]: string }; + } | { + /** + * The current working directory of the executed shell. + * If omitted VSCode's current workspace root is used. + */ + cwd: string; + + /** + * The additional environment of the executed shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env?: { [key: string]: string }; + } | { + /** + * The current working directory of the executed shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env: { [key: string]: string }; + }; + + /** + * A task that executes a shell command. + */ + export class ShellTask { + + /** + * Creates a shell task. + * + * @param name the task's name. Is presented in the user interface. + * @param commandLine the command line to execute. + * @param problemMatchers the problem matchers to use. + */ + constructor(name: string, commandLine: string, problemMatchers?: ProblemMatchers); + + /** + * Creates a shell task. + * + * @param name the task's name. Is presented in the user interface. + * @param commandLine the command line to execute. + * @param options additional options used when creating the shell. + * @param problemMatchers the problem matchers to use. + */ + constructor(name: string, commandLine: string, options: ShellOptions, problemMatchers?: ProblemMatchers); + + /** + * The task's name + */ + readonly name: string; + + /** + * The task's identifier. If omitted the internal identifier will + * be `${extensionName}:${name}` + */ + identifier: string | undefined; + + /** + * Whether the task is a background task or not. + */ + isBackground: boolean; + + /** + * The command line to execute. + */ + readonly commandLine: string; + + /** + * A human-readable string describing the source of this + * shell task, e.g. 'gulp' or 'npm'. + */ + source: string | undefined; + + /** + * The task group this tasks belongs to. See TaskGroup + * for a predefined set of available groups. + * Defaults to undefined meaning that the task doesn't + * belong to any special group. + */ + group: string | undefined; + + /** + * The shell options used when the shell is executed. Defaults to an + * empty object literal. + */ + options: ShellOptions; + + /** + * The terminal options. Defaults to an empty object literal. + */ + terminal: TerminalBehaviour; + + /** + * The problem matchers attached to the task. Defaults to an empty + * array. + */ + problemMatchers: string[]; + } + + export type Task = ProcessTask | ShellTask; + + /** + * A task provider allows to add tasks to the task service. + * A task provider is registerd via #workspace.registerTaskProvider. + */ + export interface TaskProvider { + /** + * Provides additional tasks. + * @param token A cancellation token. + * @return a #TaskSet + */ + provideTasks(token: CancellationToken): ProviderResult; + } + + export namespace workspace { + /** + * Register a task provider. + * + * @param provider A task provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerTaskProvider(provider: TaskProvider): Disposable; + } + /** * Namespace describing the environment the editor runs in. */ @@ -4156,6 +4498,8 @@ declare module 'vscode' { * A glob pattern that filters the file events must be provided. Optionally, flags to ignore certain * kinds of events can be provided. To stop listening to events the watcher must be disposed. * + * *Note* that only files within the current [workspace](#workspace.rootPath) can be watched. + * * @param globPattern A glob pattern that is applied to the names of created, changed, and deleted files. * @param ignoreCreateEvents Ignore when files have been created. * @param ignoreChangeEvents Ignore when files have been changed. @@ -4751,7 +5095,7 @@ declare module 'vscode' { /** * The label of this source control resource group. */ - readonly label: string; + label: string; /** * Whether this source control resource group is hidden when it contains diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index f72a9baa873..f571826403c 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -7,611 +7,105 @@ declare module 'vscode' { - /** - * Defines a problem pattern - */ - export interface ProblemPattern { - - /** - * The regular expression to find a problem in the console output of an - * executed task. - */ - regexp: RegExp; - - /** - * The match group index of the filename. - * - * Defaults to 1 if omitted. - */ - file?: number; - - /** - * The match group index of the problems's location. Valid location - * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). - * If omitted the line and colum properties are used. - */ - location?: number; - - /** - * The match group index of the problem's line in the source file. - * - * Defaults to 2 if omitted. - */ - line?: number; - - /** - * The match group index of the problem's character in the source file. - * - * Defaults to 3 if omitted. - */ - character?: number; - - /** - * The match group index of the problem's end line in the source file. - * - * Defaults to undefined. No end line is captured. - */ - endLine?: number; - - /** - * The match group index of the problem's end character in the source file. - * - * Defaults to undefined. No end column is captured. - */ - endCharacter?: number; - - /** - * The match group index of the problem's severity. - * - * Defaults to undefined. In this case the problem matcher's severity - * is used. - */ - severity?: number; - - /** - * The match group index of the problems's code. - * - * Defaults to undefined. No code is captured. - */ - code?: number; - - /** - * The match group index of the message. If omitted it defaults - * to 4 if location is specified. Otherwise it defaults to 5. - */ - message?: number; - - /** - * Specifies if the last pattern in a multi line problem matcher should - * loop as long as it does match a line consequently. Only valid on the - * last problem pattern in a multi line problem matcher. - */ - loop?: boolean; - } - - /** - * A multi line problem pattern. - */ - export type MultiLineProblemPattern = ProblemPattern[]; - - /** - * The way how the file location is interpreted - */ - export enum FileLocationKind { - /** - * VS Code should decide based on whether the file path found in the - * output is absolute or relative. A relative file path will be treated - * relative to the workspace root. - */ - Auto = 1, - - /** - * Always treat the file path relative. - */ - Relative = 2, - - /** - * Always treat the file path absolute. - */ - Absolute = 3 - } - - /** - * Controls to which kind of documents problems are applied. - */ - export enum ApplyToKind { - /** - * Problems are applied to all documents. - */ - AllDocuments = 1, - /** - * Problems are applied to open documents only. - */ - OpenDocuments = 2, - - /** - * Problems are applied to closed documents only. - */ - ClosedDocuments = 3 - } - - - /** - * A background monitor pattern - */ - export interface BackgroundPattern { - /** - * The actual regular expression - */ - regexp: RegExp; - - /** - * The match group index of the filename. If provided the expression - * is matched for that file only. - */ - file?: number; - } - - /** - * A description to control the activity of a problem matcher - * watching a background task. - */ - export interface BackgroundMonitor { - /** - * If set to true the monitor is in active mode when the task - * starts. This is equals of issuing a line that matches the - * beginPattern. - */ - activeOnStart?: boolean; - - /** - * If matched in the output the start of a background activity is signaled. - */ - beginsPattern: RegExp | BackgroundPattern; - - /** - * If matched in the output the end of a background activity is signaled. - */ - endsPattern: RegExp | BackgroundPattern; - } - - /** - * Defines a problem matcher - */ - export interface ProblemMatcher { - /** - * The owner of a problem. Defaults to a generated id - * if omitted. - */ - owner?: string; - - /** - * The type of documents problems detected by this matcher - * apply to. Default to `ApplyToKind.AllDocuments` if omitted. - */ - applyTo?: ApplyToKind; - - /** - * How a file location recognize by a matcher should be interpreted. If omitted the file location - * if `FileLocationKind.Auto`. - */ - fileLocation?: FileLocationKind | string; - - /** - * The actual pattern used by the problem matcher. - */ - pattern: ProblemPattern | MultiLineProblemPattern; - - /** - * The default severity of a detected problem in the output. Used - * if the `ProblemPattern` doesn't define a severity match group. - */ - severity?: DiagnosticSeverity; - - /** - * A background monitor for tasks that are running in the background. - */ - backgound?: BackgroundMonitor; - } - - /** - * Controls the behaviour of the terminal's visibility. - */ - export enum RevealKind { - /** - * Always brings the terminal to front if the task is executed. - */ - Always = 1, - - /** - * Only brings the terminal to front if a problem is detected executing the task - * (e.g. the task couldn't be started because). - */ - Silent = 2, - - /** - * The terminal never comes to front when the task is executed. - */ - Never = 3 - } - - /** - * Controls terminal specific behaviour. - */ - export interface TerminalBehaviour { - /** - * Controls whether the terminal executing a task is brought to front or not. - * Defaults to `RevealKind.Always`. - */ - reveal?: RevealKind; - - /** - * Controls whether the command is echoed in the terminal or not. - */ - echo?: boolean; - } - - - export interface ProcessOptions { - /** - * The current working directory of the executed program or shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed program or shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } - - export namespace TaskGroup { - /** - * The clean task group - */ - export const Clean: 'clean'; - /** - * The build task group - */ - export const Build: 'build'; - /** - * The rebuild all task group - */ - export const RebuildAll: 'rebuildAll'; - /** - * The test task group - */ - export const Test: 'test'; - } - - /** - * The supported task groups. - */ - export type TaskGroup = 'clean' | 'build' | 'rebuildAll' | 'test'; - - /** - * A task that starts an external process. - */ - export class ProcessTask { - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, ...problemMatchers: ProblemMatcher[]); - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param args arguments to be passed to the process. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, args: string[], ...problemMatchers: ProblemMatcher[]); - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param args arguments to be passed to the process. - * @param options additional options for the started process. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, args: string[], options: ProcessOptions, ...problemMatchers: ProblemMatcher[]); - - /** - * The task's name - */ - readonly name: string; - - /** - * The task's identifier. If omitted the name is - * used as an identifier. - */ - identifier: string; - - /** - * Whether the task is a background task or not. - */ - isBackground: boolean; - - /** - * The process to be executed. - */ - readonly process: string; - - /** - * The arguments passed to the process. Defaults to an empty array. - */ - args: string[]; - - /** - * The task group this tasks belongs to. Defaults to undefined meaning - * that the task doesn't belong to any special group. - */ - group?: TaskGroup; - - /** - * The process options used when the process is executed. - * Defaults to an empty object literal. - */ - options: ProcessOptions; - - /** - * The terminal options. Defaults to an empty object literal. - */ - terminal: TerminalBehaviour; - - /** - * The problem matchers attached to the task. Defaults to an empty - * array. - */ - problemMatchers: ProblemMatcher[]; - } - - export type ShellOptions = { - /** - * The shell executable. - */ - executable: string; - - /** - * The arguments to be passed to the shell executable used to run the task. - */ - shellArgs?: string[]; - - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } | { - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } | { - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env: { [key: string]: string }; - }; - - /** - * A task that executes a shell command. - */ - export class ShellTask { - - /** - * Creates a shell task. - * - * @param name the task's name. Is presented in the user interface. - * @param commandLine the command line to execute. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, commandLine: string, ...problemMatchers: ProblemMatcher[]); - - /** - * Creates a shell task. - * - * @param name the task's name. Is presented in the user interface. - * @param commandLine the command line to execute. - * @param options additional options used when creating the shell. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, commandLine: string, options: ShellOptions, ...problemMatchers: ProblemMatcher[]); - - /** - * The task's name - */ - readonly name: string; - - /** - * The task's identifier. If omitted the name is - * used as an identifier. - */ - identifier: string; - - /** - * Whether the task is a background task or not. - */ - isBackground: boolean; - - /** - * The command line to execute. - */ - readonly commandLine: string; - - /** - * The task group this tasks belongs to. Defaults to undefined meaning - * that the task doesn't belong to any special group. - */ - group?: TaskGroup; - - /** - * The shell options used when the shell is executed. Defaults to an - * empty object literal. - */ - options: ShellOptions; - - /** - * The terminal options. Defaults to an empty object literal. - */ - terminal: TerminalBehaviour; - - /** - * The problem matchers attached to the task. Defaults to an empty - * array. - */ - problemMatchers: ProblemMatcher[]; - } - - export type Task = ProcessTask | ShellTask; - - /** - * A task provider allows to add tasks to the task service. - * A task provider is registerd via #workspace.registerTaskProvider. - */ - export interface TaskProvider { - /** - * Provides additional tasks. - * @param token A cancellation token. - * @return a #TaskSet - */ - provideTasks(token: CancellationToken): ProviderResult; - } - - export namespace workspace { - /** - * Register a task provider. - * - * @param provider A task provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerTaskProvider(provider: TaskProvider): Disposable; - - } - export namespace window { export function sampleFunction(): Thenable; } export namespace window { - /** - * Create a new [TreeView](#TreeView) instance. - * - * @param viewId A unique id that identifies the view. - * @param provider A [TreeDataProvider](#TreeDataProvider). - * @return An instance of [TreeView](#TreeView). + * Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`. + * @param viewId Id of the view contributed using the extension point `views`. + * @param treeDataProvider A [TreeDataProvider](#TreeDataProvider) that provides tree data for the view */ - export function createTreeView(viewId: string, provider: TreeDataProvider): TreeView; + export function registerTreeDataProviderForView(viewId: string, treeDataProvider: TreeDataProvider): Disposable; } /** - * An source control is able to provide [resource states](#SourceControlResourceState) - * to the editor and interact with the editor in several source control related ways. - */ - export interface TreeView { - - /** - * Refresh the given nodes - */ - refresh(...nodes: T[]): void; - - /** - * Dispose this view - */ - dispose(): void; - } - - /** - * A data provider for a tree view contribution. - * - * The contributed tree view will ask the corresponding provider to provide the root - * node and resolve children for each node. In addition, the provider could **optionally** - * provide the following information for each node: - * - label: A human-readable label used for rendering the node. - * - hasChildren: Whether the node has children and is expandable. - * - clickCommand: A command to execute when the node is clicked. + * A data provider that provides tree data for a view */ export interface TreeDataProvider { + /** + * An optional event to signal that an element or root has changed. + */ + onDidChangeTreeData?: Event; /** - * Provide the root node. This function will be called when the tree explorer is activated - * for the first time. The root node is hidden and its direct children will be displayed on the first level of - * the tree explorer. + * get [TreeItem](#TreeItem) representation of the `element` * - * @return The root node. + * @param element The element for which [TreeItem](#TreeItem) representation is asked for. + * @return [TreeItem](#TreeItem) representation of the element */ - provideRootNode(): T | Thenable; + getTreeItem(element: T): TreeItem; /** - * Resolve the children of `node`. + * get the children of `element` or root. * - * @param node The node from which the provider resolves children. - * @return Children of `node`. + * @param element The element from which the provider gets children for. + * @return Children of `element` or root. */ - resolveChildren?(node: T): T[] | Thenable; + getChildren(element?: T): T[] | Thenable; + } + + export interface TreeItem { + /** + * A human-readable string describing this item + */ + readonly label: string; /** - * Provide a human-readable string that will be used for rendering the node. Default to use - * `node.toString()` if not provided. - * - * @param node The node from which the provider computes label. - * @return A human-readable label. + * The icon path for the tree item */ - getLabel?(node: T): string; + readonly iconPath?: string | Uri | { light: string | Uri; dark: string | Uri }; /** - * Determine if `node` has children and is expandable. Default to `true` if not provided. - * - * @param node The node to determine if it has children and is expandable. - * @return A boolean that determines if `node` has children and is expandable. + * The [command](#Command) which should be run when the tree item + * is selected. This command is called with the model representing this item as first argument. */ - getHasChildren?(node: T): boolean; + readonly command?: Command; /** - * Get the command to execute when `node` is clicked. - * - * Commands can be registered through [registerCommand](#commands.registerCommand). `node` will be provided - * as the first argument to the command's callback function. - * - * @param node The node that the command is associated with. - * @return The command to execute when `node` is clicked. + * [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. */ - getClickCommand?(node: T): Command; + readonly collapsibleState?: TreeItemCollapsibleState; + + /** + * Context value of the tree item. This can be used to contribute item specific actions in the tree. + * For example, a tree item is given a context value as `folder`. When contribution actions to `view/item/context` + * using `menus` extension point, you can specify context value for key `viewItem` in `when` expression like `viewItem == folder`. + * ``` + * "contributes": { + * "menus": { + * "view/item/context": [ + * { + * "command": "extension.deleteFolder", + * "when": "viewItem == folder" + * } + * ] + * } + * } + * ``` + * This will show action `extension.deleteFolder` only for items with `contextValue` is `folder`. + */ + readonly contextValue?: string; + } + + /** + * Collapsible state of the tree item + */ + export enum TreeItemCollapsibleState { + /** + * Determines an item can be neither collapsed nor expanded. Implies it has no children. + */ + None = 0, + /** + * Determines an item is collapsed + */ + Collapsed = 1, + /** + * Determines an item is expanded + */ + Expanded = 2 } /** diff --git a/src/vs/workbench/api/node/extHost.contribution.ts b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts similarity index 96% rename from src/vs/workbench/api/node/extHost.contribution.ts rename to src/vs/workbench/api/electron-browser/extensionHost.contribution.ts index 2a0e9f87486..f60782ffe63 100644 --- a/src/vs/workbench/api/node/extHost.contribution.ts +++ b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts @@ -9,7 +9,7 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as import { Registry } from 'vs/platform/platform'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { MainContext, InstanceCollection } from './extHost.protocol'; +import { MainContext, InstanceCollection } from '../node/extHost.protocol'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; // --- addressable @@ -19,7 +19,7 @@ import { MainThreadDiagnostics } from './mainThreadDiagnostics'; import { MainThreadDocuments } from './mainThreadDocuments'; import { MainThreadEditors } from './mainThreadEditors'; import { MainThreadErrors } from './mainThreadErrors'; -import { MainThreadTreeView } from './mainThreadTreeView'; +import { MainThreadTreeViews } from './mainThreadTreeViews'; import { MainThreadLanguageFeatures } from './mainThreadLanguageFeatures'; import { MainThreadLanguages } from './mainThreadLanguages'; import { MainThreadMessageService } from './mainThreadMessageService'; @@ -74,7 +74,7 @@ export class ExtHostContribution implements IWorkbenchContribution { col.define(MainContext.MainThreadDocuments).set(this.instantiationService.createInstance(MainThreadDocuments, documentsAndEditors)); col.define(MainContext.MainThreadEditors).set(this.instantiationService.createInstance(MainThreadEditors, documentsAndEditors)); col.define(MainContext.MainThreadErrors).set(create(MainThreadErrors)); - col.define(MainContext.MainThreadExplorers).set(create(MainThreadTreeView)); + col.define(MainContext.MainThreadTreeViews).set(create(MainThreadTreeViews)); col.define(MainContext.MainThreadLanguageFeatures).set(create(MainThreadLanguageFeatures)); col.define(MainContext.MainThreadLanguages).set(create(MainThreadLanguages)); col.define(MainContext.MainThreadMessageService).set(create(MainThreadMessageService)); diff --git a/src/vs/workbench/api/node/mainThreadCommands.ts b/src/vs/workbench/api/electron-browser/mainThreadCommands.ts similarity index 98% rename from src/vs/workbench/api/node/mainThreadCommands.ts rename to src/vs/workbench/api/electron-browser/mainThreadCommands.ts index 88a77f13009..bea731ce497 100644 --- a/src/vs/workbench/api/node/mainThreadCommands.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadCommands.ts @@ -8,7 +8,7 @@ import { IThreadService } from 'vs/workbench/services/thread/common/threadServic import { ICommandService, CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { IDisposable } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; -import { ExtHostContext, MainThreadCommandsShape, ExtHostCommandsShape } from './extHost.protocol'; +import { ExtHostContext, MainThreadCommandsShape, ExtHostCommandsShape } from '../node/extHost.protocol'; export class MainThreadCommands extends MainThreadCommandsShape { diff --git a/src/vs/workbench/api/node/mainThreadConfiguration.ts b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts similarity index 90% rename from src/vs/workbench/api/node/mainThreadConfiguration.ts rename to src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts index c77a7b026f4..f3d1533b7db 100644 --- a/src/vs/workbench/api/node/mainThreadConfiguration.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts @@ -9,7 +9,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { MainThreadConfigurationShape, ExtHostContext } from './extHost.protocol'; +import { MainThreadConfigurationShape, ExtHostContext } from '../node/extHost.protocol'; export class MainThreadConfiguration extends MainThreadConfigurationShape { @@ -35,10 +35,10 @@ export class MainThreadConfiguration extends MainThreadConfigurationShape { } $updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise { - return this._configurationEditingService.writeConfiguration(target, { key, value }); + return this._configurationEditingService.writeConfiguration(target, { key, value }, { donotNotifyError: true }); } $removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise { - return this._configurationEditingService.writeConfiguration(target, { key, value: undefined }); + return this._configurationEditingService.writeConfiguration(target, { key, value: undefined }, { donotNotifyError: true }); } } diff --git a/src/vs/workbench/api/node/mainThreadDiagnostics.ts b/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts similarity index 94% rename from src/vs/workbench/api/node/mainThreadDiagnostics.ts rename to src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts index 6602a4284e3..f0abcbb6486 100644 --- a/src/vs/workbench/api/node/mainThreadDiagnostics.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts @@ -7,7 +7,7 @@ import { IMarkerService, IMarkerData } from 'vs/platform/markers/common/markers'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { MainThreadDiagnosticsShape } from './extHost.protocol'; +import { MainThreadDiagnosticsShape } from '../node/extHost.protocol'; export class MainThreadDiagnostics extends MainThreadDiagnosticsShape { diff --git a/src/vs/workbench/api/node/mainThreadDocuments.ts b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts similarity index 97% rename from src/vs/workbench/api/node/mainThreadDocuments.ts rename to src/vs/workbench/api/electron-browser/mainThreadDocuments.ts index 153ddc8232f..13e61675fa4 100644 --- a/src/vs/workbench/api/node/mainThreadDocuments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts @@ -15,7 +15,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { ExtHostContext, MainThreadDocumentsShape, ExtHostDocumentsShape } from './extHost.protocol'; +import { ExtHostContext, MainThreadDocumentsShape, ExtHostDocumentsShape } from '../node/extHost.protocol'; import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { ITextSource } from 'vs/editor/common/model/textSource'; @@ -123,12 +123,12 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { })); this._toDispose.push(textFileService.models.onModelReverted(e => { if (this._shouldHandleFileEvent(e)) { - this._proxy.$acceptModelReverted(e.resource.toString()); + this._proxy.$acceptDirtyStateChanged(e.resource.toString(), false); } })); this._toDispose.push(textFileService.models.onModelDirty(e => { if (this._shouldHandleFileEvent(e)) { - this._proxy.$acceptModelDirty(e.resource.toString()); + this._proxy.$acceptDirtyStateChanged(e.resource.toString(), true); } })); @@ -240,7 +240,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { if (!this._modelIsSynced[input.getResource().toString()]) { throw new Error(`expected URI ${input.getResource().toString()} to have come to LIFE`); } - return this._proxy.$acceptModelDirty(input.getResource().toString()); // mark as dirty + return this._proxy.$acceptDirtyStateChanged(input.getResource().toString(), true); // mark as dirty }).then(() => { return input.getResource(); }); diff --git a/src/vs/workbench/api/node/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts similarity index 99% rename from src/vs/workbench/api/node/mainThreadDocumentsAndEditors.ts rename to src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts index 8d710b5eceb..974d8a45c70 100644 --- a/src/vs/workbench/api/node/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts @@ -11,8 +11,8 @@ import { delta } from 'vs/base/common/arrays'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import Event, { Emitter, any } from 'vs/base/common/event'; -import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IModelAddedData, ITextEditorAddData, IDocumentsAndEditorsDelta } from './extHost.protocol'; -import { MainThreadTextEditor } from 'vs/workbench/api/node/mainThreadEditor'; +import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IModelAddedData, ITextEditorAddData, IDocumentsAndEditorsDelta } from '../node/extHost.protocol'; +import { MainThreadTextEditor } from './mainThreadEditor'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/api/node/mainThreadEditor.ts b/src/vs/workbench/api/electron-browser/mainThreadEditor.ts similarity index 90% rename from src/vs/workbench/api/node/mainThreadEditor.ts rename to src/vs/workbench/api/electron-browser/mainThreadEditor.ts index b3ba44a0361..cd44f6778a1 100644 --- a/src/vs/workbench/api/node/mainThreadEditor.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadEditor.ts @@ -11,23 +11,11 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Range, IRange } from 'vs/editor/common/core/range'; import { Selection, ISelection } from 'vs/editor/common/core/selection'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { EndOfLine, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes'; import { TextEditorCursorStyle, cursorStyleToString } from 'vs/editor/common/config/editorOptions'; import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; - -export interface ITextEditorConfigurationUpdate { - tabSize?: number | 'auto'; - insertSpaces?: boolean | 'auto'; - cursorStyle?: TextEditorCursorStyle; - lineNumbers?: TextEditorLineNumbersStyle; -} -export interface IResolvedTextEditorConfiguration { - tabSize: number; - insertSpaces: boolean; - cursorStyle: TextEditorCursorStyle; - lineNumbers: TextEditorLineNumbersStyle; -} +import { IResolvedTextEditorConfiguration, ISelectionChangeEvent, ITextEditorConfigurationUpdate, TextEditorRevealType, IApplyEditsOptions, IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol'; function configurationsEqual(a: IResolvedTextEditorConfiguration, b: IResolvedTextEditorConfiguration) { if (a && !b || !a && b) { @@ -42,32 +30,11 @@ function configurationsEqual(a: IResolvedTextEditorConfiguration, b: IResolvedTe ); } -export interface ISelectionChangeEvent { - selections: Selection[]; - source?: string; -} - export interface IFocusTracker { onGainedFocus(): void; onLostFocus(): void; } -export enum TextEditorRevealType { - Default = 0, - InCenter = 1, - InCenterIfOutsideViewport = 2, - AtTop = 3 -} - -export interface IUndoStopOptions { - undoStopBefore: boolean; - undoStopAfter: boolean; -} - -export interface IApplyEditsOptions extends IUndoStopOptions { - setEndOfLine: EndOfLine; -} - /** * Text Editor that is permanently bound to the same model. * It can be bound or not to a CodeEditor. @@ -394,10 +361,10 @@ export class MainThreadTextEditor { return false; } - const snippetController = SnippetController.get(this._codeEditor); + const snippetController = SnippetController2.get(this._codeEditor); - // cancel previous snippet mode - snippetController.leaveSnippet(); + // // cancel previous snippet mode + // snippetController.leaveSnippet(); // set selection, focus editor const selections = ranges.map(r => new Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn)); @@ -405,13 +372,7 @@ export class MainThreadTextEditor { this._codeEditor.focus(); // make modifications - if (opts.undoStopBefore) { - this._codeEditor.pushUndoStop(); - } - snippetController.insertSnippet(template, 0, 0); - if (opts.undoStopAfter) { - this._codeEditor.pushUndoStop(); - } + snippetController.insert(template, 0, 0, opts.undoStopBefore, opts.undoStopAfter); return true; } diff --git a/src/vs/workbench/api/node/mainThreadEditors.ts b/src/vs/workbench/api/electron-browser/mainThreadEditors.ts similarity index 97% rename from src/vs/workbench/api/node/mainThreadEditors.ts rename to src/vs/workbench/api/electron-browser/mainThreadEditors.ts index 1163612c0f0..3de296c7519 100644 --- a/src/vs/workbench/api/node/mainThreadEditors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadEditors.ts @@ -13,11 +13,13 @@ import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService' import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorOptions, Position as EditorPosition } from 'vs/platform/editor/common/editor'; -import { TextEditorRevealType, MainThreadTextEditor, IApplyEditsOptions, IUndoStopOptions, ITextEditorConfigurationUpdate } from 'vs/workbench/api/node/mainThreadEditor'; +import { MainThreadTextEditor } from './mainThreadEditor'; +import { ITextEditorConfigurationUpdate, TextEditorRevealType, IApplyEditsOptions, IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol'; + import { MainThreadDocumentsAndEditors } from './mainThreadDocumentsAndEditors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { equals as objectEquals } from 'vs/base/common/objects'; -import { ExtHostContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData } from './extHost.protocol'; +import { ExtHostContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData } from '../node/extHost.protocol'; import { IRange } from 'vs/editor/common/core/range'; import { ISelection } from 'vs/editor/common/core/selection'; diff --git a/src/vs/workbench/api/node/mainThreadErrors.ts b/src/vs/workbench/api/electron-browser/mainThreadErrors.ts similarity index 89% rename from src/vs/workbench/api/node/mainThreadErrors.ts rename to src/vs/workbench/api/electron-browser/mainThreadErrors.ts index 03ba71b8e3b..ca8962bc1f4 100644 --- a/src/vs/workbench/api/node/mainThreadErrors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadErrors.ts @@ -5,7 +5,7 @@ 'use strict'; import * as errors from 'vs/base/common/errors'; -import { MainThreadErrorsShape } from './extHost.protocol'; +import { MainThreadErrorsShape } from '../node/extHost.protocol'; export class MainThreadErrors extends MainThreadErrorsShape { diff --git a/src/vs/workbench/api/node/mainThreadExtensionService.ts b/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts similarity index 86% rename from src/vs/workbench/api/node/mainThreadExtensionService.ts rename to src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts index 414cc32accf..14b8d69f5dc 100644 --- a/src/vs/workbench/api/node/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts @@ -13,13 +13,15 @@ import URI from 'vs/base/common/uri'; import { AbstractExtensionService, ActivatedExtension } from 'vs/platform/extensions/common/abstractExtensionService'; import { IMessage, IExtensionDescription, IExtensionsStatus } from 'vs/platform/extensions/common/extensions'; import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { areSameExtensions, getGloballyDisabledExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionsRegistry, ExtensionPoint, IExtensionPointUser, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; import { ExtensionScanner, MessagesCollector } from 'vs/workbench/node/extensionPoints'; import { IMessageService } from 'vs/platform/message/common/message'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { ExtHostContext, ExtHostExtensionServiceShape } from './extHost.protocol'; +import { ExtHostContext, ExtHostExtensionServiceShape } from '../node/extHost.protocol'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IStorageService } from 'vs/platform/storage/common/storage'; const SystemExtensionsRoot = path.normalize(path.join(URI.parse(require.toUrl('')).fsPath, '..', 'extensions')); @@ -50,8 +52,6 @@ const hasOwnProperty = Object.hasOwnProperty; export class MainProcessExtensionService extends AbstractExtensionService { - private _threadService: IThreadService; - private _messageService: IMessageService; private _proxy: ExtHostExtensionServiceShape; private _isDev: boolean; private _extensionsStatus: { [id: string]: IExtensionsStatus }; @@ -60,28 +60,30 @@ export class MainProcessExtensionService extends AbstractExtensionService { + const disabledExtensions = [ + ...getGloballyDisabledExtensions(extensionEnablementService, storageService, extensionDescriptions), + ...extensionEnablementService.getWorkspaceDisabledExtensions() + ]; + + _telemetryService.publicLog('extensionsScanned', { + totalCount: extensionDescriptions.length, + disabledCount: disabledExtensions.length + }); + this._onExtensionDescriptions(disabledExtensions.length ? extensionDescriptions.filter(e => disabledExtensions.every(id => !areSameExtensions({ id }, e))) : extensionDescriptions); }); } @@ -93,6 +95,13 @@ export class MainProcessExtensionService extends AbstractExtensionService(undefined); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/api/node/mainThreadTelemetry.ts b/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts similarity index 94% rename from src/vs/workbench/api/node/mainThreadTelemetry.ts rename to src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts index 425123d08c6..42a15120c40 100644 --- a/src/vs/workbench/api/node/mainThreadTelemetry.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { ITelemetryService, ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry'; -import { MainThreadTelemetryShape } from './extHost.protocol'; +import { MainThreadTelemetryShape } from '../node/extHost.protocol'; /** * Helper always instantiated in the main process to receive telemetry events from remote telemetry services diff --git a/src/vs/workbench/api/node/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts similarity index 98% rename from src/vs/workbench/api/node/mainThreadTerminalService.ts rename to src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 7df3be34e0b..c59fbbe5515 100644 --- a/src/vs/workbench/api/node/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -8,7 +8,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { TPromise } from 'vs/base/common/winjs.base'; -import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape } from './extHost.protocol'; +import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape } from '../node/extHost.protocol'; export class MainThreadTerminalService extends MainThreadTerminalServiceShape { diff --git a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts new file mode 100644 index 00000000000..186c646eace --- /dev/null +++ b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts @@ -0,0 +1,123 @@ +/*--------------------------------------------------------------------------------------------- + * 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 Event, { Emitter } from 'vs/base/common/event'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; +import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape } from '../node/extHost.protocol'; +import { IMessageService, Severity } from 'vs/platform/message/common/message'; +import { ViewsRegistry, ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/browser/views'; + +export class MainThreadTreeViews extends MainThreadTreeViewsShape { + + private _proxy: ExtHostTreeViewsShape; + + constructor( + @IThreadService threadService: IThreadService, + @IMessageService private messageService: IMessageService + ) { + super(); + this._proxy = threadService.get(ExtHostContext.ExtHostTreeViews); + } + + $registerView(treeViewId: string): void { + ViewsRegistry.registerTreeViewDataProvider(treeViewId, new TreeViewDataProvider(treeViewId, this._proxy, this.messageService)); + } + + $refresh(treeViewId: string, treeItemHandle?: number): void { + const treeViewDataProvider: TreeViewDataProvider = ViewsRegistry.getTreeViewDataProvider(treeViewId); + if (treeViewDataProvider) { + treeViewDataProvider.refresh(treeItemHandle); + } + } +} + +type TreeItemHandle = number; + +class TreeViewDataProvider implements ITreeViewDataProvider { + + private _onDidChange: Emitter = new Emitter(); + readonly onDidChange: Event = this._onDidChange.event; + + private childrenMap: Map = new Map(); + private itemsMap: Map = new Map(); + + constructor(private treeViewId: string, + private _proxy: ExtHostTreeViewsShape, + private messageService: IMessageService + ) { + } + + getElements(): TPromise { + return this._proxy.$getElements(this.treeViewId) + .then(elements => { + this.postGetElements(null, elements); + return elements; + }, err => this.messageService.show(Severity.Error, err)); + } + + getChildren(treeItem: ITreeItem): TPromise { + if (treeItem.children) { + return TPromise.as(treeItem.children); + } + return this._proxy.$getChildren(this.treeViewId, treeItem.handle) + .then(children => { + this.postGetElements(treeItem.handle, children); + return children; + }, err => this.messageService.show(Severity.Error, err)); + } + + refresh(treeItemHandle?: number) { + if (treeItemHandle) { + let treeItem = this.itemsMap.get(treeItemHandle); + if (treeItem) { + this._onDidChange.fire(treeItem); + } + } else { + this._onDidChange.fire(); + } + } + + private clearChildren(treeItemHandle: TreeItemHandle): void { + const children = this.childrenMap.get(treeItemHandle); + if (children) { + for (const child of children) { + this.clearChildren(child); + this.itemsMap.delete(child); + } + this.childrenMap.delete(treeItemHandle); + } + } + + private postGetElements(parent: TreeItemHandle, children: ITreeItem[]) { + this.setElements(parent, children); + } + + private setElements(parent: TreeItemHandle, children: ITreeItem[]) { + if (children && children.length) { + for (const child of children) { + this.itemsMap.set(child.handle, child); + if (child.children && child.children.length) { + this.setElements(child.handle, child.children); + } + } + if (parent) { + this.childrenMap.set(parent, children.map(child => child.handle)); + } + } + } + + private populateElementsToExpand(elements: ITreeItem[], toExpand: ITreeItem[]) { + for (const element of elements) { + if (element.collapsibleState === TreeItemCollapsibleState.Expanded) { + toExpand.push(element); + if (element.children && element.children.length) { + this.populateElementsToExpand(element.children, toExpand); + } + } + } + } +} \ No newline at end of file diff --git a/src/vs/workbench/api/node/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts similarity index 98% rename from src/vs/workbench/api/node/mainThreadWorkspace.ts rename to src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index e8566c751ce..707349e5a93 100644 --- a/src/vs/workbench/api/node/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -14,7 +14,7 @@ import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCo import { bulkEdit, IResourceEdit } from 'vs/editor/common/services/bulkEdit'; import { TPromise } from 'vs/base/common/winjs.base'; import { Uri } from 'vscode'; -import { MainThreadWorkspaceShape } from './extHost.protocol'; +import { MainThreadWorkspaceShape } from '../node/extHost.protocol'; import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; import { IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index bae49409524..11fda78db64 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -18,7 +18,7 @@ import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments'; import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/node/extHostDocumentSaveParticipant'; import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; import { ExtHostDiagnostics } from 'vs/workbench/api/node/extHostDiagnostics'; -import { ExtHostTreeView } from 'vs/workbench/api/node/extHostTreeView'; +import { ExtHostTreeViews } from 'vs/workbench/api/node/extHostTreeViews'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { ExtHostQuickOpen } from 'vs/workbench/api/node/extHostQuickOpen'; import { ExtHostProgress } from 'vs/workbench/api/node/extHostProgress'; @@ -111,7 +111,7 @@ export function createApiFactory( const extHostDocumentSaveParticipant = col.define(ExtHostContext.ExtHostDocumentSaveParticipant).set(new ExtHostDocumentSaveParticipant(extHostDocuments, threadService.get(MainContext.MainThreadWorkspace))); const extHostEditors = col.define(ExtHostContext.ExtHostEditors).set(new ExtHostEditors(threadService, extHostDocumentsAndEditors)); const extHostCommands = col.define(ExtHostContext.ExtHostCommands).set(new ExtHostCommands(threadService, extHostHeapService)); - const extHostTreeView = col.define(ExtHostContext.ExtHostTreeView).set(new ExtHostTreeView(threadService, extHostCommands)); + const extHostTreeViews = col.define(ExtHostContext.ExtHostTreeViews).set(new ExtHostTreeViews(threadService, extHostCommands)); const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set(new ExtHostConfiguration(threadService.get(MainContext.MainThreadConfiguration), initData.configuration)); const extHostDiagnostics = col.define(ExtHostContext.ExtHostDiagnostics).set(new ExtHostDiagnostics(threadService)); const languageFeatures = col.define(ExtHostContext.ExtHostLanguageFeatures).set(new ExtHostLanguageFeatures(threadService, extHostDocuments, extHostCommands, extHostHeapService, extHostDiagnostics)); @@ -369,8 +369,8 @@ export function createApiFactory( sampleFunction: proposedApiFunction(extension, () => { return extHostMessageService.showMessage(Severity.Info, 'Hello Proposed Api!', {}, []); }), - createTreeView: proposedApiFunction(extension, (providerId: string, provider: vscode.TreeDataProvider): vscode.TreeView => { - return extHostTreeView.createTreeView(providerId, provider); + registerTreeDataProviderForView: proposedApiFunction(extension, (viewId: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable => { + return extHostTreeViews.registerTreeDataProviderForView(viewId, treeDataProvider); }) }; @@ -448,9 +448,9 @@ export function createApiFactory( getConfiguration: (section?: string): vscode.WorkspaceConfiguration => { return extHostConfiguration.getConfiguration(section); }, - registerTaskProvider: proposedApiFunction(extension, (provider: vscode.TaskProvider) => { + registerTaskProvider: (provider: vscode.TaskProvider) => { return extHostTask.registerTaskProvider(extension, provider); - }) + } }; class SCM { @@ -515,7 +515,6 @@ export function createApiFactory( OverviewRulerLane: EditorCommon.OverviewRulerLane, ParameterInformation: extHostTypes.ParameterInformation, Position: extHostTypes.Position, - ProgressLocation: extHostTypes.ProgressLocation, Range: extHostTypes.Range, Selection: extHostTypes.Selection, SignatureHelp: extHostTypes.SignatureHelp, @@ -534,9 +533,10 @@ export function createApiFactory( Uri: URI, ViewColumn: extHostTypes.ViewColumn, WorkspaceEdit: extHostTypes.WorkspaceEdit, + ProgressLocation: extHostTypes.ProgressLocation, + TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState, + ThemeColor: extHostTypes.ThemeColor, // functions - FileLocationKind: extHostTypes.FileLocationKind, - ApplyToKind: extHostTypes.ApplyToKind, RevealKind: extHostTypes.RevealKind, TaskGroup: extHostTypes.TaskGroup, ShellTask: extHostTypes.ShellTask, diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index d4cd004550a..b168ae2ddac 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -35,14 +35,15 @@ import { IWorkspaceConfigurationValues } from 'vs/workbench/services/configurati import { IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; -import { IApplyEditsOptions, IUndoStopOptions, TextEditorRevealType, ITextEditorConfigurationUpdate, IResolvedTextEditorConfiguration, ISelectionChangeEvent } from './mainThreadEditor'; +import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; +import { EndOfLine, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes'; + -import { InternalTreeNodeContent } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks'; import { IModelChangedEvent } from 'vs/editor/common/model/mirrorModel'; import { IPosition } from 'vs/editor/common/core/position'; import { IRange } from 'vs/editor/common/core/range'; -import { ISelection } from 'vs/editor/common/core/selection'; +import { ISelection, Selection } from 'vs/editor/common/core/selection'; export interface IEnvironment { enableProposedApiForAll: boolean; @@ -134,6 +135,44 @@ export abstract class MainThreadDocumentsShape { $trySaveDocument(uri: URI): TPromise { throw ni(); } } + +export interface ISelectionChangeEvent { + selections: Selection[]; + source?: string; +} + +export interface ITextEditorConfigurationUpdate { + tabSize?: number | 'auto'; + insertSpaces?: boolean | 'auto'; + cursorStyle?: TextEditorCursorStyle; + lineNumbers?: TextEditorLineNumbersStyle; +} + +export interface IResolvedTextEditorConfiguration { + tabSize: number; + insertSpaces: boolean; + cursorStyle: TextEditorCursorStyle; + lineNumbers: TextEditorLineNumbersStyle; +} + +export enum TextEditorRevealType { + Default = 0, + InCenter = 1, + InCenterIfOutsideViewport = 2, + AtTop = 3 +} + +export interface IUndoStopOptions { + undoStopBefore: boolean; + undoStopAfter: boolean; +} + +export interface IApplyEditsOptions extends IUndoStopOptions { + setEndOfLine: EndOfLine; +} + + + export interface ITextDocumentShowOptions { position?: EditorPosition; preserveFocus?: boolean; @@ -155,14 +194,17 @@ export abstract class MainThreadEditorsShape { $getDiffInformation(id: string): TPromise { throw ni(); } } -export abstract class MainThreadTreeViewShape { - $registerTreeDataProvider(providerId: string): void { throw ni(); } - $refresh(providerId: string, node: InternalTreeNodeContent): void { throw ni(); } +export interface TreeItem extends vscode.TreeItem { + handle: number; + commandId?: string; + icon?: string; + iconDark?: string; + children?: TreeItem[]; } -export abstract class MainThreadTreeShape { - $registerTreeExplorerNodeProvider(providerId: string, node: InternalTreeNodeContent): void { throw ni(); } - $refresh(providerId: string, node: InternalTreeNodeContent): void { throw ni(); } +export abstract class MainThreadTreeViewsShape { + $registerView(treeViewId: string): void { throw ni(); } + $refresh(treeViewId: string, treeItemHandle?: number): void { throw ni(); } } export abstract class MainThreadErrorsShape { @@ -235,7 +277,7 @@ export abstract class MainThreadQuickOpenShape { } export abstract class MainThreadStatusBarShape { - $setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); } + $setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | editorCommon.ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); } $dispose(id: number) { throw ni(); } } @@ -295,6 +337,7 @@ export abstract class MainThreadSCMShape { $registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void { throw ni(); } $updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void { throw ni(); } + $updateGroupLabel(sourceControlHandle: number, handle: number, label: string): void { throw ni(); } $updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); } $unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); } @@ -328,8 +371,7 @@ export abstract class ExtHostDocumentsShape { $provideTextDocumentContent(handle: number, uri: URI): TPromise { throw ni(); } $acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); } $acceptModelSaved(strURL: string): void { throw ni(); } - $acceptModelDirty(strURL: string): void { throw ni(); } - $acceptModelReverted(strURL: string): void { throw ni(); } + $acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { throw ni(); } $acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); } } @@ -365,20 +407,18 @@ export abstract class ExtHostDocumentsAndEditorsShape { $acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void { throw ni(); } } +export type TreeViewCommandArg = { + treeViewId: string, + treeItemHandle: number +}; -export abstract class ExtHostTreeViewShape { - $provideRootNode(providerId: string): TPromise { throw ni(); }; - $resolveChildren(providerId: string, node: InternalTreeNodeContent): TPromise { throw ni(); } - $getInternalCommand(providerId: string, node: InternalTreeNodeContent): TPromise { throw ni(); } -} - -export abstract class ExtHostTreeShape { - $resolveChildren(providerId: string, node: InternalTreeNodeContent): TPromise { throw ni(); } - $getInternalCommand(providerId: string, node: InternalTreeNodeContent): TPromise { throw ni(); } +export abstract class ExtHostTreeViewsShape { + $getElements(treeViewId: string): TPromise { throw ni(); } + $getChildren(treeViewId: string, treeItemHandle: number): TPromise { throw ni(); } + $restore(treeViewId: string, treeItems: TreeItem[]): TPromise { throw ni(); } } export abstract class ExtHostExtensionServiceShape { - $localShowMessage(severity: Severity, msg: string): void { throw ni(); } $activateExtension(extensionDescription: IExtensionDescription): TPromise { throw ni(); } } @@ -465,7 +505,7 @@ export const MainContext = { MainThreadDocuments: createMainId('MainThreadDocuments', MainThreadDocumentsShape), MainThreadEditors: createMainId('MainThreadEditors', MainThreadEditorsShape), MainThreadErrors: createMainId('MainThreadErrors', MainThreadErrorsShape), - MainThreadExplorers: createMainId('MainThreadTreeView', MainThreadTreeViewShape), + MainThreadTreeViews: createMainId('MainThreadTreeViews', MainThreadTreeViewsShape), MainThreadLanguageFeatures: createMainId('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape), MainThreadLanguages: createMainId('MainThreadLanguages', MainThreadLanguagesShape), MainThreadMessageService: createMainId('MainThreadMessageService', MainThreadMessageServiceShape), @@ -490,7 +530,7 @@ export const ExtHostContext = { ExtHostDocuments: createExtId('ExtHostDocuments', ExtHostDocumentsShape), ExtHostDocumentSaveParticipant: createExtId('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape), ExtHostEditors: createExtId('ExtHostEditors', ExtHostEditorsShape), - ExtHostTreeView: createExtId('ExtHostTreeView', ExtHostTreeViewShape), + ExtHostTreeViews: createExtId('ExtHostTreeViews', ExtHostTreeViewsShape), ExtHostFileSystemEventService: createExtId('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape), ExtHostHeapService: createExtId('ExtHostHeapMonitor', ExtHostHeapServiceShape), ExtHostLanguageFeatures: createExtId('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape), diff --git a/src/vs/workbench/api/node/extHostDiagnostics.ts b/src/vs/workbench/api/node/extHostDiagnostics.ts index f7d240175d3..7b720e5eec1 100644 --- a/src/vs/workbench/api/node/extHostDiagnostics.ts +++ b/src/vs/workbench/api/node/extHostDiagnostics.ts @@ -12,6 +12,7 @@ import Severity from 'vs/base/common/severity'; import * as vscode from 'vscode'; import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape } from './extHost.protocol'; import { DiagnosticSeverity } from './extHostTypes'; +import { stableSort } from 'vs/base/common/arrays'; export class DiagnosticCollection implements vscode.DiagnosticCollection { @@ -74,13 +75,10 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection { toSync = []; let lastUri: vscode.Uri; - // ensure stable-sort: keep the original - // index for otherwise equal items - const sortedTuples = first - .map((tuple, idx) => ({ tuple, idx })) - .sort(DiagnosticCollection._compareIndexedTuplesByUri); + // ensure stable-sort + stableSort(first, DiagnosticCollection._compareIndexedTuplesByUri); - for (const { tuple } of sortedTuples) { + for (const tuple of first) { const [uri, diagnostics] = tuple; if (!lastUri || uri.toString() !== lastUri.toString()) { if (lastUri && this._data.get(lastUri.toString()).length === 0) { @@ -208,14 +206,10 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection { } } - private static _compareIndexedTuplesByUri(a: { tuple: [vscode.Uri, vscode.Diagnostic[]]; idx: number }, b: { tuple: [vscode.Uri, vscode.Diagnostic[]]; idx: number }): number { - if (a.tuple[0].toString() < b.tuple[0].toString()) { + private static _compareIndexedTuplesByUri(a: [vscode.Uri, vscode.Diagnostic[]], b: [vscode.Uri, vscode.Diagnostic[]]): number { + if (a[0].toString() < b[0].toString()) { return -1; - } else if (a.tuple[0].toString() > b.tuple[0].toString()) { - return 1; - } else if (a.idx < b.idx) { - return -1; - } else if (a.idx > b.idx) { + } else if (a[0].toString() > b[0].toString()) { return 1; } else { return 0; diff --git a/src/vs/workbench/api/node/extHostDocumentData.ts b/src/vs/workbench/api/node/extHostDocumentData.ts index 96cb2aec92d..edb38779935 100644 --- a/src/vs/workbench/api/node/extHostDocumentData.ts +++ b/src/vs/workbench/api/node/extHostDocumentData.ts @@ -242,9 +242,17 @@ export class ExtHostDocumentData extends MirrorModel { private _getWordRangeAtPosition(_position: vscode.Position, regexp?: RegExp): vscode.Range { let position = this._validatePosition(_position); - if (!regexp || regExpLeadsToEndlessLoop(regexp)) { + + if (!regexp) { + // use default when custom-regexp isn't provided + regexp = getWordDefinitionFor(this._languageId); + + } else if (regExpLeadsToEndlessLoop(regexp)) { + // use default when custom-regexp is bad + console.warn(`[getWordRangeAtPosition]: ignoring custom regexp '${regexp.source}' because it matches the empty string.`); regexp = getWordDefinitionFor(this._languageId); } + let wordAtText = getWordAtText( position.character + 1, ensureValidWordDefinition(regexp), diff --git a/src/vs/workbench/api/node/extHostDocuments.ts b/src/vs/workbench/api/node/extHostDocuments.ts index 918efad51f3..eacff1334c5 100644 --- a/src/vs/workbench/api/node/extHostDocuments.ts +++ b/src/vs/workbench/api/node/extHostDocuments.ts @@ -171,18 +171,17 @@ export class ExtHostDocuments extends ExtHostDocumentsShape { public $acceptModelSaved(strURL: string): void { let data = this._documentsAndEditors.getDocument(strURL); - data._acceptIsDirty(false); + this.$acceptDirtyStateChanged(strURL, false); this._onDidSaveDocument.fire(data.document); } - public $acceptModelDirty(strURL: string): void { - let document = this._documentsAndEditors.getDocument(strURL); - document._acceptIsDirty(true); - } - - public $acceptModelReverted(strURL: string): void { - let document = this._documentsAndEditors.getDocument(strURL); - document._acceptIsDirty(false); + public $acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { + let data = this._documentsAndEditors.getDocument(strURL); + data._acceptIsDirty(isDirty); + this._onDidChangeDocument.fire({ + document: data.document, + contentChanges: [] + }); } public $acceptModelChanged(strURL: string, events: IModelChangedEvent, isDirty: boolean): void { diff --git a/src/vs/workbench/api/node/extHostFileSystemEventService.ts b/src/vs/workbench/api/node/extHostFileSystemEventService.ts index abfcee9b75f..0e6ddf0a9ac 100644 --- a/src/vs/workbench/api/node/extHostFileSystemEventService.ts +++ b/src/vs/workbench/api/node/extHostFileSystemEventService.ts @@ -33,13 +33,13 @@ class FileSystemWatcher implements _FileSystemWatcher { constructor(dispatcher: Event, globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean) { this._config = 0; - if (!ignoreCreateEvents) { + if (ignoreCreateEvents) { this._config += 0b001; } - if (!ignoreChangeEvents) { + if (ignoreChangeEvents) { this._config += 0b010; } - if (!ignoreDeleteEvents) { + if (ignoreDeleteEvents) { this._config += 0b100; } diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 38c1be8627e..2bf60e23f7a 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -554,7 +554,7 @@ class SuggestAdapter { } private _convertCompletionItem(item: vscode.CompletionItem, position: vscode.Position, defaultRange: vscode.Range): modes.ISuggestion { - if (!item.label) { + if (typeof item.label !== 'string' || item.label.length === 0) { console.warn('INVALID text edit -> must have at least a label'); return undefined; } diff --git a/src/vs/workbench/api/node/extHostSCM.ts b/src/vs/workbench/api/node/extHostSCM.ts index 079d623d5dd..9d40839b177 100644 --- a/src/vs/workbench/api/node/extHostSCM.ts +++ b/src/vs/workbench/api/node/extHostSCM.ts @@ -81,6 +81,11 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG return this._label; } + set label(label: string) { + this._label = label; + this._proxy.$updateGroupLabel(this._sourceControlHandle, this._handle, label); + } + private _hideWhenEmpty: boolean | undefined = undefined; get hideWhenEmpty(): boolean | undefined { diff --git a/src/vs/workbench/api/node/extHostStatusBar.ts b/src/vs/workbench/api/node/extHostStatusBar.ts index 97c917caf51..6e91e7dbf9a 100644 --- a/src/vs/workbench/api/node/extHostStatusBar.ts +++ b/src/vs/workbench/api/node/extHostStatusBar.ts @@ -6,7 +6,7 @@ import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar'; -import { StatusBarAlignment as ExtHostStatusBarAlignment, Disposable } from './extHostTypes'; +import { StatusBarAlignment as ExtHostStatusBarAlignment, Disposable, ThemeColor } from './extHostTypes'; import { StatusBarItem, StatusBarAlignment } from 'vscode'; import { MainContext, MainThreadStatusBarShape } from './extHost.protocol'; @@ -21,7 +21,7 @@ export class ExtHostStatusBarEntry implements StatusBarItem { private _text: string; private _tooltip: string; - private _color: string; + private _color: string | ThemeColor; private _command: string; private _timeoutHandle: number; @@ -57,7 +57,7 @@ export class ExtHostStatusBarEntry implements StatusBarItem { return this._tooltip; } - public get color(): string { + public get color(): string | ThemeColor { return this._color; } @@ -75,7 +75,7 @@ export class ExtHostStatusBarEntry implements StatusBarItem { this.update(); } - public set color(color: string) { + public set color(color: string | ThemeColor) { this._color = color; this.update(); } diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 67bcbec00c9..7508d947d45 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -8,13 +8,11 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as UUID from 'vs/base/common/uuid'; import { asWinJsPromise } from 'vs/base/common/async'; -import * as Problems from 'vs/platform/markers/common/problemMatcher'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as TaskSystem from 'vs/workbench/parts/tasks/common/tasks'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from 'vs/workbench/api/node/extHost.protocol'; -import { fromDiagnosticSeverity } from 'vs/workbench/api/node/extHostTypeConverters'; import * as types from 'vs/workbench/api/node/extHostTypes'; import * as vscode from 'vscode'; @@ -23,6 +21,7 @@ interface StringMap { [key: string]: V; } +/* namespace ProblemPattern { export function from(value: vscode.ProblemPattern | vscode.MultiLineProblemPattern): Problems.ProblemPattern | Problems.MultiLineProblemPattern { if (value === void 0 || value === null) { @@ -144,7 +143,7 @@ namespace WatchingPattern { } } -namespace WathingMatcher { +namespace BackgroundMonitor { export function from(value: vscode.BackgroundMonitor): Problems.WatchingMatcher { if (value === void 0 || value === null) { return undefined; @@ -159,13 +158,13 @@ namespace WathingMatcher { } namespace ProblemMatcher { - export function from(values: vscode.ProblemMatcher[]): Problems.ProblemMatcher[] { + export function from(values: (string | vscode.ProblemMatcher)[]): (string | Problems.ProblemMatcher)[] { if (values === void 0 || values === null) { return undefined; } - let result: Problems.ProblemMatcher[]; + let result: (string | Problems.ProblemMatcher)[] = []; for (let value of values) { - let converted = fromSingle(value); + let converted = typeof value === 'string' ? value : fromSingle(value); if (converted) { result.push(converted); } @@ -186,33 +185,33 @@ namespace ProblemMatcher { filePrefix: location.prefix, pattern: ProblemPattern.from(problemMatcher.pattern), severity: fromDiagnosticSeverity(problemMatcher.severity), - }; return result; } } +*/ namespace RevealKind { - export function from(value: vscode.RevealKind): TaskSystem.ShowOutput { + export function from(value: vscode.RevealKind): TaskSystem.RevealKind { if (value === void 0 || value === null) { - return TaskSystem.ShowOutput.Always; + return TaskSystem.RevealKind.Always; } switch (value) { case types.RevealKind.Silent: - return TaskSystem.ShowOutput.Silent; + return TaskSystem.RevealKind.Silent; case types.RevealKind.Never: - return TaskSystem.ShowOutput.Never; + return TaskSystem.RevealKind.Never; } - return TaskSystem.ShowOutput.Always; + return TaskSystem.RevealKind.Always; } } namespace TerminalBehaviour { - export function from(value: vscode.TerminalBehaviour): { showOutput: TaskSystem.ShowOutput, echo: boolean } { + export function from(value: vscode.TerminalBehaviour): TaskSystem.TerminalBehavior { if (value === void 0 || value === null) { - return { showOutput: TaskSystem.ShowOutput.Always, echo: false }; + return { reveal: TaskSystem.RevealKind.Always, echo: false }; } - return { showOutput: RevealKind.from(value.reveal), echo: !!value.echo }; + return { reveal: RevealKind.from(value.reveal), echo: !!value.echo }; } } @@ -231,7 +230,10 @@ namespace Strings { } namespace CommandOptions { - export function from(value: { cwd?: string; env?: { [key: string]: string; } }): TaskSystem.CommandOptions { + function isShellOptions(value: any): value is vscode.ShellOptions { + return value && typeof value.executable === 'string'; + } + export function from(value: vscode.ShellOptions | vscode.ProcessOptions): TaskSystem.CommandOptions { if (value === void 0 || value === null) { return undefined; } @@ -249,14 +251,17 @@ namespace CommandOptions { } }); } + if (isShellOptions(value)) { + result.shell = ShellConfiguration.from(value); + } return result; } } namespace ShellConfiguration { - export function from(value: { executable?: string, args?: string[] }): boolean | TaskSystem.ShellConfiguration { - if (value === void 0 || value === null || typeof value.executable !== 'string') { - return true; + export function from(value: { executable?: string, args?: string[] }): TaskSystem.ShellConfiguration { + if (value === void 0 || value === null || !value.executable) { + return undefined; } let result: TaskSystem.ShellConfiguration = { @@ -269,7 +274,7 @@ namespace ShellConfiguration { namespace Tasks { - export function from(tasks: vscode.Task[], uuidMap: UUIDMap): TaskSystem.Task[] { + export function from(tasks: vscode.Task[], extension: IExtensionDescription, uuidMap: UUIDMap): TaskSystem.Task[] { if (tasks === void 0 || tasks === null) { return []; } @@ -277,7 +282,7 @@ namespace Tasks { try { uuidMap.start(); for (let task of tasks) { - let converted = fromSingle(task, uuidMap); + let converted = fromSingle(task, extension, uuidMap); if (converted) { result.push(converted); } @@ -288,7 +293,7 @@ namespace Tasks { return result; } - function fromSingle(task: vscode.Task, uuidMap: UUIDMap): TaskSystem.Task { + function fromSingle(task: vscode.Task, extension: IExtensionDescription, uuidMap: UUIDMap): TaskSystem.Task { if (typeof task.name !== 'string' || typeof task.identifier !== 'string') { return undefined; } @@ -303,18 +308,20 @@ namespace Tasks { if (command === void 0) { return undefined; } - let behaviour = TerminalBehaviour.from(task.terminal); - command.echo = behaviour.echo; let result: TaskSystem.Task = { _id: uuidMap.getUUID(task.identifier), + _source: { + kind: TaskSystem.TaskSourceKind.Extension, + label: typeof task.source === 'string' ? task.source : extension.name, + detail: extension.id + }, name: task.name, - identifier: task.identifier, + identifier: task.identifier ? task.identifier : `${extension.id}.${task.name}`, group: types.TaskGroup.is(task.group) ? task.group : undefined, command: command, - showOutput: behaviour.showOutput, isBackground: !!task.isBackground, suppressTaskName: true, - problemMatchers: ProblemMatcher.from(task.problemMatchers) + problemMatchers: task.problemMatchers.slice() }; return result; } @@ -326,8 +333,8 @@ namespace Tasks { let result: TaskSystem.CommandConfiguration = { name: value.process, args: Strings.from(value.args), - isShellCommand: false, - echo: false, + type: TaskSystem.CommandType.Process, + terminal: TerminalBehaviour.from(value.terminal) }; if (value.options) { result.options = CommandOptions.from(value.options); @@ -341,8 +348,8 @@ namespace Tasks { } let result: TaskSystem.CommandConfiguration = { name: value.commandLine, - isShellCommand: ShellConfiguration.from(value.options), - echo: false + type: TaskSystem.CommandType.Shell, + terminal: TerminalBehaviour.from(value.terminal) }; if (value.options) { result.options = CommandOptions.from(value.options); @@ -422,7 +429,7 @@ export class ExtHostTask extends ExtHostTaskShape { } return asWinJsPromise(token => handler.provider.provideTasks(token)).then(value => { return { - tasks: Tasks.from(value, this.getUUIDMap(handler.extension.id)), + tasks: Tasks.from(value, handler.extension, this.getUUIDMap(handler.extension.id)), extension: handler.extension }; }); diff --git a/src/vs/workbench/api/node/extHostTextEditor.ts b/src/vs/workbench/api/node/extHostTextEditor.ts index ab5572a0d62..b566c23aa34 100644 --- a/src/vs/workbench/api/node/extHostTextEditor.ts +++ b/src/vs/workbench/api/node/extHostTextEditor.ts @@ -12,9 +12,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { ExtHostDocumentData } from 'vs/workbench/api/node/extHostDocumentData'; import { Selection, Range, Position, EndOfLine, TextEditorRevealType, TextEditorLineNumbersStyle, SnippetString } from './extHostTypes'; import { ISingleEditOperation } from 'vs/editor/common/editorCommon'; -import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from 'vs/workbench/api/node/mainThreadEditor'; import * as TypeConverters from './extHostTypeConverters'; -import { MainThreadEditorsShape } from './extHost.protocol'; +import { MainThreadEditorsShape, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from './extHost.protocol'; import * as vscode from 'vscode'; import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; import { IRange } from 'vs/editor/common/core/range'; diff --git a/src/vs/workbench/api/node/extHostTextEditors.ts b/src/vs/workbench/api/node/extHostTextEditors.ts index 94003fbaa33..0f4bfdf398a 100644 --- a/src/vs/workbench/api/node/extHostTextEditors.ts +++ b/src/vs/workbench/api/node/extHostTextEditors.ts @@ -10,11 +10,11 @@ import { toThenable } from 'vs/base/common/async'; import { TPromise } from 'vs/base/common/winjs.base'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { TextEditorSelectionChangeKind } from './extHostTypes'; -import { IResolvedTextEditorConfiguration, ISelectionChangeEvent } from 'vs/workbench/api/node/mainThreadEditor'; import * as TypeConverters from './extHostTypeConverters'; import { TextEditorDecorationType, ExtHostTextEditor } from './extHostTextEditor'; import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors'; -import { MainContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData } from './extHost.protocol'; +import { Position as EditorPosition } from 'vs/platform/editor/common/editor'; +import { MainContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData, IResolvedTextEditorConfiguration, ISelectionChangeEvent } from './extHost.protocol'; import * as vscode from 'vscode'; export class ExtHostEditors extends ExtHostEditorsShape { @@ -74,6 +74,7 @@ export class ExtHostEditors extends ExtHostEditorsShape { }; } else { options = { + position: EditorPosition.ONE, preserveFocus: false, pinned: true }; diff --git a/src/vs/workbench/api/node/extHostTreeView.ts b/src/vs/workbench/api/node/extHostTreeView.ts deleted file mode 100644 index ec6318eec3a..00000000000 --- a/src/vs/workbench/api/node/extHostTreeView.ts +++ /dev/null @@ -1,162 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { localize } from 'vs/nls'; -import { TreeView, TreeDataProvider } from 'vscode'; -import { defaultGenerator } from 'vs/base/common/idGenerator'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { MainContext, ExtHostTreeViewShape, MainThreadTreeViewShape } from './extHost.protocol'; -import { InternalTreeNode } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; -import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; -import { asWinJsPromise } from 'vs/base/common/async'; -import * as modes from 'vs/editor/common/modes'; - -class InternalTreeNodeImpl implements InternalTreeNode { - - readonly id: string; - label: string; - hasChildren: boolean; - clickCommand: string = null; - - constructor(readonly providerId: string, node: any, provider: TreeDataProvider) { - this.id = defaultGenerator.nextId(); - this.label = provider.getLabel ? provider.getLabel(node) : node.toString(); - this.hasChildren = provider.getHasChildren ? provider.getHasChildren(node) : true; - if (provider.getClickCommand) { - const command = provider.getClickCommand(node); - if (command) { - this.clickCommand = command.command; - } - } - } -} - -export class ExtHostTreeView extends ExtHostTreeViewShape { - private _proxy: MainThreadTreeViewShape; - - private _extNodeProviders: { [providerId: string]: TreeDataProvider }; - private _extViews: Map> = new Map>(); - private _extNodeMaps: { [providerId: string]: { [id: string]: InternalTreeNode } }; - private _mainNodesMap: Map>; - private _childrenNodesMap: Map>; - - constructor( - threadService: IThreadService, - private commands: ExtHostCommands - ) { - super(); - - this._proxy = threadService.get(MainContext.MainThreadExplorers); - - this._extNodeProviders = Object.create(null); - this._extNodeMaps = Object.create(null); - this._mainNodesMap = new Map>(); - this._childrenNodesMap = new Map>(); - - commands.registerArgumentProcessor({ - processArgument: arg => { - if (arg && arg.providerId && arg.id) { - const extNodeMap = this._extNodeMaps[arg.providerId]; - return extNodeMap[arg.id]; - } - return arg; - } - }); - } - - createTreeView(providerId: string, provider: TreeDataProvider): TreeView { - this._proxy.$registerTreeDataProvider(providerId); - this._extNodeProviders[providerId] = provider; - this._mainNodesMap.set(providerId, new Map()); - this._childrenNodesMap.set(providerId, new Map()); - - const treeView: TreeView = { - refresh: (node: T) => { - const mainThreadNode = this._mainNodesMap.get(providerId).get(node); - this._proxy.$refresh(providerId, mainThreadNode); - }, - dispose: () => { - delete this._extNodeProviders[providerId]; - delete this._extNodeProviders[providerId]; - this._mainNodesMap.delete(providerId); - this._childrenNodesMap.delete(providerId); - this._extViews.delete(providerId); - } - }; - this._extViews.set(providerId, treeView); - return treeView; - } - - $provideRootNode(providerId: string): TPromise { - const provider = this._extNodeProviders[providerId]; - if (!provider) { - const errMessage = localize('treeExplorer.notRegistered', 'No TreeExplorerNodeProvider with id \'{0}\' registered.', providerId); - return TPromise.wrapError(errMessage); - } - - return asWinJsPromise(() => provider.provideRootNode()).then(extRootNode => { - const extNodeMap: { [id: string]: InternalTreeNode } = Object.create(null); - const internalRootNode = new InternalTreeNodeImpl(providerId, extRootNode, provider); - - extNodeMap[internalRootNode.id] = extRootNode; - this._extNodeMaps[providerId] = extNodeMap; - - this._mainNodesMap.get(providerId).set(extRootNode, internalRootNode); - - return internalRootNode; - }, err => { - const errMessage = localize('treeExplorer.failedToProvideRootNode', 'TreeExplorerNodeProvider \'{0}\' failed to provide root node.', providerId); - return TPromise.wrapError(errMessage); - }); - } - - $resolveChildren(providerId: string, mainThreadNode: InternalTreeNode): TPromise { - const provider = this._extNodeProviders[providerId]; - if (!provider) { - const errMessage = localize('treeExplorer.notRegistered', 'No TreeExplorerNodeProvider with id \'{0}\' registered.', providerId); - return TPromise.wrapError(errMessage); - } - - const extNodeMap = this._extNodeMaps[providerId]; - const extNode = extNodeMap[mainThreadNode.id]; - - const currentChildren = this._childrenNodesMap.get(providerId).get(extNode); - if (currentChildren) { - for (const child of currentChildren) { - this._mainNodesMap.get(providerId).delete(child); - } - } - - return asWinJsPromise(() => provider.resolveChildren(extNode)).then(children => { - return children.map(extChild => { - const internalChild = new InternalTreeNodeImpl(providerId, extChild, provider); - extNodeMap[internalChild.id] = extChild; - this._mainNodesMap.get(providerId).set(extChild, internalChild); - return internalChild; - }); - }); - } - - // Convert the command on the ExtHost side so we can pass the original externalNode to the registered handler - $getInternalCommand(providerId: string, mainThreadNode: InternalTreeNode): TPromise { - const commandConverter = this.commands.converter; - - if (mainThreadNode.clickCommand) { - const extNode = this._extNodeMaps[providerId][mainThreadNode.id]; - - const internalCommand = commandConverter.toInternal({ - title: '', - command: mainThreadNode.clickCommand, - arguments: [extNode] - }); - - return TPromise.wrap(internalCommand); - } - - return TPromise.as(null); - } -} \ No newline at end of file diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts new file mode 100644 index 00000000000..b772b894593 --- /dev/null +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -0,0 +1,213 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { localize } from 'vs/nls'; +import * as vscode from 'vscode'; +import URI from 'vs/base/common/uri'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; +import { MainContext, ExtHostTreeViewsShape, MainThreadTreeViewsShape, TreeItem, TreeViewCommandArg } from './extHost.protocol'; +import { TreeItemCollapsibleState } from './extHostTypes'; +import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; +import { asWinJsPromise } from 'vs/base/common/async'; +import * as modes from 'vs/editor/common/modes'; + +type TreeItemHandle = number; + +export class ExtHostTreeViews extends ExtHostTreeViewsShape { + + private treeViews: Map> = new Map>(); + private _proxy: MainThreadTreeViewsShape; + + constructor( + threadService: IThreadService, + private commands: ExtHostCommands + ) { + super(); + this._proxy = threadService.get(MainContext.MainThreadTreeViews); + commands.registerArgumentProcessor({ + processArgument: arg => { + if (arg && arg.treeViewId && arg.treeItemHandle) { + return this.convertArgument(arg); + } + return arg; + } + }); + } + + registerTreeDataProviderForView(id: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable { + const treeView = new ExtHostTreeView(id, treeDataProvider, this._proxy); + this.treeViews.set(id, treeView); + return { + dispose: () => { + this.treeViews.delete(id); + treeView.dispose(); + } + }; + } + + $getElements(treeViewId: string): TPromise { + const treeView = this.treeViews.get(treeViewId); + if (!treeView) { + return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); + } + return treeView.getTreeItems(); + } + + $getChildren(treeViewId: string, treeItemHandle?: number): TPromise { + const treeView = this.treeViews.get(treeViewId); + if (!treeView) { + return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); + } + return treeView.getChildren(treeItemHandle); + } + + private convertArgument(arg: TreeViewCommandArg): any { + const treeView = this.treeViews.get(arg.treeViewId); + if (!treeView) { + return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', arg.treeViewId)); + } + return treeView.getExtensionElement(arg.treeItemHandle); + } +} + +class ExtHostTreeView extends Disposable { + + private _itemHandlePool = 0; + + private extElementsMap: Map = new Map(); + private itemHandlesMap: Map = new Map(); + private extChildrenElementsMap: Map = new Map(); + + constructor(private viewId: string, private dataProvider: vscode.TreeDataProvider, private proxy: MainThreadTreeViewsShape) { + super(); + this.proxy.$registerView(viewId); + if (dataProvider.onDidChangeTreeData) { + this._register(dataProvider.onDidChangeTreeData(element => this._refresh(element))); + } + } + + getTreeItems(): TPromise { + this.extChildrenElementsMap.clear(); + this.extElementsMap.clear(); + this.itemHandlesMap.clear(); + + return asWinJsPromise(() => this.dataProvider.getChildren()) + .then(elements => this.processAndMapElements(elements)); + } + + getChildren(treeItemHandle: TreeItemHandle): TPromise { + let extElement = this.getExtensionElement(treeItemHandle); + if (extElement) { + this.clearChildren(extElement); + } else { + return TPromise.wrapError(localize('treeItem.notFound', 'No tree item with id \'{0}\' found.', treeItemHandle)); + } + + return asWinJsPromise(() => this.dataProvider.getChildren(extElement)) + .then(childrenElements => this.processAndMapElements(childrenElements)); + } + + getExtensionElement(treeItemHandle: TreeItemHandle): T { + return this.extElementsMap.get(treeItemHandle); + } + + private _refresh(element: T): void { + if (element) { + const itemHandle = this.itemHandlesMap.get(element); + if (itemHandle) { + this.proxy.$refresh(this.viewId, itemHandle); + } + } else { + this.proxy.$refresh(this.viewId); + } + } + + private processAndMapElements(elements: T[]): TPromise { + const treeItemsPromises: TPromise[] = []; + for (const element of elements) { + if (this.extChildrenElementsMap.has(element)) { + return TPromise.wrapError(localize('treeView.duplicateElement', 'Element {0} is already registered', element)); + } + const treeItem = this.massageTreeItem(this.dataProvider.getTreeItem(element)); + this.itemHandlesMap.set(element, treeItem.handle); + this.extElementsMap.set(treeItem.handle, element); + if (treeItem.collapsibleState === TreeItemCollapsibleState.Expanded) { + treeItemsPromises.push(this.getChildren(treeItem.handle).then(children => { + treeItem.children = children; + return treeItem; + })); + } else { + treeItemsPromises.push(TPromise.as(treeItem)); + } + } + return TPromise.join(treeItemsPromises); + } + + private massageTreeItem(extensionTreeItem: vscode.TreeItem): TreeItem { + const icon = this.getLightIconPath(extensionTreeItem); + return { + handle: ++this._itemHandlePool, + label: extensionTreeItem.label, + commandId: extensionTreeItem.command ? extensionTreeItem.command.command : void 0, + contextValue: extensionTreeItem.contextValue, + icon, + iconDark: this.getDarkIconPath(extensionTreeItem) || icon, + collapsibleState: extensionTreeItem.collapsibleState, + }; + } + + private getLightIconPath(extensionTreeItem: vscode.TreeItem) { + if (extensionTreeItem.iconPath) { + if (typeof extensionTreeItem.iconPath === 'string' || extensionTreeItem.iconPath instanceof URI) { + return this.getIconPath(extensionTreeItem.iconPath); + } + return this.getIconPath(extensionTreeItem.iconPath['light']); + } + return void 0; + } + + private getDarkIconPath(extensionTreeItem: vscode.TreeItem) { + if (extensionTreeItem.iconPath && extensionTreeItem.iconPath['dark']) { + return this.getIconPath(extensionTreeItem.iconPath['dark']); + } + return void 0; + } + + private getIconPath(iconPath: string | URI): string { + if (iconPath instanceof URI) { + return iconPath.toString(); + } + return URI.file(iconPath).toString(); + } + + private clearChildren(extElement: T): void { + const children = this.extChildrenElementsMap.get(extElement); + if (children) { + for (const child of children) { + this.clearElement(child); + } + this.extChildrenElementsMap.delete(extElement); + } + } + + private clearElement(extElement: T): void { + this.clearChildren(extElement); + + const treeItemhandle = this.itemHandlesMap.get(extElement); + this.itemHandlesMap.delete(extElement); + if (treeItemhandle) { + this.extElementsMap.delete(treeItemhandle); + } + } + + dispose() { + this.extElementsMap.clear(); + this.itemHandlesMap.clear(); + this.extChildrenElementsMap.clear(); + } +} \ No newline at end of file diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index d8279811f68..7548f24f051 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -1018,17 +1018,18 @@ export enum RevealKind { export class BaseTask { private _name: string; - private _problemMatchers: vscode.ProblemMatcher[]; + private _problemMatchers: string[]; private _identifier: string; private _isBackground: boolean; + private _source: string; + private _group: string; private _terminal: vscode.TerminalBehaviour; - constructor(name: string, problemMatchers: vscode.ProblemMatcher[]) { + constructor(name: string, problemMatchers: string[]) { if (typeof name !== 'string') { throw illegalArgument('name'); } this._name = name; - this._identifier = name; this._problemMatchers = problemMatchers || []; this._isBackground = false; this._terminal = Object.create(null); @@ -1039,11 +1040,11 @@ export class BaseTask { } set identifier(value: string) { - if (typeof value !== 'string') { - throw illegalArgument('identifier'); + if (value === void 0 || value === null) { + this._identifier = undefined; } - if (value.indexOf(':') !== -1) { - throw illegalArgument('identifier must not contain \':\''); + if (typeof value !== 'string' || value.length === 0) { + throw illegalArgument('identifier must be a string of length > 0'); } this._identifier = value; } @@ -1063,6 +1064,36 @@ export class BaseTask { this._isBackground = value; } + get source(): string { + return this._source; + } + + set source(value: string) { + if (value === void 0 || value === null) { + this._source = undefined; + return; + } + if (typeof value !== 'string' || value.length === 0) { + throw illegalArgument('source must be a string of length > 0'); + } + this._source = value; + } + + get group(): string { + return this._group; + } + + set group(value: string) { + if (value === void 0 || value === null) { + this._group = undefined; + return; + } + if (typeof value !== 'string' || value.length === 0) { + throw illegalArgument('group must be a string of length > 0'); + } + this._group = value; + } + get terminal(): vscode.TerminalBehaviour { return this._terminal; } @@ -1074,11 +1105,11 @@ export class BaseTask { this._terminal = value; } - get problemMatchers(): vscode.ProblemMatcher[] { + get problemMatchers(): string[] { return this._problemMatchers; } - set problemMatchers(value: vscode.ProblemMatcher[]) { + set problemMatchers(value: string[]) { if (!Array.isArray(value)) { value = []; } @@ -1086,12 +1117,20 @@ export class BaseTask { } } +/* namespace ProblemMatcher { export function is(value: any): value is vscode.ProblemMatcher { let candidate: vscode.ProblemMatcher = value; return candidate && !!candidate.pattern; } } +*/ + +namespace ShellOptions { + export function is(value: any): value is vscode.ShellOptions { + return value && ((typeof value.executable === 'string') || (typeof value.cwd === 'string') || !!value.env); + } +} export namespace TaskGroup { /** @@ -1114,7 +1153,7 @@ export namespace TaskGroup { */ export const Test: 'test' = 'test'; - export function is(value: string): value is vscode.TaskGroup { + export function is(value: string): value is string { return value === Clean || value === Build || value === RebuildAll || value === Test; } } @@ -1123,43 +1162,37 @@ export class ProcessTask extends BaseTask { private _process: string; private _args: string[]; - private _group: vscode.TaskGroup; private _options: vscode.ProcessOptions; - private static parseArguments(restArgs: any[]): { args: string[]; options: vscode.ProcessOptions; problemMatchers: vscode.ProblemMatcher[] } { - let args: string[] = []; - let options: vscode.ProcessOptions = undefined; - let problemMatchers: vscode.ProblemMatcher[] = []; - if (!restArgs || restArgs.length === 0) { - return { args, options, problemMatchers }; - } - let current: any = restArgs[0]; - if (Array.isArray(current)) { - args = current; - restArgs.shift(); - current = restArgs[0]; - } - if (ProblemMatcher.is(current)) { - problemMatchers = restArgs; - } else if (current) { - options = current; - restArgs.shift(); - if (restArgs.length > 0) { - problemMatchers = restArgs; - } - } - return { args, options, problemMatchers }; - } - - constructor(name: string, process: string, ...problemMatchers: vscode.ProblemMatcher[]); - constructor(name: string, process: string, args: string[], ...problemMatchers: vscode.ProblemMatcher[]); - constructor(name: string, process: string, args: string[], options: vscode.ProcessOptions, ...problemMatchers: vscode.ProblemMatcher[]); - constructor(name: string, process: string, ...rest: any[]) { + constructor(name: string, process: string, args?: string[], problemMatchers?: vscode.ProblemMatchers); + constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessOptions, problemMatchers?: vscode.ProblemMatchers); + constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessOptions | vscode.ProblemMatchers, arg5?: vscode.ProblemMatchers) { if (typeof process !== 'string') { throw illegalArgument('process'); } - let { args, options, problemMatchers } = ProcessTask.parseArguments(rest); - super(name, problemMatchers); + let args: string[]; + let options: vscode.ProcessOptions; + let problemMatchers: vscode.ProblemMatchers; + + args = arg3 || []; + if (arg4) { + if (Array.isArray(arg4) || typeof arg4 === 'string') { + problemMatchers = arg4; + } else { + options = arg4; + } + } + if (arg5 && !problemMatchers) { + problemMatchers = arg5; + } + let pm: string[]; + if (problemMatchers && (typeof problemMatchers === 'string')) { + pm = [problemMatchers]; + } else if (Array.isArray(problemMatchers)) { + pm = problemMatchers; + } + pm = pm || []; + super(name, pm); this._process = process; this._args = args; this._options = options || Object.create(null); @@ -1180,17 +1213,6 @@ export class ProcessTask extends BaseTask { this._args = value; } - get group(): vscode.TaskGroup { - return this._group; - } - - set group(value: vscode.TaskGroup) { - if (!TaskGroup.is(value)) { - throw illegalArgument('group'); - } - this._group = value; - } - get options(): vscode.ProcessOptions { return this._options; } @@ -1203,39 +1225,31 @@ export class ProcessTask extends BaseTask { } } -export class ShellTask extends BaseTask { +export class ShellTask extends BaseTask implements vscode.ShellTask { private _commandLine: string; - private _group: vscode.TaskGroup; private _options: vscode.ShellOptions; - private static parseArguments(restArgs: any[]): { options: vscode.ShellOptions; problemMatchers: vscode.ProblemMatcher[] } { - let options: vscode.ShellOptions = undefined; - let problemMatchers: vscode.ProblemMatcher[] = []; - if (!restArgs || restArgs.length === 0) { - return { options, problemMatchers }; - } - let current: any = restArgs[0]; - if (current && !ProblemMatcher.is(current)) { - options = current; - restArgs.shift(); - current = restArgs[0]; - } - if (ProblemMatcher.is(current)) { - problemMatchers = restArgs; - } - return { options, problemMatchers }; - } - - constructor(name: string, commandLine: string, ...problemMatchers: vscode.ProblemMatcher[]); - constructor(name: string, commandLine: string, options: vscode.ShellOptions, ...problemMatchers: vscode.ProblemMatcher[]); - constructor(name: string, commandLine: string, ...rest: any[]) { + constructor(name: string, commandLine: string, problemMatchers?: vscode.ProblemMatchers); + constructor(name: string, commandLine: string, options: vscode.ShellOptions, problemMatchers?: vscode.ProblemMatchers); + constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellOptions | vscode.ProblemMatchers, problemMatchers?: vscode.ProblemMatchers) { if (typeof commandLine !== 'string') { throw illegalArgument('commandLine'); } - let { options, problemMatchers } = ShellTask.parseArguments(rest); - - super(name, problemMatchers); + let options: vscode.ShellOptions = undefined; + let pm: string[]; + if (ShellOptions.is(optionsOrProblemMatchers)) { + options = optionsOrProblemMatchers; + } else { + problemMatchers = optionsOrProblemMatchers; + } + if (problemMatchers && (typeof problemMatchers === 'string')) { + pm = [problemMatchers]; + } else if (Array.isArray(problemMatchers)) { + pm = problemMatchers; + } + pm = pm || []; + super(name, pm); this._commandLine = commandLine; this._options = options || Object.create(null); } @@ -1244,17 +1258,6 @@ export class ShellTask extends BaseTask { return this._commandLine; } - get group(): vscode.TaskGroup { - return this._group; - } - - set group(value: vscode.TaskGroup) { - if (!TaskGroup.is(value)) { - throw illegalArgument('group'); - } - this._group = value; - } - get options(): vscode.ShellOptions { return this._options; } @@ -1271,3 +1274,16 @@ export enum ProgressLocation { SourceControl = 1, Window = 10, } + +export enum TreeItemCollapsibleState { + None = 0, + Collapsed = 1, + Expanded = 2 +} + +export class ThemeColor { + id: string; + constructor(id: string) { + this.id = id; + } +} \ No newline at end of file diff --git a/src/vs/workbench/api/node/mainThreadTreeView.ts b/src/vs/workbench/api/node/mainThreadTreeView.ts deleted file mode 100644 index 54168aecf5c..00000000000 --- a/src/vs/workbench/api/node/mainThreadTreeView.ts +++ /dev/null @@ -1,64 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import Event, { Emitter } from 'vs/base/common/event'; -import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { ExtHostContext, MainThreadTreeViewShape, ExtHostTreeViewShape } from './extHost.protocol'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; -import { InternalTreeNodeContent, InternalTreeNodeProvider } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; -import { ICommandService } from 'vs/platform/commands/common/commands'; - -export class MainThreadTreeView extends MainThreadTreeViewShape { - private _proxy: ExtHostTreeViewShape; - - constructor( - @IThreadService threadService: IThreadService, - @ITreeExplorerService private treeExplorerService: ITreeExplorerService, - @IMessageService private messageService: IMessageService, - @ICommandService private commandService: ICommandService - ) { - super(); - - this._proxy = threadService.get(ExtHostContext.ExtHostTreeView); - } - - $registerTreeDataProvider(providerId: string): void { - const provider = new TreeExplorerNodeProvider(providerId, this._proxy, this.messageService, this.commandService); - this.treeExplorerService.registerTreeExplorerNodeProvider(providerId, provider); - } - - $refresh(providerId: string, node: InternalTreeNodeContent): void { - (this.treeExplorerService.getProvider(providerId))._onRefresh.fire(node); - } -} - -class TreeExplorerNodeProvider implements InternalTreeNodeProvider { - - readonly _onRefresh: Emitter = new Emitter(); - readonly onRefresh: Event = this._onRefresh.event; - - constructor(public readonly id: string, private _proxy: ExtHostTreeViewShape, - private messageService: IMessageService, - private commandService: ICommandService - ) { - } - - provideRootNode(): TPromise { - return this._proxy.$provideRootNode(this.id).then(rootNode => rootNode, err => this.messageService.show(Severity.Error, err)); - } - - resolveChildren(node: InternalTreeNodeContent): TPromise { - return this._proxy.$resolveChildren(this.id, node).then(children => children, err => this.messageService.show(Severity.Error, err)); - } - - executeCommand(node: InternalTreeNodeContent): TPromise { - return this._proxy.$getInternalCommand(this.id, node).then(command => { - return this.commandService.executeCommand(command.id, ...command.arguments); - }); - } -} diff --git a/src/vs/workbench/browser/actionBarRegistry.ts b/src/vs/workbench/browser/actions.ts similarity index 100% rename from src/vs/workbench/browser/actionBarRegistry.ts rename to src/vs/workbench/browser/actions.ts diff --git a/src/vs/workbench/browser/actions/configureLocale.ts b/src/vs/workbench/browser/actions/configureLocale.ts index 02c70d9f47f..f9181f42609 100644 --- a/src/vs/workbench/browser/actions/configureLocale.ts +++ b/src/vs/workbench/browser/actions/configureLocale.ts @@ -32,7 +32,7 @@ class ConfigureLocaleAction extends Action { '{', `\t// ${nls.localize('displayLanguage', 'Defines VSCode\'s display language.')}`, `\t// ${nls.localize('doc', 'See {0} for a list of supported languages.', 'https://go.microsoft.com/fwlink/?LinkId=761051')}`, - `\t// ${nls.localize('restart', 'Changing the value requires to restart VSCode.')}`, + `\t// ${nls.localize('restart', 'Changing the value requires restarting VSCode.')}`, `\t"locale":"${Platform.language}"`, '}' ].join('\n'); diff --git a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts index 3718e0927b9..0c191dd5a55 100644 --- a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts @@ -10,7 +10,6 @@ import { Registry } from 'vs/platform/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; @@ -25,7 +24,6 @@ export class ToggleActivityBarVisibilityAction extends Action { id: string, label: string, @IPartService private partService: IPartService, - @IMessageService private messageService: IMessageService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService ) { super(id, label); @@ -37,9 +35,7 @@ export class ToggleActivityBarVisibilityAction extends Action { const visibility = this.partService.isVisible(Parts.ACTIVITYBAR_PART); const newVisibilityValue = !visibility; - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleActivityBarVisibilityAction.activityBarVisibleKey, value: newVisibilityValue }).then(null, error => { - this.messageService.show(Severity.Error, error); - }); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleActivityBarVisibilityAction.activityBarVisibleKey, value: newVisibilityValue }); return TPromise.as(null); } diff --git a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts index 1fc53c621d6..57364bd9188 100644 --- a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts +++ b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts @@ -9,7 +9,6 @@ import nls = require('vs/nls'); import { Registry } from 'vs/platform/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IPartService, Position } from 'vs/workbench/services/part/common/partService'; @@ -25,7 +24,6 @@ export class ToggleSidebarPositionAction extends Action { id: string, label: string, @IPartService private partService: IPartService, - @IMessageService private messageService: IMessageService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService ) { super(id, label); @@ -37,9 +35,7 @@ export class ToggleSidebarPositionAction extends Action { const position = this.partService.getSideBarPosition(); const newPositionValue = (position === Position.LEFT) ? 'right' : 'left'; - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleSidebarPositionAction.sidebarPositionConfigurationKey, value: newPositionValue }).then(null, error => { - this.messageService.show(Severity.Error, error); - }); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleSidebarPositionAction.sidebarPositionConfigurationKey, value: newPositionValue }); return TPromise.as(null); } diff --git a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts index d06dafc4db0..ae231cc643c 100644 --- a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts @@ -10,7 +10,6 @@ import { Registry } from 'vs/platform/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; @@ -25,7 +24,6 @@ export class ToggleStatusbarVisibilityAction extends Action { id: string, label: string, @IPartService private partService: IPartService, - @IMessageService private messageService: IMessageService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService ) { super(id, label); @@ -37,9 +35,7 @@ export class ToggleStatusbarVisibilityAction extends Action { const visibility = this.partService.isVisible(Parts.STATUSBAR_PART); const newVisibilityValue = !visibility; - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleStatusbarVisibilityAction.statusbarVisibleKey, value: newVisibilityValue }).then(null, error => { - this.messageService.show(Severity.Error, error); - }); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleStatusbarVisibilityAction.statusbarVisibleKey, value: newVisibilityValue }); return TPromise.as(null); } diff --git a/src/vs/workbench/browser/activity.ts b/src/vs/workbench/browser/activity.ts new file mode 100644 index 00000000000..5f23bef3a5e --- /dev/null +++ b/src/vs/workbench/browser/activity.ts @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Registry } from 'vs/platform/platform'; +import { IAction } from 'vs/base/common/actions'; +import { IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; + +export interface IActivity { + id: string; + name: string; + cssClass: string; +} + +export interface IGlobalActivity extends IActivity { + getActions(): IAction[]; +} + +export const GlobalActivityExtensions = 'workbench.contributions.globalActivities'; + +export interface IGlobalActivityRegistry { + registerActivity(descriptor: IConstructorSignature0): void; + getActivities(): IConstructorSignature0[]; +} + +export class GlobalActivityRegistry implements IGlobalActivityRegistry { + + private activityDescriptors = new Set>(); + + registerActivity(descriptor: IConstructorSignature0): void { + this.activityDescriptors.add(descriptor); + } + + getActivities(): IConstructorSignature0[] { + const result: IConstructorSignature0[] = []; + this.activityDescriptors.forEach(d => result.push(d)); + return result; + } +} + +Registry.add(GlobalActivityExtensions, new GlobalActivityRegistry()); \ No newline at end of file diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 3d6f853fc0f..7f698036e98 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -60,7 +60,7 @@ export class ResourceLabel extends IconLabel { } public setLabel(label: IEditorLabel, options?: IResourceLabelOptions): void { - const hasResourceChanged = this.hasResourceChanged(label); + const hasResourceChanged = this.hasResourceChanged(label, options); this.label = label; this.options = options; @@ -68,10 +68,17 @@ export class ResourceLabel extends IconLabel { this.render(hasResourceChanged); } - private hasResourceChanged(label: IEditorLabel): boolean { + private hasResourceChanged(label: IEditorLabel, options: IResourceLabelOptions): boolean { const newResource = label ? label.resource : void 0; const oldResource = this.label ? this.label.resource : void 0; + const newIsFolder = options ? options.isFolder : false; + const oldIsFolder = this.options ? this.options.isFolder : false; + + if (newIsFolder !== oldIsFolder) { + return true; // same resource but different kind (file, folder) + } + if (newResource && oldResource) { return newResource.toString() !== oldResource.toString(); } diff --git a/src/vs/workbench/browser/part.ts b/src/vs/workbench/browser/part.ts index a0cf82677f9..71e32226b2a 100644 --- a/src/vs/workbench/browser/part.ts +++ b/src/vs/workbench/browser/part.ts @@ -12,6 +12,7 @@ import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; export interface IPartOptions { hasTitle?: boolean; + borderWidth?: () => number; } /** @@ -130,6 +131,10 @@ export class PartLayout { // Content Size: Width (Fill), Height (Variable) const contentSize = new Dimension(width, height - titleSize.height); + if (this.options && typeof this.options.borderWidth === 'function') { + contentSize.width -= this.options.borderWidth(); // adjust for border size + } + sizes.push(titleSize); sizes.push(contentSize); diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index a6cbc397306..08a7aea55c4 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -20,23 +20,34 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ViewletDescriptor } from 'vs/workbench/browser/viewlet'; +import { IActivity, IGlobalActivity } from 'vs/workbench/browser/activity'; import { dispose } from 'vs/base/common/lifecycle'; import { IViewletService, } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { IThemeService, ITheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND, ACTIVITY_BAR_FOREGROUND } from 'vs/workbench/common/theme'; import { contrastBorder, activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; +import { StandardMouseEvent } from "vs/base/browser/mouseEvent"; + +export interface IViewletActivity { + badge: IBadge; + clazz: string; +} export class ActivityAction extends Action { private badge: IBadge; private _onDidChangeBadge = new Emitter(); - constructor(id: string, name: string, clazz: string) { - super(id, name, clazz); + constructor(private _activity: IActivity) { + super(_activity.id, _activity.name, _activity.cssClass); this.badge = null; } + public get activity(): IActivity { + return this._activity; + } + public get onDidChangeBadge(): Event { return this._onDidChangeBadge.event; } @@ -74,7 +85,7 @@ export class ViewletActivityAction extends ActivityAction { @IViewletService private viewletService: IViewletService, @IPartService private partService: IPartService ) { - super(viewlet.id, viewlet.name, viewlet.cssClass); + super(viewlet); } public run(event): TPromise { @@ -84,7 +95,7 @@ export class ViewletActivityAction extends ActivityAction { // prevent accident trigger on a doubleclick (to help nervous people) const now = Date.now(); - if (now - this.lastRun < ViewletActivityAction.preventDoubleClickDelay) { + if (now > this.lastRun /* https://github.com/Microsoft/vscode/issues/25830 */ && now - this.lastRun < ViewletActivityAction.preventDoubleClickDelay) { return TPromise.as(true); } this.lastRun = now; @@ -102,7 +113,13 @@ export class ViewletActivityAction extends ActivityAction { } } -export abstract class ThemableActivityActionItem extends BaseActionItem { +export class ActivityActionItem extends BaseActionItem { + protected $container: Builder; + protected $label: Builder; + protected $badge: Builder; + + private $badgeContent: Builder; + private mouseUpTimeout: number; constructor( action: ActivityAction, @@ -112,56 +129,13 @@ export abstract class ThemableActivityActionItem extends BaseActionItem { super(null, action, options); this.themeService.onThemeChange(this.onThemeChange, this, this._callOnDispose); - } - - private onThemeChange(theme: ITheme): void { - this.updateStyles(); - } - - protected abstract updateStyles(): void; -} - -export class ActivityActionItem extends ThemableActivityActionItem { - - private static manageExtensionAction: ManageExtensionAction; - private static toggleViewletPinnedAction: ToggleViewletPinnedAction; - private static draggedViewlet: ViewletDescriptor; - - private $container: Builder; - private $label: Builder; - private name: string; - private _keybinding: string; - private cssClass: string; - private $badge: Builder; - private $badgeContent: Builder; - private mouseUpTimeout: number; - - constructor( - action: ActivityAction, - private viewlet: ViewletDescriptor, - @IContextMenuService private contextMenuService: IContextMenuService, - @IActivityBarService private activityBarService: IActivityBarService, - @IKeybindingService private keybindingService: IKeybindingService, - @IInstantiationService instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService - ) { - super(action, { draggable: true }, themeService); - - this.cssClass = action.class; - this.name = viewlet.name; - this._keybinding = this.getKeybindingLabel(viewlet.id); - - if (!ActivityActionItem.manageExtensionAction) { - ActivityActionItem.manageExtensionAction = instantiationService.createInstance(ManageExtensionAction); - } - - if (!ActivityActionItem.toggleViewletPinnedAction) { - ActivityActionItem.toggleViewletPinnedAction = instantiationService.createInstance(ToggleViewletPinnedAction, void 0); - } - action.onDidChangeBadge(this.handleBadgeChangeEvenet, this, this._callOnDispose); } + protected get activity(): IActivity { + return (this._action as ActivityAction).activity; + } + protected updateStyles(): void { const theme = this.themeService.getTheme(); @@ -176,33 +150,25 @@ export class ActivityActionItem extends ThemableActivityActionItem { if (this.$badgeContent) { const badgeForeground = theme.getColor(ACTIVITY_BAR_BADGE_FOREGROUND); const badgeBackground = theme.getColor(ACTIVITY_BAR_BADGE_BACKGROUND); - const hcBorder = theme.getColor(contrastBorder); + const contrastBorderColor = theme.getColor(contrastBorder); this.$badgeContent.style('color', badgeForeground ? badgeForeground.toString() : null); this.$badgeContent.style('background-color', badgeBackground ? badgeBackground.toString() : null); - this.$badgeContent.style('border-style', hcBorder ? 'solid' : null); - this.$badgeContent.style('border-width', hcBorder ? '1px' : null); - this.$badgeContent.style('border-color', hcBorder ? hcBorder.toString() : null); + this.$badgeContent.style('border-style', contrastBorderColor ? 'solid' : null); + this.$badgeContent.style('border-width', contrastBorderColor ? '1px' : null); + this.$badgeContent.style('border-color', contrastBorderColor ? contrastBorderColor.toString() : null); } } - private getKeybindingLabel(id: string): string { - const kb = this.keybindingService.lookupKeybinding(id); - if (kb) { - return kb.getLabel(); - } - - return null; - } - public render(container: HTMLElement): void { super.render(container); // Make the container tab-able for keyboard navigation this.$container = $(container).attr({ tabIndex: '0', - role: 'button' + role: 'button', + title: this.activity.name }); // Try hard to prevent keyboard only focus feedback when using mouse @@ -220,161 +186,30 @@ export class ActivityActionItem extends ThemableActivityActionItem { }, 800); // delayed to prevent focus feedback from showing on mouse up }); - this.$container.on('contextmenu', e => { - DOM.EventHelper.stop(e, true); - - this.showContextMenu(container); - }); - - // Allow to drag - this.$container.on(DOM.EventType.DRAG_START, (e: DragEvent) => { - e.dataTransfer.effectAllowed = 'move'; - this.setDraggedViewlet(this.viewlet); - - // Trigger the action even on drag start to prevent clicks from failing that started a drag - if (!this.getAction().checked) { - this.getAction().run(); - } - }); - - // Drag enter - let counter = 0; // see https://github.com/Microsoft/vscode/issues/14470 - this.$container.on(DOM.EventType.DRAG_ENTER, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); - if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { - counter++; - this.updateFromDragging(container, true); - } - }); - - // Drag leave - this.$container.on(DOM.EventType.DRAG_LEAVE, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); - if (draggedViewlet) { - counter--; - if (counter === 0) { - this.updateFromDragging(container, false); - } - } - }); - - // Drag end - this.$container.on(DOM.EventType.DRAG_END, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); - if (draggedViewlet) { - counter = 0; - this.updateFromDragging(container, false); - - ActivityActionItem.clearDraggedViewlet(); - } - }); - - // Drop - this.$container.on(DOM.EventType.DROP, (e: DragEvent) => { - DOM.EventHelper.stop(e, true); - - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); - if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { - this.updateFromDragging(container, false); - ActivityActionItem.clearDraggedViewlet(); - - this.activityBarService.move(draggedViewlet.id, this.viewlet.id); - } - }); - // Label this.$label = $('a.action-label').appendTo(this.builder); - if (this.cssClass) { - this.$label.addClass(this.cssClass); + if (this.activity.cssClass) { + this.$label.addClass(this.activity.cssClass); } - // Badge - this.$badge = this.builder.div({ 'class': 'badge' }, (badge: Builder) => { + this.$badge = this.builder.clone().div({ 'class': 'badge' }, (badge: Builder) => { this.$badgeContent = badge.div({ 'class': 'badge-content' }); }); this.$badge.hide(); - // Keybinding - this.keybinding = this._keybinding; // force update - - // Activate on drag over to reveal targets - [this.$badge, this.$label].forEach(b => new DelayedDragHandler(b.getHTMLElement(), () => { - if (!ActivityActionItem.getDraggedViewlet() && !this.getAction().checked) { - this.getAction().run(); - } - })); - this.updateStyles(); } - private updateFromDragging(element: HTMLElement, isDragging: boolean): void { - const theme = this.themeService.getTheme(); - const dragBackground = theme.getColor(ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND); - - element.style.backgroundColor = isDragging && dragBackground ? dragBackground.toString() : null; - } - - public static getDraggedViewlet(): ViewletDescriptor { - return ActivityActionItem.draggedViewlet; - } - - private setDraggedViewlet(viewlet: ViewletDescriptor): void { - ActivityActionItem.draggedViewlet = viewlet; - } - - public static clearDraggedViewlet(): void { - ActivityActionItem.draggedViewlet = void 0; - } - - private showContextMenu(container: HTMLElement): void { - const actions: Action[] = [ActivityActionItem.toggleViewletPinnedAction]; - if (this.viewlet.extensionId) { - actions.push(new Separator()); - actions.push(ActivityActionItem.manageExtensionAction); - } - - const isPinned = this.activityBarService.isPinned(this.viewlet.id); - if (isPinned) { - ActivityActionItem.toggleViewletPinnedAction.label = nls.localize('removeFromActivityBar', "Remove from Activity Bar"); - } else { - ActivityActionItem.toggleViewletPinnedAction.label = nls.localize('keepInActivityBar', "Keep in Activity Bar"); - } - - this.contextMenuService.showContextMenu({ - getAnchor: () => container, - getActionsContext: () => this.viewlet, - getActions: () => TPromise.as(actions) - }); - } - - public focus(): void { - this.$container.domFocus(); + private onThemeChange(theme: ITheme): void { + this.updateStyles(); } public setBadge(badge: IBadge): void { this.updateBadge(badge); } - public set keybinding(keybinding: string) { - this._keybinding = keybinding; - - if (!this.$label) { - return; - } - - let title: string; - if (keybinding) { - title = nls.localize('titleKeybinding', "{0} ({1})", this.name, keybinding); - } else { - title = this.name; - } - - this.$label.title(title); - this.$badge.title(title); - } - - private updateBadge(badge: IBadge): void { + protected updateBadge(badge: IBadge): void { this.$badgeContent.empty(); this.$badge.hide(); @@ -404,10 +239,212 @@ export class ActivityActionItem extends ThemableActivityActionItem { this.$badge.show(); } - this.$label.attr('aria-label', `${this.name} - ${badge.getDescription()}`); + this.$label.attr('aria-label', `${this.activity.name} - ${badge.getDescription()}`); } } + private handleBadgeChangeEvenet(): void { + const action = this.getAction(); + if (action instanceof ActivityAction) { + this.updateBadge(action.getBadge()); + } + } + + public dispose(): void { + super.dispose(); + + if (this.mouseUpTimeout) { + clearTimeout(this.mouseUpTimeout); + } + + this.$badge.destroy(); + } +} + +export class ViewletActionItem extends ActivityActionItem { + + private static manageExtensionAction: ManageExtensionAction; + private static toggleViewletPinnedAction: ToggleViewletPinnedAction; + private static draggedViewlet: ViewletDescriptor; + + private _keybinding: string; + private cssClass: string; + + constructor( + private action: ViewletActivityAction, + @IContextMenuService private contextMenuService: IContextMenuService, + @IActivityBarService private activityBarService: IActivityBarService, + @IKeybindingService private keybindingService: IKeybindingService, + @IInstantiationService instantiationService: IInstantiationService, + @IThemeService themeService: IThemeService + ) { + super(action, { draggable: true }, themeService); + + this.cssClass = action.class; + this._keybinding = this.getKeybindingLabel(this.viewlet.id); + + if (!ViewletActionItem.manageExtensionAction) { + ViewletActionItem.manageExtensionAction = instantiationService.createInstance(ManageExtensionAction); + } + + if (!ViewletActionItem.toggleViewletPinnedAction) { + ViewletActionItem.toggleViewletPinnedAction = instantiationService.createInstance(ToggleViewletPinnedAction, void 0); + } + } + + private get viewlet(): ViewletDescriptor { + return this.action.activity as ViewletDescriptor; + } + + private getKeybindingLabel(id: string): string { + const kb = this.keybindingService.lookupKeybinding(id); + if (kb) { + return kb.getLabel(); + } + + return null; + } + + public render(container: HTMLElement): void { + super.render(container); + + this.$container.on('contextmenu', e => { + DOM.EventHelper.stop(e, true); + + this.showContextMenu(container); + }); + + // Allow to drag + this.$container.on(DOM.EventType.DRAG_START, (e: DragEvent) => { + e.dataTransfer.effectAllowed = 'move'; + this.setDraggedViewlet(this.viewlet); + + // Trigger the action even on drag start to prevent clicks from failing that started a drag + if (!this.getAction().checked) { + this.getAction().run(); + } + }); + + // Drag enter + let counter = 0; // see https://github.com/Microsoft/vscode/issues/14470 + this.$container.on(DOM.EventType.DRAG_ENTER, (e: DragEvent) => { + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); + if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { + counter++; + this.updateFromDragging(container, true); + } + }); + + // Drag leave + this.$container.on(DOM.EventType.DRAG_LEAVE, (e: DragEvent) => { + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); + if (draggedViewlet) { + counter--; + if (counter === 0) { + this.updateFromDragging(container, false); + } + } + }); + + // Drag end + this.$container.on(DOM.EventType.DRAG_END, (e: DragEvent) => { + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); + if (draggedViewlet) { + counter = 0; + this.updateFromDragging(container, false); + + ViewletActionItem.clearDraggedViewlet(); + } + }); + + // Drop + this.$container.on(DOM.EventType.DROP, (e: DragEvent) => { + DOM.EventHelper.stop(e, true); + + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); + if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { + this.updateFromDragging(container, false); + ViewletActionItem.clearDraggedViewlet(); + + this.activityBarService.move(draggedViewlet.id, this.viewlet.id); + } + }); + + // Keybinding + this.keybinding = this._keybinding; // force update + + // Activate on drag over to reveal targets + [this.$badge, this.$label].forEach(b => new DelayedDragHandler(b.getHTMLElement(), () => { + if (!ViewletActionItem.getDraggedViewlet() && !this.getAction().checked) { + this.getAction().run(); + } + })); + + this.updateStyles(); + } + + private updateFromDragging(element: HTMLElement, isDragging: boolean): void { + const theme = this.themeService.getTheme(); + const dragBackground = theme.getColor(ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND); + + element.style.backgroundColor = isDragging && dragBackground ? dragBackground.toString() : null; + } + + public static getDraggedViewlet(): ViewletDescriptor { + return ViewletActionItem.draggedViewlet; + } + + private setDraggedViewlet(viewlet: ViewletDescriptor): void { + ViewletActionItem.draggedViewlet = viewlet; + } + + public static clearDraggedViewlet(): void { + ViewletActionItem.draggedViewlet = void 0; + } + + private showContextMenu(container: HTMLElement): void { + const actions: Action[] = [ViewletActionItem.toggleViewletPinnedAction]; + if (this.viewlet.extensionId) { + actions.push(new Separator()); + actions.push(ViewletActionItem.manageExtensionAction); + } + + const isPinned = this.activityBarService.isPinned(this.viewlet.id); + if (isPinned) { + ViewletActionItem.toggleViewletPinnedAction.label = nls.localize('removeFromActivityBar', "Remove from Activity Bar"); + } else { + ViewletActionItem.toggleViewletPinnedAction.label = nls.localize('keepInActivityBar', "Keep in Activity Bar"); + } + + this.contextMenuService.showContextMenu({ + getAnchor: () => container, + getActionsContext: () => this.viewlet, + getActions: () => TPromise.as(actions) + }); + } + + public focus(): void { + this.$container.domFocus(); + } + + public set keybinding(keybinding: string) { + this._keybinding = keybinding; + + if (!this.$label) { + return; + } + + let title: string; + if (keybinding) { + title = nls.localize('titleKeybinding', "{0} ({1})", this.activity.name, keybinding); + } else { + title = this.activity.name; + } + + this.$label.title(title); + this.$badge.title(title); + } + protected _updateClass(): void { if (this.cssClass) { this.$badge.removeClass(this.cssClass); @@ -425,13 +462,6 @@ export class ActivityActionItem extends ThemableActivityActionItem { } } - private handleBadgeChangeEvenet(): void { - const action = this.getAction(); - if (action instanceof ActivityAction) { - this.updateBadge(action.getBadge()); - } - } - protected _updateEnabled(): void { if (this.getAction().enabled) { this.builder.removeClass('disabled'); @@ -443,13 +473,8 @@ export class ActivityActionItem extends ThemableActivityActionItem { public dispose(): void { super.dispose(); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); - if (this.mouseUpTimeout) { - clearTimeout(this.mouseUpTimeout); - } - - this.$badge.destroy(); this.$label.destroy(); } } @@ -459,7 +484,11 @@ export class ViewletOverflowActivityAction extends ActivityAction { constructor( private showMenu: () => void ) { - super('activitybar.additionalViewlets.action', nls.localize('additionalViews', "Additional Views"), 'toggle-more'); + super({ + id: 'activitybar.additionalViewlets.action', + name: nls.localize('additionalViews', "Additional Views"), + cssClass: 'toggle-more' + }); } public run(event): TPromise { @@ -469,8 +498,7 @@ export class ViewletOverflowActivityAction extends ActivityAction { } } -export class ViewletOverflowActivityActionItem extends ThemableActivityActionItem { - private $label: Builder; +export class ViewletOverflowActivityActionItem extends ActivityActionItem { private name: string; private cssClass: string; private actions: OpenViewletAction[]; @@ -481,7 +509,6 @@ export class ViewletOverflowActivityActionItem extends ThemableActivityActionIte private getBadge: (viewlet: ViewletDescriptor) => IBadge, @IInstantiationService private instantiationService: IInstantiationService, @IViewletService private viewletService: IViewletService, - @IKeybindingService private keybindingService: IKeybindingService, @IContextMenuService private contextMenuService: IContextMenuService, @IThemeService themeService: IThemeService ) { @@ -525,7 +552,6 @@ export class ViewletOverflowActivityActionItem extends ThemableActivityActionIte this.contextMenuService.showContextMenu({ getAnchor: () => this.builder.getHTMLElement(), getActions: () => TPromise.as(this.actions), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id), onHide: () => dispose(this.actions) }); } @@ -626,6 +652,40 @@ export class ToggleViewletPinnedAction extends Action { } } +export class GlobalActivityAction extends ActivityAction { + + constructor(activity: IGlobalActivity) { + super(activity); + } +} + +export class GlobalActivityActionItem extends ActivityActionItem { + + constructor( + action: GlobalActivityAction, + @IThemeService themeService: IThemeService, + @IContextMenuService protected contextMenuService: IContextMenuService + ) { + super(action, { draggable: false }, themeService); + } + + public onClick(e: MouseEvent): void { + const globalAction = this._action as GlobalActivityAction; + const activity = globalAction.activity as IGlobalActivity; + const actions = activity.getActions(); + + const event = new StandardMouseEvent(e); + event.stopPropagation(); + event.preventDefault(); + + this.contextMenuService.showContextMenu({ + getAnchor: () => ({ x: event.posx, y: event.posy }), + getActions: () => TPromise.as(actions), + onHide: () => dispose(actions) + }); + } +} + registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Styling with Outline color (e.g. high contrast theme) diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 3d8e0a7dd88..75f4d49aa70 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -15,9 +15,11 @@ import { Builder, $, Dimension } from 'vs/base/browser/builder'; import { Action } from 'vs/base/common/actions'; import { ActionsOrientation, ActionBar, IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { ViewletDescriptor } from 'vs/workbench/browser/viewlet'; +import { GlobalActivityExtensions, IGlobalActivityRegistry } from 'vs/workbench/browser/activity'; +import { Registry } from 'vs/platform/platform'; import { Part } from 'vs/workbench/browser/part'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { ToggleViewletPinnedAction, ViewletActivityAction, ActivityAction, ActivityActionItem, ViewletOverflowActivityAction, ViewletOverflowActivityActionItem } from 'vs/workbench/browser/parts/activitybar/activitybarActions'; +import { ToggleViewletPinnedAction, ViewletActivityAction, ActivityAction, GlobalActivityActionItem, ViewletActionItem, ViewletOverflowActivityAction, ViewletOverflowActivityActionItem, GlobalActivityAction, IViewletActivity } from 'vs/workbench/browser/parts/activitybar/activitybarActions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IActivityBarService, IBadge } from 'vs/workbench/services/activity/common/activityBarService'; import { IPartService, Position as SideBarPosition } from 'vs/workbench/services/part/common/partService'; @@ -27,18 +29,12 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { Scope as MementoScope } from 'vs/workbench/common/memento'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { ToggleActivityBarVisibilityAction } from 'vs/workbench/browser/actions/toggleActivityBarVisibility'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ACTIVITY_BAR_BACKGROUND } from 'vs/workbench/common/theme'; +import { ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BORDER } from 'vs/workbench/common/theme'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -interface IViewletActivity { - badge: IBadge; - clazz: string; -} - export class ActivitybarPart extends Part implements IActivityBarService { private static readonly ACTIVITY_ACTION_HEIGHT = 50; @@ -48,6 +44,9 @@ export class ActivitybarPart extends Part implements IActivityBarService { private dimension: Dimension; + private globalActionBar: ActionBar; + private globalActivityIdToActions: { [globalActivityId: string]: GlobalActivityAction; }; + private viewletSwitcherBar: ActionBar; private viewletOverflowAction: ViewletOverflowActivityAction; private viewletOverflowActionItem: ViewletOverflowActivityActionItem; @@ -72,6 +71,8 @@ export class ActivitybarPart extends Part implements IActivityBarService { ) { super(id, { hasTitle: false }, themeService); + this.globalActivityIdToActions = Object.create(null); + this.viewletIdToActionItems = Object.create(null); this.viewletIdToActions = Object.create(null); this.viewletIdToActivityStack = Object.create(null); @@ -81,23 +82,15 @@ export class ActivitybarPart extends Part implements IActivityBarService { const pinnedViewlets = this.memento[ActivitybarPart.PINNED_VIEWLETS] as string[]; if (pinnedViewlets) { - // TODO@Ben: Migrate git => scm viewlet - - const map = SCMPreview.enabled - ? (id => id === 'workbench.view.git' ? 'workbench.view.scm' : id) - : (id => id === 'workbench.view.scm' ? 'workbench.view.git' : id); - this.pinnedViewlets = pinnedViewlets - .map(map) + // TODO@Ben: Migrate git => scm viewlet + .map(id => id === 'workbench.view.git' ? 'workbench.view.scm' : id) .filter(arrays.uniqueFilter(str => str)); } else { this.pinnedViewlets = this.viewletService.getViewlets().map(v => v.id); } - // Update viewlet switcher when external viewlets become ready - this.extensionService.onReady().then(() => this.updateViewletSwitcher()); - this.registerListeners(); } @@ -132,6 +125,21 @@ export class ActivitybarPart extends Part implements IActivityBarService { } } + public showGlobalActivity(globalActivityId: string, badge: IBadge): IDisposable { + if (!badge) { + throw illegalArgument('badge'); + } + + const action = this.globalActivityIdToActions[globalActivityId]; + if (!action) { + throw illegalArgument('globalActivityId'); + } + + action.setBadge(badge); + + return toDisposable(() => action.setBadge(undefined)); + } + public showActivity(viewletId: string, badge: IBadge, clazz?: string): IDisposable { if (!badge) { throw illegalArgument('badge'); @@ -189,6 +197,9 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Top Actionbar with action items for each viewlet action this.createViewletSwitcher($result.clone()); + // Top Actionbar with action items for each viewlet action + this.createGlobalActivityActionBar($result.getHTMLElement()); + // Contextmenu for viewlets $(parent).on('contextmenu', (e: MouseEvent) => { DOM.EventHelper.stop(e, true); @@ -198,11 +209,11 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Allow to drop at the end to move viewlet to the end $(parent).on(DOM.EventType.DROP, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet) { DOM.EventHelper.stop(e, true); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); const targetId = this.pinnedViewlets[this.pinnedViewlets.length - 1]; if (targetId !== draggedViewlet.id) { @@ -222,15 +233,15 @@ export class ActivitybarPart extends Part implements IActivityBarService { const background = this.getColor(ACTIVITY_BAR_BACKGROUND); container.style('background-color', background); - const hcBorder = this.getColor(contrastBorder); + const borderColor = this.getColor(ACTIVITY_BAR_BORDER) || this.getColor(contrastBorder); const isPositionLeft = this.partService.getSideBarPosition() === SideBarPosition.LEFT; - container.style('box-sizing', hcBorder && isPositionLeft ? 'border-box' : null); - container.style('border-right-width', hcBorder && isPositionLeft ? '1px' : null); - container.style('border-right-style', hcBorder && isPositionLeft ? 'solid' : null); - container.style('border-right-color', isPositionLeft ? hcBorder : null); - container.style('border-left-width', hcBorder && !isPositionLeft ? '1px' : null); - container.style('border-left-style', hcBorder && !isPositionLeft ? 'solid' : null); - container.style('border-left-color', !isPositionLeft ? hcBorder : null); + container.style('box-sizing', borderColor && isPositionLeft ? 'border-box' : null); + container.style('border-right-width', borderColor && isPositionLeft ? '1px' : null); + container.style('border-right-style', borderColor && isPositionLeft ? 'solid' : null); + container.style('border-right-color', isPositionLeft ? borderColor : null); + container.style('border-left-width', borderColor && !isPositionLeft ? '1px' : null); + container.style('border-left-style', borderColor && !isPositionLeft ? 'solid' : null); + container.style('border-left-color', !isPositionLeft ? borderColor : null); } private showContextMenu(e: MouseEvent): void { @@ -256,6 +267,29 @@ export class ActivitybarPart extends Part implements IActivityBarService { }); this.updateViewletSwitcher(); + + // Update viewlet switcher when external viewlets become ready + this.extensionService.onReady().then(() => this.updateViewletSwitcher()); + } + + private createGlobalActivityActionBar(container: HTMLElement): void { + const activityRegistry = Registry.as(GlobalActivityExtensions); + const descriptors = activityRegistry.getActivities(); + const actions = descriptors + .map(d => this.instantiationService.createInstance(d)) + .map(a => new GlobalActivityAction(a)); + + this.globalActionBar = new ActionBar(container, { + actionItemProvider: a => this.instantiationService.createInstance(GlobalActivityActionItem, a), + orientation: ActionsOrientation.VERTICAL, + ariaLabel: nls.localize('globalActions', "Global Actions"), + animated: false + }); + + actions.forEach(a => { + this.globalActivityIdToActions[a.id] = a; + this.globalActionBar.push(a); + }); } private updateViewletSwitcher() { @@ -377,7 +411,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { private toAction(viewlet: ViewletDescriptor): ActivityAction { const action = this.instantiationService.createInstance(ViewletActivityAction, viewlet); - this.viewletIdToActionItems[action.id] = this.instantiationService.createInstance(ActivityActionItem, action, viewlet); + this.viewletIdToActionItems[action.id] = this.instantiationService.createInstance(ViewletActionItem, action); this.viewletIdToActions[viewlet.id] = action; return action; @@ -501,6 +535,11 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.viewletSwitcherBar = null; } + if (this.globalActionBar) { + this.globalActionBar.dispose(); + this.globalActionBar = null; + } + super.dispose(); } diff --git a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css index 7acd81393fb..50061325e7e 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css @@ -9,6 +9,9 @@ .monaco-workbench > .activitybar > .content { height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; } .monaco-workbench > .activitybar > .content .monaco-action-bar { diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index 6579242059a..dea7bce19b3 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -20,7 +20,7 @@ import errors = require('vs/base/common/errors'); import { CONTEXT as ToolBarContext, ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; import { IActionItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions'; import { Action, IAction } from 'vs/base/common/actions'; import { Part, IPartOptions } from 'vs/workbench/browser/part'; import { Composite, CompositeRegistry } from 'vs/workbench/browser/composite'; @@ -36,6 +36,7 @@ import { IProgressService } from 'vs/platform/progress/common/progress'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { attachProgressBarStyler } from 'vs/platform/theme/common/styler'; export interface ICompositeTitleLabel { @@ -487,6 +488,7 @@ export abstract class CompositePart extends Part { 'class': 'content' }, (div: Builder) => { this.progressBar = new ProgressBar(div); + this.toUnbind.push(attachProgressBarStyler(this.progressBar, this.themeService)); this.progressBar.getContainer().hide(); }); } diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index 1aff5f9a493..c113ae2837f 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -5,14 +5,12 @@ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Action, IAction } from 'vs/base/common/actions'; -import { ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; import types = require('vs/base/common/types'); import { Builder } from 'vs/base/browser/builder'; import { Registry } from 'vs/platform/platform'; import { Panel } from 'vs/workbench/browser/panel'; import { EditorInput, EditorOptions, IEditorDescriptor, IEditorInputFactory, IEditorRegistry, Extensions, IFileInputFactory } from 'vs/workbench/common/editor'; -import { IEditor, Position, POSITIONS } from 'vs/platform/editor/common/editor'; +import { IEditor, Position } from 'vs/platform/editor/common/editor'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; import { SyncDescriptor, AsyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -304,263 +302,4 @@ class EditorRegistry implements IEditorRegistry { } } -Registry.add(Extensions.Editors, new EditorRegistry()); - -/** - * The context that will be passed in to the EditorInputActionContributor. - */ -export interface IEditorInputActionContext { - editor: BaseEditor; - input: EditorInput; - position: Position; -} - -/** - * A variant of the action bar contributor to register actions to specific editor inputs of the editor. This allows to have more - * fine grained control over actions compared to contributing an action to a specific editor. - */ -export class EditorInputActionContributor extends ActionBarContributor { - - // The following data structures are partitioned into arrays of Position (one, two, three) - private mapEditorInputActionContextToPrimaryActions: { [id: string]: IEditorInputAction[] }[]; - private mapEditorInputActionContextToSecondaryActions: { [id: string]: IEditorInputAction[] }[]; - - constructor() { - super(); - - this.mapEditorInputActionContextToPrimaryActions = this.createPositionArray(); - this.mapEditorInputActionContextToSecondaryActions = this.createPositionArray(); - } - - private createPositionArray(): any[] { - const array: any[] = []; - - for (let i = 0; i < POSITIONS.length; i++) { - array[i] = {}; - } - - return array; - } - - /* Subclasses can override to provide a custom cache implementation */ - protected toId(context: IEditorInputActionContext): string { - return context.editor.getId() + context.input.getTypeId(); - } - - private clearInputsFromCache(position: Position, isPrimary: boolean): void { - if (isPrimary) { - this.doClearInputsFromCache(this.mapEditorInputActionContextToPrimaryActions[position]); - } else { - this.doClearInputsFromCache(this.mapEditorInputActionContextToSecondaryActions[position]); - } - } - - private doClearInputsFromCache(cache: { [id: string]: IEditorInputAction[] }): void { - for (let key in cache) { - if (cache.hasOwnProperty(key)) { - const cachedActions = cache[key]; - cachedActions.forEach((action) => { - action.input = null; - action.position = null; - }); - } - } - } - - /** - * Returns true if this contributor has actions for the given editor input. Subclasses must not - * override this method but instead hasActionsForEditorInput(); - */ - public hasActions(context: IEditorInputActionContext): boolean { - if (!this.checkEditorContext(context)) { - return false; - } - - // Ask Cache - if (this.mapEditorInputActionContextToPrimaryActions[context.position][this.toId(context)]) { - return true; - } - - // Ask Client - return this.hasActionsForEditorInput(context); - } - - /** - * Returns an array of actions for the given editor input. Subclasses must not override this - * method but instead getActionsForEditorInput(); - */ - public getActions(context: IEditorInputActionContext): IAction[] { - if (!this.checkEditorContext(context)) { - return []; - } - - // This will cause any cached action to be set with null for the current editor input to prevent - // leaking actions that still think the current editor input is what was set before. - this.clearInputsFromCache(context.position, true /* primary actions */); - - // First consult cache - const editorInput = context.input; - const editorPosition = context.position; - const cachedActions = this.mapEditorInputActionContextToPrimaryActions[context.position][this.toId(context)]; - if (cachedActions) { - - // Update the input field and position in all actions to indicate this change and return - cachedActions.forEach((action) => { - action.input = editorInput; - action.position = editorPosition; - }); - - return cachedActions; - } - - // Otherwise collect and keep in cache - const actions = this.getActionsForEditorInput(context); - actions.forEach((action) => { - action.input = editorInput; - action.position = editorPosition; - }); - - this.mapEditorInputActionContextToPrimaryActions[context.position][this.toId(context)] = actions; - - return actions; - } - - /** - * Returns true if this contributor has actions for the given editor input. Subclasses must not - * override this method but instead hasSecondaryActionsForEditorInput(); - */ - public hasSecondaryActions(context: IEditorInputActionContext): boolean { - if (!this.checkEditorContext(context)) { - return false; - } - - // Ask Cache - if (this.mapEditorInputActionContextToSecondaryActions[context.position][this.toId(context)]) { - return true; - } - - // Ask Client - return this.hasSecondaryActionsForEditorInput(context); - } - - /** - * Returns an array of actions for the given editor input. Subclasses must not override this - * method but instead getSecondaryActionsForEditorInput(); - */ - public getSecondaryActions(context: IEditorInputActionContext): IAction[] { - if (!this.checkEditorContext(context)) { - return []; - } - - // This will cause any cached action to be set with null for the current editor input to prevent - // leaking actions that still think the current editor input is what was set before. - this.clearInputsFromCache(context.position, false /* secondary actions */); - - // First consult cache - const editorInput = context.input; - const editorPosition = context.position; - const cachedActions = this.mapEditorInputActionContextToSecondaryActions[context.position][this.toId(context)]; - if (cachedActions) { - - // Update the input field and position in all actions to indicate this change and return - cachedActions.forEach((action) => { - action.input = editorInput; - action.position = editorPosition; - }); - - return cachedActions; - } - - // Otherwise collect and keep in cache - const actions = this.getSecondaryActionsForEditorInput(context); - actions.forEach((action) => { - action.input = editorInput; - action.position = editorPosition; - }); - - this.mapEditorInputActionContextToSecondaryActions[context.position][this.toId(context)] = actions; - - return actions; - } - - private checkEditorContext(context: IEditorInputActionContext): boolean { - return context && context.input instanceof EditorInput && context.editor instanceof BaseEditor && !types.isUndefinedOrNull(context.position); - } - - /** - * Returns true if this contributor has primary actions for the given editor input. - */ - public hasActionsForEditorInput(context: IEditorInputActionContext): boolean { - return false; - } - - /** - * Returns an array of primary actions for the given editor input. - */ - public getActionsForEditorInput(context: IEditorInputActionContext): IEditorInputAction[] { - return []; - } - - /** - * Returns true if this contributor has secondary actions for the given editor input. - */ - public hasSecondaryActionsForEditorInput(context: IEditorInputActionContext): boolean { - return false; - } - - /** - * Returns an array of secondary actions for the given editor input. - */ - public getSecondaryActionsForEditorInput(context: IEditorInputActionContext): IEditorInputAction[] { - return []; - } -} - -/** - * An editorinput action is contributed to an editor based on the editor input of the editor that is currently - * active. When the editor input changes, the action will be get the new editor input set so that the enablement - * state can be updated. In addition the position of the editor for the given input is applied. - */ -export interface IEditorInputAction extends IAction { - - /** - * The input of the editor for which this action is running. - */ - input: EditorInput; - - /** - * The position of the editor for which this action is running. - */ - position: Position; - - /** - * Implementors to define if the action is enabled or not. - */ - isEnabled(): boolean; -} - -export class EditorInputAction extends Action implements IEditorInputAction { - private _input: EditorInput; - private _position: Position; - - public get input(): EditorInput { - return this._input; - } - - public set input(input: EditorInput) { - this._input = input; - this.enabled = this.isEnabled(); - } - - public get position(): Position { - return this._position; - } - - public set position(position: Position) { - this._position = position; - } - - public isEnabled(): boolean { - return !!this._input; - } -} \ No newline at end of file +Registry.add(Extensions.Editors, new EditorRegistry()); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 51cbe1aef5d..7e8aa1bae2b 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -12,7 +12,6 @@ import { IEditorQuickOpenEntry, IQuickOpenRegistry, Extensions as QuickOpenExten import { StatusbarItemDescriptor, StatusbarAlignment, IStatusbarRegistry, Extensions as StatusExtensions } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory, SideBySideEditorInput } from 'vs/workbench/common/editor'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; @@ -24,7 +23,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; import { ChangeEncodingAction, ChangeEOLAction, ChangeModeAction, EditorStatus } from 'vs/workbench/browser/parts/editor/editorStatus'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; @@ -47,7 +46,6 @@ Registry.as(EditorExtensions.Editors).registerEditor( 'TextResourceEditor' ), [ - new SyncDescriptor(StringEditorInput), new SyncDescriptor(UntitledEditorInput), new SyncDescriptor(ResourceEditorInput) ] diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index 4419e710283..f7f5e2e9b83 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -60,8 +60,7 @@ export class SplitEditorAction extends Action { let options: EditorOptions; const codeEditor = getCodeEditor(editorToSplit); if (codeEditor) { - options = new TextEditorOptions(); - (options).fromEditor(codeEditor); + options = TextEditorOptions.fromEditor(codeEditor); } else { options = new EditorOptions(); } @@ -317,9 +316,7 @@ export abstract class BaseFocusSideGroupAction extends Action { let options: EditorOptions; const codeEditor = getCodeEditor(referenceEditor); if (codeEditor) { - options = new TextEditorOptions(); - options.pinned = true; - (options).fromEditor(codeEditor); + options = TextEditorOptions.fromEditor(codeEditor, { pinned: true }); } else { options = EditorOptions.create({ pinned: true }); } diff --git a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts index 7a54896285a..4bc4a3b143a 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts @@ -35,7 +35,8 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { editorBackground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { Themable, TABS_CONTAINER_BACKGROUND, EDITOR_GROUP_HEADER_BACKGROUND, EDITOR_GROUP_BORDER_COLOR, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_BACKGROUND } from 'vs/workbench/common/theme'; +import { Themable, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER } from 'vs/workbench/common/theme'; +import { attachProgressBarStyler } from 'vs/platform/theme/common/styler'; export enum Rochade { NONE, @@ -991,6 +992,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro // Progress Bar const progressBar = new ProgressBar($(container)); + this.toUnbind.push(attachProgressBarStyler(progressBar, this.themeService)); progressBar.getContainer().hide(); container.setProperty(EditorGroupsControl.PROGRESS_BAR_CONTROL_KEY, progressBar); // associate with container }); @@ -1009,19 +1011,19 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro silo.style('background-color', this.getColor(editorBackground)); // Border - silo.style('border-left-color', index > Position.ONE ? (this.getColor(contrastBorder) || this.getColor(EDITOR_GROUP_BORDER_COLOR)) : null); - silo.style('border-top-color', index > Position.ONE ? (this.getColor(contrastBorder) || this.getColor(EDITOR_GROUP_BORDER_COLOR)) : null); + silo.style('border-left-color', index > Position.ONE ? (this.getColor(EDITOR_GROUP_BORDER) || this.getColor(contrastBorder)) : null); + silo.style('border-top-color', index > Position.ONE ? (this.getColor(EDITOR_GROUP_BORDER) || this.getColor(contrastBorder)) : null); }); // Title control POSITIONS.forEach(position => { const container = this.getTitleAreaControl(position).getContainer(); - const hcBorder = this.getColor(contrastBorder); + const borderColor = this.getColor(EDITOR_GROUP_HEADER_TABS_BORDER) || this.getColor(contrastBorder); - container.style.backgroundColor = this.getColor(this.tabOptions.showTabs ? TABS_CONTAINER_BACKGROUND : EDITOR_GROUP_HEADER_BACKGROUND); - container.style.borderBottomWidth = (hcBorder && this.tabOptions.showTabs) ? '1px' : null; - container.style.borderBottomStyle = (hcBorder && this.tabOptions.showTabs) ? 'solid' : null; - container.style.borderBottomColor = this.tabOptions.showTabs ? hcBorder : null; + container.style.backgroundColor = this.getColor(this.tabOptions.showTabs ? EDITOR_GROUP_HEADER_TABS_BACKGROUND : EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND); + container.style.borderBottomWidth = (borderColor && this.tabOptions.showTabs) ? '1px' : null; + container.style.borderBottomStyle = (borderColor && this.tabOptions.showTabs) ? 'solid' : null; + container.style.borderBottomColor = this.tabOptions.showTabs ? borderColor : null; }); } @@ -1052,8 +1054,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro const activeEditor = $this.editorService.getActiveEditor(); const editor = getCodeEditor(activeEditor); if (editor && activeEditor.position === stacks.positionOfGroup(identifier.group) && identifier.editor.matches(activeEditor.input)) { - options = TextEditorOptions.create({ pinned: true }); - (options).fromEditor(editor); + options = TextEditorOptions.fromEditor(editor, { pinned: true }); } return options; @@ -1226,15 +1227,15 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro const containers = $this.visibleEditors.filter(e => !!e).map(e => e.getContainer()); containers.forEach((container, index) => { if (container && DOM.isAncestor(target, container.getHTMLElement())) { - const hcOutline = $this.getColor(activeContrastBorder); + const activeContrastBorderColor = $this.getColor(activeContrastBorder); overlay = $('div').style({ top: $this.tabOptions.showTabs ? `${EditorGroupsControl.EDITOR_TITLE_HEIGHT}px` : 0, height: $this.tabOptions.showTabs ? `calc(100% - ${EditorGroupsControl.EDITOR_TITLE_HEIGHT}px` : '100%', backgroundColor: $this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND), - outlineColor: hcOutline, - outlineOffset: hcOutline ? '-2px' : null, - outlineStyle: hcOutline ? 'dashed' : null, - outlineWidth: hcOutline ? '2px' : null + outlineColor: activeContrastBorderColor, + outlineOffset: activeContrastBorderColor ? '-2px' : null, + outlineStyle: activeContrastBorderColor ? 'dashed' : null, + outlineWidth: activeContrastBorderColor ? '2px' : null }).id(overlayId); overlay.appendTo(container); @@ -1282,8 +1283,14 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro // Drag enter let counter = 0; // see https://github.com/Microsoft/vscode/issues/14470 this.toUnbind.push(DOM.addDisposableListener(node, DOM.EventType.DRAG_ENTER, (e: DragEvent) => { - if (!TitleControl.getDraggedEditor() && !extractResources(e).length) { - return; // invalid DND + if (!TitleControl.getDraggedEditor()) { + // we used to check for the dragged resources here (via dnd.extractResources()) but this + // seems to be not possible on Linux and Windows where during DRAG_ENTER the resources + // are always undefined up until they are dropped when dragged from the tree. The workaround + // is to check for a datatransfer type being set. See https://github.com/Microsoft/vscode/issues/25789 + if (!e.dataTransfer.types.length) { + return; // invalid DND + } } counter++; @@ -1549,7 +1556,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro if (isDragging) { this.parent.addClass('dragging'); silo.addClass('dragging'); - borderColor = (this.getColor(contrastBorder) || this.getColor(EDITOR_GROUP_BORDER_COLOR)); + borderColor = this.getColor(EDITOR_GROUP_BORDER) || this.getColor(contrastBorder); } else { this.parent.removeClass('dragging'); silo.removeClass('dragging'); @@ -1569,11 +1576,11 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro const background = this.getColor(isDropping ? EDITOR_DRAG_AND_DROP_BACKGROUND : groupCount > 0 ? EDITOR_GROUP_BACKGROUND : null); element.style.backgroundColor = background; - const hcOutline = this.getColor(activeContrastBorder); - element.style.outlineColor = isDropping ? hcOutline : null; - element.style.outlineStyle = isDropping && hcOutline ? 'dashed' : null; - element.style.outlineWidth = isDropping && hcOutline ? '2px' : null; - element.style.outlineOffset = isDropping && hcOutline ? '-2px' : null; + const activeContrastBorderColor = this.getColor(activeContrastBorder); + element.style.outlineColor = isDropping ? activeContrastBorderColor : null; + element.style.outlineStyle = isDropping && activeContrastBorderColor ? 'dashed' : null; + element.style.outlineWidth = isDropping && activeContrastBorderColor ? '2px' : null; + element.style.outlineOffset = isDropping && activeContrastBorderColor ? '-2px' : null; } private posSilo(pos: number, leftTop: string | number, rightBottom?: string | number, borderLeftTopWidth?: string | number): void { diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 95bee547924..be76d1a4ff6 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -35,7 +35,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IMessageService, IMessageWithAction, Severity } from 'vs/platform/message/common/message'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IProgressService } from 'vs/platform/progress/common/progress'; -import { EditorStacksModel, EditorGroup, EditorIdentifier, GroupEvent } from 'vs/workbench/common/editor/editorStacksModel'; +import { EditorStacksModel, EditorGroup, EditorIdentifier, EditorCloseEvent } from 'vs/workbench/common/editor/editorStacksModel'; import Event, { Emitter } from 'vs/base/common/event'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -234,7 +234,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.telemetryService.publicLog('editorOpened', identifier.editor.getTelemetryDescriptor()); } - private onEditorClosed(event: GroupEvent): void { + private onEditorClosed(event: EditorCloseEvent): void { this.telemetryService.publicLog('editorClosed', event.editor.getTelemetryDescriptor()); } @@ -878,8 +878,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService const activeEditor = this.getActiveEditor(); const codeEditor = getCodeEditor(activeEditor); if (codeEditor && activeEditor.position === this.stacks.positionOfGroup(fromGroup) && input.matches(activeEditor.input)) { - options = TextEditorOptions.create({ pinned: true, index, inactive, preserveFocus }); - (options).fromEditor(codeEditor); + options = TextEditorOptions.fromEditor(codeEditor, { pinned: true, index, inactive, preserveFocus }); } // A move to another group is an open first... diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index 4fc02ffaf0c..d1a0d74383d 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -198,7 +198,13 @@ export abstract class EditorGroupPicker extends BaseEditorPicker { return super.getAutoFocus(searchValue); } - const isShiftNavigate = (quickNavigateConfiguration && quickNavigateConfiguration.keybindings.some(k => !k.isChord() && k.hasShiftModifier())); + const isShiftNavigate = (quickNavigateConfiguration && quickNavigateConfiguration.keybindings.some(k => { + const [firstPart, chordPart] = k.getParts(); + if (chordPart) { + return false; + } + return firstPart.shiftKey; + })); if (isShiftNavigate) { return { autoFocusLastEntry: true diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index b7fcf752dba..831f6897471 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -14,14 +14,14 @@ import paths = require('vs/base/common/paths'); import types = require('vs/base/common/types'); import uri from 'vs/base/common/uri'; import errors = require('vs/base/common/errors'); +import * as browser from 'vs/base/browser/browser'; import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { Action } from 'vs/base/common/actions'; -import { language, LANGUAGE_DEFAULT } from 'vs/base/common/platform'; +import { language, LANGUAGE_DEFAULT, AccessibilitySupport } from 'vs/base/common/platform'; import { IMode } from 'vs/editor/common/modes'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { IFileEditorInput, EncodingMode, IEncodingSupport, toResource, SideBySideEditorInput } from 'vs/workbench/common/editor'; import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IEditorAction, ICommonCodeEditor, EndOfLineSequence, IModel } from 'vs/editor/common/editorCommon'; @@ -79,6 +79,7 @@ class StateChange { encoding: boolean; EOL: boolean; tabFocusMode: boolean; + screenReaderMode: boolean; metadata: boolean; constructor() { @@ -88,6 +89,7 @@ class StateChange { this.encoding = false; this.EOL = false; this.tabFocusMode = false; + this.screenReaderMode = false; this.metadata = false; } @@ -98,6 +100,7 @@ class StateChange { this.encoding = this.encoding || other.encoding; this.EOL = this.EOL || other.EOL; this.tabFocusMode = this.tabFocusMode || other.tabFocusMode; + this.screenReaderMode = this.screenReaderMode || other.screenReaderMode; this.metadata = this.metadata || other.metadata; } } @@ -109,6 +112,7 @@ interface StateDelta { EOL?: string; indentation?: string; tabFocusMode?: boolean; + screenReaderMode?: boolean; metadata?: string; } @@ -131,6 +135,9 @@ class State { private _tabFocusMode: boolean; public get tabFocusMode(): boolean { return this._tabFocusMode; } + private _screenReaderMode: boolean; + public get screenReaderMode(): boolean { return this._screenReaderMode; } + private _metadata: string; public get metadata(): string { return this._metadata; } @@ -140,6 +147,7 @@ class State { this._encoding = null; this._EOL = null; this._tabFocusMode = false; + this._screenReaderMode = false; this._metadata = null; } @@ -189,6 +197,13 @@ class State { e.tabFocusMode = true; } } + if (typeof update.screenReaderMode !== 'undefined') { + if (this._screenReaderMode !== update.screenReaderMode) { + this._screenReaderMode = update.screenReaderMode; + somethingChanged = true; + e.screenReaderMode = true; + } + } if (typeof update.metadata !== 'undefined') { if (this._metadata !== update.metadata) { this._metadata = update.metadata; @@ -211,6 +226,7 @@ const nlsMultiSelection = nls.localize('multiSelection', "{0} selections"); const nlsEOLLF = nls.localize('endOfLineLineFeed', "LF"); const nlsEOLCRLF = nls.localize('endOfLineCarriageReturnLineFeed', "CRLF"); const nlsTabFocusMode = nls.localize('tabFocusModeEnabled', "Tab moves focus"); +const nlsScreenReaderDetected = nls.localize('screenReaderDetected', "Screen reader detected"); function _setDisplay(el: HTMLElement, desiredValue: string): void { if (el.style.display !== desiredValue) { @@ -229,6 +245,7 @@ export class EditorStatus implements IStatusbarItem { private state: State; private element: HTMLElement; private tabFocusModeElement: HTMLElement; + private screenRedearModeElement: HTMLElement; private indentationElement: HTMLElement; private selectionElement: HTMLElement; private encodingElement: HTMLElement; @@ -263,6 +280,10 @@ export class EditorStatus implements IStatusbarItem { this.tabFocusModeElement.textContent = nlsTabFocusMode; hide(this.tabFocusModeElement); + this.screenRedearModeElement = append(this.element, $('a.editor-status-screenreadermode.status-bar-info')); + this.screenRedearModeElement.textContent = nlsScreenReaderDetected; + hide(this.screenRedearModeElement); + this.selectionElement = append(this.element, $('a.editor-status-selection')); this.selectionElement.title = nls.localize('gotoLine', "Go to Line"); this.selectionElement.onclick = () => this.onSelectionClick(); @@ -307,8 +328,10 @@ export class EditorStatus implements IStatusbarItem { this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged()), this.untitledEditorService.onDidChangeEncoding(r => this.onResourceEncodingChange(r)), this.textFileService.models.onModelEncodingChanged(e => this.onResourceEncodingChange(e.resource)), - TabFocus.onDidChangeTabFocus(e => this.onTabFocusModeChange()) + TabFocus.onDidChangeTabFocus(e => this.onTabFocusModeChange()), + browser.onDidChangeAccessibilitySupport(() => this.onScreenReaderModeChange()) ); + this.onScreenReaderModeChange(); return combinedDisposable(this.toDispose); } @@ -342,6 +365,14 @@ export class EditorStatus implements IStatusbarItem { } } + if (changed.screenReaderMode) { + if (this.state.screenReaderMode && this.state.screenReaderMode === true) { + show(this.screenRedearModeElement); + } else { + hide(this.screenRedearModeElement); + } + } + if (changed.indentation) { if (this.state.indentation) { this.indentationElement.textContent = this.state.indentation; @@ -352,7 +383,7 @@ export class EditorStatus implements IStatusbarItem { } if (changed.selectionStatus) { - if (this.state.selectionStatus) { + if (this.state.selectionStatus && !this.state.screenReaderMode) { this.selectionElement.textContent = this.state.selectionStatus; show(this.selectionElement); } else { @@ -654,6 +685,12 @@ export class EditorStatus implements IStatusbarItem { this.updateState(info); } + private onScreenReaderModeChange(): void { + const info: StateDelta = { screenReaderMode: browser.getAccessibilitySupport() === AccessibilitySupport.Enabled }; + + this.updateState(info); + } + private isActiveEditor(e: IBaseEditor): boolean { const activeEditor = this.editorService.getActiveEditor(); @@ -706,7 +743,6 @@ export class ChangeModeAction extends Action { @IModelService private modelService: IModelService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, - @IMessageService private messageService: IMessageService, @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService, @IQuickOpenService private quickOpenService: IQuickOpenService, @IPreferencesService private preferencesService: IPreferencesService, @@ -886,7 +922,7 @@ export class ChangeModeAction extends Action { currentAssociations[associationKey] = language.id; // Write config - this.configurationEditingService.writeConfiguration(target, { key: ChangeModeAction.FILE_ASSOCIATION_KEY, value: currentAssociations }).done(null, (error) => this.messageService.show(Severity.Error, error.toString())); + this.configurationEditingService.writeConfiguration(target, { key: ChangeModeAction.FILE_ASSOCIATION_KEY, value: currentAssociations }); } }); }); diff --git a/src/vs/workbench/browser/parts/editor/media/editorstatus.css b/src/vs/workbench/browser/parts/editor/media/editorstatus.css index 8583a7b1502..5d33e7ae6fd 100644 --- a/src/vs/workbench/browser/parts/editor/media/editorstatus.css +++ b/src/vs/workbench/browser/parts/editor/media/editorstatus.css @@ -22,4 +22,7 @@ .monaco-workbench .editor-statusbar-item > .editor-status-tabfocusmode { padding: 0 5px 0 5px; +} +.monaco-workbench .editor-statusbar-item > .editor-status-screenreadermode { + padding: 0 5px 0 5px; } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts index fa83f95df08..6814ef611b8 100644 --- a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts @@ -12,7 +12,7 @@ import DOM = require('vs/base/browser/dom'); import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; import { EditorLabel } from 'vs/workbench/browser/labels'; import { Verbosity } from 'vs/platform/editor/common/editor'; -import { TAB_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; +import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; export class NoTabsTitleControl extends TitleControl { private titleContainer: HTMLElement; @@ -126,19 +126,11 @@ export class NoTabsTitleControl extends TitleControl { } this.editorLabel.setLabel({ name, description, resource }, { title, italic: !isPinned, extraClasses: ['title-label'] }); - this.editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND, (color, theme) => { - if (!isActive) { - if (theme.type === 'dark') { - return color.transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.7); - } - } - - return color; - }); + if (isActive) { + this.editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND); + } else { + this.editorLabel.element.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND); + } // Update Editor Actions Toolbar this.updateEditorActionsToolbar(); diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 91f679da711..759efa00c16 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -40,7 +40,7 @@ import { LinkedMap } from 'vs/base/common/map'; import { DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/editorService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme'; +import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; import { activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; interface IEditorInputLabel { @@ -212,23 +212,23 @@ export class TabsTitleControl extends TitleControl { private updateDropFeedback(element: HTMLElement, isDND: boolean, index?: number): void { const isTab = (typeof index === 'number'); - const isActiveTab = isTab && this.context.isActive(this.context.getEditor(index)); + const isActiveTab = isTab && this.context && this.context.isActive(this.context.getEditor(index)); // Background const noDNDBackgroundColor = isTab ? this.getColor(isActiveTab ? TAB_ACTIVE_BACKGROUND : TAB_INACTIVE_BACKGROUND) : null; element.style.backgroundColor = isDND ? this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) : noDNDBackgroundColor; // Outline - const hcOutline = this.getColor(activeContrastBorder); - if (hcOutline && isDND) { + const activeContrastBorderColor = this.getColor(activeContrastBorder); + if (activeContrastBorderColor && isDND) { element.style.outlineWidth = '2px'; element.style.outlineStyle = 'dashed'; - element.style.outlineColor = hcOutline; + element.style.outlineColor = activeContrastBorderColor; element.style.outlineOffset = isTab ? '-5px' : '-3px'; } else { element.style.outlineWidth = null; element.style.outlineStyle = null; - element.style.outlineColor = hcOutline; + element.style.outlineColor = activeContrastBorderColor; element.style.outlineOffset = null; } } @@ -272,8 +272,8 @@ export class TabsTitleControl extends TitleControl { // Container tabContainer.setAttribute('aria-label', `${name}, tab`); tabContainer.title = title; - tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(contrastBorder) || this.getColor(TAB_BORDER)) : null; - tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(contrastBorder) || this.getColor(TAB_BORDER)) : null; + tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;; + tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;; tabContainer.style.outlineColor = this.getColor(activeContrastBorder); const tabOptions = this.editorGroupService.getTabOptions(); @@ -291,38 +291,14 @@ export class TabsTitleControl extends TitleControl { DOM.addClass(tabContainer, 'active'); tabContainer.setAttribute('aria-selected', 'true'); tabContainer.style.backgroundColor = this.getColor(TAB_ACTIVE_BACKGROUND); - tabLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND, (color, theme) => { - if (!isGroupActive) { - if (theme.type === 'dark') { - return color.transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.7); - } - } - - return color; - }); + tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND); this.activeTab = tabContainer; } else { DOM.removeClass(tabContainer, 'active'); tabContainer.setAttribute('aria-selected', 'false'); tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND); - tabLabel.element.style.color = this.getColor(TAB_INACTIVE_FOREGROUND, (color, theme) => { - if (!isGroupActive) { - if (theme.type === 'dark') { - return color.transparent(0.5).transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.7).transparent(0.5); - } - } - - return color; - }); + tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND); } // Dirty State @@ -763,8 +739,8 @@ class TabActionRunner extends ActionRunner { registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Styling with Outline color (e.g. high contrast theme) - const outline = theme.getColor(activeContrastBorder); - if (outline) { + const activeContrastBorderColor = theme.getColor(activeContrastBorder); + if (activeContrastBorderColor) { collector.addRule(` .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.active, .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.active:hover { diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 3cc0c4b20a8..e22ac2936ab 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -17,7 +17,6 @@ import { IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { BaseTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor'; import { TextEditorOptions, TextDiffEditorOptions, EditorInput, EditorOptions, TEXT_DIFF_EDITOR_ID, IFileEditorInput } from 'vs/workbench/common/editor'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { DiffNavigator } from 'vs/editor/contrib/diffNavigator/common/diffNavigator'; @@ -31,7 +30,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; @@ -54,7 +53,7 @@ export class TextDiffEditor extends BaseTextEditor { @IStorageService storageService: IStorageService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService, + @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService @@ -249,7 +248,7 @@ export class TextDiffEditor extends BaseTextEditor { if (input instanceof DiffEditorInput) { const modifiedInput = input.modifiedInput; - return modifiedInput instanceof StringEditorInput || modifiedInput instanceof ResourceEditorInput; + return modifiedInput instanceof ResourceEditorInput; } return false; diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index d0f89123f6a..d9cb5e09200 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -21,7 +21,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Scope } from 'vs/workbench/common/memento'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -58,15 +58,14 @@ export abstract class BaseTextEditor extends BaseEditor { @IInstantiationService private _instantiationService: IInstantiationService, @IStorageService private storageService: IStorageService, @IConfigurationService private _configurationService: IConfigurationService, - @IWorkbenchThemeService protected themeService: IWorkbenchThemeService, + @IThemeService protected themeService: IThemeService, @IModeService private modeService: IModeService, @ITextFileService private textFileService: ITextFileService, - @IEditorGroupService private editorGroupService: IEditorGroupService + @IEditorGroupService protected editorGroupService: IEditorGroupService ) { super(id, telemetryService, themeService); this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.handleConfigurationChangeEvent(e.config))); - this.toUnbind.push(themeService.onDidColorThemeChange(e => this.handleConfigurationChangeEvent())); // TODO@theme this should be done from the editor itself and not from the outside } protected get instantiationService(): IInstantiationService { @@ -125,7 +124,6 @@ export abstract class BaseTextEditor extends BaseEditor { objects.assign(overrides, { overviewRulerLanes: 3, lineNumbersMinChars: 3, - theme: this.themeService.getColorTheme().id, fixedOverflowWidgets: true }); @@ -250,14 +248,14 @@ export abstract class BaseTextEditor extends BaseEditor { const editorViewState = this.getControl().saveViewState(); - let fileViewState: ITextEditorViewState = textEditorViewStateMemento[key]; - if (!fileViewState) { - fileViewState = Object.create(null); - textEditorViewStateMemento[key] = fileViewState; + let lastKnownViewState: ITextEditorViewState = textEditorViewStateMemento[key]; + if (!lastKnownViewState) { + lastKnownViewState = Object.create(null); + textEditorViewStateMemento[key] = lastKnownViewState; } if (typeof this.position === 'number') { - fileViewState[this.position] = editorViewState; + lastKnownViewState[this.position] = editorViewState; } } @@ -279,9 +277,9 @@ export abstract class BaseTextEditor extends BaseEditor { const memento = this.getMemento(this.storageService, Scope.WORKSPACE); const textEditorViewStateMemento = memento[TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY]; if (textEditorViewStateMemento) { - const fileViewState: ITextEditorViewState = textEditorViewStateMemento[key]; - if (fileViewState) { - return fileViewState[this.position]; + const viewState: ITextEditorViewState = textEditorViewStateMemento[key]; + if (viewState) { + return viewState[this.position]; } } diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index 96b76b50418..dda89f7447b 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -10,6 +10,7 @@ import types = require('vs/base/common/types'); import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { TextEditorOptions, EditorModel, EditorInput, EditorOptions } from 'vs/workbench/common/editor'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; @@ -18,7 +19,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -37,7 +38,7 @@ export class TextResourceEditor extends BaseTextEditor { @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService, + @IThemeService themeService: IThemeService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, @IModeService modeService: IModeService, @@ -118,7 +119,7 @@ export class TextResourceEditor extends BaseTextEditor { } protected restoreViewState(input: EditorInput) { - if (input instanceof UntitledEditorInput) { + if (input instanceof UntitledEditorInput || input instanceof ResourceEditorInput) { const viewState = this.loadTextEditorViewState(input.getResource().toString()); if (viewState) { this.getControl().restoreViewState(viewState); @@ -190,7 +191,7 @@ export class TextResourceEditor extends BaseTextEditor { return super.saveTextEditorViewState(arg1); } - if (arg1 instanceof UntitledEditorInput && !arg1.isDisposed()) { + if ((arg1 instanceof UntitledEditorInput || arg1 instanceof ResourceEditorInput) && !arg1.isDisposed()) { return super.saveTextEditorViewState(arg1.getResource().toString()); } } diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index 9777863076a..12c13c861ed 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -8,12 +8,12 @@ import 'vs/css!./media/titlecontrol'; import nls = require('vs/nls'); import { Registry } from 'vs/platform/platform'; -import { Scope, IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions'; import { IAction, Action } from 'vs/base/common/actions'; import errors = require('vs/base/common/errors'); import DOM = require('vs/base/browser/dom'); import { TPromise } from 'vs/base/common/winjs.base'; -import { BaseEditor, IEditorInputActionContext } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { RunOnceScheduler } from 'vs/base/common/async'; import { isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon'; import arrays = require('vs/base/common/arrays'); @@ -303,17 +303,12 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl // Editor Control Actions let editorActions = this.mapActionsToEditors[control.getId()]; if (!editorActions) { - editorActions = this.getEditorActionsForContext(control); + editorActions = { primary: control.getActions(), secondary: control.getSecondaryActions() }; this.mapActionsToEditors[control.getId()] = editorActions; } primary.push(...editorActions.primary); secondary.push(...editorActions.secondary); - // Editor Input Actions - const editorInputActions = this.getEditorActionsForContext({ input: control.input, editor: control, position: control.position }); - primary.push(...editorInputActions.primary); - secondary.push(...editorInputActions.secondary); - // MenuItems // TODO This isn't very proper but needed as we have failed to // use the correct context key service per editor only once. Don't @@ -331,29 +326,6 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl return { primary, secondary }; } - private getEditorActionsForContext(context: BaseEditor | IEditorInputActionContext): IToolbarActions { - const primaryActions: IAction[] = []; - const secondaryActions: IAction[] = []; - - // From Editor - if (context instanceof BaseEditor) { - primaryActions.push(...(context).getActions()); - secondaryActions.push(...(context).getSecondaryActions()); - } - - // From Contributions - else { - const actionBarRegistry = Registry.as(Extensions.Actionbar); - primaryActions.push(...actionBarRegistry.getActionBarActionsForContext(Scope.EDITOR, context)); - secondaryActions.push(...actionBarRegistry.getSecondaryActionBarActionsForContext(Scope.EDITOR, context)); - } - - return { - primary: primaryActions, - secondary: secondaryActions - }; - } - protected updateEditorActionsToolbar(): void { const group = this.context; if (!group) { diff --git a/src/vs/workbench/browser/parts/editor/webviewEditor.ts b/src/vs/workbench/browser/parts/editor/webviewEditor.ts new file mode 100644 index 00000000000..50f792c3e9d --- /dev/null +++ b/src/vs/workbench/browser/parts/editor/webviewEditor.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import URI from 'vs/base/common/uri'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { Scope } from 'vs/workbench/common/memento'; + +export interface HtmlPreviewEditorViewState { + scrollYPercentage: number; +} + +interface HtmlPreviewEditorViewStates { + 0?: HtmlPreviewEditorViewState; + 1?: HtmlPreviewEditorViewState; + 2?: HtmlPreviewEditorViewState; +} + +/** + * This class is only intended to be subclassed and not instantiated. + */ +export abstract class WebviewEditor extends BaseEditor { + constructor( + id: string, + telemetryService: ITelemetryService, + themeService: IThemeService, + private storageService: IStorageService + ) { + super(id, telemetryService, themeService); + } + + private get viewStateStorageKey(): string { + return this.getId() + '.editorViewState'; + } + + protected saveViewState(resource: URI | string, editorViewState: HtmlPreviewEditorViewState): void { + const memento = this.getMemento(this.storageService, Scope.WORKSPACE); + let editorViewStateMemento = memento[this.viewStateStorageKey]; + if (!editorViewStateMemento) { + editorViewStateMemento = Object.create(null); + memento[this.viewStateStorageKey] = editorViewStateMemento; + } + + let fileViewState: HtmlPreviewEditorViewStates = editorViewStateMemento[resource.toString()]; + if (!fileViewState) { + fileViewState = Object.create(null); + editorViewStateMemento[resource.toString()] = fileViewState; + } + + if (typeof this.position === 'number') { + fileViewState[this.position] = editorViewState; + } + } + + protected loadViewState(resource: URI | string): HtmlPreviewEditorViewState | null { + const memento = this.getMemento(this.storageService, Scope.WORKSPACE); + const editorViewStateMemento = memento[this.viewStateStorageKey]; + if (editorViewStateMemento) { + const fileViewState: HtmlPreviewEditorViewStates = editorViewStateMemento[resource.toString()]; + if (fileViewState) { + return fileViewState[this.position]; + } + } + return null; + } +} \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 3d7c435ff9c..8f535d23acf 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -10,7 +10,7 @@ import { IAction } from 'vs/base/common/actions'; import Event from 'vs/base/common/event'; import { Builder, $ } from 'vs/base/browser/builder'; import { Registry } from 'vs/platform/platform'; -import { Scope } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope } from 'vs/workbench/browser/actions'; import { IPanel } from 'vs/workbench/common/panel'; import { CompositePart, ICompositeTitleLabel } from 'vs/workbench/browser/parts/compositePart'; import { Panel, PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; @@ -25,8 +25,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ClosePanelAction, PanelAction, ToggleMaximizedPanelAction } from 'vs/workbench/browser/parts/panel/panelActions'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { PANEL_BACKGROUND, PANEL_BORDER_COLOR, PANEL_ACTIVE_TITLE_COLOR, PANEL_INACTIVE_TITLE_COLOR, PANEL_ACTIVE_TITLE_BORDER } from 'vs/workbench/common/theme'; -import { activeContrastBorder, focusBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { PANEL_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_INACTIVE_TITLE_FOREGROUND, PANEL_ACTIVE_TITLE_BORDER } from 'vs/workbench/common/theme'; +import { activeContrastBorder, focusBorder, contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry'; export class PanelPart extends CompositePart implements IPanelService { @@ -101,10 +101,10 @@ export class PanelPart extends CompositePart implements IPanelService { super.updateStyles(); const container = this.getContainer(); - container.style('background-color', this.getColor(PANEL_BACKGROUND)); + container.style('background-color', this.getColor(editorBackground)); const title = this.getTitleArea(); - title.style('border-top-color', this.getColor(contrastBorder) || this.getColor(PANEL_BORDER_COLOR)); + title.style('border-top-color', this.getColor(PANEL_BORDER) || this.getColor(contrastBorder)); } public openPanel(id: string, focus?: boolean): TPromise { @@ -195,7 +195,7 @@ export class PanelPart extends CompositePart implements IPanelService { registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Title Active - const titleActive = theme.getColor(PANEL_ACTIVE_TITLE_COLOR); + const titleActive = theme.getColor(PANEL_ACTIVE_TITLE_FOREGROUND); const titleActiveBorder = theme.getColor(PANEL_ACTIVE_TITLE_BORDER); collector.addRule(` .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item:hover .action-label, @@ -206,7 +206,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { `); // Title Inactive - const titleInactive = theme.getColor(PANEL_INACTIVE_TITLE_COLOR); + const titleInactive = theme.getColor(PANEL_INACTIVE_TITLE_FOREGROUND); collector.addRule(` .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label { color: ${titleInactive}; diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index edfd121cec2..32ef0a9c37a 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -22,7 +22,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenWidget, HideReason } from 'vs/base/parts/quickopen/browser/quickOpenWidget'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import labels = require('vs/base/common/labels'); import paths = require('vs/base/common/paths'); import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; @@ -49,7 +49,7 @@ import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/cont import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; +import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme'; import { attachQuickOpenStyler } from 'vs/platform/theme/common/styler'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -291,7 +291,7 @@ export class QuickOpenController extends Component implements IQuickOpenService }, this.telemetryService ); - this.toUnbind.push(attachQuickOpenStyler(this.pickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND })); + this.toUnbind.push(attachQuickOpenStyler(this.pickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND, foreground: SIDE_BAR_FOREGROUND })); const pickOpenContainer = this.pickOpenWidget.create(); this.toUnbind.push(this.listService.register(this.pickOpenWidget.getTree())); @@ -553,7 +553,7 @@ export class QuickOpenController extends Component implements IQuickOpenService }, this.telemetryService ); - this.toUnbind.push(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND })); + this.toUnbind.push(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND, foreground: SIDE_BAR_FOREGROUND })); const quickOpenContainer = this.quickOpenWidget.create(); this.toUnbind.push(this.listService.register(this.quickOpenWidget.getTree())); @@ -774,7 +774,8 @@ export class QuickOpenController extends Component implements IQuickOpenService } // Get results - return resolvedHandler.getResults(value).then(result => { + let addedGroupLabel = false; + const handleResult = (result: IModel, last = false) => { if (this.currentResultToken === currentResultToken) { // now is the time to show the input if we did not have set it before @@ -785,9 +786,10 @@ export class QuickOpenController extends Component implements IQuickOpenService // merge history and default handler results const handlerResults = (result && result.entries) || []; - this.mergeResults(quickOpenModel, handlerResults, resolvedHandler.getGroupLabel()); + addedGroupLabel = this.mergeResults(quickOpenModel, handlerResults, !addedGroupLabel ? resolvedHandler.getGroupLabel() : null, last) || addedGroupLabel; } - }); + }; + return resolvedHandler.getResults(value).then(result => handleResult(result, true), undefined, handleResult); }); } @@ -844,7 +846,7 @@ export class QuickOpenController extends Component implements IQuickOpenService return results.sort((elementA: EditorHistoryEntry, elementB: EditorHistoryEntry) => QuickOpenEntry.compare(elementA, elementB, normalizedSearchValue)); } - private mergeResults(quickOpenModel: QuickOpenModel, handlerResults: QuickOpenEntry[], groupLabel: string): void { + private mergeResults(quickOpenModel: QuickOpenModel, handlerResults: QuickOpenEntry[], groupLabel: string, last: boolean): boolean { // Remove results already showing by checking for a "resource" property const mapEntryToResource = this.mapEntriesToResource(quickOpenModel); @@ -860,17 +862,22 @@ export class QuickOpenController extends Component implements IQuickOpenService // Show additional handler results below any existing results if (additionalHandlerResults.length > 0) { - const useTopBorder = quickOpenModel.getEntries().length > 0; - additionalHandlerResults[0] = new QuickOpenEntryGroup(additionalHandlerResults[0], groupLabel, useTopBorder); + const autoFocusFirstEntry = (quickOpenModel.getEntries().length === 0); // the user might have selected another entry meanwhile in local history (see https://github.com/Microsoft/vscode/issues/20828) + if (groupLabel) { + const useTopBorder = quickOpenModel.getEntries().length > 0; + additionalHandlerResults[0] = new QuickOpenEntryGroup(additionalHandlerResults[0], groupLabel, useTopBorder); + } quickOpenModel.addEntries(additionalHandlerResults); - this.quickOpenWidget.refresh(quickOpenModel, { autoFocusFirstEntry: true }); + this.quickOpenWidget.refresh(quickOpenModel, { autoFocusFirstEntry }); + return !!groupLabel; } // Otherwise if no results are present (even from histoy) indicate this to the user - else if (quickOpenModel.getEntries().length === 0) { + else if (quickOpenModel.getEntries().length === 0 && last) { quickOpenModel.addEntries([new PlaceholderQuickOpenEntry(nls.localize('noResultsFound1', "No results found"))]); this.quickOpenWidget.refresh(quickOpenModel, { autoFocusFirstEntry: true }); } + return false; } private handleSpecificHandler(handlerDescriptor: QuickOpenHandlerDescriptor, value: string, currentResultToken: string): TPromise { diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index bf46d02791d..36f23b53283 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -15,7 +15,7 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPartService, Parts, Position as SideBarPosition } from 'vs/workbench/services/part/common/partService'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { Scope } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope } from 'vs/workbench/browser/actions'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IMessageService } from 'vs/platform/message/common/message'; @@ -26,7 +26,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import Event from 'vs/base/common/event'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; +import { SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_BORDER } from 'vs/workbench/common/theme'; export class SidebarPart extends CompositePart { @@ -63,7 +63,7 @@ export class SidebarPart extends CompositePart { Scope.VIEWLET, SIDE_BAR_TITLE_FOREGROUND, id, - { hasTitle: true } + { hasTitle: true, borderWidth: () => (this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder)) ? 1 : 0 } ); } @@ -82,15 +82,16 @@ export class SidebarPart extends CompositePart { const container = this.getContainer(); container.style('background-color', this.getColor(SIDE_BAR_BACKGROUND)); + container.style('color', this.getColor(SIDE_BAR_FOREGROUND)); - const hcBorder = this.getColor(contrastBorder); + const borderColor = this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder); const isPositionLeft = this.partService.getSideBarPosition() === SideBarPosition.LEFT; - container.style('border-right-width', hcBorder && isPositionLeft ? '1px' : null); - container.style('border-right-style', hcBorder && isPositionLeft ? 'solid' : null); - container.style('border-right-color', isPositionLeft ? hcBorder : null); - container.style('border-left-width', hcBorder && !isPositionLeft ? '1px' : null); - container.style('border-left-style', hcBorder && !isPositionLeft ? 'solid' : null); - container.style('border-left-color', !isPositionLeft ? hcBorder : null); + container.style('border-right-width', borderColor && isPositionLeft ? '1px' : null); + container.style('border-right-style', borderColor && isPositionLeft ? 'solid' : null); + container.style('border-right-color', isPositionLeft ? borderColor : null); + container.style('border-left-width', borderColor && !isPositionLeft ? '1px' : null); + container.style('border-left-style', borderColor && !isPositionLeft ? 'solid' : null); + container.style('border-left-color', !isPositionLeft ? borderColor : null); } public openViewlet(id: string, focus?: boolean): TPromise { diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 4fa06dbfe4f..b7909865487 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -27,9 +27,11 @@ import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { Action } from 'vs/base/common/actions'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND } from 'vs/workbench/common/theme'; +import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { isThemeColor } from 'vs/editor/common/editorCommon'; +import { Color } from 'vs/base/common/color'; export class StatusbarPart extends Part implements IStatusbarService { @@ -136,13 +138,13 @@ export class StatusbarPart extends Part implements IStatusbarService { const container = this.getContainer(); - container.style('color', this.getColor(STATUS_BAR_FOREGROUND)); + container.style('color', this.getColor(this.contextService.hasWorkspace() ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND)); container.style('background-color', this.getColor(this.contextService.hasWorkspace() ? STATUS_BAR_BACKGROUND : STATUS_BAR_NO_FOLDER_BACKGROUND)); - const hcBorder = this.getColor(contrastBorder); - container.style('border-top-width', hcBorder ? '1px' : null); - container.style('border-top-style', hcBorder ? 'solid' : null); - container.style('border-top-color', hcBorder); + const borderColor = this.getColor(STATUS_BAR_BORDER) || this.getColor(contrastBorder); + container.style('border-top-width', borderColor ? '1px' : null); + container.style('border-top-style', borderColor ? 'solid' : null); + container.style('border-top-color', borderColor); } private doCreateStatusItem(alignment: StatusbarAlignment, priority: number = 0): HTMLElement { @@ -217,7 +219,8 @@ class StatusBarEntryItem implements IStatusbarItem { @IMessageService private messageService: IMessageService, @ITelemetryService private telemetryService: ITelemetryService, @IContextMenuService private contextMenuService: IContextMenuService, - @IWorkbenchEditorService private editorService: IWorkbenchEditorService + @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + @IThemeService private themeService: IThemeService ) { this.entry = entry; @@ -249,8 +252,17 @@ class StatusBarEntryItem implements IStatusbarItem { } // Color - if (this.entry.color) { - $(textContainer).color(this.entry.color); + let color = this.entry.color; + if (color) { + if (isThemeColor(color)) { + let colorId = color.id; + color = (this.themeService.getTheme().getColor(colorId) || Color.transparent).toString(); + toDispose.push(this.themeService.onThemeChange(theme => { + let colorValue = (this.themeService.getTheme().getColor(colorId) || Color.transparent).toString(); + $(textContainer).color(colorValue); + })); + } + $(textContainer).color(color); } // Context Menu diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 8873d4ed56f..d7aa9318fd6 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -39,7 +39,7 @@ export class TitlebarPart extends Part implements ITitleService { private static NLS_UNSUPPORTED = nls.localize('patchedWindowTitle', "[Unsupported]"); private static NLS_EXTENSION_HOST = nls.localize('devExtensionWindowTitlePrefix', "[Extension Development Host]"); private static TITLE_DIRTY = '\u25cf '; - private static TITLE_SEPARATOR = ' - '; + private static TITLE_SEPARATOR = ' — '; private titleContainer: Builder; private title: Builder; @@ -234,18 +234,14 @@ export class TitlebarPart extends Part implements ITitleService { // Part container const container = this.getContainer(); - container.style('color', this.getColor(this.isInactive ? TITLE_BAR_INACTIVE_FOREGROUND : TITLE_BAR_ACTIVE_FOREGROUND)); - container.style('background-color', this.getColor(this.isInactive ? TITLE_BAR_INACTIVE_BACKGROUND : TITLE_BAR_ACTIVE_BACKGROUND)); + if (container) { + container.style('color', this.getColor(this.isInactive ? TITLE_BAR_INACTIVE_FOREGROUND : TITLE_BAR_ACTIVE_FOREGROUND)); + container.style('background-color', this.getColor(this.isInactive ? TITLE_BAR_INACTIVE_BACKGROUND : TITLE_BAR_ACTIVE_BACKGROUND)); + } } private onTitleDoubleclick(): void { - this.windowService.isMaximized().then(maximized => { - if (maximized) { - this.windowService.unmaximizeWindow().done(null, errors.onUnexpectedError); - } else { - this.windowService.maximizeWindow().done(null, errors.onUnexpectedError); - } - }, errors.onUnexpectedError); + this.windowService.onWindowTitleDoubleClick().then(null, errors.onUnexpectedError); } private onContextMenu(e: MouseEvent): void { diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 1281c2e600b..551ffbd9808 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -5,7 +5,7 @@ 'use strict'; import nls = require('vs/nls'); -import { TPromise } from 'vs/base/common/winjs.base'; +import { PPromise, TPromise } from 'vs/base/common/winjs.base'; import * as objects from 'vs/base/common/objects'; import filters = require('vs/base/common/filters'); import arrays = require('vs/base/common/arrays'); @@ -34,7 +34,7 @@ export class QuickOpenHandler { * As such, returning the same model instance across multiple searches will yield best * results in terms of performance when many items are shown. */ - public getResults(searchValue: string): TPromise> { + public getResults(searchValue: string): PPromise, IModel> { return TPromise.as(null); } @@ -288,7 +288,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick */ export class EditorQuickOpenEntryGroup extends QuickOpenEntryGroup implements IEditorQuickOpenEntry { - public getInput(): IEditorInput { + public getInput(): IEditorInput | IResourceInput { return null; } diff --git a/src/vs/workbench/browser/viewlet.ts b/src/vs/workbench/browser/viewlet.ts index 1ad83a799ae..5f153eee59c 100644 --- a/src/vs/workbench/browser/viewlet.ts +++ b/src/vs/workbench/browser/viewlet.ts @@ -12,7 +12,7 @@ import { Dimension, Builder, $ } from 'vs/base/browser/builder'; import { IAction, IActionRunner, Action } from 'vs/base/common/actions'; import { IActionItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { ITree, IFocusEvent, ISelectionEvent } from 'vs/base/parts/tree/browser/tree'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; import { DelayedDragHandler } from 'vs/base/browser/dnd'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; @@ -24,6 +24,7 @@ import { Composite, CompositeDescriptor, CompositeRegistry } from 'vs/workbench/ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IMessageService } from 'vs/platform/message/common/message'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IThemable } from 'vs/platform/theme/common/styler'; export abstract class Viewlet extends Composite implements IViewlet { @@ -288,15 +289,20 @@ export class CollapseAction extends Action { } } -export interface IViewletView extends IView { +export interface IViewletView extends IView, IThemable { + id?: string; create(): TPromise; setVisible(visible: boolean): TPromise; getActions(): IAction[]; getSecondaryActions(): IAction[]; getActionItem(action: IAction): IActionItem; + showHeader(): boolean; + hideHeader(): boolean; shutdown(): void; focusBody(): void; isExpanded(): boolean; + expand(): void; + collapse(): void; } /** @@ -318,20 +324,26 @@ export abstract class AdaptiveCollapsibleViewletView extends FixedCollapsibleVie initialBodySize: number, collapsed: boolean, private viewName: string, - private keybindingService: IKeybindingService, + protected keybindingService: IKeybindingService, protected contextMenuService: IContextMenuService ) { super({ expandedBodySize: initialBodySize, - headerSize: 22, initialState: collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED, - ariaHeaderLabel: viewName + ariaHeaderLabel: viewName, + headerSize: 22, }); this.actionRunner = actionRunner; this.toDispose = []; } + protected changeState(state: CollapsibleState): void { + updateTreeVisibility(this.tree, state === CollapsibleState.EXPANDED); + + super.changeState(state); + } + public create(): TPromise { return TPromise.as(null); } @@ -346,7 +358,7 @@ export abstract class AdaptiveCollapsibleViewletView extends FixedCollapsibleVie getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id) }); this.toolBar.actionRunner = this.actionRunner; - this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); + this.updateActions(); // Expand on drag over this.dragHandler = new DelayedDragHandler(container, () => { @@ -356,10 +368,8 @@ export abstract class AdaptiveCollapsibleViewletView extends FixedCollapsibleVie }); } - protected changeState(state: CollapsibleState): void { - updateTreeVisibility(this.tree, state === CollapsibleState.EXPANDED); - - super.changeState(state); + protected updateActions(): void { + this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); } protected renderViewTree(container: HTMLElement): HTMLElement { @@ -442,10 +452,11 @@ export abstract class CollapsibleViewletView extends CollapsibleView implements protected messageService: IMessageService, protected keybindingService: IKeybindingService, protected contextMenuService: IContextMenuService, - headerSize?: number + headerSize?: number, + minimumSize?: number ) { super({ - minimumSize: 2 * 22, + minimumSize: minimumSize === void 0 ? 5 * 22 : minimumSize, initialState: collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED, ariaHeaderLabel: viewName, headerSize @@ -475,7 +486,7 @@ export abstract class CollapsibleViewletView extends CollapsibleView implements getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id) }); this.toolBar.actionRunner = this.actionRunner; - this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); + this.updateActions(); // Expand on drag over this.dragHandler = new DelayedDragHandler(container, () => { @@ -485,6 +496,10 @@ export abstract class CollapsibleViewletView extends CollapsibleView implements }); } + protected updateActions(): void { + this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); + } + protected renderViewTree(container: HTMLElement): HTMLElement { return renderViewTree(container); } diff --git a/src/vs/workbench/buildfile.js b/src/vs/workbench/buildfile.js index 4f4a7086040..b4102009d69 100644 --- a/src/vs/workbench/buildfile.js +++ b/src/vs/workbench/buildfile.js @@ -17,9 +17,6 @@ function createModuleDescription(name, exclude) { exports.collectModules = function (excludes) { var modules = [ - createModuleDescription('vs/workbench/parts/git/node/gitApp', []), - createModuleDescription('vs/workbench/parts/git/node/askpass', []), - createModuleDescription('vs/workbench/parts/output/common/outputLinkComputer', ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']), createModuleDescription('vs/workbench/parts/debug/node/telemetryApp', []), @@ -28,7 +25,9 @@ exports.collectModules = function (excludes) { createModuleDescription('vs/workbench/services/search/node/worker/searchWorkerApp', []), createModuleDescription('vs/workbench/services/files/node/watcher/unix/watcherApp', []), - createModuleDescription('vs/workbench/node/extensionHostProcess', []) + createModuleDescription('vs/workbench/node/extensionHostProcess', []), + + createModuleDescription('vs/workbench/parts/terminal/node/terminalProcess', []) ]; return modules; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index c89cfe4455b..3767ac95928 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -12,8 +12,6 @@ import URI from 'vs/base/common/uri'; import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IEditor, ICommonCodeEditor, IEditorViewState, IModel } from 'vs/editor/common/editorCommon'; import { IEditorInput, IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, Position, Verbosity } from 'vs/platform/editor/common/editor'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -645,7 +643,7 @@ export class TextEditorOptions extends EditorOptions { /** * Helper to create TextEditorOptions inline. */ - public static create(settings: ITextEditorOptions): TextEditorOptions { + public static create(settings: ITextEditorOptions = Object.create(null)): TextEditorOptions { const options = new TextEditorOptions(); options.preserveFocus = settings.preserveFocus; options.forceOpen = settings.forceOpen; @@ -685,24 +683,26 @@ export class TextEditorOptions extends EditorOptions { } /** - * Sets the view state to be used when the editor is opening. + * Create a TextEditorOptions inline to be used when the editor is opening. */ - public fromEditor(editor: IEditor): void { + public static fromEditor(editor: IEditor, settings?: IEditorOptions): TextEditorOptions { + const options = TextEditorOptions.create(settings); // View state - this.editorViewState = editor.saveViewState(); + options.editorViewState = editor.saveViewState(); // Selected editor options const codeEditor = editor; if (typeof codeEditor.getConfiguration === 'function') { const config = codeEditor.getConfiguration(); if (config && config.viewInfo && config.wrappingInfo) { - this.editorOptions = Object.create(null); - this.editorOptions.renderWhitespace = config.viewInfo.renderWhitespace; - this.editorOptions.renderControlCharacters = config.viewInfo.renderControlCharacters; - this.editorOptions.wordWrap = config.wrappingInfo.isViewportWrapping ? 'on' : 'off'; + options.editorOptions = Object.create(null); + options.editorOptions.renderWhitespace = config.viewInfo.renderWhitespace; + options.editorOptions.renderControlCharacters = config.viewInfo.renderControlCharacters; + options.editorOptions.wordWrap = config.wrappingInfo.isViewportWrapping ? 'on' : 'off'; } } + return options; } /** @@ -816,25 +816,6 @@ export class TextDiffEditorOptions extends TextEditorOptions { public autoRevealFirstChange: boolean; } -/** - * Helper to return all opened editors with resources not belonging to the currently opened workspace. - */ -export function getOutOfWorkspaceEditorResources(editorGroupService: IEditorGroupService, contextService: IWorkspaceContextService): URI[] { - const resources: URI[] = []; - - editorGroupService.getStacksModel().groups.forEach(group => { - const editors = group.getEditors(); - editors.forEach(editor => { - const fileResource = toResource(editor, { supportSideBySide: true, filter: 'file' }); - if (fileResource && !contextService.isInsideWorkspace(fileResource)) { - resources.push(fileResource); - } - }); - }); - - return resources; -} - export interface IStacksModelChangeEvent { group: IEditorGroup; editor?: IEditorInput; @@ -844,7 +825,9 @@ export interface IStacksModelChangeEvent { export interface IEditorStacksModel { onModelChanged: Event; - onEditorClosed: Event; + + onWillCloseEditor: Event; + onEditorClosed: Event; groups: IEditorGroup[]; activeGroup: IEditorGroup; @@ -893,8 +876,7 @@ export interface IEditorContext extends IEditorIdentifier { event?: any; } -export interface IGroupEvent { - editor: IEditorInput; +export interface IEditorCloseEvent extends IEditorIdentifier { pinned: boolean; index: number; } diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index 00e7d3722c2..c61412c99f8 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -6,7 +6,7 @@ 'use strict'; import Event, { Emitter, once } from 'vs/base/common/event'; -import { IEditorRegistry, Extensions, EditorInput, toResource, IEditorStacksModel, IEditorGroup, IEditorIdentifier, IGroupEvent, GroupIdentifier, IStacksModelChangeEvent, IWorkbenchEditorConfiguration, EditorOpenPositioning, SideBySideEditorInput } from 'vs/workbench/common/editor'; +import { IEditorRegistry, Extensions, EditorInput, toResource, IEditorStacksModel, IEditorGroup, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, IStacksModelChangeEvent, IWorkbenchEditorConfiguration, EditorOpenPositioning, SideBySideEditorInput } from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -17,7 +17,7 @@ import { Registry } from 'vs/platform/platform'; import { Position, Direction } from 'vs/platform/editor/common/editor'; import { ResourceMap } from 'vs/base/common/map'; -export interface GroupEvent extends IGroupEvent { +export interface EditorCloseEvent extends IEditorCloseEvent { editor: EditorInput; } @@ -63,7 +63,7 @@ export class EditorGroup implements IEditorGroup { private _onEditorActivated: Emitter; private _onEditorOpened: Emitter; - private _onEditorClosed: Emitter; + private _onEditorClosed: Emitter; private _onEditorDisposed: Emitter; private _onEditorDirty: Emitter; private _onEditorLabelChange: Emitter; @@ -88,7 +88,7 @@ export class EditorGroup implements IEditorGroup { this._onEditorActivated = new Emitter(); this._onEditorOpened = new Emitter(); - this._onEditorClosed = new Emitter(); + this._onEditorClosed = new Emitter(); this._onEditorDisposed = new Emitter(); this._onEditorDirty = new Emitter(); this._onEditorLabelChange = new Emitter(); @@ -143,7 +143,7 @@ export class EditorGroup implements IEditorGroup { return this._onEditorOpened.event; } - public get onEditorClosed(): Event { + public get onEditorClosed(): Event { return this._onEditorClosed.event; } @@ -376,7 +376,7 @@ export class EditorGroup implements IEditorGroup { this.splice(index, true); // Event - this.fireEvent(this._onEditorClosed, { editor, pinned, index }, true); + this.fireEvent(this._onEditorClosed, { editor, pinned, index, group: this }, true); } public closeEditors(except: EditorInput, direction?: Direction): void { @@ -507,7 +507,7 @@ export class EditorGroup implements IEditorGroup { return !this.matches(this.preview, editor); } - private fireEvent(emitter: Emitter, arg2: EditorInput | GroupEvent, isStructuralChange: boolean): void { + private fireEvent(emitter: Emitter, arg2: EditorInput | EditorCloseEvent, isStructuralChange: boolean): void { emitter.fire(arg2); if (isStructuralChange) { @@ -699,11 +699,15 @@ export class EditorStacksModel implements IEditorStacksModel { private _onGroupActivated: Emitter; private _onGroupDeactivated: Emitter; private _onGroupRenamed: Emitter; + private _onEditorDisposed: Emitter; private _onEditorDirty: Emitter; private _onEditorLabelChange: Emitter; private _onEditorOpened: Emitter; - private _onEditorClosed: Emitter; + + private _onWillCloseEditor: Emitter; + private _onEditorClosed: Emitter; + private _onModelChanged: Emitter; constructor( @@ -728,9 +732,10 @@ export class EditorStacksModel implements IEditorStacksModel { this._onEditorDirty = new Emitter(); this._onEditorLabelChange = new Emitter(); this._onEditorOpened = new Emitter(); - this._onEditorClosed = new Emitter(); + this._onWillCloseEditor = new Emitter(); + this._onEditorClosed = new Emitter(); - this.toDispose.push(this._onGroupOpened, this._onGroupClosed, this._onGroupActivated, this._onGroupDeactivated, this._onGroupMoved, this._onGroupRenamed, this._onModelChanged, this._onEditorDisposed, this._onEditorDirty, this._onEditorLabelChange, this._onEditorClosed); + this.toDispose.push(this._onGroupOpened, this._onGroupClosed, this._onGroupActivated, this._onGroupDeactivated, this._onGroupMoved, this._onGroupRenamed, this._onModelChanged, this._onEditorDisposed, this._onEditorDirty, this._onEditorLabelChange, this._onEditorClosed, this._onWillCloseEditor); this.registerListeners(); } @@ -783,7 +788,11 @@ export class EditorStacksModel implements IEditorStacksModel { return this._onEditorOpened.event; } - public get onEditorClosed(): Event { + public get onWillCloseEditor(): Event { + return this._onWillCloseEditor.event; + } + + public get onEditorClosed(): Event { return this._onEditorClosed.event; } @@ -1155,6 +1164,7 @@ export class EditorStacksModel implements IEditorStacksModel { unbind.push(group.onEditorStateChanged(editor => this._onModelChanged.fire({ group, editor }))); unbind.push(group.onEditorOpened(editor => this._onEditorOpened.fire({ editor, group }))); unbind.push(group.onEditorClosed(event => { + this._onWillCloseEditor.fire(event); this.handleOnEditorClosed(event); this._onEditorClosed.fire(event); })); @@ -1170,7 +1180,7 @@ export class EditorStacksModel implements IEditorStacksModel { return group; } - private handleOnEditorClosed(event: GroupEvent): void { + private handleOnEditorClosed(event: EditorCloseEvent): void { const editor = event.editor; const editorsToClose = [editor]; diff --git a/src/vs/workbench/common/editor/rangeDecorations.ts b/src/vs/workbench/common/editor/rangeDecorations.ts index 322f0cb7c26..70a95b14274 100644 --- a/src/vs/workbench/common/editor/rangeDecorations.ts +++ b/src/vs/workbench/common/editor/rangeDecorations.ts @@ -12,6 +12,7 @@ import { toResource } from 'vs/workbench/common/editor'; import { isEqual } from 'vs/platform/files/common/files'; import { IRange } from 'vs/editor/common/core/range'; import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IRangeHighlightDecoration { resource: URI; @@ -91,12 +92,19 @@ export class RangeHighlightDecorations implements IDisposable { this.editorDisposables = []; } - private createRangeHighlightDecoration(isWholeLine: boolean = true): editorCommon.IModelDecorationOptions { - return { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'rangeHighlight', - isWholeLine - }; + private static _WHOLE_LINE_RANGE_HIGHLIGHT = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'rangeHighlight', + isWholeLine: true + }); + + private static _RANGE_HIGHLIGHT = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'rangeHighlight' + }); + + private createRangeHighlightDecoration(isWholeLine: boolean = true): ModelDecorationOptions { + return (isWholeLine ? RangeHighlightDecorations._WHOLE_LINE_RANGE_HIGHLIGHT : RangeHighlightDecorations._RANGE_HIGHLIGHT); } public dispose() { diff --git a/src/vs/workbench/common/editor/stringEditorInput.ts b/src/vs/workbench/common/editor/stringEditorInput.ts deleted file mode 100644 index bf5b0489b87..00000000000 --- a/src/vs/workbench/common/editor/stringEditorInput.ts +++ /dev/null @@ -1,131 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; -import { EditorModel, EditorInput } from 'vs/workbench/common/editor'; -import { StringEditorModel } from 'vs/workbench/common/editor/stringEditorModel'; -import URI from 'vs/base/common/uri'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - -/** - * A read-only text editor input whos contents are made of the provided value and mode ID. - */ -export class StringEditorInput extends EditorInput { - - public static ID = 'workbench.editors.stringEditorInput'; - - protected cachedModel: StringEditorModel; - - protected value: string; - - private name: string; - private description: string; - private modeId: string; - private singleton: boolean; - - constructor( - name: string, - description: string, - value: string, - modeId: string, - singleton: boolean, - @IInstantiationService private instantiationService: IInstantiationService - ) { - super(); - - this.name = name; - this.description = description; - this.value = value; - this.modeId = modeId || PLAINTEXT_MODE_ID; - this.singleton = singleton; - } - - protected getResource(): URI { - return null; // Subclasses can implement to associate a resource with the input - } - - public getTypeId(): string { - return StringEditorInput.ID; - } - - public getName(): string { - return this.name; - } - - public getDescription(): string { - return this.description; - } - - public getValue(): string { - return this.value; - } - - /** - * Sets the textual value of this input and will also update the underlying model if this input is resolved. - */ - public setValue(value: string): void { - this.value = value; - if (this.cachedModel) { - this.cachedModel.setValue(value); - } - } - - public resolve(refresh?: boolean): TPromise { - - // Use Cached Model - if (this.cachedModel) { - return TPromise.as(this.cachedModel); - } - - //Otherwise Create Model and Load - let model = this.instantiationService.createInstance(StringEditorModel, this.value, this.modeId, this.getResource()); - return model.load().then((resolvedModel: StringEditorModel) => { - this.cachedModel = resolvedModel; - - return this.cachedModel; - }); - } - - public matches(otherInput: any): boolean { - if (super.matches(otherInput) === true) { - return true; - } - - if (otherInput instanceof StringEditorInput) { - let otherStringEditorInput = otherInput; - - // If both inputs are singletons, check on the modeId for equalness - if (otherStringEditorInput.singleton && this.singleton && otherStringEditorInput.modeId === this.modeId) { - return true; - } - - // If we have resource URIs, use those to compare - const resource = this.getResource(); - const otherResource = otherStringEditorInput.getResource(); - if (resource && otherResource) { - return resource.toString() === otherResource.toString(); - } - - // Otherwise compare by properties - return otherStringEditorInput.value === this.value && - otherStringEditorInput.modeId === this.modeId && - otherStringEditorInput.description === this.description && - otherStringEditorInput.name === this.name; - } - - return false; - } - - public dispose(): void { - if (this.cachedModel) { - this.cachedModel.dispose(); - this.cachedModel = null; - } - - super.dispose(); - } -} \ No newline at end of file diff --git a/src/vs/workbench/common/editor/stringEditorModel.ts b/src/vs/workbench/common/editor/stringEditorModel.ts deleted file mode 100644 index bee71a6bb7b..00000000000 --- a/src/vs/workbench/common/editor/stringEditorModel.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; -import { EditorModel } from 'vs/workbench/common/editor'; -import URI from 'vs/base/common/uri'; -import { IModeService } from 'vs/editor/common/services/modeService'; -import { IModelService } from 'vs/editor/common/services/modelService'; - -/** - * An editor model whith an in-memory, readonly content that is not backed by any particular resource. - */ -export class StringEditorModel extends BaseTextEditorModel { - protected value: string; - protected modeId: string; - protected resource: URI; - - constructor( - value: string, - modeId: string, - resource: URI, - @IModeService modeService: IModeService, - @IModelService modelService: IModelService - ) { - super(modelService, modeService); - - this.value = value; - this.modeId = modeId; - this.resource = resource; - } - - /** - * The value of this string editor model. - */ - public getValue(): string { - return this.value; - } - - /** - * Sets the value of this string editor model. - */ - public setValue(value: string): void { - this.value = value; - if (this.textEditorModel) { - this.textEditorModel.setValue(value); - } - } - - public load(): TPromise { - - // Create text editor model if not yet done - if (!this.textEditorModel) { - return this.createTextEditorModel(this.value, this.resource, this.modeId); - } - - // Otherwise update - else { - this.updateTextEditorModel(this.value); - } - - return TPromise.as(this); - } -} \ No newline at end of file diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index 44c3a6c51e1..3b35554eb6e 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -4,19 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import nls = require('vs/nls'); -import { registerColor, editorBackground, contrastBorder, transparent } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, editorBackground, contrastBorder, transparent, badgeForeground, badgeBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable, Disposable, dispose } from 'vs/base/common/lifecycle'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; // < --- Tabs --- > -export const TABS_CONTAINER_BACKGROUND = registerColor('editorGroupHeader.tabsBackground', { - dark: '#252526', - light: '#F3F3F3', - hc: null -}, nls.localize('tabsContainerBackground', "Background color of the tabs container. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); - export const TAB_ACTIVE_BACKGROUND = registerColor('tab.activeBackground', { dark: editorBackground, light: editorBackground, @@ -39,13 +33,25 @@ export const TAB_ACTIVE_FOREGROUND = registerColor('tab.activeForeground', { dark: Color.white, light: '#333333', hc: Color.white -}, nls.localize('tabActiveEditorGroupActiveForeground', "Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); +}, nls.localize('tabActiveForeground', "Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); export const TAB_INACTIVE_FOREGROUND = registerColor('tab.inactiveForeground', { dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5), light: transparent(TAB_ACTIVE_FOREGROUND, 0.5), hc: Color.white -}, nls.localize('tabInactiveEditorGroupActiveForeground', "Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); +}, nls.localize('tabInactiveForeground', "Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); + +export const TAB_UNFOCUSED_ACTIVE_FOREGROUND = registerColor('tab.unfocusedActiveForeground', { + dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5), + light: transparent(TAB_ACTIVE_FOREGROUND, 0.7), + hc: Color.white +}, nls.localize('tabUnfocusedActiveForeground', "Active tab foreground color in an inactive group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); + +export const TAB_UNFOCUSED_INACTIVE_FOREGROUND = registerColor('tab.unfocusedInactiveForeground', { + dark: transparent(TAB_INACTIVE_FOREGROUND, 0.5), + light: transparent(TAB_INACTIVE_FOREGROUND, 0.5), + hc: Color.white +}, nls.localize('tabUnfocusedInactiveForeground', "Inactive tab foreground color in an inactive group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); // < --- Editors --- > @@ -56,13 +62,25 @@ export const EDITOR_GROUP_BACKGROUND = registerColor('editorGroup.background', { hc: null }, nls.localize('editorGroupBackground', "Background color of an editor group. Editor groups are the containers of editors. The background color shows up when dragging editor groups around.")); -export const EDITOR_GROUP_HEADER_BACKGROUND = registerColor('editorGroupHeader.noTabsBackground', { +export const EDITOR_GROUP_HEADER_TABS_BACKGROUND = registerColor('editorGroupHeader.tabsBackground', { + dark: '#252526', + light: '#F3F3F3', + hc: null +}, nls.localize('tabsContainerBackground', "Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.")); + +export const EDITOR_GROUP_HEADER_TABS_BORDER = registerColor('editorGroupHeader.tabsBorder', { + dark: null, + light: null, + hc: contrastBorder +}, nls.localize('tabsContainerBorder', "Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.")); + +export const EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND = registerColor('editorGroupHeader.noTabsBackground', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorGroupHeaderBackground', "Background color of the editor group title header when tabs are disabled. Editor groups are the containers of editors.")); -export const EDITOR_GROUP_BORDER_COLOR = registerColor('editorGroup.border', { +export const EDITOR_GROUP_BORDER = registerColor('editorGroup.border', { dark: '#444444', light: '#E7E7E7', hc: contrastBorder @@ -72,39 +90,33 @@ export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBa dark: Color.fromHex('#53595D').transparent(0.5), light: Color.fromHex('#3399FF').transparent(0.18), hc: null -}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around.")); +}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through.")); // < --- Panels --- > -export const PANEL_BACKGROUND = registerColor('panel.background', { - dark: editorBackground, - light: editorBackground, - hc: editorBackground -}, nls.localize('panelBackground', "Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal.")); - -export const PANEL_BORDER_COLOR = registerColor('panel.border', { +export const PANEL_BORDER = registerColor('panel.border', { dark: Color.fromHex('#808080').transparent(0.35), light: Color.fromHex('#808080').transparent(0.35), hc: contrastBorder }, nls.localize('panelBorder', "Panel border color on the top separating to the editor. Panels are shown below the editor area and contain views like output and integrated terminal.")); -export const PANEL_ACTIVE_TITLE_COLOR = registerColor('panelTitle.activeForeground', { +export const PANEL_ACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.activeForeground', { dark: '#E7E7E7', light: '#424242', hc: Color.white }, nls.localize('panelActiveTitleForeground', "Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal.")); -export const PANEL_INACTIVE_TITLE_COLOR = registerColor('panelTitle.inactiveForeground', { - dark: transparent(PANEL_ACTIVE_TITLE_COLOR, 0.5), - light: transparent(PANEL_ACTIVE_TITLE_COLOR, 0.75), +export const PANEL_INACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.inactiveForeground', { + dark: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.5), + light: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.75), hc: Color.white }, nls.localize('panelInactiveTitleForeground', "Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal.")); export const PANEL_ACTIVE_TITLE_BORDER = registerColor('panelTitle.activeBorder', { - dark: PANEL_BORDER_COLOR, - light: PANEL_BORDER_COLOR, + dark: PANEL_BORDER, + light: PANEL_BORDER, hc: contrastBorder }, nls.localize('panelActiveTitleBorder', "Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal.")); @@ -124,12 +136,24 @@ export const STATUS_BAR_BACKGROUND = registerColor('statusBar.background', { hc: null }, nls.localize('statusBarBackground', "Standard status bar background color. The status bar is shown in the bottom of the window.")); +export const STATUS_BAR_BORDER = registerColor('statusBar.border', { + dark: null, + light: null, + hc: contrastBorder +}, nls.localize('statusBarBorder', "Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window.")); + export const STATUS_BAR_NO_FOLDER_BACKGROUND = registerColor('statusBar.noFolderBackground', { dark: '#68217A', light: '#68217A', hc: null }, nls.localize('statusBarNoFolderBackground', "Status bar background color when no folder is opened. The status bar is shown in the bottom of the window.")); +export const STATUS_BAR_NO_FOLDER_FOREGROUND = registerColor('statusBar.noFolderForeground', { + dark: STATUS_BAR_FOREGROUND, + light: STATUS_BAR_FOREGROUND, + hc: STATUS_BAR_FOREGROUND +}, nls.localize('statusBarNoFolderForeground', "Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window.")); + export const STATUS_BAR_ITEM_ACTIVE_BACKGROUND = registerColor('statusBarItem.activeBackground', { dark: Color.white.transparent(0.18), light: Color.white.transparent(0.18), @@ -170,22 +194,28 @@ export const ACTIVITY_BAR_FOREGROUND = registerColor('activityBar.foreground', { hc: Color.white }, nls.localize('activityBarForeground', "Activity bar foreground color (e.g. used for the icons). The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); +export const ACTIVITY_BAR_BORDER = registerColor('activityBar.border', { + dark: null, + light: null, + hc: contrastBorder +}, nls.localize('activityBarBorder', "Activity bar border color separating to the side bar. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); + export const ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('activityBar.dropBackground', { dark: Color.white.transparent(0.12), light: Color.white.transparent(0.12), hc: Color.white.transparent(0.12), -}, nls.localize('activityBarDragAndDropBackground', "Drag and drop feedback color for the activity bar items. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); +}, nls.localize('activityBarDragAndDropBackground', "Drag and drop feedback color for the activity bar items. The color should have transparency so that the activity bar entries can still shine through. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); export const ACTIVITY_BAR_BADGE_BACKGROUND = registerColor('activityBarBadge.background', { - dark: '#007ACC', - light: '#007ACC', - hc: '#000000' + dark: badgeBackground, + light: badgeBackground, + hc: badgeBackground }, nls.localize('activityBarBadgeBackground', "Activity notification badge background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); export const ACTIVITY_BAR_BADGE_FOREGROUND = registerColor('activityBarBadge.foreground', { - dark: Color.white, - light: Color.white, - hc: Color.white + dark: badgeForeground, + light: badgeForeground, + hc: badgeForeground }, nls.localize('activityBarBadgeForeground', "Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); @@ -198,10 +228,22 @@ export const SIDE_BAR_BACKGROUND = registerColor('sideBar.background', { hc: '#000000' }, nls.localize('sideBarBackground', "Side bar background color. The side bar is the container for views like explorer and search.")); +export const SIDE_BAR_FOREGROUND = registerColor('sideBar.foreground', { + dark: null, + light: null, + hc: null +}, nls.localize('sideBarForeground', "Side bar foreground color. The side bar is the container for views like explorer and search.")); + +export const SIDE_BAR_BORDER = registerColor('sideBar.border', { + dark: null, + light: null, + hc: contrastBorder +}, nls.localize('sideBarBorder', "Side bar border color on the side separating to the editor. The side bar is the container for views like explorer and search.")); + export const SIDE_BAR_TITLE_FOREGROUND = registerColor('sideBarTitle.foreground', { - dark: '#BBBBBB', - light: '#6f6f6f', - hc: '#FFFFFF' + dark: SIDE_BAR_FOREGROUND, + light: SIDE_BAR_FOREGROUND, + hc: SIDE_BAR_FOREGROUND }, nls.localize('sideBarTitleForeground', "Side bar title foreground color. The side bar is the container for views like explorer and search.")); export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionHeader.background', { @@ -210,6 +252,12 @@ export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionH hc: null }, nls.localize('sideBarSectionHeaderBackground', "Side bar section header background color. The side bar is the container for views like explorer and search.")); +export const SIDE_BAR_SECTION_HEADER_FOREGROUND = registerColor('sideBarSectionHeader.foreground', { + dark: SIDE_BAR_FOREGROUND, + light: SIDE_BAR_FOREGROUND, + hc: SIDE_BAR_FOREGROUND +}, nls.localize('sideBarSectionHeaderForeground', "Side bar section header foreground color. The side bar is the container for views like explorer and search.")); + // < --- Title Bar --- > diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 1c9f9e8c1b2..98e0d84f20c 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -197,9 +197,7 @@ export class ToggleMenuBarAction extends Action { newVisibilityValue = 'default'; } - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleMenuBarAction.menuBarVisibilityKey, value: newVisibilityValue }).then(null, error => { - this.messageService.show(Severity.Error, error); - }); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleMenuBarAction.menuBarVisibilityKey, value: newVisibilityValue }); return TPromise.as(null); } @@ -242,10 +240,13 @@ export abstract class BaseZoomAction extends Action { const applyZoom = () => { webFrame.setZoomLevel(level); browser.setZoomFactor(webFrame.getZoomFactor()); - browser.setZoomLevel(level); // Ensure others can listen to zoom level changes + // See https://github.com/Microsoft/vscode/issues/26151 + // Cannot be trusted because the webFrame might take some time + // until it really applies the new zoom level + browser.setZoomLevel(webFrame.getZoomLevel(), /*isTrusted*/false); }; - this.configurationEditingService.writeConfiguration(target, { key: BaseZoomAction.SETTING_KEY, value: level }).done(() => applyZoom(), error => applyZoom()); + this.configurationEditingService.writeConfiguration(target, { key: BaseZoomAction.SETTING_KEY, value: level }, { donotNotifyError: true }).done(() => applyZoom(), error => applyZoom()); } } @@ -738,7 +739,7 @@ ${tableHeader}\n${table}; // 2000 chars is browsers de-facto limit for URLs, 400 chars are allowed for other string parts of the issue URL // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers if (encodeURIComponent(extensionTable).length > 1600) { - return 'the listing exceeds the lower minimum of browsers\' URL characters limit'; + return 'the listing length exceeds browsers\' URL characters limit'; } return extensionTable; diff --git a/src/vs/workbench/electron-browser/bootstrap/index.html b/src/vs/workbench/electron-browser/bootstrap/index.html index 018512e1164..1474a70e097 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.html +++ b/src/vs/workbench/electron-browser/bootstrap/index.html @@ -30,8 +30,9 @@ if (!backgroundColor) { backgroundColor = baseTheme === 'hc-black' ? '#000000' : (baseTheme === 'vs' ? '#FFFFFF' : '#1E1E1E'); } + let foregroundColor = baseTheme === 'hc-black' ? '#FFFFFF' : (baseTheme === 'vs' ? '#6C6C6C' : '#CCCCCC'); let style = document.createElement('style'); - style.innerHTML = '.monaco-shell { background-color:' + backgroundColor + '; }'; + style.innerHTML = '.monaco-shell { background-color:' + backgroundColor + '; color:' + foregroundColor + '; }'; document.head.appendChild(style); } catch (error) { diff --git a/src/vs/workbench/electron-browser/bootstrap/index.js b/src/vs/workbench/electron-browser/bootstrap/index.js index f320447cd9a..c01da62847a 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.js +++ b/src/vs/workbench/electron-browser/bootstrap/index.js @@ -14,6 +14,7 @@ if (window.location.search.indexOf('prof-startup') >= 0) { /*global window,document,define*/ +const startTimer = require('../../../base/node/startupTimers').startTimer; const path = require('path'); const electron = require('electron'); const remote = electron.remote; @@ -23,7 +24,7 @@ process.lazyEnv = new Promise(function (resolve) { const handle = setTimeout(function () { resolve(); console.warn('renderer did not receive lazyEnv in time') - }, 2000); + }, 10000); ipc.once('vscode:acceptShellEnv', function (event, shellEnv) { clearTimeout(handle); assign(process.env, shellEnv); @@ -148,7 +149,7 @@ function main() { // disable pinch zoom & apply zoom level early to avoid glitches const zoomLevel = configuration.zoomLevel; - webFrame.setZoomLevelLimits(1, 1); + webFrame.setVisualZoomLevelLimits(1, 1); if (typeof zoomLevel === 'number' && zoomLevel !== 0) { webFrame.setZoomLevel(zoomLevel); } @@ -158,18 +159,20 @@ function main() { // In the bundled version the nls plugin is packaged with the loader so the NLS Plugins // loads as soon as the loader loads. To be able to have pseudo translation + const loaderTimer = startTimer('load:loader') createScript(rootUrl + '/vs/loader.js', function () { define('fs', ['original-fs'], function (originalFS) { return originalFS; }); // replace the patched electron fs with the original node fs for all AMD code + loaderTimer.stop(); window.MonacoEnvironment = {}; - const nodeCachedDataErrors = window.MonacoEnvironment.nodeCachedDataErrors = []; + const onNodeCachedData = window.MonacoEnvironment.onNodeCachedData = []; require.config({ baseUrl: rootUrl, 'vs/nls': nlsConfig, recordStats: !!configuration.performance, nodeCachedDataDir: configuration.nodeCachedDataDir, - onNodeCachedDataError: function (err) { nodeCachedDataErrors.push(err) }, + onNodeCachedData: function () { onNodeCachedData.push(arguments) }, nodeModules: [/*BUILD->INSERT_NODE_MODULES*/] }); @@ -189,11 +192,13 @@ function main() { beforeLoadWorkbenchMain: Date.now() }; + const workbenchMainTimer = startTimer('load:workbench.main') require([ 'vs/workbench/electron-browser/workbench.main', 'vs/nls!vs/workbench/electron-browser/workbench.main', 'vs/css!vs/workbench/electron-browser/workbench.main' ], function () { + workbenchMainTimer.stop(); timers.afterLoadWorkbenchMain = Date.now(); process.lazyEnv.then(function () { diff --git a/src/vs/workbench/electron-browser/commands.ts b/src/vs/workbench/electron-browser/commands.ts index 09956f9c775..e724e95e880 100644 --- a/src/vs/workbench/electron-browser/commands.ts +++ b/src/vs/workbench/electron-browser/commands.ts @@ -207,55 +207,75 @@ export function registerCommands(): void { weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: ListFocusContext, primary: KeyCode.Home, - handler: (accessor) => { - const listService = accessor.get(IListService); - const focused = listService.getFocused(); - - // List - if (focused instanceof List) { - const list = focused; - - list.setFocus([0]); - list.reveal(0); - } - - // Tree - else if (focused) { - const tree = focused; - - tree.focusFirst({ origin: 'keyboard' }); - tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError); - } - } + handler: accessor => listFocusFirst(accessor) }); + KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: 'list.focusFirstChild', + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), + when: ListFocusContext, + primary: null, + handler: accessor => listFocusFirst(accessor, { fromFocused: true }) + }); + + function listFocusFirst(accessor: ServicesAccessor, options?: { fromFocused: boolean }): void { + const listService = accessor.get(IListService); + const focused = listService.getFocused(); + + // List + if (focused instanceof List) { + const list = focused; + + list.setFocus([0]); + list.reveal(0); + } + + // Tree + else if (focused) { + const tree = focused; + + tree.focusFirst({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : void 0); + tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError); + } + } + KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'list.focusLast', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: ListFocusContext, primary: KeyCode.End, - handler: (accessor) => { - const listService = accessor.get(IListService); - const focused = listService.getFocused(); - - // List - if (focused instanceof List) { - const list = focused; - - list.setFocus([list.length - 1]); - list.reveal(list.length - 1); - } - - // Tree - else if (focused) { - const tree = focused; - - tree.focusLast({ origin: 'keyboard' }); - tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError); - } - } + handler: accessor => listFocusLast(accessor) }); + KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: 'list.focusLastChild', + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), + when: ListFocusContext, + primary: null, + handler: accessor => listFocusLast(accessor, { fromFocused: true }) + }); + + function listFocusLast(accessor: ServicesAccessor, options?: { fromFocused: boolean }): void { + const listService = accessor.get(IListService); + const focused = listService.getFocused(); + + // List + if (focused instanceof List) { + const list = focused; + + list.setFocus([list.length - 1]); + list.reveal(list.length - 1); + } + + // Tree + else if (focused) { + const tree = focused; + + tree.focusLast({ origin: 'keyboard' }, options && options.fromFocused ? tree.getFocus() : void 0); + tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError); + } + } + KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'list.select', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), diff --git a/src/vs/workbench/electron-browser/crashReporter.ts b/src/vs/workbench/electron-browser/crashReporter.ts deleted file mode 100644 index 119229bc2d4..00000000000 --- a/src/vs/workbench/electron-browser/crashReporter.ts +++ /dev/null @@ -1,71 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 nls = require('vs/nls'); -import { onUnexpectedError } from 'vs/base/common/errors'; -import { assign, clone } from 'vs/base/common/objects'; -import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { Registry } from 'vs/platform/platform'; -import { crashReporter } from 'electron'; -import product from 'vs/platform/node/product'; -import pkg from 'vs/platform/node/package'; - -const TELEMETRY_SECTION_ID = 'telemetry'; - -interface ICrashReporterConfig { - enableCrashReporter: boolean; -} - -const configurationRegistry = Registry.as(Extensions.Configuration); -configurationRegistry.registerConfiguration({ - 'id': TELEMETRY_SECTION_ID, - 'order': 110, - title: nls.localize('telemetryConfigurationTitle', "Telemetry"), - 'type': 'object', - 'properties': { - 'telemetry.enableCrashReporter': { - 'type': 'boolean', - 'description': nls.localize('telemetry.enableCrashReporting', "Enable crash reports to be sent to Microsoft.\nThis option requires restart to take effect."), - 'default': true - } - } -}); - -export class CrashReporter { - - constructor( - configuration: Electron.CrashReporterStartOptions, - @ITelemetryService telemetryService: ITelemetryService, - @IWindowsService windowsService: IWindowsService, - @IConfigurationService configurationService: IConfigurationService - ) { - const config = configurationService.getConfiguration(TELEMETRY_SECTION_ID); - - if (!config.enableCrashReporter) { - return; - } - - telemetryService.getTelemetryInfo() - .then(info => ({ - vscode_sessionId: info.sessionId, - vscode_version: pkg.version, - vscode_commit: product.commit, - vscode_machineId: info.machineId - })) - .then(extra => assign(configuration, { extra })) - .then(configuration => { - // start crash reporter right here - crashReporter.start(clone(configuration)); - - // TODO: start crash reporter in the main process - return windowsService.startCrashReporter(configuration); - }) - .done(null, onUnexpectedError); - } -} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/extensionHost.ts b/src/vs/workbench/electron-browser/extensionHost.ts index e084eb83a99..2431281d98e 100644 --- a/src/vs/workbench/electron-browser/extensionHost.ts +++ b/src/vs/workbench/electron-browser/extensionHost.ts @@ -30,8 +30,9 @@ import { generateRandomPipeName, Protocol } from 'vs/base/parts/ipc/node/ipc.net import { createServer, Server } from 'net'; import Event, { Emitter } from 'vs/base/common/event'; import { IInitData } from 'vs/workbench/api/node/extHost.protocol'; -import { MainProcessExtensionService } from 'vs/workbench/api/node/mainThreadExtensionService'; +import { MainProcessExtensionService } from 'vs/workbench/api/electron-browser/mainThreadExtensionService'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; +import { ICrashReporterService } from 'vs/workbench/services/crashReporter/common/crashReporterService'; export const EXTENSION_LOG_BROADCAST_CHANNEL = 'vscode:extensionLog'; export const EXTENSION_ATTACH_BROADCAST_CHANNEL = 'vscode:extensionAttach'; @@ -92,7 +93,9 @@ export class ExtensionHostProcessWorker { @IInstantiationService private instantiationService: IInstantiationService, @IEnvironmentService private environmentService: IEnvironmentService, @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService, - @ITelemetryService private telemetryService: ITelemetryService + @ITelemetryService private telemetryService: ITelemetryService, + @ICrashReporterService private crashReporterService: ICrashReporterService + ) { // handle extension host lifecycle a bit special when we know we are developing an extension that runs inside this.isExtensionDevelopmentHost = environmentService.isExtensionDevelopment; @@ -111,7 +114,7 @@ export class ExtensionHostProcessWorker { const [server, hook] = <[Server, string]>data[0]; const port = data[1]; - let opts = { + const opts = { env: objects.mixin(objects.clone(process.env), { AMD_ENTRYPOINT: 'vs/workbench/node/extensionHostProcess', PIPE_LOGGING: 'true', @@ -130,6 +133,11 @@ export class ExtensionHostProcessWorker { : undefined }; + const crashReporterOptions = this.crashReporterService.getChildProcessStartOptions('extensionHost'); + if (crashReporterOptions) { + opts.env.CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterOptions); + } + // Run Extension Host as fork of current process this.extensionHostProcess = fork(URI.parse(require.toUrl('bootstrap')).fsPath, ['--type=extensionHost'], opts); diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index c62f3bbb4a3..53ab7b01760 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -14,7 +14,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform'; -import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction } from 'vs/workbench/electron-browser/actions'; +import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction } from 'vs/workbench/electron-browser/actions'; import { MessagesVisibleContext } from 'vs/workbench/electron-browser/workbench'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { registerCommands } from 'vs/workbench/electron-browser/commands'; @@ -75,6 +75,11 @@ workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(Naviga workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(IncreaseViewSizeAction, IncreaseViewSizeAction.ID, IncreaseViewSizeAction.LABEL, null), 'View: Increase View Size', viewCategory); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(DecreaseViewSizeAction, DecreaseViewSizeAction.ID, DecreaseViewSizeAction.LABEL, null), 'View: Decrease View Size', viewCategory); +// Developer related actions +const developerCategory = nls.localize('developer', "Developer"); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowStartupPerformance, ShowStartupPerformance.ID, ShowStartupPerformance.LABEL), 'Developer: Startup Performance', developerCategory); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSharedProcessAction, ToggleSharedProcessAction.ID, ToggleSharedProcessAction.LABEL), 'Developer: Toggle Shared Process', developerCategory); + // Configuration: Workbench const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); @@ -177,7 +182,7 @@ let properties: { [path: string]: IJSONSchema; } = { nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.openFilesInNewWindow.off' }, "Files will open in the window with the files' folder open or the last active window"), nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.openFilesInNewWindow.default' }, "Files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)") ], - 'default': 'default', + 'default': 'off', 'description': nls.localize('openFilesInNewWindow', `Controls if files should open in a new window. @@ -249,7 +254,7 @@ Note that there can still be cases where this setting is ignored (e.g. when usin nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.newWindowDimensions.fullscreen' }, "Open new windows in full screen mode.") ], 'default': 'default', - 'description': nls.localize('newWindowDimensions', "Controls the dimensions of opening a new window. By default, a new window will open in the center of the screen with small dimensions. When set to 'inherit', the window will get the same dimensions as the last active one. When set to 'maximized', the window will open maximized and fullscreen if configured to 'fullscreen'.") + 'description': nls.localize('newWindowDimensions', "Controls the dimensions of opening a new window when at least one window is already opened. By default, a new window will open in the center of the screen with small dimensions. When set to 'inherit', the window will get the same dimensions as the last window that was active. When set to 'maximized', the window will open maximized and fullscreen if configured to 'fullscreen'. Note that this setting does not have an impact on the first window that is opened. The first window will always restore the size and location as you left it before closing.") }, }; @@ -266,6 +271,11 @@ if (isWindows || isLinux) { 'default': 'default', 'description': nls.localize('menuBarVisibility', "Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. By default, the menu bar will be visible, unless the window is full screen.") }; + properties['window.enableMenuBarMnemonics'] = { + 'type': 'boolean', + 'default': true, + 'description': nls.localize('enableMenuBarMnemonics', "If enabled, the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead.") + }; } if (isWindows) { diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 77bc5addf9b..b20a6fd422a 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -38,10 +38,12 @@ gracefulFs.gracefulify(fs); // enable gracefulFs export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest { /** - * The physical keyboard is of ISO type (on OSX) + * The physical keyboard is of ISO type (on OSX). */ isISOKeyboard?: boolean; + accessibilitySupport?: boolean; + appRoot: string; execPath: string; @@ -57,11 +59,17 @@ export function startup(configuration: IWindowConfiguration): TPromise { // Ensure others can listen to zoom level changes browser.setZoomFactor(webFrame.getZoomFactor()); - browser.setZoomLevel(webFrame.getZoomLevel()); + + // See https://github.com/Microsoft/vscode/issues/26151 + // Can be trusted because we are not setting it ourselves. + browser.setZoomLevel(webFrame.getZoomLevel(), true /* isTrusted */); + browser.setFullscreen(!!configuration.fullscreen); KeyboardMapperFactory.INSTANCE._onKeyboardLayoutChanged(configuration.isISOKeyboard); + browser.setAccessibilitySupport(configuration.accessibilitySupport ? platform.AccessibilitySupport.Enabled : platform.AccessibilitySupport.Disabled); + // Setup Intl comparer.setFileNameComparer(new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })); diff --git a/src/vs/workbench/electron-browser/media/shell.css b/src/vs/workbench/electron-browser/media/shell.css index 2b5ece9a68d..5696fc87867 100644 --- a/src/vs/workbench/electron-browser/media/shell.css +++ b/src/vs/workbench/electron-browser/media/shell.css @@ -15,7 +15,7 @@ /* Font Families (with CJK support) */ -.monaco-shell { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; } +.monaco-shell { font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; } .monaco-shell:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } .monaco-shell:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif; } .monaco-shell:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif; } @@ -98,6 +98,10 @@ opacity: 1 !important; } +.monaco-shell .mac select:focus { + border: none; /* outline is a square, but border has a radius, so we avoid this glitch when focussed (https://github.com/Microsoft/vscode/issues/26045) */ +} + .monaco-shell.hc-black [tabindex="0"]:focus, .monaco-shell.hc-black .synthetic-focus, .monaco-shell.hc-black select:focus, diff --git a/src/vs/workbench/electron-browser/nodeCachedDataManager.ts b/src/vs/workbench/electron-browser/nodeCachedDataManager.ts index 19aa736e260..6867f109c80 100644 --- a/src/vs/workbench/electron-browser/nodeCachedDataManager.ts +++ b/src/vs/workbench/electron-browser/nodeCachedDataManager.ts @@ -7,11 +7,13 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { onUnexpectedError } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; -import { join } from 'path'; +import { join, basename } from 'path'; import { readdir, rimraf, stat } from 'vs/base/node/pfs'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +declare type OnNodeCachedDataArgs = [{ errorCode: string, path: string, detail?: string }, { path: string, length: number }]; +declare const MonacoEnvironment: { onNodeCachedData: OnNodeCachedDataArgs[] }; export class NodeCachedDataManager { @@ -26,7 +28,7 @@ export class NodeCachedDataManager { this._telemetryService = telemetryService; this._environmentService = environmentService; - this._handleCachedDataErrors(); + this._handleCachedDataInfo(); this._manageCachedDataSoon(); } @@ -34,22 +36,33 @@ export class NodeCachedDataManager { this._disposables = dispose(this._disposables); } - private _handleCachedDataErrors(): void { - const onNodeCachedDataError = (err) => { - this._telemetryService.publicLog('nodeCachedData', { errorCode: err.errorCode, path: err.path }); - }; + private _handleCachedDataInfo(): void { - // handle future and past errors - (self).require.config({ onNodeCachedDataError }); - ((window).MonacoEnvironment.nodeCachedDataErrors).forEach(onNodeCachedDataError); - delete (window).MonacoEnvironment.nodeCachedDataErrors; + let didRejectCachedData = false; + let didProduceCachedData = false; + for (const [err, data] of MonacoEnvironment.onNodeCachedData) { + // build summary + didRejectCachedData = didRejectCachedData || Boolean(err); + didProduceCachedData = didProduceCachedData || Boolean(data); - // stop when being disposed - this._disposables.push({ - dispose() { - (self).require.config({ onNodeCachedDataError: undefined }, true); + // log each failure separately + if (err) { + this._telemetryService.publicLog('cachedDataError', { + errorCode: err.errorCode, + path: basename(err.path) + }); } + } + + // log summary + this._telemetryService.publicLog('cachedDataInfo', { + didRequestCachedData: Boolean(global.require.getConfig().nodeCachedDataDir), + didRejectCachedData, + didProduceCachedData }); + + global.require.config({ onNodeCachedData: undefined }); + delete MonacoEnvironment.onNodeCachedData; } private _manageCachedDataSoon(): void { diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index e2e3976ebe7..66e974a00c7 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -16,7 +16,6 @@ import aria = require('vs/base/browser/ui/aria/aria'); import { dispose, IDisposable, Disposables } from 'vs/base/common/lifecycle'; import errors = require('vs/base/common/errors'); import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { stopProfiling } from 'vs/base/node/profiler'; import product from 'vs/platform/node/product'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import pkg from 'vs/platform/node/package'; @@ -53,7 +52,7 @@ import { IntegrityServiceImpl } from 'vs/platform/integrity/node/integrityServic import { IIntegrityService } from 'vs/platform/integrity/common/integrity'; import { EditorWorkerServiceImpl } from 'vs/editor/common/services/editorWorkerServiceImpl'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { MainProcessExtensionService } from 'vs/workbench/api/node/mainThreadExtensionService'; +import { MainProcessExtensionService } from 'vs/workbench/api/electron-browser/mainThreadExtensionService'; import { IOptions } from 'vs/workbench/common/options'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -74,7 +73,8 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { WorkbenchModeServiceImpl } from 'vs/workbench/services/mode/common/workbenchModeService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { CrashReporter } from 'vs/workbench/electron-browser/crashReporter'; +import { ICrashReporterService, NullCrashReporterService } from 'vs/workbench/services/crashReporter/common/crashReporterService'; +import { CrashReporterService } from 'vs/workbench/services/crashReporter/electron-browser/crashReporterService'; import { NodeCachedDataManager } from 'vs/workbench/electron-browser/nodeCachedDataManager'; import { getDelayedChannel } from 'vs/base/parts/ipc/common/ipc'; import { connect as connectNet } from 'vs/base/parts/ipc/node/ipc.net'; @@ -88,7 +88,6 @@ import { URLChannelClient } from 'vs/platform/url/common/urlIpc'; import { IURLService } from 'vs/platform/url/common/url'; import { IBackupService } from 'vs/platform/backup/common/backup'; import { BackupChannelClient } from 'vs/platform/backup/common/backupIpc'; -import { ReportPerformanceIssueAction } from 'vs/workbench/electron-browser/actions'; import { ExtensionHostProcessWorker } from 'vs/workbench/electron-browser/extensionHost'; import { ITimerService } from 'vs/workbench/services/timer/common/timerService'; import { remote, ipcRenderer as ipc } from 'electron'; @@ -97,14 +96,11 @@ import { MainProcessTextMateSyntax } from 'vs/editor/electron-browser/textMate/T import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { restoreFontInfo, readFontInfo, saveFontInfo } from 'vs/editor/browser/config/configuration'; import * as browser from 'vs/base/browser/browser'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; -import { readdir } from 'vs/base/node/pfs'; -import { join } from 'path'; import 'vs/platform/opener/browser/opener.contribution'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService'; import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { foreground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; +import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry'; /** * Services that we require for the Shell @@ -136,6 +132,7 @@ export class WorkbenchShell { private windowIPCService: IWindowIPCService; private timerService: ITimerService; private themeService: WorkbenchThemeService; + private lifecycleService: ILifecycleService; private container: HTMLElement; private toUnbind: IDisposable[]; @@ -172,11 +169,6 @@ export class WorkbenchShell { // Instantiation service with services const [instantiationService, serviceCollection] = this.initServiceCollection(parent.getHTMLElement()); - //crash reporting - if (!!product.crashReporter) { - instantiationService.createInstance(CrashReporter, product.crashReporter); - } - // Workbench this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.options, serviceCollection); this.workbench.startup({ @@ -221,7 +213,10 @@ export class WorkbenchShell { theme: this.themeService.getColorTheme().id, language: platform.language, experiments: this.telemetryService.getExperiments(), - pinnedViewlets: info.pinnedViewlets + pinnedViewlets: info.pinnedViewlets, + restoredViewlet: info.restoredViewlet, + restoredEditors: info.restoredEditors.length, + startupKind: this.lifecycleService.startupKind }); // Telemetry: startup metrics @@ -240,39 +235,6 @@ export class WorkbenchShell { if ((platform.isLinux || platform.isMacintosh) && process.getuid() === 0) { this.messageService.show(Severity.Warning, nls.localize('runningAsRoot', "It is recommended not to run Code as 'root'.")); } - - // Profiler: startup cpu profile - const { profileStartup } = this.environmentService; - if (profileStartup) { - this.extensionService.onReady().then(() => stopProfiling(profileStartup.dir, profileStartup.prefix)).then(() => { - - readdir(profileStartup.dir).then(files => { - return files.filter(value => value.indexOf(profileStartup.prefix) === 0); - }).then(files => { - - const profileFiles = files.reduce((prev, cur) => `${prev}${join(profileStartup.dir, cur)}\n`, '\n'); - - const primaryButton = this.messageService.confirm({ - type: 'info', - message: nls.localize('prof.message', "Successfully created profiles."), - detail: nls.localize('prof.detail', "Please create an issue and manually attach the following files:\n{0}", profileFiles), - primaryButton: nls.localize('prof.restartAndFileIssue', "Create Issue and Restart"), - secondaryButton: nls.localize('prof.restart', "Restart") - }); - - let createIssue = TPromise.as(void 0); - if (primaryButton) { - const action = this.workbench.getInstantiationService().createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL); - - createIssue = action.run(`:warning: Make sure to **attach** these files: :warning:\n${files.map(file => `-\`${join(profileStartup.dir, file)}\``).join('\n')}`).then(() => { - return this.windowsService.showItemInFolder(join(profileStartup.dir, files[0])); - }); - } - createIssue.then(() => this.windowsService.relaunch({ removeArgs: ['--prof-startup'] })); - }); - - }, err => console.error(err)); - } } private initServiceCollection(container: HTMLElement): [IInstantiationService, ServiceCollection] { @@ -349,6 +311,12 @@ export class WorkbenchShell { serviceCollection.set(ITelemetryService, this.telemetryService); disposables.add(configurationTelemetry(this.telemetryService, this.configurationService)); + let crashReporterService = NullCrashReporterService; + if (product.crashReporter && product.hockeyApp) { + crashReporterService = instantiationService.createInstance(CrashReporterService); + } + serviceCollection.set(ICrashReporterService, crashReporterService); + this.messageService = instantiationService.createInstance(MessageService, container); serviceCollection.set(IMessageService, this.messageService); serviceCollection.set(IChoiceService, this.messageService); @@ -358,6 +326,7 @@ export class WorkbenchShell { this.toUnbind.push(lifecycleService.onShutdown(reason => saveFontInfo(this.storageService))); serviceCollection.set(ILifecycleService, lifecycleService); disposables.add(lifecycleTelemetry(this.telemetryService, lifecycleService)); + this.lifecycleService = lifecycleService; const extensionManagementChannel = getDelayedChannel(sharedProcess.then(c => c.getChannel('extensions'))); serviceCollection.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementChannelClient, extensionManagementChannel)); @@ -372,9 +341,7 @@ export class WorkbenchShell { this.timerService.beforeExtensionLoad = Date.now(); - // TODO@Joao: remove - const disabledExtensions = SCMPreview.enabled ? [] : ['vscode.git']; - this.extensionService = instantiationService.createInstance(MainProcessExtensionService, disabledExtensions); + this.extensionService = instantiationService.createInstance(MainProcessExtensionService); serviceCollection.set(IExtensionService, this.extensionService); extensionHostProcessWorker.start(this.extensionService); this.extensionService.onReady().done(() => { @@ -518,6 +485,19 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { collector.addRule(`.monaco-shell { color: ${windowForeground}; }`); } + // Selection + const windowSelectionBackground = theme.getColor(selectionBackground); + if (windowSelectionBackground) { + collector.addRule(`.monaco-shell ::selection { background-color: ${windowSelectionBackground}; }`); + } + + // Input placeholder + const placeholderForeground = theme.getColor(inputPlaceholderForeground); + if (placeholderForeground) { + collector.addRule(`.monaco-shell input::-webkit-input-placeholder { color: ${placeholderForeground}; }`); + collector.addRule(`.monaco-shell textarea::-webkit-input-placeholder { color: ${placeholderForeground}; }`); + } + // List highlight const listHighlightForegroundColor = theme.getColor(listHighlightForeground); if (listHighlightForegroundColor) { diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index f779df1a858..e0eb6f23dfe 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -34,13 +34,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IPath, IOpenFileRequest, IWindowConfiguration } from 'vs/workbench/electron-browser/common'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ITitleService } from 'vs/workbench/services/title/common/titleService'; -import { Registry } from 'vs/platform/platform'; -import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchThemeService, VS_HC_THEME, VS_DARK_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService'; import * as browser from 'vs/base/browser/browser'; -import { ReloadWindowAction, ToggleDevToolsAction, ShowStartupPerformance, OpenRecentAction, ToggleSharedProcessAction } from 'vs/workbench/electron-browser/actions'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { Position, IResourceInput, IUntitledResourceInput } from 'vs/platform/editor/common/editor'; @@ -134,17 +129,17 @@ export class ElectronWindow extends Themable { // Find out if folders are dragged and show the appropiate feedback then this.includesFolder(draggedExternalResources).done(includesFolder => { if (includesFolder) { - const hcOutline = this.getColor(activeContrastBorder); + const activeContrastBorderColor = this.getColor(activeContrastBorder); dropOverlay = $(window.document.getElementById(this.partService.getWorkbenchElementId())) .div({ id: 'monaco-workbench-drop-overlay' }) .style({ backgroundColor: this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND), - outlineColor: hcOutline, - outlineOffset: hcOutline ? '-2px' : null, - outlineStyle: hcOutline ? 'dashed' : null, - outlineWidth: hcOutline ? '2px' : null + outlineColor: activeContrastBorderColor, + outlineOffset: activeContrastBorderColor ? '-2px' : null, + outlineStyle: activeContrastBorderColor ? 'dashed' : null, + outlineWidth: activeContrastBorderColor ? '2px' : null }) .on(DOM.EventType.DROP, (e: DragEvent) => { DOM.EventHelper.stop(e, true); @@ -301,6 +296,11 @@ export class ElectronWindow extends Themable { KeyboardMapperFactory.INSTANCE._onKeyboardLayoutChanged(isISOKeyboard); }); + // keyboard layout changed event + ipc.on('vscode:accessibilitySupportChanged', (event, accessibilitySupportEnabled: boolean) => { + browser.setAccessibilitySupport(accessibilitySupportEnabled ? platform.AccessibilitySupport.Enabled : platform.AccessibilitySupport.Disabled); + }); + // Configuration changes let previousConfiguredZoomLevel: number; this.configurationService.onDidUpdateConfiguration(e => { @@ -321,7 +321,10 @@ export class ElectronWindow extends Themable { if (webFrame.getZoomLevel() !== newZoomLevel) { webFrame.setZoomLevel(newZoomLevel); browser.setZoomFactor(webFrame.getZoomFactor()); - browser.setZoomLevel(webFrame.getZoomLevel()); // Ensure others can listen to zoom level changes + // See https://github.com/Microsoft/vscode/issues/26151 + // Cannot be trusted because the webFrame might take some time + // until it really applies the new zoom level + browser.setZoomLevel(webFrame.getZoomLevel(), /*isTrusted*/false); } }); @@ -335,25 +338,11 @@ export class ElectronWindow extends Themable { this.contextMenuService.showContextMenu({ getAnchor: () => target, - getActions: () => TPromise.as(TextInputActions), - getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id) + getActions: () => TPromise.as(TextInputActions) }); } } }); - - // Developer related actions - const developerCategory = nls.localize('developer', "Developer"); - const workbenchActionsRegistry = Registry.as(Extensions.WorkbenchActions); - const isDeveloping = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment; - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : void 0), 'Reload Window'); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', developerCategory); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowStartupPerformance, ShowStartupPerformance.ID, ShowStartupPerformance.LABEL), 'Developer: Startup Performance', developerCategory); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSharedProcessAction, ToggleSharedProcessAction.ID, ToggleSharedProcessAction.LABEL), 'Developer: Toggle Shared Process', developerCategory); - - // Action registered here to prevent a keybinding conflict with reload window - const fileCategory = nls.localize('file', "File"); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent', fileCategory); } private resolveKeybindings(actionIds: string[]): TPromise<{ id: string; label: string, isNative: boolean; }[]> { @@ -461,7 +450,7 @@ export class ElectronWindow extends Themable { newAutoSaveValue = AutoSaveConfiguration.AFTER_DELAY; } - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ElectronWindow.AUTO_SAVE_SETTING, value: newAutoSaveValue }).done(null, error => this.messageService.show(Severity.Error, error)); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ElectronWindow.AUTO_SAVE_SETTING, value: newAutoSaveValue }); } private includesFolder(resources: URI[]): TPromise { diff --git a/src/vs/workbench/electron-browser/workbench.main.ts b/src/vs/workbench/electron-browser/workbench.main.ts index 1845a488d23..0d6c2c4aa0c 100644 --- a/src/vs/workbench/electron-browser/workbench.main.ts +++ b/src/vs/workbench/electron-browser/workbench.main.ts @@ -18,6 +18,9 @@ import 'vs/editor/browser/editor.all'; // Menus/Actions import 'vs/platform/actions/electron-browser/menusExtensionPoint'; +// Views +import 'vs/workbench/parts/views/browser/viewsExtensionPoint'; + // Workbench import 'vs/workbench/browser/actions/toggleActivityBarVisibility'; import 'vs/workbench/browser/actions/toggleStatusbarVisibility'; @@ -45,11 +48,6 @@ import 'vs/workbench/parts/search/browser/openAnythingHandler'; // can be packag import 'vs/workbench/parts/scm/electron-browser/scm.contribution'; import 'vs/workbench/parts/scm/electron-browser/scmViewlet'; // can be packaged separately -import 'vs/workbench/parts/git/electron-browser/git.contribution'; -import 'vs/workbench/parts/git/browser/gitQuickOpen'; -import 'vs/workbench/parts/git/browser/gitActions.contribution'; -import 'vs/workbench/parts/git/browser/gitViewlet'; // can be packaged separately - import 'vs/workbench/parts/debug/electron-browser/debug.contribution'; import 'vs/workbench/parts/debug/browser/debugQuickOpen'; import 'vs/workbench/parts/debug/electron-browser/repl'; @@ -69,9 +67,6 @@ import 'vs/workbench/parts/extensions/electron-browser/extensionsViewlet'; // ca import 'vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution'; -import 'vs/workbench/parts/explorers/browser/treeExplorer.contribution'; -import 'vs/workbench/parts/explorers/browser/treeExplorerViewlet'; // can be packaged separately - import 'vs/workbench/parts/output/browser/output.contribution'; import 'vs/workbench/parts/output/browser/outputPanel'; // can be packaged separately @@ -87,7 +82,7 @@ import 'vs/workbench/parts/relauncher/electron-browser/relauncher.contribution'; import 'vs/workbench/parts/tasks/electron-browser/task.contribution'; import 'vs/workbench/parts/emmet/browser/emmet.browser.contribution'; -import 'vs/workbench/parts/emmet/node/emmet.contribution'; +import 'vs/workbench/parts/emmet/electron-browser/emmet.contribution'; // Code Editor enhacements import 'vs/workbench/parts/codeEditor/codeEditor.contribution'; @@ -105,13 +100,14 @@ import 'vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarte import 'vs/workbench/parts/update/electron-browser/update.contribution'; -import 'vs/workbench/parts/nps/electron-browser/nps.contribution'; +import 'vs/workbench/parts/surveys/electron-browser/nps.contribution'; +import 'vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution'; import 'vs/workbench/parts/performance/electron-browser/performance.contribution'; import 'vs/workbench/parts/cli/electron-browser/cli.contribution'; -import 'vs/workbench/api/node/extHost.contribution'; +import 'vs/workbench/api/electron-browser/extensionHost.contribution'; import 'vs/workbench/electron-browser/main.contribution'; import 'vs/workbench/electron-browser/main'; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 4621ddd167c..b8c52c3c984 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -7,6 +7,7 @@ import 'vs/css!./media/workbench'; +import { localize } from 'vs/nls'; import { TPromise, ValueCallback } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import Event, { Emitter, chain } from 'vs/base/common/event'; @@ -16,6 +17,7 @@ import { Delayer } from 'vs/base/common/async'; import * as browser from 'vs/base/browser/browser'; import assert = require('vs/base/common/assert'); import { StopWatch } from 'vs/base/common/stopwatch'; +import { startTimer } from 'vs/base/node/startupTimers'; import errors = require('vs/base/common/errors'); import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; @@ -34,7 +36,7 @@ import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart'; import { StatusbarPart } from 'vs/workbench/browser/parts/statusbar/statusbarPart'; import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; import { WorkbenchLayout } from 'vs/workbench/browser/layout'; -import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actionBarRegistry'; +import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; import { QuickOpenController } from 'vs/workbench/browser/parts/quickopen/quickOpenController'; import { getServices } from 'vs/platform/instantiation/common/extensions'; @@ -84,12 +86,16 @@ import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/ import { IWindowService } from 'vs/platform/windows/common/windows'; import { IMessageService } from 'vs/platform/message/common/message'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; -import { IMenuService } from 'vs/platform/actions/common/actions'; +import { IMenuService, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { MenuService } from 'vs/platform/actions/common/menuService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWindowConfiguration } from 'vs/workbench/electron-browser/common'; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; +import { OpenRecentAction, ToggleDevToolsAction, ReloadWindowAction } from "vs/workbench/electron-browser/actions"; +import { KeyMod } from 'vs/base/common/keyCodes'; +import { KeyCode } from 'vs/editor/common/standalone/standaloneBase'; export const MessagesVisibleContext = new RawContextKey('globalMessageVisible', false); export const EditorsVisibleContext = new RawContextKey('editorIsOpen', false); @@ -114,6 +120,8 @@ export interface IWorkbenchStartedInfo { restoreViewletDuration: number; restoreEditorsDuration: number; pinnedViewlets: string[]; + restoredViewlet: string; + restoredEditors: string[]; } export interface IWorkbenchCallbacks { @@ -257,6 +265,9 @@ export class Workbench implements IPartService { // Create Workbench this.createWorkbench(); + // Install some global actions + this.createGlobalActions(); + // Services this.initServices(); if (this.callbacks && this.callbacks.onServicesCreated) { @@ -285,8 +296,8 @@ export class Workbench implements IPartService { // Restore last opened viewlet let viewletRestoreStopWatch: StopWatch; + let viewletIdToRestore: string; if (!this.sideBarHidden) { - let viewletIdToRestore: string; if (this.shouldRestoreLastOpenedViewlet()) { viewletIdToRestore = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE); @@ -297,7 +308,8 @@ export class Workbench implements IPartService { } viewletRestoreStopWatch = StopWatch.create(); - compositeAndEditorPromises.push(this.viewletService.openViewlet(viewletIdToRestore).then(() => { + const viewletTimer = startTimer('restore:viewlet'); + compositeAndEditorPromises.push(viewletTimer.while(this.viewletService.openViewlet(viewletIdToRestore)).then(() => { viewletRestoreStopWatch.stop(); })); } @@ -311,7 +323,9 @@ export class Workbench implements IPartService { // Load Editors const editorRestoreStopWatch = StopWatch.create(); - compositeAndEditorPromises.push(this.resolveEditorsToOpen().then(inputs => { + const restoredEditors: string[] = []; + const editorsTimer = startTimer('restore:editors'); + compositeAndEditorPromises.push(editorsTimer.while(this.resolveEditorsToOpen().then(inputs => { let editorOpenPromise: TPromise; if (inputs.length) { editorOpenPromise = this.editorService.openEditors(inputs.map(input => { return { input, position: EditorPosition.ONE }; })); @@ -319,11 +333,18 @@ export class Workbench implements IPartService { editorOpenPromise = this.editorPart.restoreEditors(); } - return editorOpenPromise.then(() => { + return editorOpenPromise.then(editors => { this.onEditorsChanged(); // make sure we show the proper background in the editor area editorRestoreStopWatch.stop(); + for (const editor of editors) { + if (editor.input) { + restoredEditors.push(editor.input.getName()); + } else { + restoredEditors.push(`other:${editor.getId()}`); + } + } }); - })); + }))); if (this.storageService.getBoolean(Workbench.zenModeActiveSettingKey, StorageScope.WORKSPACE, false)) { this.toggleZenMode(true); @@ -340,6 +361,8 @@ export class Workbench implements IPartService { restoreViewletDuration: viewletRestoreStopWatch ? Math.round(viewletRestoreStopWatch.elapsed()) : 0, restoreEditorsDuration: Math.round(editorRestoreStopWatch.elapsed()), pinnedViewlets: this.activitybarPart.getPinned(), + restoredViewlet: viewletIdToRestore, + restoredEditors }); } @@ -360,6 +383,16 @@ export class Workbench implements IPartService { } } + private createGlobalActions(): void { + const isDeveloping = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment; + + // Actions registered here to adjust for developing vs built workbench + const workbenchActionsRegistry = Registry.as(Extensions.WorkbenchActions); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : void 0), 'Reload Window'); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', localize('developer', "Developer")); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent', localize('file', "File")); + } + private resolveEditorsToOpen(): TPromise { // Files to open, diff or create diff --git a/src/vs/workbench/node/extensionHostMain.ts b/src/vs/workbench/node/extensionHostMain.ts index d84ec84c924..fd41b0c29fe 100644 --- a/src/vs/workbench/node/extensionHostMain.ts +++ b/src/vs/workbench/node/extensionHostMain.ts @@ -12,6 +12,8 @@ import { join } from 'path'; import { IRemoteCom } from 'vs/platform/extensions/common/ipcRemoteCom'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { ExtHostThreadService } from 'vs/workbench/services/thread/common/extHostThreadService'; +import { QueryType, ISearchQuery } from 'vs/platform/search/common/search'; +import { DiskSearch } from 'vs/workbench/services/search/node/searchService'; import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry'; import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IInitData, IEnvironment, MainContext } from 'vs/workbench/api/node/extHost.protocol'; @@ -34,6 +36,7 @@ export class ExtensionHostMain { private _isTerminating: boolean = false; private _contextService: IWorkspaceContextService; + private _diskSearch: DiskSearch; private _environment: IEnvironment; private _extensionService: ExtHostExtensionService; @@ -122,13 +125,33 @@ export class ExtensionHostMain { } }); - const fileNames = Object.keys(desiredFilesMap); + const matchingPatterns = Object.keys(desiredFilesMap).map(p => { + // TODO: This is a bit hacky -- maybe this should be implemented by using something like + // `workspaceGlob` or something along those lines? + if (p.indexOf('*') > -1 || p.indexOf('?') > -1) { + if (!this._diskSearch) { + // Shut down this search process after 1s + this._diskSearch = new DiskSearch(false, 1000); + } - return TPromise.join(fileNames.map(f => pfs.exists(join(folderPath, f)))).then(exists => { - fileNames - .filter((f, i) => exists[i]) - .forEach(fileName => { - const activationEvent = `workspaceContains:${fileName}`; + const query: ISearchQuery = { + folderResources: [workspace.resource], + type: QueryType.File, + maxResults: 1, + includePattern: { [p]: true } + }; + + return this._diskSearch.search(query).then(result => result.results.length ? p : undefined); + } else { + return pfs.exists(join(folderPath, p)).then(exists => exists ? p : undefined); + } + }); + + return TPromise.join(matchingPatterns).then(patterns => { + patterns + .filter(p => p !== undefined) + .forEach(p => { + const activationEvent = `workspaceContains:${p}`; this._extensionService.activateByEvent(activationEvent) .done(null, err => console.error(err)); diff --git a/src/vs/workbench/node/extensionPoints.ts b/src/vs/workbench/node/extensionPoints.ts index 1eb54c3f49e..c1b76d345ec 100644 --- a/src/vs/workbench/node/extensionPoints.ts +++ b/src/vs/workbench/node/extensionPoints.ts @@ -18,6 +18,7 @@ import Types = require('vs/base/common/types'); import { isValidExtensionDescription } from 'vs/platform/extensions/node/extensionValidator'; import * as semver from 'semver'; import { getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; const MANIFEST_FILE = 'package.json'; @@ -47,7 +48,9 @@ export class MessagesCollector { this._messages.push({ type: type, message: message, - source: source + source: source, + extensionId: undefined, + extensionPointId: undefined }); } @@ -88,7 +91,7 @@ class ExtensionManifestParser extends ExtensionManifestHandler { try { return JSON.parse(manifestContents.toString()); } catch (e) { - this._collector.error(this._absoluteFolderPath, nls.localize('jsonParseFail', "Failed to parse {0}: {1}.", this._absoluteManifestPath, json.getParseErrorMessage(e.message))); + this._collector.error(this._absoluteFolderPath, nls.localize('jsonParseFail', "Failed to parse {0}: {1}.", this._absoluteManifestPath, getParseErrorMessage(e.message))); } return null; }, (err) => { @@ -123,7 +126,7 @@ class ExtensionManifestNLSReplacer extends ExtensionManifestHandler { return ExtensionManifestNLSReplacer.resolveOriginalMessageBundle(messageBundle.original, errors).then(originalMessages => { if (errors.length > 0) { errors.forEach((error) => { - this._collector.error(this._absoluteFolderPath, nls.localize('jsonsParseFail', "Failed to parse {0} or {1}: {2}.", messageBundle.localized, messageBundle.original, json.getParseErrorMessage(error.error))); + this._collector.error(this._absoluteFolderPath, nls.localize('jsonsParseFail', "Failed to parse {0} or {1}: {2}.", messageBundle.localized, messageBundle.original, getParseErrorMessage(error.error))); }); return extensionDescription; } diff --git a/src/vs/workbench/parts/backup/common/backupRestorer.ts b/src/vs/workbench/parts/backup/common/backupRestorer.ts index 54d1e832897..77603e199d9 100644 --- a/src/vs/workbench/parts/backup/common/backupRestorer.ts +++ b/src/vs/workbench/parts/backup/common/backupRestorer.ts @@ -83,26 +83,25 @@ export class BackupRestorer implements IWorkbenchContribution { private doOpenEditors(resources: URI[]): TPromise { const stacks = this.groupService.getStacksModel(); const hasOpenedEditors = stacks.groups.length > 0; - - const inputs = resources.map(resource => this.resolveInput(resource)); - const openEditorsArgs = inputs.map((input, index) => { - return { input, options: { pinned: true, preserveFocus: true, inactive: index > 0 || hasOpenedEditors }, position: Position.ONE }; - }); + const inputs = resources.map((resource, index) => this.resolveInput(resource, index, hasOpenedEditors)); // Open all remaining backups as editors and resolve them to load their backups - return this.editorService.openEditors(openEditorsArgs).then(() => void 0); + return this.editorService.openEditors(inputs.map(input => { return { input, position: Position.ONE }; })).then(() => void 0); } - private resolveInput(resource: URI): IResourceInput | IUntitledResourceInput { + private resolveInput(resource: URI, index: number, hasOpenedEditors: boolean): IResourceInput | IUntitledResourceInput { + const options = { pinned: true, preserveFocus: true, inactive: index > 0 || hasOpenedEditors }; + if (resource.scheme === 'untitled' && !BackupRestorer.UNTITLED_REGEX.test(resource.fsPath)) { // TODO@Ben debt: instead of guessing if an untitled file has an associated file path or not // this information should be provided by the backup service and stored as meta data within - return { filePath: resource.fsPath }; + return { filePath: resource.fsPath, options }; } - return { resource }; + return { resource, options }; } + public getId(): string { return 'vs.backup.backupRestorer'; } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts index 6e8205b0cdd..584821e2d3a 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts @@ -8,7 +8,6 @@ import * as nls from 'vs/nls'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; @editorAction export class ToggleRenderControlCharacterAction extends EditorAction { @@ -24,12 +23,9 @@ export class ToggleRenderControlCharacterAction extends EditorAction { public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { const configurationEditingService = accessor.get(IConfigurationEditingService); - const messageService = accessor.get(IMessageService); let newRenderControlCharacters = !editor.getConfiguration().viewInfo.renderControlCharacters; - configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderControlCharacters', value: newRenderControlCharacters }).then(null, error => { - messageService.show(Severity.Error, error); - }); + configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderControlCharacters', value: newRenderControlCharacters }); } } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts index 7697db1cbcf..f8e373a96f0 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts @@ -8,7 +8,6 @@ import * as nls from 'vs/nls'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; @editorAction export class ToggleRenderWhitespaceAction extends EditorAction { @@ -24,7 +23,6 @@ export class ToggleRenderWhitespaceAction extends EditorAction { public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { const configurationEditingService = accessor.get(IConfigurationEditingService); - const messageService = accessor.get(IMessageService); let renderWhitespace = editor.getConfiguration().viewInfo.renderWhitespace; let newRenderWhitespace: string; @@ -34,8 +32,6 @@ export class ToggleRenderWhitespaceAction extends EditorAction { newRenderWhitespace = 'none'; } - configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderWhitespace', value: newRenderWhitespace }).then(null, error => { - messageService.show(Severity.Error, error); - }); + configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'editor.renderWhitespace', value: newRenderWhitespace }); } } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index 9773fc9163e..e0bf3b52629 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -11,14 +11,13 @@ import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Disposable } from 'vs/base/common/lifecycle'; import { IMessageService } from 'vs/platform/message/common/message'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; -import { InternalEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { InternalEditorOptions, EDITOR_DEFAULTS } from 'vs/editor/common/config/editorOptions'; const transientWordWrapState = 'transientWordWrapState'; const isWordWrapMinifiedKey = 'isWordWrapMinified'; @@ -67,7 +66,7 @@ function readWordWrapState(model: IModel, configurationService: IConfigurationSe const _transientState = readTransientState(model, codeEditorService); return { configuredWordWrap: _configuredWordWrap, - configuredWordWrapMinified: (typeof _configuredWordWrapMinified.value === 'undefined' ? DefaultConfig.editor.wordWrapMinified : _configuredWordWrapMinified.value), + configuredWordWrapMinified: (typeof _configuredWordWrapMinified.value === 'undefined' ? EDITOR_DEFAULTS.wordWrapMinified : _configuredWordWrapMinified.value), transientState: _transientState }; } diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/parts/debug/browser/debugActionItems.ts index 8165e4055b6..50d19edfefb 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionItems.ts @@ -17,8 +17,9 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ICommandService } from 'vs/platform/commands/common/commands'; import { IDebugService } from 'vs/workbench/parts/debug/common/debug'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler'; +import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; +import { selectBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; @@ -37,7 +38,7 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem { private context: any, private action: IAction, @IDebugService private debugService: IDebugService, - @IThemeService themeService: IThemeService, + @IThemeService private themeService: IThemeService, @IConfigurationService private configurationService: IConfigurationService, @ICommandService private commandService: ICommandService ) { @@ -115,6 +116,10 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem { event.stopPropagation(); } })); + this.toDispose.push(attachStylerCallback(this.themeService, { selectBorder }, colors => { + this.container.style.border = colors.selectBorder ? `1px solid ${colors.selectBorder}` : null; + selectBoxContainer.style.borderLeft = colors.selectBorder ? `1px solid ${colors.selectBorder}` : null; + })); this.updateOptions(); } diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index 714284ed642..6a23b8588cd 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -6,12 +6,14 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import * as lifecycle from 'vs/base/common/lifecycle'; +import severity from 'vs/base/common/severity'; import { TPromise } from 'vs/base/common/winjs.base'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IFileService } from 'vs/platform/files/common/files'; +import { IMessageService } from 'vs/platform/message/common/message'; import { IDebugService, State, IProcess, IThread, IEnablement, IBreakpoint, IStackFrame, IFunctionBreakpoint, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, IExpression, REPL_ID } from 'vs/workbench/parts/debug/common/debug'; import { Variable, Expression, Thread, Breakpoint, Process } from 'vs/workbench/parts/debug/common/debugModel'; @@ -75,7 +77,8 @@ export class ConfigureAction extends AbstractDebugAction { constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IMessageService private messageService: IMessageService ) { super(id, label, 'debug-action configure', debugService, keybindingService); this.toDispose.push(debugService.getViewModel().onDidSelectConfiguration(configurationName => this.updateClass())); @@ -96,6 +99,7 @@ export class ConfigureAction extends AbstractDebugAction { public run(event?: any): TPromise { if (!this.contextService.getWorkspace()) { + this.messageService.show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration.")); return TPromise.as(null); } diff --git a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts index 2287c14feb2..7afe47c4c78 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts @@ -115,6 +115,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi if (mouseClickEvent.detail === 2) { // double click on debug bar centers it again #8250 this.setXCoordinate(0.5 * window.innerWidth); + this.storePosition(); } }); @@ -129,8 +130,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi // Reduce x by width of drag handle to reduce jarring #16604 this.setXCoordinate(mouseMoveEvent.posx - 14); }).once('mouseup', (e: MouseEvent) => { - const mouseMoveEvent = new StandardMouseEvent(e); - this.storageService.store(DEBUG_ACTIONS_WIDGET_POSITION_KEY, mouseMoveEvent.posx / window.innerWidth, StorageScope.WORKSPACE); + this.storePosition(); this.dragArea.removeClass('dragged'); $window.off('mousemove'); }); @@ -140,6 +140,12 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi this.toDispose.push(browser.onDidChangeZoomLevel(() => this.positionDebugWidget())); } + private storePosition(): void { + const position = parseFloat(this.$el.getComputedStyle().left) / window.innerWidth; + this.storageService.store(DEBUG_ACTIONS_WIDGET_POSITION_KEY, position, StorageScope.WORKSPACE); + this.telemetryService.publicLog(DEBUG_ACTIONS_WIDGET_POSITION_KEY, { position }); + } + protected updateStyles(): void { super.updateStyles(); @@ -149,10 +155,10 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi const widgetShadowColor = this.getColor(widgetShadow); this.$el.style('box-shadow', widgetShadowColor ? `0 5px 8px ${widgetShadowColor}` : null); - const hcBorder = this.getColor(contrastBorder); - this.$el.style('border-style', hcBorder ? 'solid' : null); - this.$el.style('border-width', hcBorder ? '1px' : null); - this.$el.style('border-color', hcBorder); + const contrastBorderColor = this.getColor(contrastBorder); + this.$el.style('border-style', contrastBorderColor ? 'solid' : null); + this.$el.style('border-width', contrastBorderColor ? '1px' : null); + this.$el.style('border-color', contrastBorderColor); } } diff --git a/src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts b/src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts index 883f40a1cab..58912bfea85 100644 --- a/src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts +++ b/src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts @@ -122,8 +122,8 @@ export class DebugEditorModelManager implements IWorkbenchContribution { } // only show decorations for the currently focussed thread. - const columnUntilEOLRange = new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, Constants.MAX_SAFE_SMALL_INTEGER); - const range = new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, stackFrame.column + 1); + const columnUntilEOLRange = new Range(stackFrame.range.startLineNumber, stackFrame.range.startColumn, stackFrame.range.startLineNumber, Constants.MAX_SAFE_SMALL_INTEGER); + const range = new Range(stackFrame.range.startLineNumber, stackFrame.range.startColumn, stackFrame.range.startLineNumber, stackFrame.range.startColumn + 1); // compute how to decorate the editor. Different decorations are used if this is a top stack frame, focussed stack frame, // an exception or a stack frame that did not change the line number (we only decorate the columns, not the whole line). @@ -144,10 +144,16 @@ export class DebugEditorModelManager implements IWorkbenchContribution { options: DebugEditorModelManager.TOP_STACK_FRAME_DECORATION, range: columnUntilEOLRange }); + if (stackFrame.range.endLineNumber && stackFrame.range.endColumn) { + result.push({ + options: { className: 'debug-top-stack-frame-range' }, + range: stackFrame.range + }); + } if (this.modelDataMap.has(modelUriStr)) { const modelData = this.modelDataMap.get(modelUriStr); - if (modelData.topStackFrameRange && modelData.topStackFrameRange.startLineNumber === stackFrame.lineNumber && modelData.topStackFrameRange.startColumn !== stackFrame.column) { + if (modelData.topStackFrameRange && modelData.topStackFrameRange.startLineNumber === stackFrame.range.startLineNumber && modelData.topStackFrameRange.startColumn !== stackFrame.range.startColumn) { result.push({ options: DebugEditorModelManager.TOP_STACK_FRAME_INLINE_DECORATION, range: columnUntilEOLRange @@ -161,6 +167,12 @@ export class DebugEditorModelManager implements IWorkbenchContribution { options: DebugEditorModelManager.FOCUSED_STACK_FRAME_MARGIN, range }); + if (stackFrame.range.endLineNumber && stackFrame.range.endColumn) { + result.push({ + options: { className: 'debug-focused-stack-frame-range' }, + range: stackFrame.range + }); + } result.push({ options: DebugEditorModelManager.FOCUSED_STACK_FRAME_DECORATION, diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/parts/debug/browser/debugViewlet.ts index 5b3b171fc66..a36d3128022 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewlet.ts @@ -75,9 +75,9 @@ export class DebugViewlet extends Viewlet { this.viewletSettings) ); - this.views.forEach(view => { + this.views.forEach((view, index) => { if (view instanceof HeaderView) { - attachHeaderViewStyler(view, this.themeService); + attachHeaderViewStyler(view, this.themeService, { noContrastBorder: index === 0 }); } }); diff --git a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts index 805cc62a57d..70004ffb526 100644 --- a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts +++ b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts @@ -14,6 +14,8 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; const $ = dom.$; // theming @@ -28,9 +30,10 @@ export class ExceptionWidget extends ZoneWidget { constructor(editor: ICodeEditor, private exceptionInfo: IExceptionInfo, private lineNumber: number, @IContextViewService private contextViewService: IContextViewService, @IDebugService private debugService: IDebugService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IInstantiationService private instantiationService: IInstantiationService ) { - super(editor, { showFrame: true, showArrow: true, frameWidth: 1 }); + super(editor, { showFrame: true, showArrow: true, frameWidth: 1, className: 'exception-widget-container' }); this._backgroundColor = Color.white; @@ -79,7 +82,9 @@ export class ExceptionWidget extends ZoneWidget { if (this.exceptionInfo.details && this.exceptionInfo.details.stackTrace) { let stackTrace = $('.stack-trace'); - stackTrace.textContent = this.exceptionInfo.details.stackTrace; + const linkDetector = this.instantiationService.createInstance(LinkDetector); + const linkedStackTrace = linkDetector.handleLinks(this.exceptionInfo.details.stackTrace); + typeof linkedStackTrace === 'string' ? stackTrace.textContent = linkedStackTrace : stackTrace.appendChild(linkedStackTrace); dom.append(container, stackTrace); } } @@ -88,7 +93,10 @@ export class ExceptionWidget extends ZoneWidget { // Reload the height with respect to the exception text content and relayout it to match the line count. this.container.style.height = 'initial'; - const computedLinesNumber = Math.ceil(this.container.offsetHeight / this.editor.getConfiguration().fontInfo.lineHeight); + const lineHeight = this.editor.getConfiguration().lineHeight; + const arrowHeight = Math.round(lineHeight / 3); + const computedLinesNumber = Math.ceil((this.container.offsetHeight + arrowHeight) / lineHeight); + this._relayout(computedLinesNumber); } } diff --git a/src/vs/workbench/parts/debug/browser/linkDetector.ts b/src/vs/workbench/parts/debug/browser/linkDetector.ts new file mode 100644 index 00000000000..d2fd4efab48 --- /dev/null +++ b/src/vs/workbench/parts/debug/browser/linkDetector.ts @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import strings = require('vs/base/common/strings'); +import uri from 'vs/base/common/uri'; +import { isMacintosh } from 'vs/base/common/platform'; +import * as errors from 'vs/base/common/errors'; +import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent'; +import * as nls from 'vs/nls'; +import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; + +export class LinkDetector { + private static FILE_LOCATION_PATTERNS: RegExp[] = [ + // group 0: full path with line and column + // group 1: full path without line and column, matched by `*.*` in the end to work only on paths with extensions in the end (s.t. node:10352 would not match) + // group 2: drive letter on windows with trailing backslash or leading slash on mac/linux + // group 3: line number, matched by (:(\d+)) + // group 4: column number, matched by ((?::(\d+))?) + // eg: at Context. (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11) + /(?![\(])(?:file:\/\/)?((?:([a-zA-Z]+:)|[^\(\)<>\'\"\[\]:\s]+)(?:[\\/][^\(\)<>\'\"\[\]:]*)?\.[a-zA-Z]+[0-9]*):(\d+)(?::(\d+))?/g + ]; + + constructor( + @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + @IWorkspaceContextService private contextService: IWorkspaceContextService + ) { + // noop + } + + /** + * Matches and handles relative and absolute file links in the string provided. + * Returns element that wraps the processed string, where matched links are replaced by
and unmatched parts are surrounded by elements. + * 'onclick' event is attached to all anchored links that opens them in the editor. + * If no links were detected, returns the original string. + */ + public handleLinks(text: string): HTMLElement | string { + let linkContainer: HTMLElement; + + for (let pattern of LinkDetector.FILE_LOCATION_PATTERNS) { + pattern.lastIndex = 0; // the holy grail of software development + let lastMatchIndex = 0; + + let match = pattern.exec(text); + while (match !== null) { + let resource: uri = null; + try { + resource = (match && !strings.startsWith(match[0], 'http')) + && (match[2] || strings.startsWith(match[0], '/') ? uri.file(match[1]) : this.contextService.toResource(match[1])); + } catch (e) { } + + if (!resource) { + match = pattern.exec(text); + continue; + } + if (!linkContainer) { + linkContainer = document.createElement('span'); + } + + let textBeforeLink = text.substring(lastMatchIndex, match.index); + if (textBeforeLink) { + let span = document.createElement('span'); + span.textContent = textBeforeLink; + linkContainer.appendChild(span); + } + + const link = document.createElement('a'); + link.textContent = text.substr(match.index, match[0].length); + link.title = isMacintosh ? nls.localize('fileLinkMac', "Click to follow (Cmd + click opens to the side)") : nls.localize('fileLink', "Click to follow (Ctrl + click opens to the side)"); + linkContainer.appendChild(link); + const line = Number(match[3]); + const column = match[4] ? Number(match[4]) : undefined; + link.onclick = (e) => this.onLinkClick(new StandardMouseEvent(e), resource, line, column); + + lastMatchIndex = pattern.lastIndex; + const currentMatch = match; + match = pattern.exec(text); + + // Append last string part if no more link matches + if (!match) { + let textAfterLink = text.substr(currentMatch.index + currentMatch[0].length); + if (textAfterLink) { + let span = document.createElement('span'); + span.textContent = textAfterLink; + linkContainer.appendChild(span); + } + } + } + } + + return linkContainer || text; + } + + private onLinkClick(event: IMouseEvent, resource: uri, line: number, column: number = 0): void { + const selection = window.getSelection(); + if (selection.type === 'Range') { + return; // do not navigate when user is selecting + } + + event.preventDefault(); + + this.editorService.openEditor({ + resource, + options: { + selection: { + startLineNumber: line, + startColumn: column + } + } + }, event.ctrlKey || event.metaKey).done(null, errors.onUnexpectedError); + } +} diff --git a/src/vs/workbench/parts/debug/browser/media/breakpointWidget.css b/src/vs/workbench/parts/debug/browser/media/breakpointWidget.css index ad120c2ab7f..8d190b91ca0 100644 --- a/src/vs/workbench/parts/debug/browser/media/breakpointWidget.css +++ b/src/vs/workbench/parts/debug/browser/media/breakpointWidget.css @@ -16,10 +16,6 @@ padding: 0 10px; } -.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .breakpoint-select-container .select-box { - border-color: rgba(128, 128, 128, 0.35); -} - .monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .inputBoxContainer { flex: 1; } diff --git a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css index f66a4e2a48c..7c67f7d14b8 100644 --- a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css +++ b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css @@ -13,6 +13,10 @@ background: rgba(255, 255, 102, 0.45); } +.monaco-editor .debug-top-stack-frame-range { + background: #ffeca0; +} + .monaco-editor .debug-top-stack-frame-column::before { background: url('current-arrow.svg') center center no-repeat; } @@ -21,6 +25,10 @@ background: rgba(206, 231, 206, 0.45); } +.monaco-editor .debug-focused-stack-frame-range { + background: rgba(206, 231, 206, 1); +} + .monaco-editor .debug-breakpoint-hint-glyph { background: url('breakpoint-hint.svg') center center no-repeat; } @@ -177,11 +185,19 @@ background: rgba(122, 189, 122, 0.3); } +.monaco-editor.vs-dark .debug-focused-stack-frame-range { + background: rgba(122, 189, 122, 0.5); +} + .monaco-editor.vs-dark .debug-top-stack-frame-line, .monaco-editor.vs-dark .debug-top-stack-frame-exception-line { background-color: rgba(255, 255, 0, 0.2) } +.monaco-editor.vs-dark .debug-top-stack-frame-range { + background-color: rgba(255, 255, 0, 0.3) +} + .monaco-editor.vs-dark .debug-breakpoint-glyph, .monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-glyph-column::before { background: url('breakpoint-dark.svg') center center no-repeat; diff --git a/src/vs/workbench/parts/debug/browser/media/debugHover.css b/src/vs/workbench/parts/debug/browser/media/debugHover.css index 29707f09e11..a734651beab 100644 --- a/src/vs/workbench/parts/debug/browser/media/debugHover.css +++ b/src/vs/workbench/parts/debug/browser/media/debugHover.css @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ .monaco-editor .debug-hover-widget { - border: 1px solid #CCC; position: absolute; margin-top: -1px; cursor: default; @@ -13,8 +12,6 @@ animation-name: fadeIn; -webkit-user-select: text; word-break: break-all; - background-color: #F3F3F3; - border: 1px solid #CCC; padding: 4px 5px; } @@ -87,12 +84,6 @@ /* Dark theme */ -.monaco-editor.vs-dark .debug-hover-widget, -.monaco-editor.hc-black .debug-hover-widget { - background-color: #2D2D30; - border-color: #555; -} - .monaco-editor.vs-dark .debug-hover-widget .value, .monaco-editor.hc-black .debug-hover-widget .value { color: rgba(204, 204, 204, 0.6); @@ -118,11 +109,6 @@ color: #CE9178; } -.monaco-editor.vs-dark .debug-hover-widget, -.monaco-editor.hc-black .debug-hover-widget { - border-color: #555; -} - .monaco-editor.vs-dark .debugHoverHighlight, .monaco-editor.hc-theme .debugHoverHighlight { background-color: rgba(38, 79, 120, 0.25); diff --git a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css index feff9b7cff6..174bf9f39aa 100644 --- a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css +++ b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css @@ -57,7 +57,6 @@ margin-right: 0.3em; height: 20px; flex-shrink: 1; - border: 1px solid #dddddd; margin-top: 7px; } @@ -65,11 +64,6 @@ border-radius: 4px; } -.vs-dark .monaco-workbench > .part > .title > .title-actions .start-debug-action-item, -.hc-black .monaco-workbench > .part > .title > .title-actions .start-debug-action-item { - border-color: #3c3c3c; -} - .monaco-workbench > .part > .title > .title-actions .start-debug-action-item .icon { height: 20px; width: 20px; @@ -84,15 +78,6 @@ background: url('continue-inverse.svg') center center no-repeat; } -.monaco-workbench > .part > .title > .title-actions .start-debug-action-item .configuration { - border-left: 1px solid #dddddd; -} - -.vs-dark .monaco-workbench > .part > .title > .title-actions .start-debug-action-item .configuration, -.hc-black .monaco-workbench > .part > .title > .title-actions .start-debug-action-item .configuration { - border-color: #3c3c3c; -} - .monaco-workbench .monaco-action-bar .start-debug-action-item .configuration .select-box { border: none; margin-top: 0px; @@ -222,6 +207,10 @@ font-style: italic; } +.debug-viewlet .debug-call-stack .stack-frame.subtle { + font-style: italic; +} + .debug-viewlet .debug-call-stack .stack-frame.label > .file { display: none; } diff --git a/src/vs/workbench/parts/debug/browser/media/exceptionWidget.css b/src/vs/workbench/parts/debug/browser/media/exceptionWidget.css index 5ec6d6305e6..ba5443e0a2c 100644 --- a/src/vs/workbench/parts/debug/browser/media/exceptionWidget.css +++ b/src/vs/workbench/parts/debug/browser/media/exceptionWidget.css @@ -3,6 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +.monaco-editor .zone-widget.exception-widget-container { + overflow: hidden; +} + .monaco-editor .zone-widget .zone-widget-container.exception-widget { padding: 6px 10px; white-space: pre-wrap; @@ -27,6 +31,11 @@ margin-top: 0.5em; } +.monaco-editor .zone-widget .zone-widget-container.exception-widget a { + text-decoration: underline; + cursor: pointer; +} + /* High Contrast Theming */ .monaco-workbench.mac .zone-widget .zone-widget-container.exception-widget { diff --git a/src/vs/workbench/parts/debug/browser/media/repl.css b/src/vs/workbench/parts/debug/browser/media/repl.css index c25e4150f66..9c59952e8e1 100644 --- a/src/vs/workbench/parts/debug/browser/media/repl.css +++ b/src/vs/workbench/parts/debug/browser/media/repl.css @@ -76,6 +76,7 @@ .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row.has-children > .content.input-output-pair:before { top: 8px; + cursor: pointer; } .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row.has-children > .content.input-output-pair:after { @@ -114,21 +115,13 @@ position: absolute; } -.monaco-workbench.windows .repl .repl-input-wrapper:before { - content: '\203A'; /* character does not exist on windows */ - font-size: 30px; - line-height: 12px; +.monaco-workbench .repl .repl-input-wrapper:before { + content: '\276f'; + line-height: 18px; } .monaco-workbench.linux .repl .repl-input-wrapper:before { - content: '\276f'; font-size: 9px; - line-height: 18px; -} - -.monaco-workbench.mac .repl .repl-input-wrapper:before { - content: '\276f'; - line-height: 18px; } /* Actions */ diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index c870954e3e2..310e20a0d22 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as nls from 'vs/nls'; import uri from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import severity from 'vs/base/common/severity'; @@ -36,6 +37,11 @@ export const CONTEXT_VARIABLES_FOCUSED = new RawContextKey('variablesFo export const EDITOR_CONTRIBUTION_ID = 'editor.contrib.debug'; export const DEBUG_SCHEME = 'debug'; +export const INTERNAL_CONSOLE_OPTIONS_SCHEMA = { + enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], + default: 'openOnFirstSessionStart', + description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.") +}; // raw @@ -63,12 +69,16 @@ export interface ITreeElement { getId(): string; } +export interface IReplElement extends ITreeElement { + toString(): string; +} + export interface IExpressionContainer extends ITreeElement { hasChildren: boolean; getChildren(): TPromise; } -export interface IExpression extends ITreeElement, IExpressionContainer { +export interface IExpression extends IReplElement, IExpressionContainer { name: string; value: string; valueChanged?: boolean; @@ -174,9 +184,8 @@ export interface IScope extends IExpressionContainer { export interface IStackFrame extends ITreeElement { thread: IThread; name: string; - lineNumber: number; - column: number; frameId: number; + range: IRange; source: Source; getScopes(): TPromise; getMostSpecificScopes(range: IRange): TPromise; @@ -200,7 +209,9 @@ export interface IRawBreakpoint { export interface IBreakpoint extends IEnablement { uri: uri; lineNumber: number; + endLineNumber?: number; column: number; + endColumn?: number; condition: string; hitCondition: string; verified: boolean; @@ -270,7 +281,7 @@ export interface IModel extends ITreeElement { getFunctionBreakpoints(): IFunctionBreakpoint[]; getExceptionBreakpoints(): IExceptionBreakpoint[]; getWatchExpressions(): IExpression[]; - getReplElements(): ITreeElement[]; + getReplElements(): IReplElement[]; onDidChangeBreakpoints: Event; onDidChangeCallStack: Event; @@ -294,6 +305,7 @@ export interface IDebugConfiguration { openExplorerOnEnd: boolean; inlineValues: boolean; hideActionBar: boolean; + internalConsoleOptions: string; } export interface IGlobalConfig { @@ -308,7 +320,7 @@ export interface IEnvConfig { request: string; internalConsoleOptions?: string; preLaunchTask?: string; - __restart?: boolean; + __restart?: any; debugServer?: number; noDebug?: boolean; port?: number; diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index d1189a6d8ce..4b0a76db320 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -18,14 +18,14 @@ import { ISuggestion } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; import { ITreeElement, IExpression, IExpressionContainer, IProcess, IStackFrame, IExceptionBreakpoint, IBreakpoint, IFunctionBreakpoint, IModel, - IConfig, ISession, IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IRawBreakpoint, IExceptionInfo + IConfig, ISession, IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IRawBreakpoint, IExceptionInfo, IReplElement } from 'vs/workbench/parts/debug/common/debug'; import { Source } from 'vs/workbench/parts/debug/common/debugSource'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; const MAX_REPL_LENGTH = 10000; -export abstract class AbstractOutputElement implements ITreeElement { +export abstract class AbstractOutputElement implements IReplElement { private static ID_COUNTER = 0; constructor(private id = AbstractOutputElement.ID_COUNTER++) { @@ -35,6 +35,8 @@ export abstract class AbstractOutputElement implements ITreeElement { public getId(): string { return `outputelement:${this.id}`; } + + abstract toString(): string; } export class OutputElement extends AbstractOutputElement { @@ -48,6 +50,10 @@ export class OutputElement extends AbstractOutputElement { super(); this.counter = 1; } + + public toString(): string { + return this.value; + } } export class OutputNameValueElement extends AbstractOutputElement implements IExpression { @@ -88,6 +94,10 @@ export class OutputNameValueElement extends AbstractOutputElement implements IEx return TPromise.as(result); } + + public toString(): string { + return `${this.name}: ${this.value}`; + } } export class ExpressionContainer implements IExpressionContainer { @@ -180,7 +190,7 @@ export class ExpressionContainer implements IExpressionContainer { count, filter }).then(response => { - return response && response.body && response.body.variables ? distinct(response.body.variables.filter(v => !!v), v => v.name).map( + return response && response.body && response.body.variables ? distinct(response.body.variables.filter(v => !!v && v.name), v => v.name).map( v => new Variable(this.process, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.type) ) : []; }, (e: Error) => [new Variable(this.process, this, 0, null, e.message, '', 0, 0, null, false)]); @@ -197,6 +207,10 @@ export class ExpressionContainer implements IExpressionContainer { ExpressionContainer.allValues.get(this.getId()) !== Expression.DEFAULT_VALUE && ExpressionContainer.allValues.get(this.getId()) !== value; ExpressionContainer.allValues.set(this.getId(), value); } + + public toString(): string { + return this.value; + } } export class Expression extends ExpressionContainer implements IExpression { @@ -244,21 +258,23 @@ export class Expression extends ExpressionContainer implements IExpression { this.reference = 0; }); } + + public toString(): string { + return `${this.name}\n${this.value}`; + } } export class Variable extends ExpressionContainer implements IExpression { // Used to show the error message coming from the adapter when setting the value #7807 public errorMessage: string; - private static NOT_PROPERTY_SYNTAX = /^[a-zA-Z_][a-zA-Z0-9_]*$/; - private static ARRAY_ELEMENT_SYNTAX = /\[.*\]$/; constructor( process: IProcess, public parent: IExpressionContainer, reference: number, public name: string, - private _evaluateName: string, + public evaluateName: string, value: string, namedVariables: number, indexedVariables: number, @@ -270,35 +286,6 @@ export class Variable extends ExpressionContainer implements IExpression { this.value = value; } - public get evaluateName(): string { - if (this._evaluateName) { - return this._evaluateName; - } - - // TODO@Isidor get rid of this ugly heuristic - let names = [this.name]; - let v = this.parent; - while (v instanceof Variable || v instanceof Expression) { - names.push((v).name); - v = (v).parent; - } - names = names.reverse(); - - let result = null; - names.forEach(name => { - if (!result) { - result = name; - } else if (Variable.ARRAY_ELEMENT_SYNTAX.test(name) || (this.process.configuration.type === 'node' && !Variable.NOT_PROPERTY_SYNTAX.test(name))) { - // use safe way to access node properties a['property_name']. Also handles array elements. - result = name && name.indexOf('[') === 0 ? `${result}${name}` : `${result}['${name}']`; - } else { - result = `${result}.${name}`; - } - }); - - return result; - } - public setVariable(value: string): TPromise { return this.process.session.setVariable({ name: this.name, @@ -316,6 +303,10 @@ export class Variable extends ExpressionContainer implements IExpression { this.errorMessage = err.message; }); } + + public toString(): string { + return `${this.name}: ${this.value}`; + } } export class Scope extends ExpressionContainer implements IScope { @@ -342,8 +333,7 @@ export class StackFrame implements IStackFrame { public frameId: number, public source: Source, public name: string, - public lineNumber: number, - public column: number + public range: IRange ) { this.scopes = null; } @@ -372,8 +362,9 @@ export class StackFrame implements IStackFrame { return scopes; } - return [scopes.filter(scope => scope.range && Range.containsRange(scope.range, range)) - .sort((first, second) => (first.range.endLineNumber - first.range.startLineNumber) - (second.range.endLineNumber - second.range.startLineNumber)).shift()]; + const scopesContainingRange = scopes.filter(scope => scope.range && Range.containsRange(scope.range, range)) + .sort((first, second) => (first.range.endLineNumber - first.range.startLineNumber) - (second.range.endLineNumber - second.range.startLineNumber)); + return scopesContainingRange.length > 0 ? scopesContainingRange.slice(0, 1) : scopes; }); } @@ -382,7 +373,7 @@ export class StackFrame implements IStackFrame { } public toString(): string { - return `${this.name} (${this.source.inMemory ? this.source.name : this.source.uri.fsPath}:${this.lineNumber})`; + return `${this.name} (${this.source.inMemory ? this.source.name : this.source.uri.fsPath}:${this.range.startLineNumber})`; } public openInEditor(editorService: IWorkbenchEditorService, preserveFocus?: boolean, sideBySide?: boolean): TPromise { @@ -392,7 +383,7 @@ export class StackFrame implements IStackFrame { description: this.source.origin, options: { preserveFocus, - selection: { startLineNumber: this.lineNumber, startColumn: 1 }, + selection: { startLineNumber: this.range.startLineNumber, startColumn: 1 }, revealIfVisible: true, revealInCenterIfOutsideViewport: true, pinned: !preserveFocus @@ -402,15 +393,17 @@ export class StackFrame implements IStackFrame { } export class Thread implements IThread { - private promisedCallStack: TPromise; - private cachedCallStack: IStackFrame[]; + private fetchPromise: TPromise; + private callStack: IStackFrame[]; + private staleCallStack: IStackFrame[]; public stoppedDetails: IRawStoppedDetails; public stopped: boolean; constructor(public process: IProcess, public name: string, public threadId: number) { - this.promisedCallStack = null; + this.fetchPromise = null; this.stoppedDetails = null; - this.cachedCallStack = null; + this.callStack = []; + this.staleCallStack = []; this.stopped = false; } @@ -419,43 +412,48 @@ export class Thread implements IThread { } public clearCallStack(): void { - this.promisedCallStack = null; - this.cachedCallStack = null; + this.fetchPromise = null; + if (this.callStack.length) { + this.staleCallStack = this.callStack; + } + this.callStack = []; } public getCallStack(): IStackFrame[] { - return this.cachedCallStack; + return this.callStack; + } + + public getStaleCallStack(): IStackFrame[] { + return this.staleCallStack; } /** - * Queries the debug adapter for the callstack and returns a promise with - * the stack frames of the callstack. + * Queries the debug adapter for the callstack and returns a promise + * which completes once the call stack has been retrieved. * If the thread is not stopped, it returns a promise to an empty array. - * Only gets the first 20 stack frames. Calling this method consecutive times - * with getAdditionalStackFrames = true gets the remainder of the call stack. + * Only fetches the first stack frame for performance reasons. Calling this method consecutive times + * gets the remainder of the call stack. */ - public fetchCallStack(getAdditionalStackFrames = false): TPromise { + public fetchCallStack(): TPromise { if (!this.stopped) { - return TPromise.as([]); + return TPromise.as(null); } - if (!this.promisedCallStack) { - this.promisedCallStack = this.getCallStackImpl(0).then(callStack => { - this.cachedCallStack = callStack; - return callStack; + if (!this.fetchPromise) { + this.fetchPromise = this.getCallStackImpl(0, 1).then(callStack => { + this.callStack = callStack || []; }); - } else if (getAdditionalStackFrames) { - this.promisedCallStack = this.promisedCallStack.then(callStackFirstPart => this.getCallStackImpl(callStackFirstPart.length).then(callStackSecondPart => { - this.cachedCallStack = callStackFirstPart.concat(callStackSecondPart); - return this.cachedCallStack; + } else { + this.fetchPromise = this.fetchPromise.then(() => this.getCallStackImpl(this.callStack.length, 20).then(callStackSecondPart => { + this.callStack = this.callStack.concat(callStackSecondPart); })); } - return this.promisedCallStack; + return this.fetchPromise; } - private getCallStackImpl(startFrame: number): TPromise { - return this.process.session.stackTrace({ threadId: this.threadId, startFrame, levels: 20 }).then(response => { + private getCallStackImpl(startFrame: number, levels: number): TPromise { + return this.process.session.stackTrace({ threadId: this.threadId, startFrame, levels }).then(response => { if (!response || !response.body) { return []; } @@ -474,7 +472,12 @@ export class Thread implements IThread { this.process.sources.set(source.uri.toString(), source); } - return new StackFrame(this, rsf.id, source, rsf.name, rsf.line, rsf.column); + return new StackFrame(this, rsf.id, source, rsf.name, new Range( + rsf.line, + rsf.column, + rsf.endLine, + rsf.endColumn + )); }); }, (err: Error) => { if (this.stoppedDetails) { @@ -668,6 +671,8 @@ export class Breakpoint implements IBreakpoint { public verified: boolean; public idFromAdapter: number; public message: string; + public endLineNumber: number; + public endColumn: number; private id: string; constructor( @@ -677,7 +682,6 @@ export class Breakpoint implements IBreakpoint { public enabled: boolean, public condition: string, public hitCondition: string, - public respectColumn: boolean // TODO@Isidor remove this in March ) { if (enabled === undefined) { this.enabled = true; @@ -732,7 +736,7 @@ export class Model implements IModel { private processes: Process[]; private toDispose: lifecycle.IDisposable[]; - private replElements: ITreeElement[]; + private replElements: IReplElement[]; private _onDidChangeBreakpoints: Emitter; private _onDidChangeCallStack: Emitter; private _onDidChangeWatchExpressions: Emitter; @@ -806,6 +810,12 @@ export class Model implements IModel { } } + public fetchCallStack(thread: IThread): TPromise { + return (thread).fetchCallStack().then(() => { + this._onDidChangeCallStack.fire(); + }); + } + public getBreakpoints(): Breakpoint[] { return this.breakpoints; } @@ -838,8 +848,9 @@ export class Model implements IModel { public addBreakpoints(uri: uri, rawData: IRawBreakpoint[]): void { this.breakpoints = this.breakpoints.concat(rawData.map(rawBp => - new Breakpoint(uri, rawBp.lineNumber, rawBp.column, rawBp.enabled, rawBp.condition, rawBp.hitCondition, true))); + new Breakpoint(uri, rawBp.lineNumber, rawBp.column, rawBp.enabled, rawBp.condition, rawBp.hitCondition))); this.breakpointsActivated = true; + this.breakpoints = distinct(this.breakpoints, bp => `${bp.uri.toString()}:${bp.lineNumber}:${bp.column}`); this._onDidChangeBreakpoints.fire(); } @@ -853,12 +864,15 @@ export class Model implements IModel { const bpData = data[bp.getId()]; if (bpData) { bp.lineNumber = bpData.line ? bpData.line : bp.lineNumber; + bp.endLineNumber = bpData.endLine; bp.column = bpData.column; + bp.endColumn = bpData.endColumn; bp.verified = bpData.verified; bp.idFromAdapter = bpData.id; bp.message = bpData.message; } }); + this.breakpoints = distinct(this.breakpoints, bp => `${bp.uri.toString()}:${bp.lineNumber}:${bp.column}`); this._onDidChangeBreakpoints.fire(); } @@ -910,7 +924,7 @@ export class Model implements IModel { this._onDidChangeBreakpoints.fire(); } - public getReplElements(): ITreeElement[] { + public getReplElements(): IReplElement[] { return this.replElements; } @@ -947,7 +961,7 @@ export class Model implements IModel { this._onDidChangeREPLElements.fire(); } - private addReplElements(newElements: ITreeElement[]): void { + private addReplElements(newElements: IReplElement[]): void { this.replElements.push(...newElements); if (this.replElements.length > MAX_REPL_LENGTH) { this.replElements.splice(0, this.replElements.length - MAX_REPL_LENGTH); diff --git a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts index 5f1345593d9..a8ec4386a55 100644 --- a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts +++ b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts @@ -121,8 +121,10 @@ declare module DebugProtocol { export interface TerminatedEvent extends Event { // event: 'terminated'; body?: { - /** A debug adapter may set 'restart' to true to request that the front end restarts the session. */ - restart?: boolean; + /** A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session. + The value is not interpreted by the client and passed unmodified as an attribute '__restart' to the launchRequest. + */ + restart?: any; }; } @@ -1121,8 +1123,8 @@ declare module DebugProtocol { endColumn?: number; /** The module associated with this frame, if any. */ moduleId?: number | string; - /** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. */ - presentationHint?: 'normal' | 'label'; + /** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. */ + presentationHint?: 'normal' | 'label' | 'subtle'; } /** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. */ diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 9baa6c91210..22c7191e517 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -18,7 +18,7 @@ import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelD import { DebugViewRegistry } from 'vs/workbench/parts/debug/browser/debugViewRegistry'; import { VariablesView, WatchExpressionsView, CallStackView, BreakpointsView } from 'vs/workbench/parts/debug/electron-browser/debugViews'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; -import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA } from 'vs/workbench/parts/debug/common/debug'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { DebugEditorModelManager } from 'vs/workbench/parts/debug/browser/debugEditorModelManager'; @@ -172,6 +172,7 @@ configurationRegistry.registerConfiguration({ description: nls.localize({ comment: ['This is the description for a setting'], key: 'hideActionBar' }, "Controls if the floating debug action bar should be hidden"), default: false }, + 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, 'launch': { type: 'object', description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"), diff --git a/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts b/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts index 9138126104f..ec6a8673d4f 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as nls from 'vs/nls'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; +import { TPromise } from 'vs/base/common/winjs.base'; import severity from 'vs/base/common/severity'; import { List } from 'vs/base/browser/ui/list/listWidget'; import * as errors from 'vs/base/common/errors'; @@ -11,6 +13,8 @@ import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IListService } from 'vs/platform/list/browser/listService'; +import { IMessageService } from 'vs/platform/message/common/message'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IDebugService, IConfig, IEnablement, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED, EDITOR_CONTRIBUTION_ID, IDebugEditorContribution } from 'vs/workbench/parts/debug/common/debug'; import { Expression, Variable, Breakpoint, FunctionBreakpoint } from 'vs/workbench/parts/debug/common/debugModel'; import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; @@ -195,6 +199,11 @@ export function registerCommands(): void { primary: undefined, handler: (accessor) => { const manager = accessor.get(IDebugService).getConfigurationManager(); + if (!accessor.get(IWorkspaceContextService).getWorkspace()) { + accessor.get(IMessageService).show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration.")); + return TPromise.as(null); + } + return manager.openConfigFile(false).done(editor => { if (editor) { const codeEditor = editor.getControl(); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index 16926ebfc58..35091fbd8b7 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -311,7 +311,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { return null; } - return config.configurations.filter(config => config && config.name === name).pop(); + return config.configurations.filter(config => config && config.name === name).shift(); } public resloveConfiguration(config: debug.IConfig): TPromise { @@ -409,7 +409,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { } } - return this.quickOpenService.pick([...this.adapters.filter(a => a.hasInitialConfiguration()), { label: 'More...' }], { placeHolder: nls.localize('selectDebug', "Select Environment") }) + return this.quickOpenService.pick([...this.adapters.filter(a => a.hasInitialConfiguration()), { label: 'More...', separator: { border: true } }], { placeHolder: nls.localize('selectDebug', "Select Environment") }) .then(picked => { if (picked instanceof Adapter) { return picked; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index 71db8f69118..95e12911dcf 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -19,7 +19,7 @@ import { StandardTokenType } from 'vs/editor/common/modes'; import { DEFAULT_WORD_REGEXP } from 'vs/editor/common/model/wordHelper'; import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; -import { IDecorationOptions, IModelDecorationOptions, IModelDeltaDecoration, TrackedRangeStickiness, Handler } from 'vs/editor/common/editorCommon'; +import { IDecorationOptions, IModelDecorationOptions, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/editorCommon'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { Range } from 'vs/editor/common/core/range'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -37,6 +37,7 @@ import { FloatingClickWidget } from 'vs/workbench/parts/preferences/browser/pref import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; const HOVER_DELAY = 300; const LAUNCH_JSON_REGEX = /launch\.json$/; @@ -368,8 +369,8 @@ export class DebugEditorContribution implements IDebugEditorContribution { this.closeExceptionWidget(); } else if (sameUri) { focusedSf.thread.exceptionInfo.then(exceptionInfo => { - if (exceptionInfo && exceptionSf.lineNumber && exceptionSf.column) { - this.showExceptionWidget(exceptionInfo, exceptionSf.lineNumber, exceptionSf.column); + if (exceptionInfo && exceptionSf.range.startLineNumber && exceptionSf.range.startColumn) { + this.showExceptionWidget(exceptionInfo, exceptionSf.range.startLineNumber, exceptionSf.range.startColumn); } }); } @@ -434,7 +435,7 @@ export class DebugEditorContribution implements IDebugEditorContribution { // Check if there are more characters on a line after a "configurations": [, if yes enter a newline if (this.editor.getModel().getLineLastNonWhitespaceColumn(position.lineNumber) > position.column) { this.editor.setPosition(position); - this.editor.trigger(this.getId(), Handler.LineBreakInsert, undefined); + CoreEditingCommands.LineBreakInsert.runEditorCommand(null, this.editor, null); } // Check if there is already an empty line to insert suggest, if yes just place the cursor if (this.editor.getModel().getLineLastNonWhitespaceColumn(position.lineNumber + 1) === 0) { @@ -467,11 +468,11 @@ export class DebugEditorContribution implements IDebugEditorContribution { this.removeInlineValuesScheduler.cancel(); - stackFrame.getMostSpecificScopes(new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, stackFrame.column)) + stackFrame.getMostSpecificScopes(stackFrame.range) // Get all top level children in the scope chain .then(scopes => TPromise.join(scopes.map(scope => scope.getChildren() .then(children => { - let range = new Range(0, 0, stackFrame.lineNumber, stackFrame.column); + let range = new Range(0, 0, stackFrame.range.startLineNumber, stackFrame.range.startColumn); if (scope.range) { range = range.setStartPosition(scope.range.startLineNumber, scope.range.startColumn); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts index c4f703de4e9..ce54f235ae5 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts @@ -21,8 +21,9 @@ import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/p import { Expression } from 'vs/workbench/parts/debug/common/debugModel'; import { VariablesRenderer, renderExpressionValue, VariablesDataSource } from 'vs/workbench/parts/debug/electron-browser/debugViewer'; import { IListService } from 'vs/platform/list/browser/listService'; -import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { attachListStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; const MAX_ELEMENTS_SHOWN = 18; @@ -88,6 +89,14 @@ export class DebugHoverWidget implements IContentWidget { this.toDispose.push(attachListStyler(this.tree, this.themeService)); this.toDispose.push(this.listService.register(this.tree)); + this.toDispose.push(attachStylerCallback(this.themeService, { editorHoverBackground, editorHoverBorder }, colors => { + this.domNode.style.backgroundColor = colors.editorHoverBackground; + if (colors.editorHoverBorder) { + this.domNode.style.border = `1px solid ${colors.editorHoverBorder}`; + } else { + this.domNode.style.border = null; + } + })); } private registerListeners(): void { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 359b940f29d..c54ba326fb5 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -7,6 +7,7 @@ import * as nls from 'vs/nls'; import * as lifecycle from 'vs/base/common/lifecycle'; import Event, { Emitter } from 'vs/base/common/event'; import * as paths from 'vs/base/common/paths'; +import { RunOnceScheduler } from 'vs/base/common/async'; import * as strings from 'vs/base/common/strings'; import { generateUuid } from 'vs/base/common/uuid'; import uri from 'vs/base/common/uri'; @@ -79,6 +80,7 @@ export class DebugService implements debug.IDebugService { private debugType: IContextKey; private debugState: IContextKey; private breakpointsToSendOnResourceSaved: Set; + private callStackScheduler: RunOnceScheduler; constructor( @IStorageService private storageService: IStorageService, @@ -117,6 +119,17 @@ export class DebugService implements debug.IDebugService { this.loadExceptionBreakpoints(), this.loadWatchExpressions()); this.toDispose.push(this.model); this.viewModel = new ViewModel(this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE, null)); + this.callStackScheduler = new RunOnceScheduler(() => { + const focusedThread = this.viewModel.focusedThread; + if (focusedThread) { + const callStack = focusedThread.getCallStack(); + // Some adapters might not respect the number levels in StackTraceRequest and might + // return more stackFrames than requested. For those do not send an additional stackTrace request. + if (callStack.length <= 1) { + this.model.fetchCallStack(focusedThread).done(undefined, errors.onUnexpectedError); + } + } + }, 420); this.registerListeners(lifecycleService); } @@ -291,13 +304,17 @@ export class DebugService implements debug.IDebugService { const thread = process && process.getThread(threadId); if (thread) { - thread.fetchCallStack().then(callStack => { + // Call fetch call stack twice, the first only return the top stack frame. + // Second retrieves the rest of the call stack. For performance reasons #25605 + this.model.fetchCallStack(thread).then(() => { + const callStack = thread.getCallStack(); + this.callStackScheduler.schedule(); if (callStack.length > 0 && !this.viewModel.focusedStackFrame) { // focus first stack frame from top that has source location if no other stack frame is focussed const stackFrameToFocus = first(callStack, sf => sf.source && sf.source.available, callStack[0]); this.focusStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError); this.windowService.getWindow().focus(); - aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", event.body.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.lineNumber)); + aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", event.body.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.range.startLineNumber)); return stackFrameToFocus.openInEditor(this.editorService); } @@ -318,8 +335,8 @@ export class DebugService implements debug.IDebugService { this.toDisposeOnSessionEnd.get(session.getId()).push(session.onDidTerminateDebugee(event => { aria.status(nls.localize('debuggingStopped', "Debugging stopped.")); if (session && session.getId() === event.body.sessionId) { - if (event.body && typeof event.body.restart === 'boolean' && event.body.restart && process) { - this.restartProcess(process, true).done(null, err => this.messageService.show(severity.Error, err.message)); + if (event.body && event.body.restart && process) { + this.restartProcess(process, event.body.restart).done(null, err => this.messageService.show(severity.Error, err.message)); } else { session.disconnect().done(null, errors.onUnexpectedError); } @@ -407,7 +424,7 @@ export class DebugService implements debug.IDebugService { let result: Breakpoint[]; try { result = JSON.parse(this.storageService.get(DEBUG_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((breakpoint: any) => { - return new Breakpoint(uri.parse(breakpoint.uri.external || breakpoint.source.uri.external), breakpoint.lineNumber, breakpoint.respectColumn ? breakpoint.column : undefined, breakpoint.enabled, breakpoint.condition, breakpoint.hitCondition, breakpoint.respectColumn); + return new Breakpoint(uri.parse(breakpoint.uri.external || breakpoint.source.uri.external), breakpoint.lineNumber, breakpoint.column, breakpoint.enabled, breakpoint.condition, breakpoint.hitCondition); }); } catch (e) { } @@ -453,7 +470,7 @@ export class DebugService implements debug.IDebugService { return debug.State.Stopped; } const focusedProcess = this.viewModel.focusedProcess; - if (focusedProcess) { + if (focusedProcess && this.sessionStates.has(focusedProcess.getId())) { return this.sessionStates.get(focusedProcess.getId()); } if (this.sessionStates.size > 0) { @@ -765,7 +782,9 @@ export class DebugService implements debug.IDebugService { if (!this.viewModel.focusedProcess) { this.focusStackFrameAndEvaluate(null, process); } - if (configuration.internalConsoleOptions === 'openOnSessionStart' || (!this.viewModel.changedWorkbenchViewState && configuration.internalConsoleOptions !== 'neverOpen')) { + + const internalConsoleOptions = configuration.internalConsoleOptions || this.configurationService.getConfiguration('debug').internalConsoleOptions; + if (internalConsoleOptions === 'openOnSessionStart' || (!this.viewModel.changedWorkbenchViewState && internalConsoleOptions === 'openOnFirstSessionStart')) { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } @@ -872,7 +891,7 @@ export class DebugService implements debug.IDebugService { this.model.deemphasizeSource(uri); } - public restartProcess(process: debug.IProcess, internalRestart?: boolean): TPromise { + public restartProcess(process: debug.IProcess, restartData?: any): TPromise { if (process.session.capabilities.supportsRestartRequest) { return process.session.custom('restart', null); } @@ -888,7 +907,7 @@ export class DebugService implements debug.IDebugService { // Take the type from the process since the debug extension might overwrite it #21316 config.type = process.configuration.type; config.noDebug = process.configuration.noDebug; - config.__restart = internalRestart; + config.__restart = restartData; } this.createProcess(config || process.configuration).then(() => c(null), err => e(err)); }, 300); @@ -941,9 +960,9 @@ export class DebugService implements debug.IDebugService { if (this.model.getProcesses().length === 0) { // set breakpoints back to unverified since the session ended. - const data: { [id: string]: { line: number, verified: boolean, column: number } } = {}; + const data: { [id: string]: { line: number, verified: boolean, column: number, endLine: number, endColumn: number } } = {}; this.model.getBreakpoints().forEach(bp => { - data[bp.getId()] = { line: bp.lineNumber, verified: false, column: bp.column }; + data[bp.getId()] = { line: bp.lineNumber, verified: false, column: bp.column, endLine: bp.endLineNumber, endColumn: bp.endColumn }; }); this.model.updateBreakpoints(data); @@ -1004,7 +1023,7 @@ export class DebugService implements debug.IDebugService { return; } - const data: { [id: string]: { line?: number, column?: number, verified: boolean } } = {}; + const data: { [id: string]: DebugProtocol.Breakpoint } = {}; for (let i = 0; i < breakpointsToSend.length; i++) { data[breakpointsToSend[i].getId()] = response.body.breakpoints[i]; if (!breakpointsToSend[i].column) { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index 190059b707c..ea989342bbb 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -271,7 +271,7 @@ export class CallStackController extends BaseDebugController { const process = this.debugService.getModel().getProcesses().filter(p => p.getId() === threadAndProcessIds.processId).pop(); const thread = process && process.getThread(threadAndProcessIds.threadId); if (thread) { - (thread).fetchCallStack(true) + (thread).fetchCallStack() .done(() => tree.refresh(), errors.onUnexpectedError); } @@ -351,7 +351,7 @@ export class CallStackDataSource implements IDataSource { public getChildren(tree: ITree, element: any): TPromise { if (element instanceof Thread) { - return this.getThreadChildren(element); + return TPromise.as(this.getThreadChildren(element)); } if (element instanceof Model) { return TPromise.as(element.getProcesses()); @@ -361,17 +361,25 @@ export class CallStackDataSource implements IDataSource { return TPromise.as(process.getAllThreads()); } - private getThreadChildren(thread: Thread): TPromise { - return thread.fetchCallStack().then((callStack: any[]) => { - if (thread.stoppedDetails && thread.stoppedDetails.framesErrorMessage) { - return callStack.concat([thread.stoppedDetails.framesErrorMessage]); - } - if (thread.stoppedDetails && thread.stoppedDetails.totalFrames > callStack.length) { - return callStack.concat([new ThreadAndProcessIds(thread.process.getId(), thread.threadId)]); - } + private getThreadChildren(thread: Thread): any[] { + const callStack: any[] = thread.getCallStack(); + if (!callStack) { + return []; + } + if (callStack.length === 1) { + // To reduce flashing of the call stack view simply append the stale call stack + // once we have the correct data the tree will refresh and we will no longer display it. + return callStack.concat(thread.getStaleCallStack().slice(1)); + } - return callStack; - }); + if (thread.stoppedDetails && thread.stoppedDetails.framesErrorMessage) { + return callStack.concat([thread.stoppedDetails.framesErrorMessage]); + } + if (thread.stoppedDetails && thread.stoppedDetails.totalFrames > callStack.length && callStack.length > 1) { + return callStack.concat([new ThreadAndProcessIds(thread.process.getId(), thread.threadId)]); + } + + return callStack; } public getParent(tree: ITree, element: any): TPromise { @@ -529,8 +537,10 @@ export class CallStackRenderer implements IRenderer { } private renderStackFrame(stackFrame: debug.IStackFrame, data: IStackFrameTemplateData): void { - stackFrame.source.presenationHint === 'deemphasize' ? dom.addClass(data.stackFrame, 'disabled') : dom.removeClass(data.stackFrame, 'disabled'); - stackFrame.source.presenationHint === 'label' ? dom.addClass(data.stackFrame, 'label') : dom.removeClass(data.stackFrame, 'label'); + dom.toggleClass(data.stackFrame, 'disabled', stackFrame.source.presenationHint === 'deemphasize'); + dom.toggleClass(data.stackFrame, 'label', stackFrame.source.presenationHint === 'label'); + dom.toggleClass(data.stackFrame, 'subtle', stackFrame.source.presenationHint === 'subtle'); + data.file.title = stackFrame.source.raw.path || stackFrame.source.name; if (stackFrame.source.raw.origin) { data.file.title += `\n${stackFrame.source.raw.origin}`; @@ -538,8 +548,11 @@ export class CallStackRenderer implements IRenderer { data.label.textContent = stackFrame.name; data.label.title = stackFrame.name; data.fileName.textContent = getSourceName(stackFrame.source, this.contextService); - if (stackFrame.lineNumber !== undefined) { - data.lineNumber.textContent = `${stackFrame.lineNumber}`; + if (stackFrame.range.startLineNumber !== undefined) { + data.lineNumber.textContent = `${stackFrame.range.startLineNumber}`; + if (stackFrame.range.startColumn) { + data.lineNumber.textContent += `:${stackFrame.range.startColumn}`; + } dom.removeClass(data.lineNumber, 'unavailable'); } else { dom.addClass(data.lineNumber, 'unavailable'); @@ -562,7 +575,7 @@ export class CallstackAccessibilityProvider implements IAccessibilityProvider { return nls.localize('threadAriaLabel', "Thread {0}, callstack, debug", (element).name); } if (element instanceof StackFrame) { - return nls.localize('stackFrameAriaLabel', "Stack Frame {0} line {1} {2}, callstack, debug", (element).name, (element).lineNumber, getSourceName((element).source, this.contextService)); + return nls.localize('stackFrameAriaLabel', "Stack Frame {0} line {1} {2}, callstack, debug", (element).name, (element).range.startLineNumber, getSourceName((element).source, this.contextService)); } return null; @@ -586,7 +599,8 @@ export class VariablesActionProvider implements IActionProvider { } public hasSecondaryActions(tree: ITree, element: any): boolean { - return element instanceof Variable; + // Only show context menu on "real" variables. Not on array chunk nodes. + return element instanceof Variable && !!element.value; } public getSecondaryActions(tree: ITree, element: any): TPromise { @@ -1249,11 +1263,21 @@ export class BreakpointsController extends BaseDebugController { public openBreakpointSource(breakpoint: Breakpoint, event: IKeyboardEvent | IMouseEvent, preserveFocus: boolean): void { const sideBySide = (event && (event.ctrlKey || event.metaKey)); + const selection = breakpoint.endLineNumber ? { + startLineNumber: breakpoint.lineNumber, + endLineNumber: breakpoint.endLineNumber, + startColumn: breakpoint.column, + endColumn: breakpoint.endColumn + } : { + startLineNumber: breakpoint.lineNumber, + startColumn: 1 + }; + this.editorService.openEditor({ resource: breakpoint.uri, options: { preserveFocus, - selection: { startLineNumber: breakpoint.lineNumber, startColumn: 1 }, + selection, revealIfVisible: true, revealInCenterIfOutsideViewport: true, pinned: !preserveFocus diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts index cf22f4dcaee..f70b82840e5 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts @@ -12,7 +12,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as errors from 'vs/base/common/errors'; import { EventType } from 'vs/base/common/events'; import { IActionRunner, IAction } from 'vs/base/common/actions'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { IHighlightEvent, ITree } from 'vs/base/parts/tree/browser/tree'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; @@ -80,7 +80,7 @@ export class VariablesView extends CollapsibleViewletView { } return undefined; }).done(null, errors.onUnexpectedError); - }, 700); + }, 400); } public renderHeader(container: HTMLElement): void { @@ -116,11 +116,11 @@ export class VariablesView extends CollapsibleViewletView { this.toolBar.setActions(prepareActions([collapseAction]))(); this.toDispose.push(viewModel.onDidFocusStackFrame(sf => { - // Only delay if the stack frames got cleared and there is no active stack frame - // Otherwise just update immediately - if (sf) { + // Refresh the tree immediatly if it is not visible. + // Otherwise postpone the refresh until user stops stepping. + if (!this.tree.getContentHeight()) { this.onFocusStackFrameScheduler.schedule(0); - } else if (!this.onFocusStackFrameScheduler.isScheduled()) { + } else { this.onFocusStackFrameScheduler.schedule(); } })); @@ -447,6 +447,9 @@ export class BreakpointsView extends AdaptiveCollapsibleViewletView { if (first.uri.toString() !== second.uri.toString()) { return paths.basename(first.uri.fsPath).localeCompare(paths.basename(second.uri.fsPath)); } + if (first.lineNumber === second.lineNumber) { + return first.column - second.column; + } return first.lineNumber - second.lineNumber; } diff --git a/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts b/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts index d67bdc446e5..aef048ce10f 100644 --- a/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts +++ b/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts @@ -6,9 +6,10 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import { TPromise } from 'vs/base/common/winjs.base'; -import { clipboard } from 'electron'; +import { ITree } from 'vs/base/parts/tree/browser/tree'; import { Variable } from 'vs/workbench/parts/debug/common/debugModel'; import { IDebugService, IStackFrame } from 'vs/workbench/parts/debug/common/debug'; +import { clipboard } from 'electron'; export class CopyValueAction extends Action { static ID = 'workbench.debug.viewlet.action.copyValue'; @@ -42,6 +43,30 @@ export class CopyAction extends Action { } } +export class CopyAllAction extends Action { + static ID = 'workbench.debug.action.copyAll'; + static LABEL = nls.localize('copyAll', "Copy All"); + + constructor(id: string, label: string, private tree: ITree) { + super(id, label); + } + + public run(): TPromise { + let text = ''; + const navigator = this.tree.getNavigator(); + // skip first navigator element - the root node + while (navigator.next()) { + if (text) { + text += `\n`; + } + text += navigator.current().toString(); + } + + clipboard.writeText(text); + return TPromise.as(null); + } +} + export class CopyStackTraceAction extends Action { static ID = 'workbench.action.debug.copyStackTrace'; static LABEL = nls.localize('copyStackTrace', "Copy Call Stack"); diff --git a/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts b/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts index f0d9a852f02..0df197051a3 100644 --- a/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts +++ b/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts @@ -79,7 +79,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession { super(id); this.emittedStopped = false; this.readyForBreakpoints = false; - this.allThreadsContinued = false; + this.allThreadsContinued = true; this.sentPromises = []; this._onDidInitialize = new Emitter(); diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index f473819c540..06e263aff1d 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -38,11 +38,11 @@ import * as debug from 'vs/workbench/parts/debug/common/debug'; import { ClearReplAction } from 'vs/workbench/parts/debug/browser/debugActions'; import { ReplHistory } from 'vs/workbench/parts/debug/common/replHistory'; import { Panel } from 'vs/workbench/browser/panel'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IListService } from 'vs/platform/list/browser/listService'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; const $ = dom.$; @@ -89,7 +89,7 @@ export class Repl extends Panel implements IPrivateReplService { @IInstantiationService private instantiationService: IInstantiationService, @IStorageService private storageService: IStorageService, @IPanelService private panelService: IPanelService, - @IWorkbenchThemeService protected themeService: IWorkbenchThemeService, + @IThemeService protected themeService: IThemeService, @IModelService private modelService: IModelService, @IContextKeyService private contextKeyService: IContextKeyService, @IListService private listService: IListService @@ -105,7 +105,6 @@ export class Repl extends Panel implements IPrivateReplService { this.toDispose.push(this.debugService.getModel().onDidChangeReplElements(() => { this.refreshReplElements(this.debugService.getModel().getReplElements().length === 0); })); - this.toDispose.push(this.themeService.onDidColorThemeChange(e => this.replInput.updateOptions(this.getReplInputOptions()))); // TODO@theme this should be done from the editor itself and not from the outside this.toDispose.push(this.panelService.onDidPanelOpen(panel => this.refreshReplElements(true))); } @@ -280,9 +279,12 @@ export class Repl extends Panel implements IPrivateReplService { }, lineDecorationsWidth: 0, scrollBeyondLastLine: false, - theme: this.themeService.getColorTheme().id, renderLineHighlight: 'none', - fixedOverflowWidgets: true + fixedOverflowWidgets: true, + acceptSuggestionOnEnter: 'smart', + minimap: { + enabled: false + } }; } diff --git a/src/vs/workbench/parts/debug/electron-browser/replEditor.ts b/src/vs/workbench/parts/debug/electron-browser/replEditor.ts index 3e607802ab3..dfa70d783bd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replEditor.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replEditor.ts @@ -17,8 +17,9 @@ import { MenuPreventer } from 'vs/editor/contrib/multicursor/browser/menuPrevent import { SelectionClipboard } from 'vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard'; import { ContextMenuController } from 'vs/editor/contrib/contextmenu/browser/contextmenu'; import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { TabCompletionController } from 'vs/workbench/parts/snippets/electron-browser/tabCompletion'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; export class ReplInputEditor extends CodeEditorWidget { constructor( @@ -27,9 +28,10 @@ export class ReplInputEditor extends CodeEditorWidget { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IContextKeyService contextKeyService: IContextKeyService + @IContextKeyService contextKeyService: IContextKeyService, + @IThemeService themeService: IThemeService ) { - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, themeService); } protected _getContributions(): IEditorContributionCtor[] { @@ -38,7 +40,7 @@ export class ReplInputEditor extends CodeEditorWidget { SelectionClipboard, ContextMenuController, SuggestController, - SnippetController, + SnippetController2, TabCompletionController, ]; } diff --git a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts index 361bd48ec99..ad21d8b752a 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts @@ -7,22 +7,20 @@ import * as nls from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; import { IAction } from 'vs/base/common/actions'; import { isFullWidthCharacter, removeAnsiEscapeCodes, endsWith } from 'vs/base/common/strings'; -import uri from 'vs/base/common/uri'; -import { isMacintosh } from 'vs/base/common/platform'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import * as dom from 'vs/base/browser/dom'; -import * as errors from 'vs/base/common/errors'; import severity from 'vs/base/common/severity'; -import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent'; +import { IMouseEvent } from 'vs/base/browser/mouseEvent'; import { ITree, IAccessibilityProvider, IDataSource, IRenderer, IActionProvider } from 'vs/base/parts/tree/browser/tree'; import { ICancelableEvent } from 'vs/base/parts/tree/browser/treeDefaults'; import { IExpressionContainer, IExpression } from 'vs/workbench/parts/debug/common/debug'; import { Model, OutputNameValueElement, Expression, OutputElement, Variable } from 'vs/workbench/parts/debug/common/debugModel'; import { renderVariable, renderExpressionValue, IVariableTemplateData, BaseDebugController } from 'vs/workbench/parts/debug/electron-browser/debugViewer'; import { ClearReplAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { CopyAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; +import { CopyAction, CopyAllAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; const $ = dom.$; @@ -83,25 +81,18 @@ export class ReplExpressionsRenderer implements IRenderer { private static VALUE_OUTPUT_TEMPLATE_ID = 'outputValue'; private static NAME_VALUE_OUTPUT_TEMPLATE_ID = 'outputNameValue'; - private static FILE_LOCATION_PATTERNS: RegExp[] = [ - // group 0: the full thing :) - // group 1: absolute path - // group 2: drive letter on windows with trailing backslash or leading slash on mac/linux - // group 3: line number - // group 4: column number - // eg: at Context. (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11) - /((\/|[a-zA-Z]:\\)[^\(\)<>\'\"\[\]]+):(\d+):(\d+)/ - ]; - private static LINE_HEIGHT_PX = 18; private width: number; private characterWidth: number; + private linkDetector: LinkDetector; + constructor( - @IWorkbenchEditorService private editorService: IWorkbenchEditorService + @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + @IInstantiationService private instantiationService: IInstantiationService ) { - // noop + this.linkDetector = this.instantiationService.createInstance(LinkDetector); } public getHeight(tree: ITree, element: any): number { @@ -330,7 +321,7 @@ export class ReplExpressionsRenderer implements IRenderer { // flush text buffer if we have any if (buffer) { - this.insert(this.handleLinks(buffer), currentToken || tokensContainer); + this.insert(this.linkDetector.handleLinks(buffer), currentToken || tokensContainer); buffer = ''; } @@ -350,7 +341,7 @@ export class ReplExpressionsRenderer implements IRenderer { // flush remaining text buffer if we have any if (buffer) { - let res = this.handleLinks(buffer); + let res = this.linkDetector.handleLinks(buffer); if (typeof res !== 'string' || currentToken) { if (!tokensContainer) { tokensContainer = document.createElement('span'); @@ -371,67 +362,6 @@ export class ReplExpressionsRenderer implements IRenderer { } } - private handleLinks(text: string): HTMLElement | string { - let linkContainer: HTMLElement; - - for (let pattern of ReplExpressionsRenderer.FILE_LOCATION_PATTERNS) { - pattern.lastIndex = 0; // the holy grail of software development - - const match = pattern.exec(text); - let resource: uri = null; - try { - resource = match && uri.file(match[1]); - } catch (e) { } - - if (resource) { - linkContainer = document.createElement('span'); - - let textBeforeLink = text.substr(0, match.index); - if (textBeforeLink) { - let span = document.createElement('span'); - span.textContent = textBeforeLink; - linkContainer.appendChild(span); - } - - const link = document.createElement('a'); - link.textContent = text.substr(match.index, match[0].length); - link.title = isMacintosh ? nls.localize('fileLinkMac', "Click to follow (Cmd + click opens to the side)") : nls.localize('fileLink', "Click to follow (Ctrl + click opens to the side)"); - linkContainer.appendChild(link); - link.onclick = (e) => this.onLinkClick(new StandardMouseEvent(e), resource, Number(match[3]), Number(match[4])); - - let textAfterLink = text.substr(match.index + match[0].length); - if (textAfterLink) { - let span = document.createElement('span'); - span.textContent = textAfterLink; - linkContainer.appendChild(span); - } - - break; // support one link per line for now - } - } - - return linkContainer || text; - } - - private onLinkClick(event: IMouseEvent, resource: uri, line: number, column: number): void { - const selection = window.getSelection(); - if (selection.type === 'Range') { - return; // do not navigate when user is selecting - } - - event.preventDefault(); - - this.editorService.openEditor({ - resource, - options: { - selection: { - startLineNumber: line, - startColumn: column - } - } - }, event.ctrlKey || event.metaKey).done(null, errors.onUnexpectedError); - } - public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { // noop } @@ -478,6 +408,7 @@ export class ReplExpressionsActionProvider implements IActionProvider { public getSecondaryActions(tree: ITree, element: any): TPromise { const actions: IAction[] = []; actions.push(new CopyAction(CopyAction.ID, CopyAction.LABEL)); + actions.push(new CopyAllAction(CopyAllAction.ID, CopyAllAction.LABEL, tree)); actions.push(this.instantiationService.createInstance(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL)); return TPromise.as(actions); diff --git a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts index ff87ebc629e..78ba083f9a0 100644 --- a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts +++ b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts @@ -3,14 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { localize } from 'vs/nls'; import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { IDebugService, State } from 'vs/workbench/parts/debug/common/debug'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_BACKGROUND, Themable } from 'vs/workbench/common/theme'; +import { STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_BACKGROUND, Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme'; +import { addClass, removeClass } from 'vs/base/browser/dom'; // colors for theming @@ -20,6 +21,12 @@ export const STATUS_BAR_DEBUGGING_BACKGROUND = registerColor('statusBar.debuggin hc: '#CC6633' }, localize('statusBarDebuggingBackground', "Status bar background color when a program is being debugged. The status bar is shown in the bottom of the window")); +export const STATUS_BAR_DEBUGGING_FOREGROUND = registerColor('statusBar.debuggingForeground', { + dark: STATUS_BAR_FOREGROUND, + light: STATUS_BAR_FOREGROUND, + hc: STATUS_BAR_FOREGROUND +}, localize('statusBarDebuggingForeground', "Status bar foreground color when a program is being debugged. The status bar is shown in the bottom of the window")); + export class StatusBarColorProvider extends Themable implements IWorkbenchContribution { private static ID = 'debug.statusbarColorProvider'; @@ -45,25 +52,42 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri protected updateStyles(): void { super.updateStyles(); - if (this.partService.isVisible(Parts.STATUSBAR_PART)) { - const container = this.partService.getContainer(Parts.STATUSBAR_PART); - container.style.backgroundColor = this.getColor(this.getBackgroundColorKey()); + const container = this.partService.getContainer(Parts.STATUSBAR_PART); + if (this.isDebugging()) { + addClass(container, 'debugging'); + } else { + removeClass(container, 'debugging'); } + + container.style.backgroundColor = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_DEBUGGING_BACKGROUND, STATUS_BAR_BACKGROUND)); + container.style.color = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_DEBUGGING_FOREGROUND, STATUS_BAR_FOREGROUND)); } - private getBackgroundColorKey(): string { + private getColorKey(noFolderColor: string, debuggingColor: string, normalColor: string): string { - // no debugging - if (this.debugService.state === State.Inactive || this.isRunningWithoutDebug()) { + // Not debugging + if (!this.isDebugging()) { if (this.contextService.hasWorkspace()) { - return STATUS_BAR_BACKGROUND; + return normalColor; } - return STATUS_BAR_NO_FOLDER_BACKGROUND; + return noFolderColor; } - // debugging - return STATUS_BAR_DEBUGGING_BACKGROUND; + // Debugging + return debuggingColor; + } + + private isDebugging(): boolean { + if (this.debugService.state === State.Inactive) { + return false; + } + + if (this.isRunningWithoutDebug()) { + return false; + } + + return true; } private isRunningWithoutDebug(): boolean { @@ -75,4 +99,11 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri public getId(): string { return StatusBarColorProvider.ID; } -} \ No newline at end of file +} + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + const statusBarItemDebuggingForeground = theme.getColor(STATUS_BAR_DEBUGGING_FOREGROUND); + if (statusBarItemDebuggingForeground) { + collector.addRule(`.monaco-workbench > .part.statusbar.debugging > .statusbar-item .mask-icon { background-color: ${statusBarItemDebuggingForeground} !important; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index 6926d85d529..4deae35b1b0 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -12,7 +12,7 @@ import * as objects from 'vs/base/common/objects'; import * as paths from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; import { IJSONSchema, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema'; -import { IRawAdapter, IAdapterExecutable } from 'vs/workbench/parts/debug/common/debug'; +import { IRawAdapter, IAdapterExecutable, INTERNAL_CONSOLE_OPTIONS_SCHEMA } from 'vs/workbench/parts/debug/common/debug'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -183,7 +183,7 @@ export class Adapter { enum: [this.type], description: nls.localize('debugType', "Type of configuration."), pattern: '^(?!node2)', - errorMessage: nls.localize('debugTypeNotRecognised', "The debug type is not recoginzed. Make sure that you have a corresponding debug extension installed and that it is enabled."), + errorMessage: nls.localize('debugTypeNotRecognised', "The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled."), patternErrorMessage: nls.localize('node2NotSupported', "\"node2\" is no longer supported, use \"node\" instead and set the \"protocol\" attribute to \"inspector\".") }; properties['name'] = { @@ -205,11 +205,7 @@ export class Adapter { default: null, description: nls.localize('debugPrelaunchTask', "Task to run before debug session starts.") }; - properties['internalConsoleOptions'] = { - enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], - default: 'openOnFirstSessionStart', - description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.") - }; + properties['internalConsoleOptions'] = INTERNAL_CONSOLE_OPTIONS_SCHEMA; const osProperties = objects.deepClone(properties); properties['windows'] = { diff --git a/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts b/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts index 31dd5f1f8d8..872818bd727 100644 --- a/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts +++ b/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts @@ -25,7 +25,7 @@ suite('Debug - View Model', () => { const mockSession = new MockSession(); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, mockSession); const thread = new Thread(process, 'myThread', 1); - const frame = new StackFrame(thread, 1, null, 'app.js', 1, 1); + const frame = new StackFrame(thread, 1, null, 'app.js', { startColumn: 1, startLineNumber: 1, endColumn: undefined, endLineNumber: undefined }); model.setFocusedStackFrame(frame, process); assert.equal(model.focusedStackFrame.getId(), frame.getId()); diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/parts/debug/test/common/mockDebug.ts index 4f401f39687..c2f725b82c1 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebug.ts @@ -115,7 +115,12 @@ export class MockSession implements debug.ISession { public stackTrace(args: DebugProtocol.StackTraceArguments): TPromise { return TPromise.as({ body: { - stackFrames: [] + stackFrames: [{ + id: 1, + name: 'mock', + line: 5, + column: 6 + }] } }); } diff --git a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts index 1705f9d25e5..da310a4f622 100644 --- a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts +++ b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts @@ -163,24 +163,24 @@ suite('Debug - Model', () => { assert.equal(process.getAllThreads().length, 2); assert.equal(thread1.name, threadName1); assert.equal(thread1.stopped, true); - assert.equal(thread1.getCallStack(), undefined); + assert.equal(thread1.getCallStack().length, 0); assert.equal(thread1.stoppedDetails.reason, stoppedReason); assert.equal(thread2.name, threadName2); assert.equal(thread2.stopped, true); - assert.equal(thread2.getCallStack(), undefined); + assert.equal(thread2.getCallStack().length, 0); assert.equal(thread2.stoppedDetails.reason, stoppedReason); // after calling getCallStack, the callstack becomes available // and results in a request for the callstack in the debug adapter thread1.fetchCallStack().then(() => { - assert.notEqual(thread1.getCallStack(), undefined); - assert.equal(thread2.getCallStack(), undefined); + assert.notEqual(thread1.getCallStack().length, 0); + assert.equal(thread2.getCallStack().length, 0); assert.equal(sessionStub.callCount, 1); }); thread2.fetchCallStack().then(() => { - assert.notEqual(thread1.getCallStack(), undefined); - assert.notEqual(thread2.getCallStack(), undefined); + assert.notEqual(thread1.getCallStack().length, 0); + assert.notEqual(thread2.getCallStack().length, 0); assert.equal(sessionStub.callCount, 2); }); @@ -189,17 +189,17 @@ suite('Debug - Model', () => { thread1.fetchCallStack().then(() => { return thread2.fetchCallStack(); }).then(() => { - assert.equal(sessionStub.callCount, 2); + assert.equal(sessionStub.callCount, 4); }); // clearing the callstack results in the callstack not being available thread1.clearCallStack(); assert.equal(thread1.stopped, true); - assert.equal(thread1.getCallStack(), undefined); + assert.equal(thread1.getCallStack().length, 0); thread2.clearCallStack(); assert.equal(thread2.stopped, true); - assert.equal(thread2.getCallStack(), undefined); + assert.equal(thread2.getCallStack().length, 0); model.clearThreads(process.getId(), true); assert.equal(process.getThread(threadId1), null); @@ -255,39 +255,33 @@ suite('Debug - Model', () => { assert.equal(stoppedThread.name, stoppedThreadName); assert.equal(stoppedThread.stopped, true); assert.equal(process.getAllThreads().length, 2); - assert.equal(stoppedThread.getCallStack(), undefined); + assert.equal(stoppedThread.getCallStack().length, 0); assert.equal(stoppedThread.stoppedDetails.reason, stoppedReason); assert.equal(runningThread.name, runningThreadName); assert.equal(runningThread.stopped, false); - assert.equal(runningThread.getCallStack(), undefined); + assert.equal(runningThread.getCallStack().length, 0); assert.equal(runningThread.stoppedDetails, undefined); // after calling getCallStack, the callstack becomes available // and results in a request for the callstack in the debug adapter stoppedThread.fetchCallStack().then(() => { - assert.notEqual(stoppedThread.getCallStack(), undefined); - assert.equal(runningThread.getCallStack(), undefined); + assert.notEqual(stoppedThread.getCallStack().length, 0); + assert.equal(runningThread.getCallStack().length, 0); assert.equal(sessionStub.callCount, 1); }); // calling getCallStack on the running thread returns empty array // and does not return in a request for the callstack in the debug // adapter - runningThread.fetchCallStack().then(callStack => { - assert.deepEqual(callStack, []); - assert.equal(sessionStub.callCount, 1); - }); - - // calling multiple times getCallStack doesn't result in multiple calls - // to the debug adapter - stoppedThread.fetchCallStack().then(() => { + runningThread.fetchCallStack().then(() => { + assert.equal(runningThread.getCallStack().length, 0); assert.equal(sessionStub.callCount, 1); }); // clearing the callstack results in the callstack not being available stoppedThread.clearCallStack(); assert.equal(stoppedThread.stopped, true); - assert.equal(stoppedThread.getCallStack(), undefined); + assert.equal(stoppedThread.getCallStack().length, 0); model.clearThreads(process.getId(), true); assert.equal(process.getThread(stoppedThreadId), null); @@ -310,7 +304,7 @@ suite('Debug - Model', () => { assert.equal(model.getWatchExpressions().length, 0); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, rawSession); const thread = new Thread(process, 'mockthread', 1); - const stackFrame = new StackFrame(thread, 1, null, 'app.js', 1, 1); + const stackFrame = new StackFrame(thread, 1, null, 'app.js', { startLineNumber: 1, startColumn: 1, endLineNumber: undefined, endColumn: undefined }); model.addWatchExpression(process, stackFrame, 'console').done(); model.addWatchExpression(process, stackFrame, 'console').done(); let watchExpressions = model.getWatchExpressions(); @@ -338,7 +332,7 @@ suite('Debug - Model', () => { assert.equal(model.getReplElements().length, 0); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, rawSession); const thread = new Thread(process, 'mockthread', 1); - const stackFrame = new StackFrame(thread, 1, null, 'app.js', 1, 1); + const stackFrame = new StackFrame(thread, 1, null, 'app.js', { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 10 }); model.addReplExpression(process, stackFrame, 'myVariable').done(); model.addReplExpression(process, stackFrame, 'myVariable').done(); model.addReplExpression(process, stackFrame, 'myVariable').done(); diff --git a/src/vs/workbench/parts/emmet/node/actions/balance.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/balance.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/balance.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/balance.ts index 73e410694a3..10f58a6a5c2 100644 --- a/src/vs/workbench/parts/emmet/node/actions/balance.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/balance.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/base64.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/base64.ts similarity index 98% rename from src/vs/workbench/parts/emmet/node/actions/base64.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/base64.ts index 5aef2083c34..2cf45dbd7f7 100644 --- a/src/vs/workbench/parts/emmet/node/actions/base64.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/base64.ts @@ -11,7 +11,7 @@ import { fileExists } from 'vs/base/node/pfs'; import fs = require('fs'); import { dirname, join, normalize, isValidBasename } from 'vs/base/common/paths'; -import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { Action } from 'vs/base/common/actions'; import { ServicesAccessor, editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/editPoints.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts similarity index 97% rename from src/vs/workbench/parts/emmet/node/actions/editPoints.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts index aa89a2d9d7a..d74d9e32771 100644 --- a/src/vs/workbench/parts/emmet/node/actions/editPoints.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/evaluateMath.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/evaluateMath.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.ts index df8a9de1bc3..5eb52a5b5c1 100644 --- a/src/vs/workbench/parts/emmet/node/actions/evaluateMath.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/expandAbbreviation.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts similarity index 83% rename from src/vs/workbench/parts/emmet/node/actions/expandAbbreviation.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts index 75f7ae270f3..26125b52a0f 100644 --- a/src/vs/workbench/parts/emmet/node/actions/expandAbbreviation.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts @@ -6,11 +6,12 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; -import { Handler, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -32,7 +33,7 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction { EditorContextKeys.hasSingleSelection, EditorContextKeys.tabDoesNotMoveFocus, ContextKeyExpr.has('config.emmet.triggerExpansionOnTab'), - ContextKeyExpr.not('config.emmet.suggestExpandedAbbreviation') + ContextKeyExpr.not('config.emmet.useModules') ) } ); @@ -40,6 +41,6 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction { protected noExpansionOccurred(editor: ICommonCodeEditor): void { // forward the tab key back to the editor - editor.trigger('emmet', Handler.Tab, {}); + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); } } diff --git a/src/vs/workbench/parts/emmet/node/actions/incrementDecrement.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.ts similarity index 98% rename from src/vs/workbench/parts/emmet/node/actions/incrementDecrement.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.ts index 44db17292f1..527820f3126 100644 --- a/src/vs/workbench/parts/emmet/node/actions/incrementDecrement.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/matchingPair.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/matchingPair.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.ts index 707709b439a..4dea6318bd2 100644 --- a/src/vs/workbench/parts/emmet/node/actions/matchingPair.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/mergeLines.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.ts similarity index 95% rename from src/vs/workbench/parts/emmet/node/actions/mergeLines.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.ts index e90f53a5bb8..9333f8b8053 100644 --- a/src/vs/workbench/parts/emmet/node/actions/mergeLines.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/reflectCssValue.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/reflectCssValue.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.ts index 8683775c625..405a3585fd8 100644 --- a/src/vs/workbench/parts/emmet/node/actions/reflectCssValue.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/removeTag.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.ts similarity index 95% rename from src/vs/workbench/parts/emmet/node/actions/removeTag.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.ts index b24c78755bd..076be1ef8df 100644 --- a/src/vs/workbench/parts/emmet/node/actions/removeTag.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/selectItem.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.ts similarity index 97% rename from src/vs/workbench/parts/emmet/node/actions/selectItem.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.ts index b22d4f4765c..f301c1a6e3a 100644 --- a/src/vs/workbench/parts/emmet/node/actions/selectItem.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/splitJoinTag.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.ts similarity index 95% rename from src/vs/workbench/parts/emmet/node/actions/splitJoinTag.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.ts index eb0a7115473..b26d13b1c03 100644 --- a/src/vs/workbench/parts/emmet/node/actions/splitJoinTag.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/toggleComment.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/toggleComment.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.ts index 4d7f164cecb..4eb599b30ff 100644 --- a/src/vs/workbench/parts/emmet/node/actions/toggleComment.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/updateImageSize.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.ts similarity index 96% rename from src/vs/workbench/parts/emmet/node/actions/updateImageSize.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.ts index 1583dae99a3..c165ff518ab 100644 --- a/src/vs/workbench/parts/emmet/node/actions/updateImageSize.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { editorAction } from 'vs/editor/common/editorCommonExtensions'; diff --git a/src/vs/workbench/parts/emmet/node/actions/updateTag.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.ts similarity index 97% rename from src/vs/workbench/parts/emmet/node/actions/updateTag.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.ts index 463d711f4f0..914f3bd64e2 100644 --- a/src/vs/workbench/parts/emmet/node/actions/updateTag.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { ServicesAccessor, editorAction } from 'vs/editor/common/editorCommonExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; diff --git a/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.ts similarity index 97% rename from src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts rename to src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.ts index 16e571f45ed..ab7d540a331 100644 --- a/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.ts @@ -6,7 +6,7 @@ 'use strict'; import nls = require('vs/nls'); -import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/node/emmetActions'; +import { EmmetEditorAction, EmmetActionContext } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; import { ServicesAccessor, editorAction } from 'vs/editor/common/editorCommonExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; diff --git a/src/vs/workbench/parts/emmet/node/editorAccessor.ts b/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts similarity index 78% rename from src/vs/workbench/parts/emmet/node/editorAccessor.ts rename to src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts index 480bf4e8f64..26f7cf390e7 100644 --- a/src/vs/workbench/parts/emmet/node/editorAccessor.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts @@ -5,13 +5,14 @@ 'use strict'; -import { ICommonCodeEditor, Handler } from 'vs/editor/common/editorCommon'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import strings = require('vs/base/common/strings'); -import snippets = require('vs/editor/contrib/snippet/common/snippet'); import { Range } from 'vs/editor/common/core/range'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; +import { SnippetParser, walk, Placeholder, Variable, Text, Marker } from 'vs/editor/contrib/snippet/browser/snippetParser'; import emmet = require('emmet'); @@ -92,8 +93,73 @@ export class EditorAccessor implements emmet.Editor { if (!range) { return; } - let codeSnippet = snippets.CodeSnippet.fromEmmet(value); - SnippetController.get(this._editor).runWithReplaceRange(codeSnippet, range); + + const tweakedValue = EditorAccessor.fixEmmetFinalTabstop(value); + + // let selection define the typing range + this._editor.setSelection(range); + SnippetController2.get(this._editor).insert(tweakedValue); + + // let codeSnippet = snippets.CodeSnippet.fromEmmet(value); + // SnippetController.get(this._editor).runWithReplaceRange(codeSnippet, range); + } + + private static fixEmmetFinalTabstop(template: string): string { + + let matchFinalStops = template.match(/\$\{0\}|\$0/g); + if (!matchFinalStops || matchFinalStops.length === 1) { + return template; + } + + // string to string conversion that tries to fix the + // snippet in-place + + let marker = new SnippetParser(true, false).parse(template); + let maxIndex = -Number.MIN_VALUE; + + // find highest placeholder index + walk(marker, candidate => { + if (candidate instanceof Placeholder) { + let index = Number(candidate.index); + if (index > maxIndex) { + maxIndex = index; + } + } + return true; + }); + + // rewrite final tabstops + walk(marker, candidate => { + if (candidate instanceof Placeholder) { + if (candidate.isFinalTabstop) { + candidate.index = String(++maxIndex); + } + } + return true; + }); + + // write back as string + function toSnippetString(marker: Marker): string { + if (marker instanceof Text) { + return SnippetParser.escape(marker.string); + + } else if (marker instanceof Placeholder) { + if (marker.defaultValue.length > 0) { + return `\${${marker.index}:${marker.defaultValue.map(toSnippetString).join('')}}`; + } else { + return `\$${marker.index}`; + } + } else if (marker instanceof Variable) { + if (marker.defaultValue.length > 0) { + return `\${${marker.name}:${marker.defaultValue.map(toSnippetString).join('')}}`; + } else { + return `\$${marker.name}`; + } + } else { + throw new Error('unexpected marker: ' + marker); + } + } + return marker.map(toSnippetString).join(''); } public getRangeToReplace(value: string, start: number, end: number): Range { @@ -133,7 +199,7 @@ export class EditorAccessor implements emmet.Editor { // During Expand Abbreviation action, if the expanded abbr is the same as the text it intends to replace, // then treat it as a no-op and return TAB to the editor if (this._emmetActionName === 'expand_abbreviation' && (value === textToReplace || value === textToReplace + '${0}')) { - this._editor.trigger('emmet', Handler.Tab, {}); + CoreEditingCommands.Tab.runEditorCommand(null, this._editor, null); return null; } diff --git a/src/vs/workbench/parts/emmet/node/emmet.contribution.ts b/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts similarity index 92% rename from src/vs/workbench/parts/emmet/node/emmet.contribution.ts rename to src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts index 48186e1eb47..0a177c237f6 100644 --- a/src/vs/workbench/parts/emmet/node/emmet.contribution.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts @@ -59,6 +59,11 @@ configurationRegistry.registerConfiguration({ 'type': 'string', 'default': null, 'description': nls.localize('emmetExtensionsPath', 'Path to a folder containing emmet profiles, snippets and preferences') + }, + 'emmet.useModules': { + 'type': 'boolean', + 'default': false, + 'description': nls.localize('emmetUseModules', 'Use the new emmet modules for emmet features than the single emmet library.') } } }); diff --git a/src/vs/workbench/parts/emmet/node/emmet.d.ts b/src/vs/workbench/parts/emmet/electron-browser/emmet.d.ts similarity index 100% rename from src/vs/workbench/parts/emmet/node/emmet.d.ts rename to src/vs/workbench/parts/emmet/electron-browser/emmet.d.ts diff --git a/src/vs/workbench/parts/emmet/node/emmetActions.ts b/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts similarity index 92% rename from src/vs/workbench/parts/emmet/node/emmetActions.ts rename to src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts index 9f5b8e089b7..c2325f2a22f 100644 --- a/src/vs/workbench/parts/emmet/node/emmetActions.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts @@ -7,13 +7,12 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; -import { EditorAction, ServicesAccessor, IActionOptions } from 'vs/editor/common/editorCommonExtensions'; -import { ICommandKeybindingsOptions } from 'vs/editor/common/config/config'; +import { EditorAction, ServicesAccessor, IActionOptions, ICommandKeybindingsOptions } from 'vs/editor/common/editorCommonExtensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { grammarsExtPoint, ITMSyntaxExtensionPoint } from 'vs/editor/node/textMate/TMGrammars'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { EditorAccessor, IGrammarContributions } from 'vs/workbench/parts/emmet/node/editorAccessor'; +import { EditorAccessor, IGrammarContributions } from 'vs/workbench/parts/emmet/electron-browser/editorAccessor'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IExtensionService, ExtensionPointContribution } from 'vs/platform/extensions/common/extensions'; import { IMessageService } from 'vs/platform/message/common/message'; @@ -23,7 +22,7 @@ import * as pfs from 'vs/base/node/pfs'; import Severity from 'vs/base/common/severity'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { ICommandService } from 'vs/platform/commands/common/commands'; interface IEmmetConfiguration { emmet: { @@ -31,7 +30,8 @@ interface IEmmetConfiguration { syntaxProfiles: any; triggerExpansionOnTab: boolean, excludeLanguages: string[], - extensionsPath: string + extensionsPath: string, + useModules: boolean }; } @@ -241,7 +241,16 @@ export abstract class EmmetEditorAction extends EditorAction { 'editor.emmet.action.updateTag': 'emmet.updateTag', 'editor.emmet.action.matchingPair': 'emmet.matchTag', 'editor.emmet.action.wrapWithAbbreviation': 'emmet.wrapWithAbbreviation', - 'editor.emmet.action.expandAbbreviation': 'emmet.expandAbbreviation' + 'editor.emmet.action.expandAbbreviation': 'emmet.expandAbbreviation', + 'editor.emmet.action.balanceInward': 'emmet.balanceIn', + 'editor.emmet.action.balanceOutward': 'emmet.balanceOut', + 'editor.emmet.action.previousEditPoint': 'emmet.prevEditPoint', + 'editor.emmet.action.nextEditPoint': 'emmet.nextEditPoint', + 'editor.emmet.action.mergeLines': 'emmet.mergeLines', + 'editor.emmet.action.selectPreviousItem': 'emmet.selectPrevItem', + 'editor.emmet.action.selectNextItem': 'emmet.selectNextItem', + 'editor.emmet.action.splitJoinTag': 'emmet.splitJoinTag', + 'editor.emmet.action.toggleComment': 'emmet.toggleComment' }; protected emmetActionName: string; @@ -281,7 +290,7 @@ export abstract class EmmetEditorAction extends EditorAction { const commandService = accessor.get(ICommandService); let mappedCommand = this.actionMap[this.id]; - if (mappedCommand && CommandsRegistry.getCommand(mappedCommand)) { + if (mappedCommand && configurationService.getConfiguration().emmet.useModules) { return commandService.executeCommand(mappedCommand); } diff --git a/src/vs/workbench/parts/emmet/test/node/editorAccessor.test.ts b/src/vs/workbench/parts/emmet/test/electron-browser/editorAccessor.test.ts similarity index 98% rename from src/vs/workbench/parts/emmet/test/node/editorAccessor.test.ts rename to src/vs/workbench/parts/emmet/test/electron-browser/editorAccessor.test.ts index 7374c917f28..f395f892499 100644 --- a/src/vs/workbench/parts/emmet/test/node/editorAccessor.test.ts +++ b/src/vs/workbench/parts/emmet/test/electron-browser/editorAccessor.test.ts @@ -5,7 +5,7 @@ 'use strict'; -import { EditorAccessor, ILanguageIdentifierResolver, IGrammarContributions } from 'vs/workbench/parts/emmet/node/editorAccessor'; +import { EditorAccessor, ILanguageIdentifierResolver, IGrammarContributions } from 'vs/workbench/parts/emmet/electron-browser/editorAccessor'; import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import assert = require('assert'); import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; diff --git a/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts index 6bc0a3375d0..d191c415426 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts @@ -11,7 +11,7 @@ import baseplatform = require('vs/base/common/platform'); import { IAction, Action } from 'vs/base/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import paths = require('vs/base/common/paths'); -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import uri from 'vs/base/common/uri'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -141,5 +141,5 @@ Registry.as(ActionExtensions.WorkbenchActions).registe { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_C }, KEYBINDING_CONTEXT_TERMINAL_NOT_FOCUSED ), - 'Open New Command Prompt' + baseplatform.isWindows ? 'Open New Command Prompt' : 'Open New Terminal' ); diff --git a/src/vs/workbench/parts/explorers/browser/media/Refresh.svg b/src/vs/workbench/parts/explorers/browser/media/Refresh.svg deleted file mode 100644 index e0345748192..00000000000 --- a/src/vs/workbench/parts/explorers/browser/media/Refresh.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/explorers/browser/media/Refresh_inverse.svg b/src/vs/workbench/parts/explorers/browser/media/Refresh_inverse.svg deleted file mode 100644 index d79fdaa4e8e..00000000000 --- a/src/vs/workbench/parts/explorers/browser/media/Refresh_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/explorers/browser/media/treeExplorer.contribution.css b/src/vs/workbench/parts/explorers/browser/media/treeExplorer.contribution.css deleted file mode 100644 index 35425359a07..00000000000 --- a/src/vs/workbench/parts/explorers/browser/media/treeExplorer.contribution.css +++ /dev/null @@ -1,18 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -.monaco-workbench .extensionViewlet-action.toggle { - background: url('Refresh.svg') center center no-repeat; -} - -.vs-dark .monaco-workbench .extensionViewlet-action.toggle, -.hc-black .monaco-workbench .extensionViewlet-action.toggle { - background: url('Refresh_inverse.svg') center center no-repeat; -} - -.custom-viewlet-tree-node-item { - height: 22px; - line-height: 22px; -} diff --git a/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.ts b/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.ts deleted file mode 100644 index c55073b1027..00000000000 --- a/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.ts +++ /dev/null @@ -1,120 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./media/treeExplorer.contribution'; - -import { localize } from 'vs/nls'; -import { join } from 'vs/base/common/paths'; -import { createCSSRule } from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/platform'; -import { ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; -import { TreeExplorerService } from 'vs/workbench/parts/explorers/browser/treeExplorerService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ToggleViewletAction } from 'vs/workbench/browser/viewlet'; -import { ITreeExplorer } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { toViewletId, toViewletCSSClass, isValidViewletId } from 'vs/workbench/parts/explorers/common/treeExplorer'; -import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; - -registerSingleton(ITreeExplorerService, TreeExplorerService); - -const viewSchema: IJSONSchema = { - description: localize('vscode.extension.contributes.view', 'Contributes custom view'), - type: 'object', - properties: { - id: { - description: localize('vscode.extension.contributes.view.id', 'Unique id used to identify view created through vscode.workspace.createTreeView'), - type: 'string' - }, - label: { - description: localize('vscode.extension.contributes.view.label', 'Human readable string used to render the view'), - type: 'string' - }, - icon: { - description: localize('vscode.extension.contributes.view.icon', 'Path to the view icon'), - type: 'string' - } - } -}; - -const viewsSchema: IJSONSchema = { - description: localize('vscode.extension.contributes.views', 'Contributes custom views'), - type: 'object', - items: viewSchema -}; - -export class OpenViewletAction extends ToggleViewletAction { - - constructor( - id: string, - label: string, - @IViewletService viewletService: IViewletService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService - ) { - super(id, label, id, viewletService, editorService); - } -} - -export class ExtensionExplorersContribtion implements IWorkbenchContribution { - - constructor() { - this.init(); - } - - public getId(): string { - return 'vs.extension.view'; - } - - private init() { - ExtensionsRegistry.registerExtensionPoint('views', [], viewsSchema).setHandler(extensions => { - for (let extension of extensions) { - for (const { id, label, icon } of extension.value) { - if (!isValidViewletId(id)) { - console.warn(`Tree view extension '${label}' has invalid id and failed to activate.`); - continue; - } - - const viewletId = toViewletId(id); - const viewletCSSClass = toViewletCSSClass(id); - - // Generate CSS to show the icon in the activity bar - if (icon) { - const iconClass = `.monaco-workbench > .activitybar .monaco-action-bar .action-label.${viewletCSSClass}`; - const iconPath = join(extension.description.extensionFolderPath, icon); - - createCSSRule(iconClass, `-webkit-mask: url('${iconPath}') no-repeat 50% 50%`); - } - - // Register action to open the viewlet - const registry = Registry.as(ActionExtensions.WorkbenchActions); - registry.registerWorkbenchAction( - new SyncActionDescriptor(OpenViewletAction, viewletId, localize('showViewlet', "Show {0}", label)), - 'View: Show {0}', - localize('view', "View") - ); - - // Register as viewlet - Registry.as(ViewletExtensions.Viewlets).registerViewlet(new ViewletDescriptor( - 'vs/workbench/parts/explorers/browser/treeExplorerViewlet', - 'TreeExplorerViewlet', - viewletId, - label, - viewletCSSClass, - -1, - extension.description.id - )); - } - } - }); - } -} - -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionExplorersContribtion); \ No newline at end of file diff --git a/src/vs/workbench/parts/explorers/browser/treeExplorerActions.ts b/src/vs/workbench/parts/explorers/browser/treeExplorerActions.ts deleted file mode 100644 index 04103edf29f..00000000000 --- a/src/vs/workbench/parts/explorers/browser/treeExplorerActions.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import * as nls from 'vs/nls'; -import { Action } from 'vs/base/common/actions'; -import { TreeExplorerView } from 'vs/workbench/parts/explorers/browser/views/treeExplorerView'; -import { toViewletActionId } from 'vs/workbench/parts/explorers/common/treeExplorer'; - -export class RefreshViewExplorerAction extends Action { - - constructor(view: TreeExplorerView) { - super(toViewletActionId('refresh'), nls.localize('refresh', "Refresh"), 'extensionViewlet-action toggle', true, () => { - view.updateInput(); - return TPromise.as(null); - }); - } -} diff --git a/src/vs/workbench/parts/explorers/browser/treeExplorerMenus.ts b/src/vs/workbench/parts/explorers/browser/treeExplorerMenus.ts deleted file mode 100644 index 4fa05c578f7..00000000000 --- a/src/vs/workbench/parts/explorers/browser/treeExplorerMenus.ts +++ /dev/null @@ -1,100 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 Event, { Emitter } from 'vs/base/common/event'; -import { IDisposable, dispose, empty as EmptyDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IAction } from 'vs/base/common/actions'; -import { fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; - - -export class TreeExplorerMenus implements IDisposable { - - private disposables: IDisposable[] = []; - - private activeProviderId: string; - private titleDisposable: IDisposable = EmptyDisposable; - private titleActions: IAction[] = []; - private titleSecondaryActions: IAction[] = []; - - private _onDidChangeTitle = new Emitter(); - get onDidChangeTitle(): Event { return this._onDidChangeTitle.event; } - - constructor( - @IContextKeyService private contextKeyService: IContextKeyService, - @ITreeExplorerService private treeExplorerService: ITreeExplorerService, - @IMenuService private menuService: IMenuService - ) { - this.setActiveProvider(this.treeExplorerService.activeProvider); - this.treeExplorerService.onDidChangeProvider(this.setActiveProvider, this, this.disposables); - } - - private setActiveProvider(activeProvider: string | undefined): void { - if (this.titleDisposable) { - this.titleDisposable.dispose(); - this.titleDisposable = EmptyDisposable; - } - - if (!activeProvider) { - return; - } - - this.activeProviderId = activeProvider; - - const titleMenu = this.menuService.createMenu(MenuId.ViewTitle, this.contextKeyService); - const updateActions = () => { - this.titleActions = []; - this.titleSecondaryActions = []; - fillInActions(titleMenu, null, { primary: this.titleActions, secondary: this.titleSecondaryActions }); - this._onDidChangeTitle.fire(); - }; - - const listener = titleMenu.onDidChange(updateActions); - updateActions(); - - this.titleDisposable = toDisposable(() => { - listener.dispose(); - titleMenu.dispose(); - this.titleActions = []; - this.titleSecondaryActions = []; - }); - } - - getTitleActions(): IAction[] { - return this.titleActions; - } - - getTitleSecondaryActions(): IAction[] { - return this.titleSecondaryActions; - } - - getResourceContextActions(): IAction[] { - return this.getActions(MenuId.ViewResource).secondary; - } - - private getActions(menuId: MenuId): { primary: IAction[]; secondary: IAction[]; } { - if (!this.activeProviderId) { - return { primary: [], secondary: [] }; - } - - const menu = this.menuService.createMenu(menuId, this.contextKeyService); - const primary = []; - const secondary = []; - const result = { primary, secondary }; - fillInActions(menu, { shouldForwardArgs: true }, result, g => g === 'inline'); - - menu.dispose(); - - return result; - } - - dispose(): void { - this.disposables = dispose(this.disposables); - } -} diff --git a/src/vs/workbench/parts/explorers/browser/treeExplorerService.ts b/src/vs/workbench/parts/explorers/browser/treeExplorerService.ts deleted file mode 100644 index 649fa221e2a..00000000000 --- a/src/vs/workbench/parts/explorers/browser/treeExplorerService.ts +++ /dev/null @@ -1,85 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 Event, { Emitter } from 'vs/base/common/event'; -import { localize } from 'vs/nls'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; -import { InternalTreeNode, InternalTreeNodeProvider } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; -import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; - -export class TreeExplorerService implements ITreeExplorerService { - public _serviceBrand: any; - - private _activeProvider: string; - private activeProviderContextKey: IContextKey; - - private _onDidChangeProvider = new Emitter(); - get onDidChangeProvider(): Event { return this._onDidChangeProvider.event; } - - private _onTreeExplorerNodeProviderRegistered = new Emitter(); - public get onTreeExplorerNodeProviderRegistered(): Event { return this._onTreeExplorerNodeProviderRegistered.event; }; - - private _treeExplorerNodeProviders: { [providerId: string]: InternalTreeNodeProvider }; - - constructor( - @IContextKeyService private contextKeyService: IContextKeyService, - @IMessageService private messageService: IMessageService - ) { - this._treeExplorerNodeProviders = Object.create(null); - this.activeProviderContextKey = this.contextKeyService.createKey('view', void 0); - } - - get activeProvider(): string { - return this._activeProvider; - } - - set activeProvider(provider: string) { - if (!provider) { - throw new Error('invalid provider'); - } - - this._activeProvider = provider; - this.activeProviderContextKey.set(provider ? provider : void 0); - - this._onDidChangeProvider.fire(provider); - } - - public registerTreeExplorerNodeProvider(providerId: string, provider: InternalTreeNodeProvider): void { - this._treeExplorerNodeProviders[providerId] = provider; - this._onTreeExplorerNodeProviderRegistered.fire(providerId); - } - - public hasProvider(providerId: string): boolean { - return !!this._treeExplorerNodeProviders[providerId]; - } - - public provideRootNode(providerId: string): TPromise { - const provider = this.getProvider(providerId); - return TPromise.wrap(provider.provideRootNode()); - } - - public resolveChildren(providerId: string, node: InternalTreeNode): TPromise { - const provider = this.getProvider(providerId); - return TPromise.wrap(provider.resolveChildren(node)); - } - - public executeCommand(providerId: string, node: InternalTreeNode): TPromise { - const provider = this.getProvider(providerId); - return TPromise.wrap(provider.executeCommand(node)); - } - - public getProvider(providerId: string): InternalTreeNodeProvider { - const provider = this._treeExplorerNodeProviders[providerId]; - - if (!provider) { - this.messageService.show(Severity.Error, localize('treeExplorer.noMatchingProviderId', 'No TreeExplorerNodeProvider with id {providerId} registered.')); - } - - return provider; - } -} diff --git a/src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts b/src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts deleted file mode 100644 index 856261d3172..00000000000 --- a/src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts +++ /dev/null @@ -1,102 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { Builder, Dimension } from 'vs/base/browser/builder'; -import { Orientation } from 'vs/base/browser/ui/splitview/splitview'; -import { IAction } from 'vs/base/common/actions'; -import { Viewlet } from 'vs/workbench/browser/viewlet'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { TreeExplorerView } from 'vs/workbench/parts/explorers/browser/views/treeExplorerView'; -import { TreeExplorerViewletState } from 'vs/workbench/parts/explorers/browser/views/treeExplorerViewer'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachHeaderViewStyler } from 'vs/platform/theme/common/styler'; - -export class TreeExplorerViewlet extends Viewlet { - - private viewletContainer: Builder; - private view: TreeExplorerView; - - private viewletState: TreeExplorerViewletState; - private viewletId: string; - private treeNodeProviderId: string; - - constructor( - viewletId: string, - @ITelemetryService telemetryService: ITelemetryService, - @IInstantiationService private instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService - ) { - super(viewletId, telemetryService, themeService); - - this.viewletState = new TreeExplorerViewletState(); - this.viewletId = viewletId; - - const tokens = viewletId.split('.'); - this.treeNodeProviderId = tokens[tokens.length - 1]; - } - - public getId(): string { - return this.viewletId; - } - - public create(parent: Builder): TPromise { - super.create(parent); - - this.viewletContainer = parent.div(); - this.addTreeView(); - - return TPromise.as(null); - } - - public layout(dimension: Dimension): void { - this.view.layout(dimension.height, Orientation.VERTICAL); - } - - public setVisible(visible: boolean): TPromise { - return super.setVisible(visible).then(() => { - this.view.setVisible(visible).done(); - }); - } - - public getActions(): IAction[] { - return this.view.getActions(); - } - - private addTreeView(): void { - const headerSize = 0; // Hide header (root node) by default - - this.view = this.instantiationService.createInstance(TreeExplorerView, this.viewletState, this.treeNodeProviderId, this.getActionRunner(), headerSize); - attachHeaderViewStyler(this.view, this.themeService); - this.view.render(this.viewletContainer.getHTMLElement(), Orientation.VERTICAL); - } - - public focus(): void { - super.focus(); - - if (this.view) { - this.view.focusBody(); - } - } - - public shutdown(): void { - if (this.view) { - this.view.shutdown(); - } - - super.shutdown(); - } - - public dispose(): void { - if (this.view) { - this.view = null; - this.view.dispose(); - } - - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts b/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts deleted file mode 100644 index 332041abe84..00000000000 --- a/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts +++ /dev/null @@ -1,139 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 nls = require('vs/nls'); -import { TPromise } from 'vs/base/common/winjs.base'; -import * as DOM from 'vs/base/browser/dom'; -import { Builder, $ } from 'vs/base/browser/builder'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { CollapsibleViewletView } from 'vs/workbench/browser/viewlet'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IAction, IActionRunner, IActionItem } from 'vs/base/common/actions'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IListService } from 'vs/platform/list/browser/listService'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; -import { ITree } from 'vs/base/parts/tree/browser/tree'; -import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; -import { TreeExplorerViewletState, TreeDataSource, TreeRenderer, TreeController } from 'vs/workbench/parts/explorers/browser/views/treeExplorerViewer'; -import { TreeExplorerMenus } from 'vs/workbench/parts/explorers/browser/treeExplorerMenus'; -import { RefreshViewExplorerAction } from 'vs/workbench/parts/explorers/browser/treeExplorerActions'; -import { attachListStyler } from 'vs/platform/theme/common/styler'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { createActionItem } from 'vs/platform/actions/browser/menuItemActionItem'; - -export class TreeExplorerView extends CollapsibleViewletView { - - private providerDisposables: IDisposable[]; - private menus: TreeExplorerMenus; - - constructor( - private viewletState: TreeExplorerViewletState, - private treeNodeProviderId: string, - actionRunner: IActionRunner, - headerSize: number, - @IMessageService messageService: IMessageService, - @IKeybindingService keybindingService: IKeybindingService, - @IContextMenuService contextMenuService: IContextMenuService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @IInstantiationService private instantiationService: IInstantiationService, - @ITreeExplorerService private treeExplorerService: ITreeExplorerService, - @IListService private listService: IListService, - @IThemeService private themeService: IThemeService - ) { - super(actionRunner, false, nls.localize('treeExplorerViewlet.tree', "Tree Explorer Section"), messageService, keybindingService, contextMenuService, headerSize); - this.treeExplorerService.activeProvider = treeNodeProviderId; - this.menus = this.instantiationService.createInstance(TreeExplorerMenus); - this.create(); - } - - public renderBody(container: HTMLElement): void { - this.treeContainer = super.renderViewTree(container); - DOM.addClass(this.treeContainer, 'tree-explorer-viewlet-tree-view'); - - this.tree = this.createViewer($(this.treeContainer)); - } - - public createViewer(container: Builder): ITree { - const dataSource = this.instantiationService.createInstance(TreeDataSource, this.treeNodeProviderId); - const renderer = this.instantiationService.createInstance(TreeRenderer, this.viewletState, this.actionRunner, container.getHTMLElement()); - const controller = this.instantiationService.createInstance(TreeController, this.treeNodeProviderId, this.menus); - - const tree = new Tree(container.getHTMLElement(), { - dataSource, - renderer, - controller - }, { - keyboardSupport: false - }); - - this.toDispose.push(attachListStyler(tree, this.themeService)); - this.toDispose.push(this.listService.register(tree)); - - return tree; - } - - getActions(): IAction[] { - return [...this.menus.getTitleActions(), new RefreshViewExplorerAction(this)]; - } - - getSecondaryActions(): IAction[] { - return this.menus.getTitleSecondaryActions(); - } - - getActionItem(action: IAction): IActionItem { - return createActionItem(action, this.keybindingService, this.messageService); - } - - public create(): TPromise { - return this.updateInput(); - } - - public setVisible(visible: boolean): TPromise { - return super.setVisible(visible); - } - - public updateInput(): TPromise { - if (this.treeExplorerService.hasProvider(this.treeNodeProviderId)) { - return this.updateProvider(); - } - // Provider registration happens independently of the reading of extension's contribution, - // which constructs the viewlet, so it's possible the viewlet is constructed before a provider - // is registered. - // This renders the viewlet first and wait for a corresponding provider is registered. - else { - this.treeExplorerService.onTreeExplorerNodeProviderRegistered(providerId => { - if (this.treeNodeProviderId === providerId) { - return this.updateProvider(); - } - return undefined; - }); - - return TPromise.as(null); - } - } - - public getOptimalWidth(): number { - const parentNode = this.tree.getHTMLElement(); - const childNodes = [].slice.call(parentNode.querySelectorAll('.outline-item-label > a')); - - return DOM.getLargestChildWidth(parentNode, childNodes); - } - - private updateProvider(): TPromise { - if (this.providerDisposables) { - dispose(this.providerDisposables); - } - - const provider = this.treeExplorerService.getProvider(this.treeNodeProviderId); - provider.onRefresh(node => this.tree.refresh(node)); - return this.treeExplorerService.provideRootNode(this.treeNodeProviderId).then(tree => { - this.tree.setInput(tree); - }); - } -} diff --git a/src/vs/workbench/parts/explorers/browser/views/treeExplorerViewer.ts b/src/vs/workbench/parts/explorers/browser/views/treeExplorerViewer.ts deleted file mode 100644 index a54e64d0c77..00000000000 --- a/src/vs/workbench/parts/explorers/browser/views/treeExplorerViewer.ts +++ /dev/null @@ -1,208 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { $, Builder } from 'vs/base/browser/builder'; -import { ITree, IDataSource, IRenderer, IActionProvider, ContextMenuEvent } from 'vs/base/parts/tree/browser/tree'; -import { InternalTreeNode } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; -import { ClickBehavior, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; -import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IActionRunner, IAction, ActionRunner } from 'vs/base/common/actions'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; -import { ITreeExplorerService } from 'vs/workbench/parts/explorers/common/treeExplorerService'; -import { IProgressService } from 'vs/platform/progress/common/progress'; -import { TreeExplorerMenus } from 'vs/workbench/parts/explorers/browser/treeExplorerMenus'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; -import { ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MenuItemAction } from 'vs/platform/actions/common/actions'; - -export class TreeDataSource implements IDataSource { - - constructor( - private treeNodeProviderId: string, - @ITreeExplorerService private treeExplorerService: ITreeExplorerService, - @IProgressService private progressService: IProgressService - ) { - - } - - public getId(tree: ITree, node: InternalTreeNode): string { - return node.id.toString(); - } - - public hasChildren(tree: ITree, node: InternalTreeNode): boolean { - return node.hasChildren; - } - - public getChildren(tree: ITree, node: InternalTreeNode): TPromise { - const promise = this.treeExplorerService.resolveChildren(this.treeNodeProviderId, node); - - this.progressService.showWhile(promise, 800); - - return promise; - } - - public getParent(tree: ITree, node: InternalTreeNode): TPromise { - return TPromise.as(null); - } -} - -export interface ITreeExplorerTemplateData { - label: Builder; -} - -export class TreeRenderer implements IRenderer { - - private static ITEM_HEIGHT = 22; - private static TREE_TEMPLATE_ID = 'treeExplorer'; - - constructor( - state: TreeExplorerViewletState, - actionRunner: IActionRunner - ) { - } - - public getHeight(tree: ITree, element: any): number { - return TreeRenderer.ITEM_HEIGHT; - } - - public getTemplateId(tree: ITree, element: any): string { - return TreeRenderer.TREE_TEMPLATE_ID; - } - - public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): ITreeExplorerTemplateData { - const el = $(container); - const item = $('.custom-viewlet-tree-node-item'); - item.appendTo(el); - - const label = $('.custom-viewlet-tree-node-item-label').appendTo(item); - const link = $('a.plain').appendTo(label); - - return { label: link }; - } - - public renderElement(tree: ITree, node: InternalTreeNode, templateId: string, templateData: ITreeExplorerTemplateData): void { - templateData.label.text(node.label).title(node.label); - } - - public disposeTemplate(tree: ITree, templateId: string, templateData: ITreeExplorerTemplateData): void { - } -} - -export class TreeController extends DefaultController { - - constructor( - private treeNodeProviderId: string, - private menus: TreeExplorerMenus, - @IContextMenuService private contextMenuService: IContextMenuService, - @ITreeExplorerService private treeExplorerService: ITreeExplorerService, - @IKeybindingService private _keybindingService: IKeybindingService - ) { - super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false }); - } - - public onLeftClick(tree: ITree, node: InternalTreeNode, event: IMouseEvent, origin: string = 'mouse'): boolean { - super.onLeftClick(tree, node, event, origin); - - if (node.clickCommand) { - this.treeExplorerService.executeCommand(this.treeNodeProviderId, node); - } - - return true; - } - - public onContextMenu(tree: ITree, node: InternalTreeNode, event: ContextMenuEvent): boolean { - tree.setFocus(node); - const actions = this.menus.getResourceContextActions(); - if (!actions.length) { - return true; - } - const anchor = { x: event.posx + 1, y: event.posy }; - this.contextMenuService.showContextMenu({ - getAnchor: () => anchor, - - getActions: () => { - return TPromise.as(actions); - }, - - getActionItem: (action) => { - const keybinding = this._keybindingFor(action); - if (keybinding) { - return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); - } - return null; - }, - - getKeyBinding: (action): ResolvedKeybinding => { - return this._keybindingFor(action); - }, - - onHide: (wasCancelled?: boolean) => { - if (wasCancelled) { - tree.DOMFocus(); - } - }, - - getActionsContext: () => node, - - actionRunner: new MultipleSelectionActionRunner(() => tree.getSelection()) - }); - - return true; - } - - private _keybindingFor(action: IAction): ResolvedKeybinding { - return this._keybindingService.lookupKeybinding(action.id); - } -} - -export interface ITreeExplorerViewletState { - actionProvider: IActionProvider; -} - -export class TreeExplorerActionProvider extends ContributableActionProvider { - private state: TreeExplorerViewletState; - - constructor(state: TreeExplorerViewletState) { - super(); - - this.state = state; - } -} - -export class TreeExplorerViewletState implements ITreeExplorerViewletState { - private _actionProvider: TreeExplorerActionProvider; - - constructor() { - this._actionProvider = new TreeExplorerActionProvider(this); - } - - public get actionProvider() { return this._actionProvider; } -} - -class MultipleSelectionActionRunner extends ActionRunner { - - constructor(private getSelectedResources: () => InternalTreeNode[]) { - super(); - } - - runAction(action: IAction, context: InternalTreeNode): TPromise { - if (action instanceof MenuItemAction) { - const selection = this.getSelectedResources(); - const filteredSelection = selection.filter(s => s !== context); - - if (selection.length === filteredSelection.length || selection.length === 1) { - return action.run(context); - } - - return action.run(context, ...filteredSelection); - } - - return super.runAction(action, context); - } -} diff --git a/src/vs/workbench/parts/explorers/common/treeExplorer.ts b/src/vs/workbench/parts/explorers/common/treeExplorer.ts deleted file mode 100644 index fad6a30fd85..00000000000 --- a/src/vs/workbench/parts/explorers/common/treeExplorer.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -export function toViewletId(viewletId: string): string { - return `workbench.view.extension.${viewletId}`; -} - -export function toViewletActionId(viewletId: string): string { - return `workbench.action.extension.${viewletId}`; -} - -export function toViewletCSSClass(viewletId: string): string { - return `extensionViewlet-${viewletId}`; -} - -export function isValidViewletId(viewletId: string): boolean { - return /^[a-z0-9_-]+$/i.test(viewletId); // Only allow alphanumeric letters, `_` and `-`. -} diff --git a/src/vs/workbench/parts/explorers/common/treeExplorerService.ts b/src/vs/workbench/parts/explorers/common/treeExplorerService.ts deleted file mode 100644 index 6e388e29b82..00000000000 --- a/src/vs/workbench/parts/explorers/common/treeExplorerService.ts +++ /dev/null @@ -1,28 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 Event from 'vs/base/common/event'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { InternalTreeNode, InternalTreeNodeProvider } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; - -export const ITreeExplorerService = createDecorator('treeExplorerService'); - -export interface ITreeExplorerService { - _serviceBrand: any; - - onDidChangeProvider: Event; - activeProvider: string; - - onTreeExplorerNodeProviderRegistered: Event; - registerTreeExplorerNodeProvider(providerId: string, provider: InternalTreeNodeProvider): void; - hasProvider(providerId: string): boolean; - getProvider(providerId: string): InternalTreeNodeProvider; - - provideRootNode(providerId: string): TPromise; - resolveChildren(providerId: string, node: InternalTreeNode): TPromise; - executeCommand(providerId: string, node: InternalTreeNode): TPromise; -} diff --git a/src/vs/workbench/parts/explorers/common/treeExplorerViewModel.ts b/src/vs/workbench/parts/explorers/common/treeExplorerViewModel.ts deleted file mode 100644 index a2b19716471..00000000000 --- a/src/vs/workbench/parts/explorers/common/treeExplorerViewModel.ts +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import Event from 'vs/base/common/event'; - -export interface InternalTreeNodeContent { - label: string; - hasChildren: boolean; - clickCommand: string; -} - -export interface InternalTreeNode extends InternalTreeNodeContent { - readonly id: string; - readonly providerId: string; -} - -export interface InternalTreeNodeProvider { - id: string; - provideRootNode(): Thenable; - resolveChildren(node: InternalTreeNodeContent): Thenable; - executeCommand(node: InternalTreeNodeContent): TPromise; - onRefresh?: Event; -} diff --git a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts index f6ff2ad5dd9..11915ba81c4 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts @@ -688,6 +688,10 @@ export class ExtensionEditor extends BaseEditor { } const keyBinding = KeybindingIO.readKeybinding(key || rawKeyBinding.key, OS); + if (!keyBinding) { + return null; + } + return this.keybindingService.resolveKeybinding(keyBinding)[0]; } diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index 748b574f248..b922ba26c25 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -31,13 +31,17 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; import { IExtensionService, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import URI from 'vs/base/common/uri'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, registerColor, foreground } from 'vs/platform/theme/common/colorRegistry'; +import { Color } from 'vs/base/common/color'; export class InstallAction extends Action { private static InstallLabel = localize('installAction', "Install"); private static InstallingLabel = localize('installing', "Installing"); - private static Class = 'extension-action install'; + private static Class = 'extension-action prominent install'; private static InstallingClass = 'extension-action install installing'; private disposables: IDisposable[] = []; @@ -152,7 +156,7 @@ export class UninstallAction extends Action { export class CombinedInstallAction extends Action { - private static NoExtensionClass = 'extension-action install no-extension'; + private static NoExtensionClass = 'extension-action prominent install no-extension'; private installAction: InstallAction; private uninstallAction: UninstallAction; private disposables: IDisposable[] = []; @@ -223,7 +227,7 @@ export class CombinedInstallAction extends Action { export class UpdateAction extends Action { - private static EnabledClass = 'extension-action update'; + private static EnabledClass = 'extension-action prominent update'; private static DisabledClass = `${UpdateAction.EnabledClass} disabled`; private static Label = localize('updateAction', "Update"); @@ -476,7 +480,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction { export class EnableAction extends Action { static ID = 'extensions.enable'; - private static EnabledClass = 'extension-action enable'; + private static EnabledClass = 'extension-action prominent enable'; private static DisabledClass = `${EnableAction.EnabledClass} disabled`; private disposables: IDisposable[] = []; @@ -681,6 +685,59 @@ export class CheckForUpdatesAction extends Action { } } +export class ToggleAutoUpdateAction extends Action { + + constructor( + id: string, + label: string, + private autoUpdateValue: boolean, + @IConfigurationService configurationService: IConfigurationService, + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService + ) { + super(id, label, '', true); + this.updateEnablement(); + configurationService.onDidUpdateConfiguration(() => this.updateEnablement()); + } + + private updateEnablement(): void { + this.enabled = this.extensionsWorkbenchService.isAutoUpdateEnabled !== this.autoUpdateValue; + } + + run(): TPromise { + return this.extensionsWorkbenchService.setAutoUpdate(this.autoUpdateValue); + } +} + +export class EnableAutoUpdateAction extends ToggleAutoUpdateAction { + + static ID = 'workbench.extensions.action.enableAutoUpdate'; + static LABEL = localize('enableAutoUpdate', "Enable Auto Updating Extensions"); + + constructor( + id = EnableAutoUpdateAction.ID, + label = EnableAutoUpdateAction.LABEL, + @IConfigurationService configurationService: IConfigurationService, + @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService + ) { + super(id, label, true, configurationService, extensionsWorkbenchService); + } +} + +export class DisableAutoUpdateAction extends ToggleAutoUpdateAction { + + static ID = 'workbench.extensions.action.disableAutoUpdate'; + static LABEL = localize('disableAutoUpdate', "Disable Auto Updating Extensions"); + + constructor( + id = EnableAutoUpdateAction.ID, + label = EnableAutoUpdateAction.LABEL, + @IConfigurationService configurationService: IConfigurationService, + @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService + ) { + super(id, label, false, configurationService, extensionsWorkbenchService); + } +} + export class UpdateAllAction extends Action { static ID = 'workbench.extensions.action.updateAllExtensions'; @@ -1048,6 +1105,34 @@ export class ShowRecommendedKeymapExtensionsAction extends Action { } } +export class ShowLanguageExtensionsAction extends Action { + + static ID = 'workbench.extensions.action.showLanguageExtensions'; + static LABEL = localize('showLanguageExtensions', "Show Language Extensions"); + static SHORT_LABEL = localize('showLanguageExtensionsShort', "Language Extensions"); + + constructor( + id: string, + label: string, + @IViewletService private viewletService: IViewletService + ) { + super(id, label, null, true); + } + + run(): TPromise { + return this.viewletService.openViewlet(VIEWLET_ID, true) + .then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search('@sort:installs @category:languages '); + viewlet.focus(); + }); + } + + protected isEnabled(): boolean { + return true; + } +} + export class ChangeSortAction extends Action { private query: Query; @@ -1303,3 +1388,63 @@ CommandsRegistry.registerCommand('workbench.extensions.action.showLanguageExtens viewlet.focus(); }); }); + +export const extensionButtonProminentBackground = registerColor('extensionButton.prominentBackground', { + dark: '#327e36', + light: '#327e36', + hc: null +}, localize('extensionButtonProminentBackground', "Button background color for actions extension that stand out (e.g. install button).")); + +export const extensionButtonProminentForeground = registerColor('extensionButton.prominentForeground', { + dark: Color.white, + light: Color.white, + hc: null +}, localize('extensionButtonProminentForeground', "Button foreground color for actions extension that stand out (e.g. install button).")); + +export const extensionButtonProminentHoverBackground = registerColor('extensionButton.prominentHoverBackground', { + dark: '#28632b', + light: '#28632b', + hc: null +}, localize('extensionButtonProminentHoverBackground', "Button background hover color for actions extension that stand out (e.g. install button).")); + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + const foregroundColor = theme.getColor(foreground); + if (foregroundColor) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action.built-in-status { border-color: ${foregroundColor}; }`); + } + + const buttonBackgroundColor = theme.getColor(buttonBackground); + if (buttonBackgroundColor) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action { background-color: ${buttonBackgroundColor}; }`); + } + + const buttonForegroundColor = theme.getColor(buttonForeground); + if (buttonForegroundColor) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action { color: ${buttonForegroundColor}; }`); + } + + const buttonHoverBackgroundColor = theme.getColor(buttonHoverBackground); + if (buttonHoverBackgroundColor) { + collector.addRule(`.monaco-action-bar .action-item:hover .action-label.extension-action { background-color: ${buttonHoverBackgroundColor}; }`); + } + + const contrastBorderColor = theme.getColor(contrastBorder); + if (contrastBorderColor) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action { border: 1px solid ${contrastBorderColor}; }`); + } + + const extensionButtonProminentBackgroundColor = theme.getColor(extensionButtonProminentBackground); + if (extensionButtonProminentBackground) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`); + } + + const extensionButtonProminentForegroundColor = theme.getColor(extensionButtonProminentForeground); + if (extensionButtonProminentForeground) { + collector.addRule(`.monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`); + } + + const extensionButtonProminentHoverBackgroundColor = theme.getColor(extensionButtonProminentHoverBackground); + if (extensionButtonProminentHoverBackground) { + collector.addRule(`.monaco-action-bar .action-item:hover .action-label.extension-action.prominent { background-color: ${extensionButtonProminentHoverBackgroundColor}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/browser/media/extensionActions.css b/src/vs/workbench/parts/extensions/browser/media/extensionActions.css index 5a51986dce8..c9b9d8508a2 100644 --- a/src/vs/workbench/parts/extensions/browser/media/extensionActions.css +++ b/src/vs/workbench/parts/extensions/browser/media/extensionActions.css @@ -4,69 +4,10 @@ *--------------------------------------------------------------------------------------------*/ .monaco-action-bar .action-item .action-label.extension-action { - border: 1px solid #CCC; - color: #6C6C6C; - background-color: #E2E2E2; padding: 0 5px; line-height: initial; } -.monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action { - background-color: #D9D9D9; -} - -.monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action { - background-color: #C9C9C9; -} - -.vs-dark .monaco-action-bar .action-item .action-label.extension-action { - border: 1px solid #545454; - color: #CCC; - background-color: #3A3A3A; -} - -.vs-dark .monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action { - background-color: #464646; -} - -.vs-dark .monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action { - background-color: #505050; -} - -.monaco-action-bar .action-item .action-label.extension-action.install, -.monaco-action-bar .action-item .action-label.extension-action.enable, -.monaco-action-bar .action-item .action-label.extension-action.update { - color: white; - background-color: #327e36; - border-color: #519A55; -} - -.monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action.install, -.monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action.enable, -.monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action.update { - background-color: #478E4B; -} - -.monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action.install, -.monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action.enable, -.monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action.update { - background-color: #6DA770; -} - -.monaco-action-bar .action-item .action-label.extension-action.reload { - color: white; - background-color: #007ACC; - border-color: #3F8BCE; -} - -.monaco-action-bar .action-item:not(.disabled):hover .action-label.extension-action.reload { - background-color: #2584C4; -} - -.monaco-action-bar .action-item:not(.disabled):active .action-label.extension-action.reload { - background-color: #4294CC -} - .monaco-action-bar .action-item .action-label.clear-extensions { background: url('clear.svg') center center no-repeat; } @@ -95,7 +36,6 @@ .monaco-action-bar .action-item .action-label.extension-action.built-in-status { border-radius: 4px; - border-color: #c1c1c1; color: inherit; background-color: transparent; opacity: 0.9; diff --git a/src/vs/workbench/parts/extensions/browser/media/extensionEditor.css b/src/vs/workbench/parts/extensions/browser/media/extensionEditor.css index 535e95226df..4eb762a80a4 100644 --- a/src/vs/workbench/parts/extensions/browser/media/extensionEditor.css +++ b/src/vs/workbench/parts/extensions/browser/media/extensionEditor.css @@ -58,12 +58,6 @@ white-space: nowrap; } -.extension-editor > .header > .details > .title .extension-status { - width: 10px; - height: 10px; - margin-left: 10px; -} - .extension-editor > .header > .details > .subtitle { padding-top: 10px; white-space: nowrap; diff --git a/src/vs/workbench/parts/extensions/browser/media/extensionsWidgets.css b/src/vs/workbench/parts/extensions/browser/media/extensionsWidgets.css index 09a1b1342fd..7ddd1d4c880 100644 --- a/src/vs/workbench/parts/extensions/browser/media/extensionsWidgets.css +++ b/src/vs/workbench/parts/extensions/browser/media/extensionsWidgets.css @@ -46,22 +46,4 @@ .extension-ratings.small > .count { margin-left: 2px; -} - -.extension-status { - display: none; -} - -.extension-status.active, -.extension-status.disabled { - border-radius: 50%; - display: inline-block; -} - -.extension-status.active { - background: #478E4B; -} - -.extension-status.disabled { - background: #5f5f5f; } \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/common/extensions.ts b/src/vs/workbench/parts/extensions/common/extensions.ts index 7828aa162c1..269fd45a7df 100644 --- a/src/vs/workbench/parts/extensions/common/extensions.ts +++ b/src/vs/workbench/parts/extensions/common/extensions.ts @@ -67,6 +67,7 @@ export interface IExtensionsWorkbenchService { _serviceBrand: any; onChange: Event; local: IExtension[]; + isAutoUpdateEnabled: boolean; queryLocal(): TPromise; queryGallery(options?: IQueryOptions): TPromise>; canInstall(extension: IExtension): boolean; @@ -77,10 +78,12 @@ export interface IExtensionsWorkbenchService { loadDependencies(extension: IExtension): TPromise; open(extension: IExtension, sideByside?: boolean): TPromise; checkForUpdates(): TPromise; + setAutoUpdate(autoUpdate: boolean): TPromise; } export const ConfigurationKey = 'extensions'; export interface IExtensionsConfiguration { autoUpdate: boolean; + ignoreRecommendations: boolean; } \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index 930fd9d6769..c5f9866b41e 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -15,13 +15,16 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IModel } from 'vs/editor/common/editorCommon'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import product from 'vs/platform/node/product'; -import { IChoiceService } from 'vs/platform/message/common/message'; +import { IChoiceService, IMessageService } from 'vs/platform/message/common/message'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ShowRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction } from 'vs/workbench/parts/extensions/browser/extensionsActions'; import Severity from 'vs/base/common/severity'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { Schemas } from 'vs/base/common/network'; import { IFileService } from 'vs/platform/files/common/files'; +import { IExtensionsConfiguration, ConfigurationKey } from 'vs/workbench/parts/extensions/common/extensions'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; interface IExtensionsContent { recommendations: string[]; @@ -37,6 +40,7 @@ export class ExtensionTipsService implements IExtensionTipsService { private _availableRecommendations: { [pattern: string]: string[] } = Object.create(null); private importantRecommendations: { [id: string]: { name: string; pattern: string; } }; private importantRecommendationsIgnoreList: string[]; + private _allRecommendations: string[]; private _disposables: IDisposable[] = []; constructor( @@ -47,7 +51,10 @@ export class ExtensionTipsService implements IExtensionTipsService { @IExtensionManagementService private extensionsService: IExtensionManagementService, @IInstantiationService private instantiationService: IInstantiationService, @IFileService private fileService: IFileService, - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IConfigurationService private configurationService: IConfigurationService, + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, + @IMessageService private messageService: IMessageService ) { if (!this._galleryService.isEnabled()) { return; @@ -74,13 +81,25 @@ export class ExtensionTipsService implements IExtensionTipsService { } getRecommendations(): string[] { - return Object.keys(this._recommendations); + const allRecomendations = this._getAllRecommendationsInProduct(); + return Object.keys(this._recommendations) + .filter(recommendation => allRecomendations.indexOf(recommendation) !== -1); } getKeymapRecommendations(): string[] { return product.keymapExtensionTips || []; } + private _getAllRecommendationsInProduct(): string[] { + if (!this._allRecommendations) { + this._allRecommendations = [...Object.keys(this.importantRecommendations)]; + forEach(this._availableRecommendations, ({ value: ids }) => { + this._allRecommendations.push(...ids); + }); + } + return this._allRecommendations; + } + private _suggestTips() { const extensionTips = product.extensionTips; if (!extensionTips) { @@ -152,6 +171,12 @@ export class ExtensionTipsService implements IExtensionTipsService { StorageScope.GLOBAL ); + const config = this.configurationService.getConfiguration(ConfigurationKey); + + if (config.ignoreRecommendations) { + return; + } + this.extensionsService.getInstalled(LocalExtensionType.User).done(local => { Object.keys(this.importantRecommendations) .filter(id => this.importantRecommendationsIgnoreList.indexOf(id) === -1) @@ -174,14 +199,13 @@ export class ExtensionTipsService implements IExtensionTipsService { this.choiceService.choose(Severity.Info, message, options, 2).done(choice => { switch (choice) { case 0: return recommendationsAction.run(); - case 1: - this.importantRecommendationsIgnoreList.push(id); - - return this.storageService.store( + case 1: this.importantRecommendationsIgnoreList.push(id); + this.storageService.store( 'extensionsAssistant/importantRecommendationsIgnore', JSON.stringify(this.importantRecommendationsIgnoreList), StorageScope.GLOBAL ); + return this.ignoreExtensionRecommendations(); } }); }); @@ -196,6 +220,11 @@ export class ExtensionTipsService implements IExtensionTipsService { return; } + const config = this.configurationService.getConfiguration(ConfigurationKey); + + if (config.ignoreRecommendations) { + return; + } this.getWorkspaceRecommendations().done(allRecommendations => { if (!allRecommendations.length) { return; @@ -228,6 +257,35 @@ export class ExtensionTipsService implements IExtensionTipsService { }); } + private ignoreExtensionRecommendations() { + const message = localize('ignoreExtensionRecommendations', "Do you want to ignore all extension recommendations ?"); + const options = [ + localize('ignoreAll', "Yes, Ignore All"), + localize('no', "No"), + localize('cancel', "Cancel") + ]; + + this.choiceService.choose(Severity.Info, message, options, 2).done(choice => { + switch (choice) { + case 0: // If the user ignores the current message and selects different file type + // we should hide all the stacked up messages as he has selected Yes, Ignore All + this.messageService.hideAll(); + return this.setIgnoreRecommendationsConfig(true); + case 1: return this.setIgnoreRecommendationsConfig(false); + } + }); + } + + private setIgnoreRecommendationsConfig(configVal: boolean) { + let target = ConfigurationTarget.USER; + const configKey = 'extensions.ignoreRecommendations'; + this.configurationEditingService.writeConfiguration(target, { key: configKey, value: configVal }); + if (configVal) { + const ignoreWorkspaceRecommendationsStorageKey = 'extensionsAssistant/workspaceRecommendationsIgnore'; + this.storageService.store(ignoreWorkspaceRecommendationsStorageKey, true, StorageScope.WORKSPACE); + } + } + getKeywordsForExtension(extension: string): string[] { const keywords = product.extensionKeywords || {}; return keywords[extension] || []; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts index b34622e879a..74161d1c27c 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts @@ -24,7 +24,7 @@ import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/e import { OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowWorkspaceRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, UpdateAllAction, ConfigureWorkspaceRecommendedExtensionsAction, - EnableAllAction, EnableAllWorkpsaceAction, DisableAllAction, DisableAllWorkpsaceAction, CheckForUpdatesAction + EnableAllAction, EnableAllWorkpsaceAction, DisableAllAction, DisableAllWorkpsaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction } from 'vs/workbench/parts/extensions/browser/extensionsActions'; import { OpenExtensionsFolderAction, InstallVSIXAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; @@ -37,7 +37,7 @@ import jsonContributionRegistry = require('vs/platform/jsonschemas/common/jsonCo import { ExtensionsConfigurationSchema, ExtensionsConfigurationSchemaId } from 'vs/workbench/parts/extensions/common/extensionsFileTemplate'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeymapExtensions } from 'vs/workbench/parts/extensions/electron-browser/keymapExtensions'; +import { KeymapExtensions, BetterMergeDisabled } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; import { adoptToGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; // Singletons @@ -48,6 +48,7 @@ registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService); const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); workbenchRegistry.registerWorkbenchContribution(StatusUpdater); workbenchRegistry.registerWorkbenchContribution(KeymapExtensions); +workbenchRegistry.registerWorkbenchContribution(BetterMergeDisabled); Registry.as(OutputExtensions.OutputChannels) .registerChannel(ExtensionsChannelId, ExtensionsLabel); @@ -115,6 +116,9 @@ actionRegistry.registerWorkbenchAction(recommendationsActionDescriptor, 'Extensi const keymapRecommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedKeymapExtensionsAction, ShowRecommendedKeymapExtensionsAction.ID, ShowRecommendedKeymapExtensionsAction.SHORT_LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_M) }); actionRegistry.registerWorkbenchAction(keymapRecommendationsActionDescriptor, 'Preferences: Keymaps', PreferencesLabel); +const languageExtensionsActionDescriptor = new SyncActionDescriptor(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL); +actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Extensions: Language Extensions', PreferencesLabel); + const workspaceRecommendationsActionDescriptor = new SyncActionDescriptor(ShowWorkspaceRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction.ID, ShowWorkspaceRecommendedExtensionsAction.LABEL); actionRegistry.registerWorkbenchAction(workspaceRecommendationsActionDescriptor, 'Extensions: Show Workspace Recommended Extensions', ExtensionsLabel); @@ -154,6 +158,9 @@ actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: En const checkForUpdatesAction = new SyncActionDescriptor(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL); actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Updates`, ExtensionsLabel); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel); + Registry.as(ConfigurationExtensions.Configuration) .registerConfiguration({ id: 'extensions', @@ -164,6 +171,11 @@ Registry.as(ConfigurationExtensions.Configuration) 'extensions.autoUpdate': { type: 'boolean', description: localize('extensionsAutoUpdate', "Automatically update extensions"), + default: true + }, + 'extensions.ignoreRecommendations': { + type: 'boolean', + description: localize('extensionsIgnoreRecommendations', "Ignore extension recommendations"), default: false } } diff --git a/src/vs/workbench/parts/extensions/electron-browser/keymapExtensions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts similarity index 53% rename from src/vs/workbench/parts/extensions/electron-browser/keymapExtensions.ts rename to src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts index 5c30ad7c0be..c33a4ecd7d4 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/keymapExtensions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts @@ -6,20 +6,23 @@ 'use strict'; import * as arrays from 'vs/base/common/arrays'; -import * as nls from 'vs/nls'; +import { localize } from 'vs/nls'; import Event, { chain, any, debounceEvent } from 'vs/base/common/event'; import { onUnexpectedError, canceled } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IChoiceService } from 'vs/platform/message/common/message'; -import Severity from 'vs/base/common/severity'; +import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService, IExtensionTipsService, LocalExtensionType } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { IMessageService, Severity, IChoiceService } from 'vs/platform/message/common/message'; +import { Action } from 'vs/base/common/actions'; +import { BetterMergeDisabledNowKey, BetterMergeId, getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -export interface IKeymapExtension { +export interface IExtensionStatus { identifier: string; local: ILocalExtension; globallyEnabled: boolean; @@ -32,13 +35,14 @@ export class KeymapExtensions implements IWorkbenchContribution { constructor( @IInstantiationService private instantiationService: IInstantiationService, @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, + @IExtensionTipsService private tipsService: IExtensionTipsService, @IChoiceService private choiceService: IChoiceService, @ILifecycleService lifecycleService: ILifecycleService, @ITelemetryService private telemetryService: ITelemetryService, ) { this.disposables.push( lifecycleService.onShutdown(() => this.dispose()), - instantiationService.invokeFunction(onKeymapExtensionChanged)((ids => { + instantiationService.invokeFunction(onExtensionChanged)((ids => { TPromise.join(ids.map(id => this.checkForOtherKeymaps(id))) .then(null, onUnexpectedError); })) @@ -50,10 +54,11 @@ export class KeymapExtensions implements IWorkbenchContribution { } private checkForOtherKeymaps(extensionId: string): TPromise { - return this.instantiationService.invokeFunction(getInstalledKeymaps).then(extensions => { - const extension = arrays.first(extensions, extension => extension.identifier === extensionId); + return this.instantiationService.invokeFunction(getInstalledExtensions).then(extensions => { + const keymaps = extensions.filter(extension => isKeymapExtension(this.tipsService, extension)); + const extension = arrays.first(keymaps, extension => extension.identifier === extensionId); if (extension && extension.globallyEnabled) { - const otherKeymaps = extensions.filter(extension => extension.identifier !== extensionId && extension.globallyEnabled); + const otherKeymaps = keymaps.filter(extension => extension.identifier !== extensionId && extension.globallyEnabled); if (otherKeymaps.length) { return this.promptForDisablingOtherKeymaps(extension, otherKeymaps); } @@ -62,16 +67,16 @@ export class KeymapExtensions implements IWorkbenchContribution { }); } - private promptForDisablingOtherKeymaps(newKeymap: IKeymapExtension, oldKeymaps: IKeymapExtension[]): TPromise { + private promptForDisablingOtherKeymaps(newKeymap: IExtensionStatus, oldKeymaps: IExtensionStatus[]): TPromise { const telemetryData: { [key: string]: any; } = { newKeymap: newKeymap.identifier, oldKeymaps: oldKeymaps.map(k => k.identifier) }; this.telemetryService.publicLog('disableOtherKeymapsConfirmation', telemetryData); - const message = nls.localize('disableOtherKeymapsConfirmation', "Disable other keymaps to avoid conflicts between keybindings?"); + const message = localize('disableOtherKeymapsConfirmation', "Disable other keymaps ({0}) to avoid conflicts between keybindings?", oldKeymaps.map(k => `'${k.local.manifest.displayName}'`).join(', ')); const options = [ - nls.localize('yes', "Yes"), - nls.localize('no', "No") + localize('yes', "Yes"), + localize('no', "No") ]; return this.choiceService.choose(Severity.Info, message, options, 1, false) .then(value => { @@ -92,7 +97,7 @@ export class KeymapExtensions implements IWorkbenchContribution { } } -export function onKeymapExtensionChanged(accessor: ServicesAccessor): Event { +export function onExtensionChanged(accessor: ServicesAccessor): Event { const extensionService = accessor.get(IExtensionManagementService); const extensionEnablementService = accessor.get(IExtensionEnablementService); return debounceEvent(any( @@ -110,13 +115,12 @@ export function onKeymapExtensionChanged(accessor: ServicesAccessor): Event { +export function getInstalledExtensions(accessor: ServicesAccessor): TPromise { const extensionService = accessor.get(IExtensionManagementService); const extensionEnablementService = accessor.get(IExtensionEnablementService); - const tipsService = accessor.get(IExtensionTipsService); return extensionService.getInstalled().then(extensions => { const globallyDisabled = extensionEnablementService.getGloballyDisabledExtensions(); - const installedExtensions = extensions.map(extension => { + return extensions.map(extension => { const identifier = stripVersion(extension.id); return { identifier, @@ -124,15 +128,56 @@ export function getInstalledKeymaps(accessor: ServicesAccessor): TPromise isKeymapExtension(tipsService, extension)); }); } -function isKeymapExtension(tipsService: IExtensionTipsService, extension: IKeymapExtension): boolean { +export function isKeymapExtension(tipsService: IExtensionTipsService, extension: IExtensionStatus): boolean { const cats = extension.local.manifest.categories; return cats && cats.indexOf('Keymaps') !== -1 || tipsService.getKeymapRecommendations().indexOf(extension.identifier) !== -1; } function stripVersion(id: string): string { - return id.replace(/-\d+\.\d+\.\d+$/, ''); + return getIdAndVersionFromLocalExtensionId(id).id; +} + +export class BetterMergeDisabled implements IWorkbenchContribution { + + constructor( + @IStorageService storageService: IStorageService, + @IMessageService messageService: IMessageService, + @IExtensionService extensionService: IExtensionService, + @IExtensionManagementService extensionManagementService: IExtensionManagementService, + @ITelemetryService telemetryService: ITelemetryService, + ) { + extensionService.onReady().then(() => { + if (storageService.getBoolean(BetterMergeDisabledNowKey, StorageScope.GLOBAL, false)) { + storageService.remove(BetterMergeDisabledNowKey, StorageScope.GLOBAL); + telemetryService.publicLog('betterMergeDisabled'); + messageService.show(Severity.Info, { + message: localize('betterMergeDisabled', "The Better Merge extension is now built-in, the installed extension was disabled and can be uninstalled."), + actions: [ + new Action('uninstall', localize('uninstall', "Uninstall"), null, true, () => { + telemetryService.publicLog('betterMergeUninstall', { + outcome: 'uninstall', + }); + return extensionManagementService.getInstalled(LocalExtensionType.User).then(extensions => { + return Promise.all(extensions.filter(e => stripVersion(e.id) === BetterMergeId) + .map(e => extensionManagementService.uninstall(e, true))); + }); + }), + new Action('later', localize('later', "Later"), null, true, () => { + telemetryService.publicLog('betterMergeUninstall', { + outcome: 'later', + }); + return TPromise.as(true); + }) + ] + }); + } + }); + } + + getId(): string { + return 'vs.extensions.betterMergeDisabled'; + } } diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 73345e9c66b..63e301eff01 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -32,7 +32,8 @@ import { Delegate, Renderer } from 'vs/workbench/parts/extensions/browser/extens import { IExtensionsWorkbenchService, IExtension, IExtensionsViewlet, VIEWLET_ID, ExtensionState } from '../common/extensions'; import { ShowRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, - ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction + ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction, + EnableAutoUpdateAction, DisableAutoUpdateAction } from 'vs/workbench/parts/extensions/browser/extensionsActions'; import { InstallVSIXAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, SortBy, SortOrder, IQueryOptions, LocalExtensionType } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -50,8 +51,9 @@ import { IActivityBarService, ProgressBadge, NumberBadge } from 'vs/workbench/se import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { inputForeground, inputBackground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { inputForeground, inputBackground, inputBorder } from 'vs/platform/theme/common/colorRegistry'; import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; interface SearchInputEvent extends Event { target: HTMLInputElement; @@ -71,6 +73,8 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { private secondaryActions: IAction[]; private disposables: IDisposable[] = []; + private isAutoUpdateEnabled: boolean; + constructor( @ITelemetryService telemetryService: ITelemetryService, @IExtensionGalleryService private galleryService: IExtensionGalleryService, @@ -86,12 +90,23 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { @IViewletService private viewletService: IViewletService, @IExtensionService private extensionService: IExtensionService, @IModeService private modeService: IModeService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IConfigurationService private configurationService: IConfigurationService, ) { super(VIEWLET_ID, telemetryService, themeService); this.searchDelayer = new ThrottledDelayer(500); this.disposables.push(viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); + this.isAutoUpdateEnabled = this.extensionsWorkbenchService.isAutoUpdateEnabled; + + this.configurationService.onDidUpdateConfiguration(() => { + const isAutoUpdateEnabled = this.extensionsWorkbenchService.isAutoUpdateEnabled; + if (this.isAutoUpdateEnabled !== isAutoUpdateEnabled) { + this.isAutoUpdateEnabled = isAutoUpdateEnabled; + this.secondaryActions = null; + this.updateTitleArea(); + } + }, this, this.disposables); } create(parent: Builder): TPromise { @@ -140,20 +155,24 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { .filter(e => !!e) .on(this.openExtension, this, this.disposables); + chain(this.list.onPin) + .map(e => e.elements[0]) + .filter(e => !!e) + .on(this.pin, this, this.disposables); + return TPromise.as(null); } public updateStyles(): void { super.updateStyles(); - const hcBorder = this.getColor(contrastBorder); - this.searchBox.style.backgroundColor = this.getColor(inputBackground); this.searchBox.style.color = this.getColor(inputForeground); - this.searchBox.style.borderWidth = hcBorder ? '1px' : null; - this.searchBox.style.borderStyle = hcBorder ? 'solid' : null; - this.searchBox.style.borderColor = hcBorder; + const inputBorderColor = this.getColor(inputBorder); + this.searchBox.style.borderWidth = inputBorderColor ? '1px' : null; + this.searchBox.style.borderStyle = inputBorderColor ? 'solid' : null; + this.searchBox.style.borderColor = inputBorderColor; } setVisible(visible: boolean): TPromise { @@ -207,8 +226,11 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.instantiationService.createInstance(ChangeSortAction, 'extensions.sort.name', localize('sort by name', "Sort By: Name"), this.onSearchChange, 'name'), new Separator(), this.instantiationService.createInstance(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL), - this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL), - this.instantiationService.createInstance(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL) + ...(this.isAutoUpdateEnabled ? [this.instantiationService.createInstance(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL)] : [this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL), this.instantiationService.createInstance(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL)]), + this.instantiationService.createInstance(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL), + new Separator(), + this.instantiationService.createInstance(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL), + this.instantiationService.createInstance(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL) ]; } @@ -420,6 +442,13 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.extensionsWorkbenchService.open(extension).done(null, err => this.onError(err)); } + private pin(): void { + const activeEditor = this.editorService.getActiveEditor(); + const activeEditorInput = this.editorService.getActiveEditorInput(); + + this.editorInputService.pinEditor(activeEditor.position, activeEditorInput); + } + private onEnter(): void { this.list.setSelection(this.list.getFocus()); } diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css index e6790ffae2a..14b5fb4f7a7 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css @@ -82,10 +82,11 @@ .extensions-viewlet > .extensions .extension > .details > .header-container > .header { display: flex; align-items: baseline; - flex-wrap: wrap; + flex-wrap: nowrap; overflow: hidden; flex: 1; min-width: 0; + } .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .name { @@ -122,12 +123,6 @@ display: none; } -.extensions-viewlet > .extensions .extension > .details > .header-container .extension-status { - width: 8px; - height: 8px; - margin-left: 6px; -} - .extensions-viewlet > .extensions .extension > .details > .footer { display: flex; justify-content: flex-end; @@ -155,7 +150,7 @@ .extensions-viewlet > .extensions .extension.disabled > .icon, .extensions-viewlet > .extensions .extension.disabled > .details > .header-container, -.extensions-viewlet > .extensions .extension.disabled > .details > .description, +.extensions-viewlet > .extensions .extension.disabled > .details > .description .extensions-viewlet > .extensions .extension.disabled > .details > .footer > .author { opacity: 0.5; } diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index bcaad136e04..9f4f45594c4 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -26,6 +26,7 @@ import { import { getGalleryExtensionIdFromLocal, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IChoiceService, IMessageService } from 'vs/platform/message/common/message'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; @@ -308,12 +309,15 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { private _onChange: Emitter = new Emitter(); get onChange(): Event { return this._onChange.event; } + private _isAutoUpdateEnabled: boolean; + constructor( @IInstantiationService private instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IExtensionManagementService private extensionService: IExtensionManagementService, @IExtensionGalleryService private galleryService: IExtensionGalleryService, @IConfigurationService private configurationService: IConfigurationService, + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, @ITelemetryService private telemetryService: ITelemetryService, @IMessageService private messageService: IMessageService, @IChoiceService private choiceService: IChoiceService, @@ -337,6 +341,17 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { .filter(uri => /^extension/.test(uri.path)) .on(this.onOpenExtensionUrl, this, this.disposables); + this._isAutoUpdateEnabled = this.configurationService.getConfiguration(ConfigurationKey).autoUpdate; + this.configurationService.onDidUpdateConfiguration(() => { + const isAutoUpdateEnabled = this.configurationService.getConfiguration(ConfigurationKey).autoUpdate; + if (this._isAutoUpdateEnabled !== isAutoUpdateEnabled) { + this._isAutoUpdateEnabled = isAutoUpdateEnabled; + if (this._isAutoUpdateEnabled) { + this.checkForUpdates(); + } + } + }, this, this.disposables); + this.queryLocal().done(() => this.eventuallySyncWithGallery(true)); } @@ -426,6 +441,17 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { return this.syncDelayer.trigger(() => this.syncWithGallery(), 0); } + get isAutoUpdateEnabled(): boolean { + return this._isAutoUpdateEnabled; + } + + setAutoUpdate(autoUpdate: boolean): TPromise { + if (this.isAutoUpdateEnabled === autoUpdate) { + return TPromise.as(null); + } + return this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'extensions.autoUpdate', value: autoUpdate }); + } + private eventuallySyncWithGallery(immediate = false): void { const loop = () => this.syncWithGallery().then(() => this.eventuallySyncWithGallery()); const delay = immediate ? 0 : ExtensionsWorkbenchService.SyncPeriod; @@ -452,9 +478,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { } private autoUpdateExtensions(): TPromise { - const config = this.configurationService.getConfiguration(ConfigurationKey); - - if (!config.autoUpdate) { + if (!this.isAutoUpdateEnabled) { return TPromise.as(null); } diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts index ca746ff803c..0f50eb3a0e5 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts @@ -30,6 +30,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; suite('ExtensionsActions Test', () => { @@ -52,6 +53,7 @@ suite('ExtensionsActions Test', () => { instantiationService.stub(ITelemetryService, NullTelemetryService); instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(TestWorkspace)); + instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) }); instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService); @@ -97,7 +99,7 @@ suite('ExtensionsActions Test', () => { testObject.extension = paged.firstPage[0]; assert.ok(!testObject.enabled); assert.equal('Install', testObject.label); - assert.equal('extension-action install', testObject.class); + assert.equal('extension-action prominent install', testObject.class); done(); }); }); @@ -231,7 +233,7 @@ suite('ExtensionsActions Test', () => { const testObject: ExtensionsActions.CombinedInstallAction = instantiationService.createInstance(ExtensionsActions.CombinedInstallAction); assert.ok(!testObject.enabled); - assert.equal('extension-action install no-extension', testObject.class); + assert.equal('extension-action prominent install no-extension', testObject.class); }); test('Test CombinedInstallAction when extension is system extension', (done) => { @@ -242,7 +244,7 @@ suite('ExtensionsActions Test', () => { instantiationService.get(IExtensionsWorkbenchService).queryLocal().done(extensions => { testObject.extension = extensions[0]; assert.ok(!testObject.enabled); - assert.equal('extension-action install no-extension', testObject.class); + assert.equal('extension-action prominent install no-extension', testObject.class); done(); }); }); @@ -257,7 +259,7 @@ suite('ExtensionsActions Test', () => { testObject.extension = paged.firstPage[0]; assert.ok(testObject.enabled); assert.equal('Install', testObject.label); - assert.equal('extension-action install', testObject.class); + assert.equal('extension-action prominent install', testObject.class); done(); }); }); diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 3940de57545..d42837e340e 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -31,6 +31,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { IChoiceService } from 'vs/platform/message/common/message'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; suite('ExtensionsWorkbenchService Test', () => { @@ -55,6 +56,7 @@ suite('ExtensionsWorkbenchService Test', () => { instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService); instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(TestWorkspace)); + instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) }); instantiationService.stub(IExtensionManagementService, ExtensionManagementService); instantiationService.stub(IExtensionManagementService, 'onInstallExtension', installEvent.event); diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedback.ts b/src/vs/workbench/parts/feedback/electron-browser/feedback.ts index 10f65422a6e..ec3746121ea 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedback.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedback.ts @@ -17,6 +17,9 @@ import * as dom from 'vs/base/browser/dom'; import { ICommandService } from 'vs/platform/commands/common/commands'; import * as errors from 'vs/base/common/errors'; import { IIntegrityService } from 'vs/platform/integrity/common/integrity'; +import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { attachStylerCallback } from 'vs/platform/theme/common/styler'; +import { editorWidgetBackground, widgetShadow, inputBorder, inputForeground, inputBackground, inputActiveOptionBorder, editorBackground, buttonBackground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; export interface IFeedback { feedback: string; @@ -67,12 +70,13 @@ export class FeedbackDropdown extends Dropdown { options: IFeedbackDropdownOptions, @ITelemetryService protected telemetryService: ITelemetryService, @ICommandService private commandService: ICommandService, - @IIntegrityService protected integrityService: IIntegrityService + @IIntegrityService protected integrityService: IIntegrityService, + @IThemeService private themeService: IThemeService ) { super(container, { contextViewProvider: options.contextViewProvider, labelRenderer: (container: HTMLElement): IDisposable => { - $(container).addClass('send-feedback'); + $(container).addClass('send-feedback', 'mask-icon'); return null; } @@ -200,6 +204,18 @@ export class FeedbackDropdown extends Dropdown { this.onSubmit(); }); + this.toDispose.push(attachStylerCallback(this.themeService, { widgetShadow, editorWidgetBackground, inputBackground, inputForeground, inputBorder, editorBackground, contrastBorder }, colors => { + $form.style('background-color', colors.editorWidgetBackground); + $form.style('box-shadow', colors.widgetShadow ? `0 2px 8px ${colors.widgetShadow}` : null); + + this.feedbackDescriptionInput.style.backgroundColor = colors.inputBackground; + this.feedbackDescriptionInput.style.color = colors.inputForeground; + this.feedbackDescriptionInput.style.border = `1px solid ${colors.inputBorder || 'transparent'}`; + + $contactUs.style('background-color', colors.editorBackground); + $contactUs.style('border', `1px solid ${colors.contrastBorder || 'transparent'}`); + })); + return { dispose: () => { this.feedbackForm = null; @@ -329,3 +345,18 @@ export class FeedbackDropdown extends Dropdown { this.aliasEnabled = false; } } + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + + // Sentiment Buttons + const inputActiveOptionBorderColor = theme.getColor(inputActiveOptionBorder); + if (inputActiveOptionBorderColor) { + collector.addRule(`.monaco-shell .feedback-form .sentiment.checked { border: 1px solid ${inputActiveOptionBorderColor}; }`); + } + + // Links + const linkColor = theme.getColor(buttonBackground) || theme.getColor(contrastBorder); + if (linkColor) { + collector.addRule(`.monaco-shell .feedback-form .content .channels a { color: ${linkColor}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts index 4c0f0e51c46..b124264626e 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts @@ -11,8 +11,9 @@ import { FeedbackDropdown, IFeedback, IFeedbackService } from './feedback'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import product from 'vs/platform/node/product'; -import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme'; +import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; class TwitterFeedbackService implements IFeedbackService { @@ -53,6 +54,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem { constructor( @IInstantiationService private instantiationService: IInstantiationService, @IContextViewService private contextViewService: IContextViewService, + @IWorkspaceContextService private contextService: IWorkspaceContextService, @IThemeService themeService: IThemeService ) { super(themeService); @@ -62,7 +64,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem { super.updateStyles(); if (this.dropdown) { - this.dropdown.label.style('background-color', this.getColor(STATUS_BAR_FOREGROUND)); + this.dropdown.label.style('background-color', this.getColor(this.contextService.hasWorkspace() ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND)); } } diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/feedback.css b/src/vs/workbench/parts/feedback/electron-browser/media/feedback.css index c957d301d0c..ae5f2d5236a 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/media/feedback.css +++ b/src/vs/workbench/parts/feedback/electron-browser/media/feedback.css @@ -36,17 +36,9 @@ .monaco-shell .feedback-form .content .contactus { padding: 10px; - border: solid 1px #B4BABF; - background-color: #EBF2F9; float: right; } -.monaco-shell.vs-dark .feedback-form .content .contactus { - border: solid 1px #44444C; - background-color: #333337; -} - - .monaco-shell .feedback-form .content .channels { margin-top: 5px; font-size: 0.9em; @@ -58,14 +50,9 @@ /* TODO @C5 review link color */ .monaco-shell .feedback-form .content .channels a { - color: #007ACC; padding: 2px 0; } -.monaco-shell.vs-dark .feedback-form .content .channels a { - color: #75BEFF; -} - .monaco-shell .feedback-form .content .channels a:hover { text-decoration: underline; } @@ -131,10 +118,6 @@ width: 20%; } -.monaco-shell .feedback-form .feedback-sentiment span { - color:rgb(111, 111, 111); -} - .monaco-shell .feedback-form .sentiment { height: 32px; width: 32px; @@ -148,10 +131,6 @@ background-color: #eaeaea; } -.monaco-shell .feedback-form .sentiment.checked { - border: 1px solid #39F; -} - /* Statusbar */ .monaco-shell .statusbar-item > .dropdown.send-feedback { display: inline-block; @@ -163,20 +142,6 @@ } /* Theming */ -.monaco-shell.vs .feedback-form { - color: black; - background: #F6F6F6; -} - -.monaco-shell .feedback-form h2 { - color: #007ACC; -} - -.monaco-shell.vs .feedback-form h3 { - color: #646465; -} - - .monaco-shell.vs .feedback-form .feedback-alias, .monaco-shell.vs .feedback-form .feedback-description { font-family: inherit; border: 1px solid transparent; @@ -224,33 +189,17 @@ background-color: #E51400; } -.monaco-shell.vs-dark .feedback-form { - background: #252526; - box-shadow: 0 2px 8px #000; -} - -.monaco-shell.vs-dark .feedback-form h2 { - color: #75BEFF; -} - .monaco-shell.vs-dark .feedback-form h3 { font-weight: normal; font-size: 1.2em; } .monaco-shell.vs-dark .feedback-form .sentiment:hover { - background-color: #1e1e1e; -} - -.monaco-shell.vs-dark .feedback-form .sentiment.checked { - border-color: #75BEFF; + background-color: rgba(30,30,30,0.8); } .monaco-shell.vs-dark .feedback-form .feedback-alias, .monaco-shell.vs-dark .feedback-form .feedback-description { font-family: inherit; - border: 1px solid transparent; - background-color: #333337; - color: #D4D4D4; } .monaco-shell.vs-dark .feedback-form .cancel, @@ -259,7 +208,7 @@ } .monaco-shell.vs-dark .feedback-form .cancel:hover { - background-color: #1e1e1e; + background-color: rgba(30,30,30,0.8); } .monaco-shell .feedback-form .sentiment.smile { @@ -287,40 +236,18 @@ margin-left: 5px; } -.monaco-shell .feedback-form .privacyLink { - float: left; - color: #007ACC !Important; -} -.monaco-shell.vs-dark .feedback-form .privacyLink { - color: #75BEFF !Important; -} - -.monaco-shell .feedback-form .privacyLink:hover { - text-decoration: underline; -} - /* High Contrast Theming */ .monaco-shell.hc-black .feedback-form { - background-color: #000; outline: 2px solid #6fc3df; outline-offset: -2px; } -.monaco-shell.hc-black .feedback-form h2 { - color: white; -} - .monaco-shell.hc-black .feedback-form .feedback-alias, .monaco-shell.hc-black .feedback-form .feedback-description { font-family: inherit; - border: 1px solid #6FC3DF; - background-color: #000; - color: #D4D4D4; } .monaco-shell.hc-black .feedback-form .content .contactus { padding: 10px; - border: solid 1px #6FC3DF; - background-color: #0C141F; float: right; } .monaco-shell.hc-black .feedback-form .cancel { @@ -343,13 +270,6 @@ background-color: #0C141F; } -.monaco-shell.hc-black .feedback-form .sentiment { - border: 1px solid transparent; -} - -.monaco-shell.hc-black .feedback-form .sentiment.checked { - border: 1px solid #f38518; -} .monaco-shell .feedback-form .infotip { background: none; @@ -360,8 +280,4 @@ height: 16px; width: 16px; display: inline-block; -} - -.monaco-shell.hc-black .feedback-form .privacyLink { - color: white !Important; } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index ec7f682e99c..3929604de10 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -14,7 +14,7 @@ import { Action } from 'vs/base/common/actions'; import { VIEWLET_ID, TEXT_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { ITextFileEditorModel, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; -import { EditorOptions, TextEditorOptions } from 'vs/workbench/common/editor'; +import { EditorOptions, TextEditorOptions, IEditorCloseEvent } from 'vs/workbench/common/editor'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { ExplorerViewlet } from 'vs/workbench/parts/files/browser/explorerViewlet'; @@ -28,7 +28,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { CancelAction } from 'vs/platform/message/common/message'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -49,7 +49,7 @@ export class TextFileEditor extends BaseTextEditor { @IHistoryService private historyService: IHistoryService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService, + @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService, @@ -58,6 +58,9 @@ export class TextFileEditor extends BaseTextEditor { // Clear view state for deleted files this.toUnbind.push(this.fileService.onFileChanges(e => this.onFilesChanged(e))); + + // React to editors closing to preserve view state + this.toUnbind.push(editorGroupService.getStacksModel().onWillCloseEditor(e => this.onWillCloseEditor(e))); } private onFilesChanged(e: FileChangesEvent): void { @@ -67,6 +70,12 @@ export class TextFileEditor extends BaseTextEditor { } } + private onWillCloseEditor(e: IEditorCloseEvent): void { + if (e.editor === this.input && this.position === this.editorGroupService.getStacksModel().positionOfGroup(e.group)) { + this.doSaveTextEditorViewState(this.input); + } + } + public getTitle(): string { return this.input ? this.input.getName() : nls.localize('textFileEditor', "Text File Editor"); } @@ -104,9 +113,7 @@ export class TextFileEditor extends BaseTextEditor { } // Remember view settings if input changes - if (oldInput) { - this.saveTextEditorViewState(oldInput.getResource().toString()); - } + this.doSaveTextEditorViewState(oldInput); // Different Input (Reload) return input.resolve(true).then(resolvedModel => { @@ -224,9 +231,7 @@ export class TextFileEditor extends BaseTextEditor { public clearInput(): void { // Keep editor view state in settings to restore when coming back - if (this.input) { - this.saveTextEditorViewState(this.input.getResource().toString()); - } + this.doSaveTextEditorViewState(this.input); // Clear Model this.getControl().setModel(null); @@ -238,11 +243,15 @@ export class TextFileEditor extends BaseTextEditor { public shutdown(): void { // Save View State - if (this.input) { - this.saveTextEditorViewState(this.input.getResource().toString()); - } + this.doSaveTextEditorViewState(this.input); // Call Super super.shutdown(); } + + private doSaveTextEditorViewState(input: FileEditorInput): void { + if (input && !input.isDisposed()) { + this.saveTextEditorViewState(input.getResource().toString()); + } + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index e32cb7f8843..9160ec7459b 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -6,20 +6,20 @@ 'use strict'; import 'vs/css!./media/explorerviewlet'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IAction, IActionRunner } from 'vs/base/common/actions'; import { TPromise } from 'vs/base/common/winjs.base'; import { Dimension, Builder } from 'vs/base/browser/builder'; import { Scope } from 'vs/workbench/common/memento'; import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration } from 'vs/workbench/parts/files/common/files'; import { IViewletView, Viewlet } from 'vs/workbench/browser/viewlet'; -import { SplitView, Orientation } from 'vs/base/browser/ui/splitview/splitview'; +import { SplitView } from 'vs/base/browser/ui/splitview/splitview'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ActionRunner, FileViewletState } from 'vs/workbench/parts/files/browser/views/explorerViewer'; import { ExplorerView } from 'vs/workbench/parts/files/browser/views/explorerView'; import { EmptyView } from 'vs/workbench/parts/files/browser/views/emptyView'; import { OpenEditorsView } from 'vs/workbench/parts/files/browser/views/openEditorsView'; -import { IStorageService } from 'vs/platform/storage/common/storage'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -32,8 +32,17 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachHeaderViewStyler } from 'vs/platform/theme/common/styler'; +import { ViewsRegistry, ViewLocation, IViewDescriptor } from 'vs/workbench/parts/views/browser/views'; + +interface IViewState { + collapsed: boolean; + size: number; +} export class ExplorerViewlet extends Viewlet { + + private static EXPLORER_VIEWS_STATE = 'workbench.explorer.views.state'; + private viewletContainer: Builder; private splitView: SplitView; private views: IViewletView[]; @@ -43,7 +52,7 @@ export class ExplorerViewlet extends Viewlet { private emptyView: EmptyView; private openEditorsVisible: boolean; - private lastFocusedView: ExplorerView | OpenEditorsView | EmptyView; + private lastFocusedView: IViewletView; private focusListener: IDisposable; private delayEditorOpeningInOpenedEditors: boolean; @@ -52,11 +61,12 @@ export class ExplorerViewlet extends Viewlet { private dimension: Dimension; private viewletVisibleContextKey: IContextKey; + private disposables: IDisposable[] = []; constructor( @ITelemetryService telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IStorageService storageService: IStorageService, + @IStorageService private storageService: IStorageService, @IEditorGroupService private editorGroupService: IEditorGroupService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationService private configurationService: IConfigurationService, @@ -72,7 +82,9 @@ export class ExplorerViewlet extends Viewlet { this.viewletVisibleContextKey = ExplorerViewletVisibleContext.bindTo(contextKeyService); this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE); - this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config)); + + this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config), this, this.disposables); + ViewsRegistry.onViewsRegistered(viewDescriptors => this.addCustomViews(viewDescriptors.filter(viewDescriptor => ViewLocation.Explorer === viewDescriptor.location), true), this, this.disposables); } public create(parent: Builder): TPromise { @@ -80,78 +92,158 @@ export class ExplorerViewlet extends Viewlet { this.viewletContainer = parent.div().addClass('explorer-viewlet'); - const settings = this.configurationService.getConfiguration(); - - return this.onConfigurationUpdated(settings); + return this.render(); } public getActions(): IAction[] { - if (this.openEditorsVisible) { - return []; + if (this.views.length === 1) { + return this.views[0].getActions(); } - - if (this.explorerView) { - return this.explorerView.getActions(); - } - return []; } - private onConfigurationUpdated(config: IFilesConfiguration): TPromise { + private render(): TPromise { + const config = this.configurationService.getConfiguration(); // No need to delay if preview is disabled this.delayEditorOpeningInOpenedEditors = !!config.workbench.editor.enablePreview; // Open editors view should always be visible in no folder workspace. - const openEditorsVisible = !this.contextService.hasWorkspace() || config.explorer.openEditors.visible !== 0; + this.openEditorsVisible = !this.contextService.hasWorkspace() || config.explorer.openEditors.visible !== 0; - // Create views on startup and if open editors visibility has changed #6919 - if (this.openEditorsVisible !== openEditorsVisible) { - this.dispose(); - this.openEditorsVisible = openEditorsVisible; - this.views = []; - this.viewletContainer.clearChildren(); + this.views = []; + this.viewletContainer.clearChildren(); - if (this.openEditorsVisible) { - this.splitView = new SplitView(this.viewletContainer.getHTMLElement()); + this.splitView = new SplitView(this.viewletContainer.getHTMLElement()); - // Open editors view - this.addOpenEditorsView(); + // Track focus + this.focusListener = this.splitView.onFocus((view: IViewletView) => { + this.lastFocusedView = view; + }); - // Track focus - this.focusListener = this.splitView.onFocus((view: ExplorerView | OpenEditorsView | EmptyView) => { - this.lastFocusedView = view; - }); - } + const customViews = ViewsRegistry.getViews(ViewLocation.Explorer); - // Explorer view - this.addExplorerView(); - this.lastFocusedView = this.explorerView; + if (this.openEditorsVisible) { + // Open editors view + this.openEditorsView = this.instantiationService.createInstance(OpenEditorsView, this.getActionRunner(), this.viewletSettings); + this.views.push(this.openEditorsView); + } - return TPromise.join(this.views.map(view => view.create())).then(() => void 0).then(() => { + const viewsState = JSON.parse(this.storageService.get(ExplorerViewlet.EXPLORER_VIEWS_STATE, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}')); + + // Explorer view + this.views.push(this.createExplorerOrEmptyView(viewsState)); + + // custom views + for (const view of customViews) { + this.addCustomView(view, viewsState[view.id], -1); + } + + for (let i = 0; i < this.views.length; i++) { + const view = this.views[i]; + attachHeaderViewStyler(view, this.themeService, { noContrastBorder: i === 0 }); + this.splitView.addView(view, viewsState[view.id] ? (viewsState[view.id]).size : void 0); + } + + this.lastFocusedView = this.explorerView; + + return TPromise.join(this.views.map(view => view.create())).then(() => void 0).then(() => { + this.onViewsUpdated(); + return this.setVisible(this.isVisible()).then(() => this.focus()); // Focus the viewlet since that triggers a rerender. + }); + } + + private updateOpenEditorsView(): void { + if (!this.splitView) { + return; + } + + if (this.openEditorsVisible) { + this.openEditorsView = this.instantiationService.createInstance(OpenEditorsView, this.getActionRunner(), this.viewletSettings); + this.views.unshift(this.openEditorsView); + this.splitView.addView(this.openEditorsView, undefined, 0); + this.openEditorsView.create().then(() => { + if (this.views.length === 2) { + this.views[1].showHeader(); + } if (this.dimension) { this.layout(this.dimension); } - // Update title area since the title actions have changed. this.updateTitleArea(); - return this.setVisible(this.isVisible()).then(() => this.focus()); // Focus the viewlet since that triggers a rerender. }); + } else { + this.views.shift(); + this.splitView.removeView(this.openEditorsView); + this.openEditorsView.dispose(); + this.openEditorsView = null; + this.onViewsUpdated(); + } + } + + private addCustomViews(viewDescriptors: IViewDescriptor[], end: boolean): void { + if (!this.splitView || !viewDescriptors.length) { + return; + } + const views = []; + + const registered = ViewsRegistry.getViews(ViewLocation.Explorer); + const viewsState = JSON.parse(this.storageService.get(ExplorerViewlet.EXPLORER_VIEWS_STATE, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}')); + for (const viewDescriptor of viewDescriptors) { + let index = end ? -1 : this.openEditorsView ? registered.indexOf(viewDescriptor) + 2 : registered.indexOf(viewDescriptor) + 1; + const view = this.addCustomView(viewDescriptor, viewsState[viewDescriptor.id], index); + views.push(view); + attachHeaderViewStyler(view, this.themeService); + this.splitView.addView(view, viewsState[view.id] ? (viewsState[view.id]).size : void 0, end ? void 0 : index); } - return TPromise.as(null); + TPromise.join(views.map(view => view.create())).then(() => void 0).then(() => { + this.onViewsUpdated(); + }); } - private addOpenEditorsView(): void { - this.openEditorsView = this.instantiationService.createInstance(OpenEditorsView, this.getActionRunner(), this.viewletSettings); - attachHeaderViewStyler(this.openEditorsView, this.themeService); - - this.splitView.addView(this.openEditorsView); - - this.views.push(this.openEditorsView); + private addCustomView(viewDescriptor: IViewDescriptor, viewState: IViewState, index: number): IViewletView { + const view = this.instantiationService.createInstance(viewDescriptor.ctor, viewDescriptor.id, { + name: viewDescriptor.name, + actionRunner: this.getActionRunner(), + collapsed: viewState ? viewState.collapsed : true + }); + if (index !== -1) { + this.views.splice(index, 0, view); + } else { + this.views.push(view); + } + return view; } - private addExplorerView(): void { + private onViewsUpdated(): void { + if (this.views.length > 1) { + this.views[0].showHeader(); + } else { + this.views[0].hideHeader(); + if (!this.views[0].isExpanded()) { + this.views[0].expand(); + } + } + + if (this.dimension) { + this.layout(this.dimension); + } + + // Update title area since the title actions have changed. + this.updateTitleArea(); + } + + private onConfigurationUpdated(config: IFilesConfiguration): void { + // Open editors view should always be visible in no folder workspace. + const openEditorsVisible = !this.contextService.hasWorkspace() || config.explorer.openEditors.visible !== 0; + if (this.openEditorsVisible !== openEditorsVisible) { + this.openEditorsVisible = openEditorsVisible; + this.updateOpenEditorsView(); + } + } + + private createExplorerOrEmptyView(viewsState: any): IViewletView { let explorerOrEmptyView: ExplorerView | EmptyView; // With a Workspace @@ -188,25 +280,21 @@ export class ExplorerViewlet extends Viewlet { }); const explorerInstantiator = this.instantiationService.createChild(new ServiceCollection([IWorkbenchEditorService, delegatingEditorService])); - - const headerSize = this.openEditorsVisible ? undefined : 0; // If open editors are not visible set header size explicitly to 0, otherwise const it be computed by super class. - this.explorerView = explorerOrEmptyView = explorerInstantiator.createInstance(ExplorerView, this.viewletState, this.getActionRunner(), this.viewletSettings, headerSize); - attachHeaderViewStyler(this.explorerView, this.themeService); + this.explorerView = explorerOrEmptyView = explorerInstantiator.createInstance(ExplorerView, this.viewletState, { + collapsed: viewsState[ExplorerView.ID] ? (viewsState[ExplorerView.ID]).collapsed : false, + actionRunner: this.getActionRunner() + }, this.viewletSettings, void 0); } // No workspace else { - this.emptyView = explorerOrEmptyView = this.instantiationService.createInstance(EmptyView, this.getActionRunner()); - attachHeaderViewStyler(this.emptyView, this.themeService); + this.emptyView = explorerOrEmptyView = this.instantiationService.createInstance(EmptyView, { + collapsed: viewsState[EmptyView.ID] ? (viewsState[EmptyView.ID]).collapsed : false, + actionRunner: this.getActionRunner() + }); } - if (this.openEditorsVisible) { - this.splitView.addView(explorerOrEmptyView); - } else { - explorerOrEmptyView.render(this.viewletContainer.getHTMLElement(), Orientation.VERTICAL); - } - - this.views.push(explorerOrEmptyView); + return explorerOrEmptyView; } public getExplorerView(): ExplorerView { @@ -260,7 +348,7 @@ export class ExplorerViewlet extends Viewlet { return this.openEditorsView.focus(); } - private hasSelectionOrFocus(view: ExplorerView | OpenEditorsView | EmptyView): boolean { + private hasSelectionOrFocus(view: IViewletView): boolean { if (!view) { return false; } @@ -284,12 +372,7 @@ export class ExplorerViewlet extends Viewlet { public layout(dimension: Dimension): void { this.dimension = dimension; - - if (this.openEditorsVisible) { - this.splitView.layout(dimension.height); - } else if (this.explorerView) { - this.explorerView.layout(dimension.height, Orientation.VERTICAL); - } + this.splitView.layout(dimension.height); } public getActionRunner(): IActionRunner { @@ -306,7 +389,7 @@ export class ExplorerViewlet extends Viewlet { public getOptimalWidth(): number { const additionalMargin = 16; - const openedEditorsViewWidth = this.openEditorsVisible ? this.openEditorsView.getOptimalWidth() : 0; + const openedEditorsViewWidth = this.openEditorsView ? this.openEditorsView.getOptimalWidth() : 0; const explorerView = this.getExplorerView(); const explorerViewWidth = explorerView ? explorerView.getOptimalWidth() : 0; const optimalWidth = Math.max(openedEditorsViewWidth, explorerViewWidth); @@ -315,29 +398,45 @@ export class ExplorerViewlet extends Viewlet { } public shutdown(): void { + this.saveViewsState(); this.views.forEach((view) => view.shutdown()); - super.shutdown(); } + private saveViewsState(): void { + const viewletState = this.views.reduce((result, view) => { + result[view.id] = this.getViewState(view); + return result; + }, {}); + this.storageService.store(ExplorerViewlet.EXPLORER_VIEWS_STATE, JSON.stringify(viewletState), this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL); + } + + private getViewState(view: IViewletView): IViewState { + return { + collapsed: !view.isExpanded(), + size: view.size > 0 ? view.size : void 0 + }; + } + public dispose(): void { + + for (const view of this.views) { + view.dispose(); + } + if (this.splitView) { - this.splitView.dispose(); this.splitView = null; } if (this.explorerView) { - this.explorerView.dispose(); this.explorerView = null; } if (this.openEditorsView) { - this.openEditorsView.dispose(); this.openEditorsView = null; } if (this.emptyView) { - this.emptyView.dispose(); this.emptyView = null; } @@ -345,5 +444,9 @@ export class ExplorerViewlet extends Viewlet { this.focusListener.dispose(); this.focusListener = null; } + + this.disposables = dispose(this.disposables); + + super.dispose(); } } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts index 7c3bd0125d2..6f04409b592 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts @@ -9,7 +9,7 @@ import { Registry } from 'vs/platform/platform'; import { Action, IAction } from 'vs/base/common/actions'; import { isMacintosh } from 'vs/base/common/platform'; import { ActionItem, BaseActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { GlobalNewUntitledFileAction, SaveFileAsAction, OpenFileAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView } from 'vs/workbench/parts/files/browser/fileActions'; import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/parts/files/browser/saveErrorHandler'; import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index f65444bfadb..3e19dc5ed9d 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -228,7 +228,7 @@ configurationRegistry.registerConfiguration({ '\r\n' ], 'default': (platform.isLinux || platform.isMacintosh) ? '\n' : '\r\n', - 'description': nls.localize('eol', "The default end of line character."), + 'description': nls.localize('eol', "The default end of line character. Use \\n for LF and \\r\\n for CRLF."), }, 'files.trimTrailingWhitespace': { 'type': 'boolean', @@ -261,7 +261,7 @@ configurationRegistry.registerConfiguration({ }, 'files.watcherExclude': { 'type': 'object', - 'default': { '**/.git/objects/**': true, '**/node_modules/**': true }, + 'default': platform.isWindows /* https://github.com/Microsoft/vscode/issues/23954 */ ? { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/*/**': true } : { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/**': true }, 'description': nls.localize('watcherExclude', "Configure glob patterns of file paths to exclude from file watching. Changing this setting requires a restart. When you experience Code consuming lots of cpu time on startup, you can exclude large folders to reduce the initial load.") }, 'files.hotExit': { diff --git a/src/vs/workbench/parts/files/browser/media/explorerviewlet.css b/src/vs/workbench/parts/files/browser/media/explorerviewlet.css index b8a40903a74..c0718789375 100644 --- a/src/vs/workbench/parts/files/browser/media/explorerviewlet.css +++ b/src/vs/workbench/parts/files/browser/media/explorerviewlet.css @@ -182,14 +182,4 @@ .hc-black .monaco-workbench .explorer-viewlet .open-editor, .hc-black .monaco-workbench .explorer-viewlet .editor-group { line-height: 20px; -} - -/* TODO@Theme */ - -.vs .monaco-workbench .explorer-viewlet .header .monaco-count-badge { - background-color: rgba(190, 190, 190, 0.7); -} - -.vs-dark .monaco-workbench .explorer-viewlet .header .monaco-count-badge { - background-color: rgba(100, 100, 100, 0.5); } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/views/emptyView.ts b/src/vs/workbench/parts/files/browser/views/emptyView.ts index 41c0f5f7bbd..de505174be1 100644 --- a/src/vs/workbench/parts/files/browser/views/emptyView.ts +++ b/src/vs/workbench/parts/files/browser/views/emptyView.ts @@ -13,24 +13,32 @@ import { IActionRunner, IAction } from 'vs/base/common/actions'; import { Button } from 'vs/base/browser/ui/button/button'; import { $ } from 'vs/base/browser/builder'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { CollapsibleView } from 'vs/base/browser/ui/splitview/splitview'; +import { CollapsibleView, CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; import { attachButtonStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IViewOptions } from 'vs/workbench/parts/views/browser/views'; export class EmptyView extends CollapsibleView { - private openFolderButton: Button; + public static ID: string = 'workbench.explorer.emptyView'; + + public readonly id: string = EmptyView.ID; + + private openFolderButton: Button; + private actionRunner: IActionRunner; constructor( - private actionRunner: IActionRunner, + options: IViewOptions, @IThemeService private themeService: IThemeService, @IInstantiationService private instantiationService: IInstantiationService ) { super({ - minimumSize: 2 * 22, - ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") + minimumSize: 5 * 22, + ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), + initialState: options.collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED }); + this.actionRunner = options.actionRunner; } public renderHeader(container: HTMLElement): void { diff --git a/src/vs/workbench/parts/files/browser/views/explorerView.ts b/src/vs/workbench/parts/files/browser/views/explorerView.ts index a9930687411..cad31f52e9f 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerView.ts @@ -12,8 +12,8 @@ import { ThrottledDelayer } from 'vs/base/common/async'; import errors = require('vs/base/common/errors'); import labels = require('vs/base/common/labels'); import paths = require('vs/base/common/paths'); -import { Action, IActionRunner, IAction } from 'vs/base/common/actions'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { Action, IAction } from 'vs/base/common/actions'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { ITree } from 'vs/base/parts/tree/browser/tree'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocussedContext, ExplorerFocussedContext } from 'vs/workbench/parts/files/common/files'; @@ -43,9 +43,11 @@ import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/th import { isLinux } from 'vs/base/common/platform'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { IViewOptions } from 'vs/workbench/parts/views/browser/views'; export class ExplorerView extends CollapsibleViewletView { + public static ID: string = 'workbench.explorer.fileView'; private static EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first private static EXPLORER_FILE_CHANGES_REFRESH_DELAY = 100; // delay in ms to refresh the explorer from disk file changes private static EXPLORER_IMPORT_REFRESH_DELAY = 300; // delay in ms to refresh the explorer from imports @@ -55,6 +57,8 @@ export class ExplorerView extends CollapsibleViewletView { private static COMMON_SCM_FOLDERS = ['.git', '.svn', '.hg']; + public readonly id: string = ExplorerView.ID; + private explorerViewer: ITree; private filter: FileFilter; private viewletState: FileViewletState; @@ -76,7 +80,7 @@ export class ExplorerView extends CollapsibleViewletView { constructor( viewletState: FileViewletState, - actionRunner: IActionRunner, + options: IViewOptions, settings: any, headerSize: number, @IMessageService messageService: IMessageService, @@ -95,11 +99,11 @@ export class ExplorerView extends CollapsibleViewletView { @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IEnvironmentService private environmentService: IEnvironmentService ) { - super(actionRunner, false, nls.localize('explorerSection', "Files Explorer Section"), messageService, keybindingService, contextMenuService, headerSize); + super(options.actionRunner, options.collapsed, nls.localize('explorerSection', "Files Explorer Section"), messageService, keybindingService, contextMenuService, headerSize); this.settings = settings; this.viewletState = viewletState; - this.actionRunner = actionRunner; + this.actionRunner = options.actionRunner; this.autoReveal = true; this.explorerRefreshDelayer = new ThrottledDelayer(ExplorerView.EXPLORER_FILE_CHANGES_REFRESH_DELAY); @@ -134,7 +138,7 @@ export class ExplorerView extends CollapsibleViewletView { DOM.toggleClass(this.treeContainer, 'align-icons-and-twisties', fileIconTheme.hasFileIcons && !fileIconTheme.hasFolderIcons); }; - this.themeService.onDidFileIconThemeChange(onFileIconThemeChange); + this.toDispose.push(this.themeService.onDidFileIconThemeChange(onFileIconThemeChange)); onFileIconThemeChange(this.themeService.getFileIconTheme()); } diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index 4494835dff8..95f1dc2599c 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -22,7 +22,7 @@ import { isMacintosh, isLinux } from 'vs/base/common/platform'; import glob = require('vs/base/common/glob'); import { FileLabel, IFileLabelOptions } from 'vs/workbench/browser/labels'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { IFilesConfiguration } from 'vs/workbench/parts/files/common/files'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IFileOperationResult, FileOperationResult, IFileService, isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; @@ -33,7 +33,6 @@ import { DesktopDragAndDropData, ExternalElementsDragAndDropData } from 'vs/base import { ClickBehavior, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; import { FileStat, NewStatPlaceholder } from 'vs/workbench/parts/files/common/explorerViewModel'; import { DragMouseEvent, IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -44,7 +43,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IMessageService, IConfirmation, Severity } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes'; +import { KeyCode } from 'vs/base/common/keyCodes'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IMenuService, IMenu, MenuId } from 'vs/platform/actions/common/actions'; import { fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; @@ -396,8 +395,7 @@ export class FileController extends DefaultController { @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMenuService menuService: IMenuService, - @IContextKeyService contextKeyService: IContextKeyService, - @IKeybindingService private keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false /* handled via IListService */ }); @@ -495,7 +493,6 @@ export class FileController extends DefaultController { }); }, getActionItem: this.state.actionProvider.getActionItem.bind(this.state.actionProvider, tree, stat), - getKeyBinding: (a): ResolvedKeybinding => this.keybindingService.lookupKeybinding(a.id), getActionsContext: (event) => { return { viewletState: this.state, diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts index b6f1e2db772..3af3b297057 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts @@ -31,8 +31,9 @@ import { ToggleEditorLayoutAction } from 'vs/workbench/browser/actions/toggleEdi import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IListService } from 'vs/platform/list/browser/listService'; import { EditorGroup } from 'vs/workbench/common/editor/editorStacksModel'; -import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { attachListStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; @@ -42,6 +43,8 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { private static DEFAULT_VISIBLE_OPEN_EDITORS = 9; private static DEFAULT_DYNAMIC_HEIGHT = true; + readonly id: string = 'workbench.explorer.openEditorsView'; + private settings: any; private visibleOpenEditors: number; private dynamicHeight: boolean; @@ -87,6 +90,20 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { titleSpan.textContent = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors"); this.dirtyCountElement = dom.append(titleDiv, $('.monaco-count-badge')); + + this.toDispose.push((attachStylerCallback(this.themeService, { badgeBackground, badgeForeground, contrastBorder }, colors => { + const background = colors.badgeBackground ? colors.badgeBackground.toString() : null; + const foreground = colors.badgeForeground ? colors.badgeForeground.toString() : null; + const border = colors.contrastBorder ? colors.contrastBorder.toString() : null; + + this.dirtyCountElement.style.backgroundColor = background; + this.dirtyCountElement.style.color = foreground; + + this.dirtyCountElement.style.borderWidth = border ? '1px' : null; + this.dirtyCountElement.style.borderStyle = border ? 'solid' : null; + this.dirtyCountElement.style.borderColor = border; + }))); + this.updateDirtyIndicator(); super.renderHeader(container); diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts index e662f47ce91..f275bfd30a5 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts @@ -23,7 +23,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorGroup, IEditorStacksModel } from 'vs/workbench/common/editor'; import { OpenEditor } from 'vs/workbench/parts/files/common/explorerViewModel'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -170,8 +170,7 @@ export class Controller extends DefaultController { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorGroupService: IEditorGroupService, @IContextMenuService private contextMenuService: IContextMenuService, - @ITelemetryService private telemetryService: ITelemetryService, - @IKeybindingService private keybindingService: IKeybindingService + @ITelemetryService private telemetryService: ITelemetryService ) { super({ clickBehavior: ClickBehavior.ON_MOUSE_DOWN, keyboardSupport: false }); } @@ -261,7 +260,6 @@ export class Controller extends DefaultController { this.contextMenuService.showContextMenu({ getAnchor: () => anchor, getActions: () => this.actionProvider.getSecondaryActions(tree, element), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id), onHide: (wasCancelled?: boolean) => { if (wasCancelled) { tree.DOMFocus(); diff --git a/src/vs/workbench/parts/git/browser/gitActions.contribution.ts b/src/vs/workbench/parts/git/browser/gitActions.contribution.ts deleted file mode 100644 index 6d2ea142908..00000000000 --- a/src/vs/workbench/parts/git/browser/gitActions.contribution.ts +++ /dev/null @@ -1,749 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 nls = require('vs/nls'); -import lifecycle = require('vs/base/common/lifecycle'); -import platform = require('vs/platform/platform'); -import abr = require('vs/workbench/browser/actionBarRegistry'); -import { TPromise } from 'vs/base/common/winjs.base'; -import editorbrowser = require('vs/editor/browser/editorBrowser'); -import editorcommon = require('vs/editor/common/editorCommon'); -import baseeditor = require('vs/workbench/browser/parts/editor/baseEditor'); -import WorkbenchEditorCommon = require('vs/workbench/common/editor'); -import tdeditor = require('vs/workbench/browser/parts/editor/textDiffEditor'); -import teditor = require('vs/workbench/browser/parts/editor/textEditor'); -import filesCommon = require('vs/workbench/parts/files/common/files'); -import gitcontrib = require('vs/workbench/parts/git/browser/gitWorkbenchContributions'); -import diffei = require('vs/workbench/common/editor/diffEditorInput'); -import { IGitService, Status, IFileStatus, StatusType } from 'vs/workbench/parts/git/common/git'; -import gitei = require('vs/workbench/parts/git/browser/gitEditorInputs'); -import { getSelectedChanges, applyChangesToModel, getChangeRevertEdits } from 'vs/workbench/parts/git/common/stageRanges'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IViewlet } from 'vs/workbench/common/viewlet'; -import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import wbar = require('vs/workbench/common/actionRegistry'); -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { - OpenChangeAction, OpenFileAction, SyncAction, PullAction, PushAction, - PushToRemoteAction, PublishAction, StartGitBranchAction, StartGitCheckoutAction, - InputCommitAction, UndoLastCommitAction, BaseStageAction, BaseUnstageAction, - PullWithRebaseAction -} from './gitActions'; -import paths = require('vs/base/common/paths'); -import URI from 'vs/base/common/uri'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; -import { IMessageService } from 'vs/platform/message/common/message'; - -function getStatus(gitService: IGitService, contextService: IWorkspaceContextService, input: WorkbenchEditorCommon.IFileEditorInput): IFileStatus { - const model = gitService.getModel(); - const repositoryRoot = model.getRepositoryRoot(); - const statusModel = model.getStatus(); - const repositoryRelativePath = paths.normalize(paths.relative(repositoryRoot, input.getResource().fsPath)); - - return statusModel.getWorkingTreeStatus().find(repositoryRelativePath) || - statusModel.getIndexStatus().find(repositoryRelativePath) || - statusModel.getMergeStatus().find(repositoryRelativePath); -} - -class OpenInDiffAction extends baseeditor.EditorInputAction { - - static ID = 'workbench.action.git.openInDiff'; - static Label = nls.localize('switchToChangesView', "Switch to Changes View"); - - private gitService: IGitService; - private viewletService: IViewletService; - private editorService: IWorkbenchEditorService; - private partService: IPartService; - private contextService: IWorkspaceContextService; - private toDispose: lifecycle.IDisposable[]; - - constructor( @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IGitService gitService: IGitService, @IViewletService viewletService: IViewletService, @IPartService partService: IPartService, @IWorkspaceContextService contextService: IWorkspaceContextService) { - super(OpenInDiffAction.ID, OpenInDiffAction.Label); - - this.class = 'git-action open-in-diff'; - this.gitService = gitService; - this.viewletService = viewletService; - this.editorService = editorService; - this.partService = partService; - this.contextService = contextService; - - this.toDispose = [this.gitService.addBulkListener(() => this.onGitStateChanged())]; - - this.enabled = this.isEnabled(); - } - - public isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - const model = this.gitService.getModel(); - if (!model || !(typeof model.getRepositoryRoot() === 'string')) { - return false; - } - - var status = this.getStatus(); - - return status && ( - status.getStatus() === Status.MODIFIED || - status.getStatus() === Status.INDEX_MODIFIED || - status.getStatus() === Status.INDEX_RENAMED - ); - } - - private onGitStateChanged(): void { - if (this.gitService.isIdle()) { - this.enabled = this.isEnabled(); - } - } - - private getStatus(): IFileStatus { - return getStatus(this.gitService, this.contextService, this.input); - } - - public run(context?: WorkbenchEditorCommon.IEditorContext): TPromise { - const event = context ? context.event : null; - const sideBySide = !!(event && (event.ctrlKey || event.metaKey)); - const editor = this.editorService.getActiveEditor().getControl(); - const viewState = editor ? editor.saveViewState() : null; - - return this.gitService.getInput(this.getStatus()).then((input) => { - var promise = TPromise.as(null); - - if (this.partService.isVisible(Parts.SIDEBAR_PART)) { - promise = this.viewletService.openViewlet(gitcontrib.VIEWLET_ID, false); - } - - return promise.then(() => { - var options = new WorkbenchEditorCommon.TextDiffEditorOptions(); - options.forceOpen = true; - options.autoRevealFirstChange = false; - - return this.editorService.openEditor(input, options, sideBySide).then((editor) => { - if (viewState) { - var codeEditor = this.editorService.getActiveEditor().getControl(); - codeEditor.restoreViewState({ - original: { - cursorState: undefined, - viewState: undefined, - contributionsState: undefined - }, - modified: viewState - }); - } - }); - }); - }); - } - - public dispose(): void { - this.toDispose = lifecycle.dispose(this.toDispose); - } -} - -class OpenInEditorAction extends baseeditor.EditorInputAction { - - private static DELETED_STATES = [Status.BOTH_DELETED, Status.DELETED, Status.DELETED_BY_US, Status.INDEX_DELETED]; - static ID = 'workbench.action.git.openInEditor'; - static LABEL = nls.localize('openInEditor', "Switch to Editor View"); - - private gitService: IGitService; - private fileService: IFileService; - private viewletService: IViewletService; - private editorService: IWorkbenchEditorService; - private partService: IPartService; - private contextService: IWorkspaceContextService; - - constructor( @IFileService fileService: IFileService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IGitService gitService: IGitService, @IViewletService viewletService: IViewletService, @IPartService partService: IPartService, @IWorkspaceContextService contextService: IWorkspaceContextService) { - super(OpenInEditorAction.ID, OpenInEditorAction.LABEL); - - this.class = 'git-action open-in-editor'; - this.gitService = gitService; - this.fileService = fileService; - this.viewletService = viewletService; - this.editorService = editorService; - this.partService = partService; - this.contextService = contextService; - - this.enabled = this.isEnabled(); - } - - public isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - const model = this.gitService.getModel(); - if (!model || !(typeof model.getRepositoryRoot() === 'string')) { - return false; - } - - var status: IFileStatus = (this.input).getFileStatus(); - if (OpenInEditorAction.DELETED_STATES.indexOf(status.getStatus()) > -1) { - return false; - } - - return true; - } - - public run(context?: WorkbenchEditorCommon.IEditorContext): TPromise { - const model = this.gitService.getModel(); - const resource = URI.file(paths.join(model.getRepositoryRoot(), this.getRepositoryRelativePath())); - const event = context ? context.event : null; - const sideBySide = !!(event && (event.ctrlKey || event.metaKey)); - const modifiedViewState = this.saveTextViewState(); - - return this.fileService.resolveFile(resource).then(stat => { - return this.editorService.openEditor({ - resource: stat.resource, - options: { - forceOpen: true - } - }, sideBySide).then(editor => { - this.restoreTextViewState(modifiedViewState); - - if (this.partService.isVisible(Parts.SIDEBAR_PART)) { - return this.viewletService.openViewlet(filesCommon.VIEWLET_ID, false); - } - return undefined; - }); - }); - } - - private saveTextViewState(): editorcommon.ICodeEditorViewState { - var textEditor = this.getTextEditor(); - if (textEditor) { - return textEditor.saveViewState(); - } - - return null; - } - - private restoreTextViewState(state: editorcommon.ICodeEditorViewState): void { - var textEditor = this.getTextEditor(); - if (textEditor) { - return textEditor.restoreViewState(state); - } - } - - private getTextEditor(): editorcommon.ICommonCodeEditor { - var editor = this.editorService.getActiveEditor(); - - if (editor instanceof tdeditor.TextDiffEditor) { - return (editor.getControl()).getModifiedEditor(); - } else if (editor instanceof teditor.BaseTextEditor) { - return editor.getControl(); - } - - return null; - } - - private getRepositoryRelativePath(): string { - var status: IFileStatus = (this.input).getFileStatus(); - - if (status.getStatus() === Status.INDEX_RENAMED) { - return status.getRename(); - } else { - var indexStatus = this.gitService.getModel().getStatus().find(status.getPath(), StatusType.INDEX); - - if (indexStatus && indexStatus.getStatus() === Status.INDEX_RENAMED) { - return indexStatus.getRename(); - } else { - return status.getPath(); - } - } - } -} - -export class WorkbenchStageAction extends BaseStageAction { - - static ID = 'workbench.action.git.stage'; - static LABEL = nls.localize('workbenchStage', "Stage"); - private contextService: IWorkspaceContextService; - - constructor( - id = WorkbenchStageAction.ID, - label = WorkbenchStageAction.LABEL, - @IGitService gitService: IGitService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IWorkspaceContextService contextService: IWorkspaceContextService - ) { - super(id, label, '', gitService, editorService); - this.contextService = contextService; - this.onGitServiceChange(); - } - - protected updateEnablement(): void { - if (this.contextService) { - this.enabled = this.isEnabled(); - } else { - this.enabled = super.isEnabled(); - } - } - - isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - const editor = this.editorService.getActiveEditor(); - if (!editor || !(editor instanceof baseeditor.BaseEditor)) { - return false; - } - - return true; - } - - run(context?: any): TPromise { - const input = this.editorService.getActiveEditor().input; - let fileStatus: IFileStatus; - - if (gitei.isGitEditorInput(input)) { - const gitInput = input as gitei.GitDiffEditorInput; - fileStatus = gitInput.getFileStatus(); - } else { - fileStatus = getStatus(this.gitService, this.contextService, input as WorkbenchEditorCommon.IFileEditorInput); - } - - if (!fileStatus) { - return TPromise.as(null); - } - - return super.run(fileStatus); - } -} - -export class WorkbenchUnstageAction extends BaseUnstageAction { - - static ID = 'workbench.action.git.unstage'; - static LABEL = nls.localize('workbenchUnstage', "Unstage"); - private contextService: IWorkspaceContextService; - - constructor( - id = WorkbenchUnstageAction.ID, - label = WorkbenchUnstageAction.LABEL, - @IGitService gitService: IGitService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IWorkspaceContextService contextService: IWorkspaceContextService - ) { - super(id, label, '', gitService, editorService); - this.contextService = contextService; - this.onGitServiceChange(); - } - - protected updateEnablement(): void { - if (this.contextService) { - this.enabled = this.isEnabled(); - } else { - this.enabled = super.isEnabled(); - } - } - - isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - const editor = this.editorService.getActiveEditor(); - if (!editor || !(editor instanceof baseeditor.BaseEditor)) { - return false; - } - - return true; - } - - run(context?: any): TPromise { - const input = this.editorService.getActiveEditor().input; - let fileStatus: IFileStatus; - - if (gitei.isGitEditorInput(input)) { - const gitInput = input as gitei.GitDiffEditorInput; - fileStatus = gitInput.getFileStatus(); - } else { - fileStatus = getStatus(this.gitService, this.contextService, input as WorkbenchEditorCommon.IFileEditorInput); - } - - if (!fileStatus) { - return TPromise.as(null); - } - - return super.run(fileStatus); - } -} - -export abstract class BaseStageRangesAction extends baseeditor.EditorInputAction { - private gitService: IGitService; - private editorService: IWorkbenchEditorService; - private editor: editorbrowser.IDiffEditor; - - constructor(id: string, label: string, editor: tdeditor.TextDiffEditor, @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(id, label); - - this.editorService = editorService; - this.gitService = gitService; - this.editor = editor.getControl(); - this.editor.getModifiedEditor().onDidChangeCursorSelection(() => this.updateEnablement()); - this.editor.onDidUpdateDiff(() => this.updateEnablement()); - this.class = 'git-action stage-ranges'; - } - - public isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService || !this.editorService) { - return false; - } - - var changes = this.editor.getLineChanges(); - var selections = this.editor.getSelections(); - - if (!changes || !selections || selections.length === 0) { - return false; - } - - return getSelectedChanges(changes, selections).length > 0; - } - - protected getRangesAppliedResult(editor: editorbrowser.IDiffEditor) { - var selections = editor.getSelections(); - var changes = getSelectedChanges(editor.getLineChanges(), selections); - return applyChangesToModel(editor.getModel().original, editor.getModel().modified, changes); - } - - public run(): TPromise { - var result = this.getRangesAppliedResult(this.editor); - - var status = (this.input).getFileStatus(); - var path = status.getPath(); - var viewState = this.editor.saveViewState(); - - return this.gitService.stage(status.getPath(), result).then(() => { - var statusModel = this.gitService.getModel().getStatus(); - - status = statusModel.getWorkingTreeStatus().find(path) || statusModel.getIndexStatus().find(path); - - if (status) { - return this.gitService.getInput(status).then((input) => { - var options = new WorkbenchEditorCommon.TextDiffEditorOptions(); - options.forceOpen = true; - options.autoRevealFirstChange = false; - - return this.editorService.openEditor(input, options, this.position).then(() => { - this.editor.restoreViewState(viewState); - }); - }); - } - return undefined; - }); - } - - private updateEnablement(): void { - this.enabled = this.isEnabled(); - } -} - -export class StageRangesAction extends BaseStageRangesAction { - static ID = 'workbench.action.git.stageRanges'; - static LABEL = nls.localize('stageSelectedLines', "Stage Selected Lines"); - - constructor(editor: tdeditor.TextDiffEditor, @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(StageRangesAction.ID, StageRangesAction.LABEL, editor, gitService, editorService); - } -} - -export class UnstageRangesAction extends BaseStageRangesAction { - static ID = 'workbench.action.git.unstageRanges'; - static LABEL = nls.localize('unstageSelectedLines', "Unstage Selected Lines"); - - constructor(editor: tdeditor.TextDiffEditor, @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(UnstageRangesAction.ID, UnstageRangesAction.LABEL, editor, gitService, editorService); - } - - protected getRangesAppliedResult(editor: editorbrowser.IDiffEditor) { - const selections = editor.getSelections(); - const changes = getSelectedChanges(editor.getLineChanges(), selections) - .map(c => ({ - modifiedStartLineNumber: c.originalStartLineNumber, - modifiedEndLineNumber: c.originalEndLineNumber, - originalStartLineNumber: c.modifiedStartLineNumber, - originalEndLineNumber: c.modifiedEndLineNumber - })); - - return applyChangesToModel(editor.getModel().modified, editor.getModel().original, changes); - } -} - -export class RevertRangesAction extends baseeditor.EditorInputAction { - static ID = 'workbench.action.git.revertRanges'; - static LABEL = nls.localize('revertSelectedLines', "Revert Selected Lines"); - - private editor: editorbrowser.IDiffEditor; - - constructor( - editor: tdeditor.TextDiffEditor, - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IMessageService private messageService: IMessageService - ) { - super(RevertRangesAction.ID, RevertRangesAction.LABEL); - - this.editor = editor.getControl(); - this.editor.getModifiedEditor().onDidChangeCursorSelection(() => this.updateEnablement()); - this.editor.onDidUpdateDiff(() => this.updateEnablement()); - this.class = 'git-action revert-ranges'; - } - - public isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.editorService) { - return false; - } - - const changes = this.editor.getLineChanges(); - const selections = this.editor.getSelections(); - - if (!changes || !selections || selections.length === 0) { - return false; - } - - return getSelectedChanges(changes, selections).length > 0; - } - - public run(): TPromise { - const selections = this.editor.getSelections(); - const changes = getSelectedChanges(this.editor.getLineChanges(), selections); - const { original, modified } = this.editor.getModel(); - - const revertEdits = getChangeRevertEdits(original, modified, changes); - - if (revertEdits.length === 0) { - return TPromise.as(null); - } - - const confirm = { - message: nls.localize('confirmRevertMessage', "Are you sure you want to revert the selected changes?"), - detail: nls.localize('irreversible', "This action is irreversible!"), - primaryButton: nls.localize({ key: 'revertChangesLabel', comment: ['&& denotes a mnemonic'] }, "&&Revert Changes") - }; - - if (!this.messageService.confirm(confirm)) { - return TPromise.as(null); - } - - modified.pushEditOperations(selections, revertEdits, () => selections); - modified.pushStackElement(); - - return TPromise.wrap(null); - } - - private updateEnablement(): void { - this.enabled = this.isEnabled(); - } -} - -class FileEditorActionContributor extends baseeditor.EditorInputActionContributor { - private instantiationService: IInstantiationService; - - constructor( @IInstantiationService instantiationService: IInstantiationService) { - super(); - - this.instantiationService = instantiationService; - } - - public hasActionsForEditorInput(context: baseeditor.IEditorInputActionContext): boolean { - return context.input instanceof FileEditorInput; - } - - public getActionsForEditorInput(context: baseeditor.IEditorInputActionContext): baseeditor.IEditorInputAction[] { - return [this.instantiationService.createInstance(OpenInDiffAction)]; - } -} - -class GitEditorActionContributor extends baseeditor.EditorInputActionContributor { - private instantiationService: IInstantiationService; - - constructor( @IInstantiationService instantiationService: IInstantiationService) { - super(); - - this.instantiationService = instantiationService; - } - - public hasActionsForEditorInput(context: baseeditor.IEditorInputActionContext): boolean { - return gitei.isGitEditorInput(context.input); - } - - public getActionsForEditorInput(context: baseeditor.IEditorInputActionContext): baseeditor.IEditorInputAction[] { - return [this.instantiationService.createInstance(OpenInEditorAction)]; - } -} - -class GitWorkingTreeDiffEditorActionContributor extends baseeditor.EditorInputActionContributor { - private instantiationService: IInstantiationService; - - constructor( @IInstantiationService instantiationService: IInstantiationService) { - super(); - - this.instantiationService = instantiationService; - } - - public hasSecondaryActionsForEditorInput(context: baseeditor.IEditorInputActionContext): boolean { - return (context.input instanceof gitei.GitDiffEditorInput && context.editor instanceof tdeditor.TextDiffEditor); - } - - public getSecondaryActionsForEditorInput(context: baseeditor.IEditorInputActionContext): baseeditor.IEditorInputAction[] { - if (context.input instanceof gitei.GitIndexDiffEditorInput) { - return [this.instantiationService.createInstance(UnstageRangesAction, context.editor)]; - } - - return [ - this.instantiationService.createInstance(StageRangesAction, context.editor), - this.instantiationService.createInstance(RevertRangesAction, context.editor)]; - } -} - -class GlobalOpenChangeAction extends OpenChangeAction { - - static ID = 'workbench.action.git.globalOpenChange'; - static LABEL = nls.localize('openChange', "Open Change"); - - constructor( - id: string, - label: string, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IGitService gitService: IGitService, - @IWorkspaceContextService protected contextService: IWorkspaceContextService, - @IViewletService protected viewletService: IViewletService, - @IPartService protected partService: IPartService - ) { - super(editorService, gitService); - } - - public getInput(): WorkbenchEditorCommon.IFileEditorInput { - const input = this.editorService.getActiveEditorInput(); - if (input instanceof FileEditorInput) { - return input; - } - - return null; - } - - public run(context?: any): TPromise { - let input = this.getInput(); - - if (!input) { - return TPromise.as(null); - } - - let status = getStatus(this.gitService, this.contextService, input); - - if (!status) { - return TPromise.as(null); - } - - var sideBySide = !!(context && (context.ctrlKey || context.metaKey)); - var editor = this.editorService.getActiveEditor().getControl(); - var viewState = editor ? editor.saveViewState() : null; - - return this.gitService.getInput(status).then((input) => { - var promise = TPromise.as(null); - - if (this.partService.isVisible(Parts.SIDEBAR_PART)) { - promise = this.viewletService.openViewlet(gitcontrib.VIEWLET_ID, false); - } - - return promise.then(() => { - var options = new WorkbenchEditorCommon.TextDiffEditorOptions(); - options.forceOpen = true; - options.autoRevealFirstChange = false; - - return this.editorService.openEditor(input, options, sideBySide).then((editor) => { - if (viewState) { - var codeEditor = this.editorService.getActiveEditor().getControl(); - codeEditor.restoreViewState({ - original: { - cursorState: undefined, - viewState: undefined, - contributionsState: undefined - }, - modified: viewState - }); - } - }); - }); - }); - } -} - -class GlobalOpenInEditorAction extends OpenFileAction { - - static ID = 'workbench.action.git.globalOpenFile'; - static LABEL = nls.localize('openFile', "Open File"); - - constructor( - id = GlobalOpenInEditorAction.ID, - label = GlobalOpenInEditorAction.LABEL, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IFileService fileService: IFileService, - @IGitService gitService: IGitService, - @IWorkspaceContextService contextService: IWorkspaceContextService - ) { - super(editorService, fileService, gitService, contextService); - } - - public run(event?: any): TPromise { - let input = this.editorService.getActiveEditorInput(); - if (input instanceof diffei.DiffEditorInput) { - input = input.modifiedInput; - } - - if (!(input instanceof FileEditorInput)) { - return TPromise.as(null); - } - - const status = getStatus(this.gitService, this.contextService, input); - - if (!status) { - return TPromise.as(null); - } - - return super.run(status); - } -} - -if (!SCMPreview.enabled) { - var actionBarRegistry = platform.Registry.as(abr.Extensions.Actionbar); - actionBarRegistry.registerActionBarContributor(abr.Scope.EDITOR, FileEditorActionContributor); - actionBarRegistry.registerActionBarContributor(abr.Scope.EDITOR, GitEditorActionContributor); - actionBarRegistry.registerActionBarContributor(abr.Scope.EDITOR, GitWorkingTreeDiffEditorActionContributor); - - let workbenchActionRegistry = (platform.Registry.as(wbar.Extensions.WorkbenchActions)); - - // Register Actions - const category = nls.localize('git', "Git"); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenChangeAction, GlobalOpenChangeAction.ID, GlobalOpenChangeAction.LABEL), 'Git: Open Change', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenInEditorAction, GlobalOpenInEditorAction.ID, GlobalOpenInEditorAction.LABEL), 'Git: Open File', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PullAction, PullAction.ID, PullAction.LABEL), 'Git: Pull', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PullWithRebaseAction, PullWithRebaseAction.ID, PullWithRebaseAction.LABEL), 'Git: Pull (Rebase)', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PushAction, PushAction.ID, PushAction.LABEL), 'Git: Push', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PushToRemoteAction, PushToRemoteAction.ID, PushToRemoteAction.LABEL), 'Git: Push to...', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SyncAction, SyncAction.ID, SyncAction.LABEL), 'Git: Sync', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PublishAction, PublishAction.ID, PublishAction.LABEL), 'Git: Publish', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(StartGitBranchAction, StartGitBranchAction.ID, StartGitBranchAction.LABEL), 'Git: Branch', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(StartGitCheckoutAction, StartGitCheckoutAction.ID, StartGitCheckoutAction.LABEL), 'Git: Checkout', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InputCommitAction, InputCommitAction.ID, InputCommitAction.LABEL), 'Git: Commit', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(UndoLastCommitAction, UndoLastCommitAction.ID, UndoLastCommitAction.LABEL), 'Git: Undo Last Commit', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(WorkbenchStageAction, WorkbenchStageAction.ID, WorkbenchStageAction.LABEL), 'Git: Stage', category); - workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(WorkbenchUnstageAction, WorkbenchUnstageAction.ID, WorkbenchUnstageAction.LABEL), 'Git: Unstage', category); -} diff --git a/src/vs/workbench/parts/git/browser/gitActions.ts b/src/vs/workbench/parts/git/browser/gitActions.ts deleted file mode 100644 index 0b80d5e1663..00000000000 --- a/src/vs/workbench/parts/git/browser/gitActions.ts +++ /dev/null @@ -1,1299 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { Promise, TPromise } from 'vs/base/common/winjs.base'; -import nls = require('vs/nls'); -import { IEventEmitter } from 'vs/base/common/eventEmitter'; -import { ITree } from 'vs/base/parts/tree/browser/tree'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { isString } from 'vs/base/common/types'; -import { Action } from 'vs/base/common/actions'; -import { IDiffEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import model = require('vs/workbench/parts/git/common/gitModel'); -import inputs = require('vs/workbench/parts/git/browser/gitEditorInputs'); -import { TextDiffEditorOptions } from 'vs/workbench/common/editor'; -import errors = require('vs/base/common/errors'); -import platform = require('vs/base/common/platform'); -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IEditor } from 'vs/platform/editor/common/editor'; -import { IFileService, IFileStat } from 'vs/platform/files/common/files'; -import { IMessageService, IConfirmation, IChoiceService } from 'vs/platform/message/common/message'; -import Severity from 'vs/base/common/severity'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IGitService, IFileStatus, Status, StatusType, ServiceState, IModel, IBranch, GitErrorCodes, IGitConfiguration } from 'vs/workbench/parts/git/common/git'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import paths = require('vs/base/common/paths'); -import URI from 'vs/base/common/uri'; -import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; - -function flatten(context?: any, preferFocus = false): IFileStatus[] { - if (!context) { - return context; - - } else if (Array.isArray(context)) { - if (context.some((c: any) => !(c instanceof model.FileStatus))) { - throw new Error('Invalid context.'); - } - return context; - - } else if (context instanceof model.FileStatus) { - return [context]; - - } else if (context instanceof model.StatusGroup) { - return (context).all(); - - } else if (context.tree) { - var elements = (context.tree).getSelection(); - return elements.indexOf(context.fileStatus) > -1 ? elements : [context.fileStatus]; - - } else if (context.selection) { - return !preferFocus && context.selection.indexOf(context.focus) > -1 ? context.selection : [context.focus]; - - } else { - throw new Error('Invalid context.'); - } -} - -export abstract class GitAction extends Action { - - protected gitService: IGitService; - protected toDispose: IDisposable[]; - - constructor(id: string, label: string, cssClass: string, gitService: IGitService) { - super(id, label, cssClass, false); - - this.gitService = gitService; - this.toDispose = [this.gitService.addBulkListener(() => this.onGitServiceChange())]; - this.onGitServiceChange(); - } - - protected onGitServiceChange(): void { - this.updateEnablement(); - } - - protected updateEnablement(): void { - this.enabled = this.isEnabled(); - } - - protected isEnabled(): boolean { - return !!this.gitService; - } - - public abstract run(e?: any): Promise; - - public dispose(): void { - this.gitService = null; - this.toDispose = dispose(this.toDispose); - - super.dispose(); - } -} - -export class OpenChangeAction extends GitAction { - - static ID = 'workbench.action.git.openChange'; - protected editorService: IWorkbenchEditorService; - - constructor( @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IGitService gitService: IGitService) { - super(OpenChangeAction.ID, nls.localize('openChange', "Open Change"), 'git-action open-change', gitService); - this.editorService = editorService; - this.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && !!this.editorService; - } - - public run(context?: any): Promise { - var statuses = flatten(context, true); - - return this.gitService.getInput(statuses[0]).then((input) => { - var options = new TextDiffEditorOptions(); - - options.forceOpen = true; - - return this.editorService.openEditor(input, options); - }); - } -} - -export class OpenFileAction extends GitAction { - - private static DELETED_STATES = [Status.BOTH_DELETED, Status.DELETED, Status.DELETED_BY_US, Status.INDEX_DELETED]; - static ID = 'workbench.action.git.openFile'; - - protected fileService: IFileService; - protected editorService: IWorkbenchEditorService; - protected contextService: IWorkspaceContextService; - - constructor( @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IGitService gitService: IGitService, @IWorkspaceContextService contextService: IWorkspaceContextService) { - super(OpenFileAction.ID, nls.localize('openFile', "Open File"), 'git-action open-file', gitService); - this.fileService = fileService; - this.editorService = editorService; - this.contextService = contextService; - this.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && !!this.editorService || !!this.fileService; - } - - private getPath(status: IFileStatus): string { - if (status.getStatus() === Status.INDEX_RENAMED) { - return status.getRename(); - } else { - var indexStatus = this.gitService.getModel().getStatus().find(status.getPath(), StatusType.INDEX); - - if (indexStatus && indexStatus.getStatus() === Status.INDEX_RENAMED) { - return status.getRename(); - } else { - return status.getPath(); - } - } - } - - public run(context?: any): Promise { - var statuses = flatten(context, true); - var status = statuses[0]; - - if (!(status instanceof model.FileStatus)) { - return Promise.wrapError(new Error('Can\'t open file.')); - } - - if (OpenFileAction.DELETED_STATES.indexOf(status.getStatus()) > -1) { - return Promise.wrapError(new Error('Can\'t open file which has been deleted.')); - } - - const resource = URI.file(paths.join(this.gitService.getModel().getRepositoryRoot(), this.getPath(status))); - - return this.fileService.resolveFile(resource) - .then(stat => this.editorService.openEditor({ - resource: stat.resource, - options: { forceOpen: true } - })); - } -} - -export class InitAction extends GitAction { - - static ID = 'workbench.action.git.init'; - - constructor( @IGitService gitService: IGitService) { - super(InitAction.ID, nls.localize('init', "Init"), 'git-action init', gitService); - } - - protected isEnabled(): boolean { - return super.isEnabled() && this.gitService.getState() === ServiceState.NotARepo; - } - - public run(): Promise { - return this.gitService.init(); - } -} - -export class RefreshAction extends GitAction { - - static ID = 'workbench.action.git.refresh'; - - constructor( @IGitService gitService: IGitService) { - super(RefreshAction.ID, nls.localize('refresh', "Refresh"), 'git-action refresh', gitService); - } - - public run(): Promise { - return this.gitService.status(); - } -} - -export abstract class BaseStageAction extends GitAction { - protected editorService: IWorkbenchEditorService; - - constructor(id: string, label: string, className: string, gitService: IGitService, editorService: IWorkbenchEditorService) { - super(id, label, className, gitService); - this.editorService = editorService; - } - - public run(context?: any): Promise { - var flatContext = flatten(context); - - return this.gitService.add(flatContext).then(status => { - var targetEditor = this.findGitWorkingTreeEditor(); - if (!targetEditor) { - return TPromise.as(status); - } - - var currentGitEditorInput = (targetEditor.input); - var currentFileStatus = currentGitEditorInput.getFileStatus(); - - if (flatContext && flatContext.every((f) => f !== currentFileStatus)) { - return TPromise.as(status); - } - - var path = currentGitEditorInput.getFileStatus().getPath(); - var fileStatus = status.getStatus().find(path, StatusType.INDEX); - - if (!fileStatus) { - return TPromise.as(status); - } - - var editorControl = targetEditor.getControl(); - var viewState = editorControl ? editorControl.saveViewState() : null; - - return this.gitService.getInput(fileStatus).then(input => { - var options = new TextDiffEditorOptions(); - options.forceOpen = true; - - return this.editorService.openEditor(input, options, targetEditor.position).then((editor) => { - if (viewState) { - editorControl.restoreViewState(viewState); - } - - return status; - }); - }); - }); - } - - private findGitWorkingTreeEditor(): IEditor { - var editors = this.editorService.getVisibleEditors(); - for (var i = 0; i < editors.length; i++) { - var editor = editors[i]; - if (inputs.isGitEditorInput(editor.input)) { - return editor; - } - } - - return null; - } - - public dispose(): void { - this.editorService = null; - - super.dispose(); - } -} - -export class StageAction extends BaseStageAction { - static ID = 'workbench.action.git.stage'; - static LABEL = nls.localize('stageChanges', "Stage"); - - constructor( - @IGitService gitService: IGitService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService - ) { - super(StageAction.ID, StageAction.LABEL, 'git-action stage', gitService, editorService); - } -} - -export class GlobalStageAction extends BaseStageAction { - - static ID = 'workbench.action.git.stageAll'; - - constructor( @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(GlobalStageAction.ID, nls.localize('stageAllChanges', "Stage All"), 'git-action stage', gitService, editorService); - } - - protected isEnabled(): boolean { - return super.isEnabled() && this.gitService.getModel().getStatus().getWorkingTreeStatus().all().length > 0; - } - - public run(context?: any): Promise { - return super.run(); - } -} - -export abstract class BaseUndoAction extends GitAction { - - private editorService: IWorkbenchEditorService; - private messageService: IMessageService; - private fileService: IFileService; - private contextService: IWorkspaceContextService; - - constructor(id: string, label: string, className: string, gitService: IGitService, messageService: IMessageService, fileService: IFileService, editorService: IWorkbenchEditorService, contextService: IWorkspaceContextService) { - super(id, label, className, gitService); - this.editorService = editorService; - this.messageService = messageService; - this.fileService = fileService; - this.contextService = contextService; - this.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && !!this.editorService && !!this.fileService; - } - - public run(context?: any): Promise { - if (!this.messageService.confirm(this.getConfirm(context))) { - return TPromise.as(null); - } - - var promises: Promise[] = []; - - if (context instanceof model.StatusGroup) { - promises = [this.gitService.undo()]; - - } else { - var all: IFileStatus[] = flatten(context); - var toClean: IFileStatus[] = []; - var toCheckout: IFileStatus[] = []; - - for (var i = 0; i < all.length; i++) { - var status = all[i].clone(); - - switch (status.getStatus()) { - case Status.UNTRACKED: - case Status.IGNORED: - toClean.push(status); - break; - - default: - toCheckout.push(status); - break; - } - } - - if (toClean.length > 0) { - promises.push(this.gitService.clean(toClean)); - } - - if (toCheckout.length > 0) { - promises.push(this.gitService.checkout('', toCheckout)); - } - } - - return Promise.join(promises).then((statuses: IModel[]) => { - if (statuses.length === 0) { - return TPromise.as(null); - } - - var status = statuses[statuses.length - 1]; - - var targetEditor = this.findWorkingTreeDiffEditor(); - if (!targetEditor) { - return TPromise.as(status); - } - - var currentGitEditorInput = targetEditor.input; - var currentFileStatus = currentGitEditorInput.getFileStatus(); - - if (all && all.every((f) => f !== currentFileStatus)) { - return TPromise.as(status); - } - - var path = currentGitEditorInput.getFileStatus().getPath(); - - var editor = targetEditor.getControl(); - var modifiedEditorControl = editor ? editor.getModifiedEditor() : null; - var modifiedViewState = modifiedEditorControl ? modifiedEditorControl.saveViewState() : null; - - return this.fileService.resolveFile(this.contextService.toResource(path)).then((stat: IFileStat) => { - return this.editorService.openEditor({ - resource: stat.resource, - options: { - forceOpen: true - } - }, targetEditor.position).then((editor) => { - if (modifiedViewState) { - var codeEditor = targetEditor.getControl(); - - if (codeEditor) { - codeEditor.restoreViewState(modifiedViewState); - } - } - }); - }); - }).then(null, (errors: any[]): Promise => { - console.error('One or more errors occurred', errors); - return Promise.wrapError(errors[0]); - }); - } - - private findWorkingTreeDiffEditor(): IEditor { - var editors = this.editorService.getVisibleEditors(); - for (var i = 0; i < editors.length; i++) { - var editor = editors[i]; - if (editor.input instanceof inputs.GitWorkingTreeDiffEditorInput) { - return editor; - } - } - - return null; - } - - private getConfirm(context: any): IConfirmation { - const all = flatten(context); - - if (all.length > 1) { - const count = all.length; - - return { - message: nls.localize('confirmUndoMessage', "Are you sure you want to clean all changes?"), - detail: count === 1 - ? nls.localize('confirmUndoAllOne', "There are unstaged changes in {0} file.\n\nThis action is irreversible!", count) - : nls.localize('confirmUndoAllMultiple', "There are unstaged changes in {0} files.\n\nThis action is irreversible!", count), - primaryButton: nls.localize({ key: 'cleanChangesLabel', comment: ['&& denotes a mnemonic'] }, "&&Clean Changes") - }; - } - - const label = all[0].getPathComponents().reverse()[0]; - - return { - message: nls.localize('confirmUndo', "Are you sure you want to clean changes in '{0}'?", label), - detail: nls.localize('irreversible', "This action is irreversible!"), - primaryButton: nls.localize({ key: 'cleanChangesLabel', comment: ['&& denotes a mnemonic'] }, "&&Clean Changes") - }; - } - - public dispose(): void { - this.editorService = null; - this.fileService = null; - - super.dispose(); - } -} - -export class UndoAction extends BaseUndoAction { - static ID = 'workbench.action.git.undo'; - constructor( @IGitService gitService: IGitService, @IMessageService messageService: IMessageService, @IFileService fileService: IFileService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IWorkspaceContextService contextService: IWorkspaceContextService) { - super(UndoAction.ID, nls.localize('undoChanges', "Clean"), 'git-action undo', gitService, messageService, fileService, editorService, contextService); - } -} - -export class GlobalUndoAction extends BaseUndoAction { - - static ID = 'workbench.action.git.undoAll'; - - constructor( @IGitService gitService: IGitService, @IMessageService messageService: IMessageService, @IFileService fileService: IFileService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IWorkspaceContextService contextService: IWorkspaceContextService) { - super(GlobalUndoAction.ID, nls.localize('undoAllChanges', "Clean All"), 'git-action undo', gitService, messageService, fileService, editorService, contextService); - } - - protected isEnabled(): boolean { - return super.isEnabled() && this.gitService.getModel().getStatus().getWorkingTreeStatus().all().length > 0; - } - - public run(context?: any): Promise { - return super.run(this.gitService.getModel().getStatus().getWorkingTreeStatus()); - } -} - -export abstract class BaseUnstageAction extends GitAction { - - protected editorService: IWorkbenchEditorService; - - constructor(id: string, label: string, className: string, gitService: IGitService, editorService: IWorkbenchEditorService) { - super(id, label, className, gitService); - this.editorService = editorService; - this.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && !!this.editorService; - } - - public run(context?: any): Promise { - var flatContext = flatten(context); - - return this.gitService.revertFiles('HEAD', flatContext).then((status: IModel) => { - var targetEditor = this.findGitIndexEditor(); - if (!targetEditor) { - return TPromise.as(status); - } - - var currentGitEditorInput = (targetEditor.input); - var currentFileStatus = currentGitEditorInput.getFileStatus(); - - if (flatContext && flatContext.every((f) => f !== currentFileStatus)) { - return TPromise.as(status); - } - - var path = currentGitEditorInput.getFileStatus().getPath(); - var fileStatus = status.getStatus().find(path, StatusType.WORKING_TREE); - - if (!fileStatus) { - return TPromise.as(status); - } - - var editorControl = targetEditor.getControl(); - var viewState = editorControl ? editorControl.saveViewState() : null; - - return this.gitService.getInput(fileStatus).then((input) => { - var options = new TextDiffEditorOptions(); - options.forceOpen = true; - - return this.editorService.openEditor(input, options, targetEditor.position).then((editor) => { - if (viewState) { - editorControl.restoreViewState(viewState); - } - - return status; - }); - }); - }); - } - - private findGitIndexEditor(): IEditor { - var editors = this.editorService.getVisibleEditors(); - for (var i = 0; i < editors.length; i++) { - var editor = editors[i]; - if (inputs.isGitEditorInput(editor.input)) { - return editor; - } - } - - return null; - } - - public dispose(): void { - this.editorService = null; - - super.dispose(); - } -} - -export class UnstageAction extends BaseUnstageAction { - static ID = 'workbench.action.git.unstage'; - static LABEL = nls.localize('unstage', "Unstage"); - - constructor( - @IGitService gitService: IGitService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService - ) { - super(UnstageAction.ID, UnstageAction.LABEL, 'git-action unstage', gitService, editorService); - } -} - -export class GlobalUnstageAction extends BaseUnstageAction { - - static ID = 'workbench.action.git.unstageAll'; - - constructor( @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(GlobalUnstageAction.ID, nls.localize('unstageAllChanges', "Unstage All"), 'git-action unstage', gitService, editorService); - } - - protected isEnabled(): boolean { - return super.isEnabled() && this.gitService.getModel().getStatus().getIndexStatus().all().length > 0; - } - - public run(context?: any): Promise { - return super.run(); - } -} - -enum LifecycleState { - Alive, - Disposing, - Disposed -} - -export class CheckoutAction extends GitAction { - - static ID = 'workbench.action.git.checkout'; - private editorService: IWorkbenchEditorService; - private branch: IBranch; - private HEAD: IBranch; - - private state: LifecycleState; - private runPromises: Promise[]; - - constructor(branch: IBranch, @IGitService gitService: IGitService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(CheckoutAction.ID, branch.name, 'git-action checkout', gitService); - - this.editorService = editorService; - this.branch = branch; - this.HEAD = null; - this.state = LifecycleState.Alive; - this.runPromises = []; - this.onGitServiceChange(); - } - - protected onGitServiceChange(): void { - if (this.gitService.getState() === ServiceState.OK) { - this.HEAD = this.gitService.getModel().getHEAD(); - - if (this.HEAD && this.HEAD.name === this.branch.name) { - this.class = 'git-action checkout HEAD'; - } else { - this.class = 'git-action checkout'; - } - } - - super.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && !!this.HEAD; - } - - public run(context?: any): Promise { - if (this.state !== LifecycleState.Alive) { - return Promise.wrapError('action disposed'); - } else if (this.HEAD && this.HEAD.name === this.branch.name) { - return TPromise.as(null); - } - - var result = this.gitService.checkout(this.branch.name).then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.DirtyWorkTree) { - return Promise.wrapError(new Error(nls.localize('dirtyTreeCheckout', "Can't checkout. Please commit or stash your work first."))); - } - - return Promise.wrapError(err); - }); - - this.runPromises.push(result); - result.done(() => this.runPromises.splice(this.runPromises.indexOf(result), 1)); - - return result; - } - - public dispose(): void { - if (this.state !== LifecycleState.Alive) { - return; - } - - this.state = LifecycleState.Disposing; - Promise.join(this.runPromises).done(() => this.actuallyDispose()); - } - - private actuallyDispose(): void { - this.editorService = null; - this.branch = null; - this.HEAD = null; - - super.dispose(); - - this.state = LifecycleState.Disposed; - } -} - -export class BranchAction extends GitAction { - - static ID = 'workbench.action.git.branch'; - private checkout: boolean; - - constructor(checkout: boolean, @IGitService gitService: IGitService) { - super(BranchAction.ID, 'Branch', 'git-action checkout', gitService); - this.checkout = checkout; - } - - public run(context?: any): Promise { - if (!isString(context)) { - return TPromise.as(false); - } - - return this.gitService.branch(context, this.checkout); - } -} - -export interface ICommitState extends IEventEmitter { - getCommitMessage(): string; - onEmptyCommitMessage(): void; -} - -export abstract class BaseCommitAction extends GitAction { - protected commitState: ICommitState; - - constructor(commitState: ICommitState, id: string, label: string, cssClass: string, gitService: IGitService) { - super(id, label, cssClass, gitService); - - this.commitState = commitState; - - this.toDispose.push(commitState.addListener('change/commitInputBox', () => { - this.updateEnablement(); - })); - - this.onGitServiceChange(); - } - - protected isEnabled(): boolean { - return super.isEnabled() && this.gitService.getModel().getStatus().getIndexStatus().all().length > 0; - } - - public run(context?: any): Promise { - if (!this.commitState.getCommitMessage()) { - this.commitState.onEmptyCommitMessage(); - return TPromise.as(null); - } - - return this.commit(); - } - - protected abstract commit(): Promise; -} - -export class CommitAction extends BaseCommitAction { - - static ID = 'workbench.action.git.commit'; - - constructor(commitState: ICommitState, @IGitService gitService: IGitService) { - super(commitState, CommitAction.ID, nls.localize('commitStaged', "Commit Staged"), 'git-action commit', gitService); - } - - protected commit(): Promise { - return this.gitService.commit(this.commitState.getCommitMessage()); - } -} - -export class CommitAmendAction extends BaseCommitAction { - - static ID = 'workbench.action.git.commitAmend'; - - constructor(commitState: ICommitState, @IGitService gitService: IGitService) { - super(commitState, CommitAction.ID, nls.localize('commitStagedAmend', "Commit Staged (Amend)"), 'git-action commit-amend', gitService); - } - - protected commit(): Promise { - return this.gitService.commit(this.commitState.getCommitMessage(), true); - } -} - -export class CommitSignedOffAction extends BaseCommitAction { - - static ID = 'workbench.action.git.commitSignedOff'; - - constructor(commitState: ICommitState, @IGitService gitService: IGitService) { - super(commitState, CommitAction.ID, nls.localize('commitStagedSignedOff', "Commit Staged (Signed Off)"), 'git-action commit-signed-off', gitService); - } - - protected commit(): Promise { - return this.gitService.commit(this.commitState.getCommitMessage(), undefined, undefined, true); - } -} - -export class InputCommitAction extends GitAction { - - static ID = 'workbench.action.git.input-commit'; - static LABEL = nls.localize('commit', "Commit"); - - constructor( - id = InputCommitAction.ID, - label = InputCommitAction.LABEL, - @IGitService gitService: IGitService, - @IQuickOpenService private quickOpenService: IQuickOpenService - ) { - super(id, label, '', gitService); - } - - protected isEnabled(): boolean { - if (!this.gitService) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - const status = this.gitService.getModel().getStatus(); - - return status.getIndexStatus().all().length > 0 || status.getWorkingTreeStatus().all().length > 0; - } - - run(): TPromise { - if (!this.enabled) { - return TPromise.as(null); - } - - const status = this.gitService.getModel().getStatus(); - - return this.quickOpenService.input({ prompt: nls.localize('commitMessage', "Commit Message") }) - .then(message => message && this.gitService.commit(message, false, status.getIndexStatus().all().length === 0)); - } -} - -export class StageAndCommitAction extends BaseCommitAction { - - static ID = 'workbench.action.git.stageAndCommit'; - static LABEL = nls.localize('commitAll', "Commit All"); - static CSSCLASS = 'git-action stage-and-commit'; - - constructor( - commitState: ICommitState, - id: string = StageAndCommitAction.ID, - label: string = StageAndCommitAction.LABEL, - cssClass: string = StageAndCommitAction.CSSCLASS, - @IGitService gitService: IGitService - ) { - super(commitState, id, label, cssClass, gitService); - } - - protected isEnabled(): boolean { - if (!this.gitService) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - var status = this.gitService.getModel().getStatus(); - - return status.getIndexStatus().all().length > 0 - || status.getWorkingTreeStatus().all().length > 0; - } - - protected commit(): Promise { - return this.gitService.commit(this.commitState.getCommitMessage(), false, true); - } -} - -export class StageAndCommitSignedOffAction extends StageAndCommitAction { - - static ID = 'workbench.action.git.stageAndCommitSignedOff'; - - constructor(commitState: ICommitState, @IGitService gitService: IGitService) { - super(commitState, StageAndCommitAction.ID, nls.localize('commitAllSignedOff', "Commit All (Signed Off)"), 'git-action stage-and-commit-signed-off', gitService); - } - - protected commit(): Promise { - return this.gitService.commit(this.commitState.getCommitMessage(), false, true, true); - } -} - -export class SmartCommitAction extends BaseCommitAction { - - static ID = 'workbench.action.git.commitAll'; - private static ALL = nls.localize('commitAll2', "Commit All"); - private static STAGED = nls.localize('commitStaged2', "Commit Staged"); - - private messageService: IMessageService; - - constructor(commitState: ICommitState, @IGitService gitService: IGitService, @IMessageService messageService: IMessageService) { - super(commitState, SmartCommitAction.ID, SmartCommitAction.ALL, 'git-action smart-commit', gitService); - this.messageService = messageService; - this.onGitServiceChange(); - } - - protected onGitServiceChange(): void { - super.onGitServiceChange(); - - if (!this.enabled) { - this.label = SmartCommitAction.ALL; - return; - } - - var status = this.gitService.getModel().getStatus(); - - if (status.getIndexStatus().all().length > 0) { - this.label = SmartCommitAction.STAGED; - } else { - this.label = SmartCommitAction.ALL; - } - - this.label += ' (' + (platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter') + ')'; - } - - protected isEnabled(): boolean { - if (!this.gitService) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - var status = this.gitService.getModel().getStatus(); - - return status.getIndexStatus().all().length > 0 - || status.getWorkingTreeStatus().all().length > 0; - } - - protected commit(): Promise { - const status = this.gitService.getModel().getStatus(); - return this.gitService.commit(this.commitState.getCommitMessage(), false, status.getIndexStatus().all().length === 0); - } -} - -export class PullAction extends GitAction { - - static ID = 'workbench.action.git.pull'; - static LABEL = 'Pull'; - - constructor( - id = PullAction.ID, - label = PullAction.LABEL, - @IGitService gitService: IGitService - ) { - super(id, label, 'git-action pull', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - var model = this.gitService.getModel(); - var HEAD = model.getHEAD(); - - if (!HEAD || !HEAD.name || !HEAD.upstream) { - return false; - } - - return true; - } - - public run(context?: any): Promise { - return this.pull(); - } - - protected pull(rebase = false): Promise { - return this.gitService.pull(rebase).then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.DirtyWorkTree) { - return Promise.wrapError(errors.create(nls.localize('dirtyTreePull', "Can't pull. Please commit or stash your work first."), { severity: Severity.Warning })); - } else if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return Promise.wrapError(errors.create(nls.localize('authFailed', "Authentication failed on the git remote."))); - } - - return Promise.wrapError(err); - }); - } -} - -export class PullWithRebaseAction extends PullAction { - - static ID = 'workbench.action.git.pull.rebase'; - static LABEL = 'Pull (Rebase)'; - - constructor( - id = PullWithRebaseAction.ID, - label = PullWithRebaseAction.LABEL, - @IGitService gitService: IGitService - ) { - super(id, label, gitService); - } - - public run(context?: any): Promise { - return this.pull(true); - } -} - -export class PushAction extends GitAction { - - static ID = 'workbench.action.git.push'; - static LABEL = 'Push'; - - constructor( - id: string = PushAction.ID, - label: string = PushAction.LABEL, - @IGitService gitService: IGitService - ) { - super(id, label, 'git-action push', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - var model = this.gitService.getModel(); - var HEAD = model.getHEAD(); - - if (!HEAD || !HEAD.name || !HEAD.upstream) { - return false; - } - - if (!HEAD.ahead) { // no commits to pull or push - return false; - } - - return true; - } - - public run(context?: any): Promise { - return this.gitService.push().then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return Promise.wrapError(errors.create(nls.localize('authFailed', "Authentication failed on the git remote."))); - } - - return Promise.wrapError(err); - }); - } -} - -export class PushToRemoteAction extends GitAction { - - static ID = 'workbench.action.git.pushToRemote'; - static LABEL = nls.localize('pushToRemote', "Push to..."); - - constructor( - id: string = PushToRemoteAction.ID, - label: string = PushToRemoteAction.LABEL, - @IGitService gitService: IGitService, - @IQuickOpenService private quickOpenService: IQuickOpenService - ) { - super(id, label, 'git-action publish', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - const model = this.gitService.getModel(); - - if (model.getRemotes().length === 0) { - return false; - } - - const HEAD = model.getHEAD(); - - if (!HEAD || !HEAD.name) { - return false; - } - - return true; - } - - public run(context?: any): Promise { - const model = this.gitService.getModel(); - const remotes = model.getRemotes(); - const branchName = model.getHEAD().name; - const picks = remotes.map(({ name, url }) => ({ label: name, description: url })); - const placeHolder = nls.localize('pushToRemotePickMessage', "Pick a remote to push the branch '{0}' to:", branchName); - - return this.quickOpenService.pick(picks, { placeHolder }) - .then(pick => pick && pick.label) - .then(remote => remote && this.gitService.push(remote, branchName)) - .then(null, err => { - if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return Promise.wrapError(errors.create(nls.localize('authFailed', "Authentication failed on the git remote."))); - } - - return Promise.wrapError(err); - }); - } -} - -export class PublishAction extends GitAction { - - static ID = 'workbench.action.git.publish'; - static LABEL = nls.localize('publish', "Publish"); - - constructor( - id: string = PublishAction.ID, - label: string = PublishAction.LABEL, - @IGitService gitService: IGitService, - @IQuickOpenService private quickOpenService: IQuickOpenService, - @IMessageService private messageService: IMessageService - ) { - super(id, label, 'git-action publish', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - const model = this.gitService.getModel(); - - if (model.getRemotes().length === 0) { - return false; - } - - const HEAD = model.getHEAD(); - - if (!HEAD || !HEAD.name || HEAD.upstream) { - return false; - } - - return true; - } - - public run(context?: any): Promise { - const model = this.gitService.getModel(); - const remotes = model.getRemotes(); - const branchName = model.getHEAD().name; - let promise: TPromise; - - if (remotes.length === 1) { - const remoteName = remotes[0].name; - - const result = this.messageService.confirm({ - message: nls.localize('confirmPublishMessage', "Are you sure you want to publish '{0}' to '{1}'?", branchName, remoteName), - primaryButton: nls.localize({ key: 'confirmPublishMessageButton', comment: ['&& denotes a mnemonic'] }, "&&Publish") - }); - - promise = TPromise.as(result ? remoteName : null); - } else { - const picks = remotes.map(({ name, url }) => ({ - label: name, - description: url - })); - - const placeHolder = nls.localize('publishPickMessage', "Pick a remote to publish the branch '{0}' to:", branchName); - - promise = this.quickOpenService.pick(picks, { placeHolder }) - .then(pick => pick && pick.label); - } - - return promise - .then(remote => remote && this.gitService.push(remote, branchName, { setUpstream: true })) - .then(null, err => { - if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return Promise.wrapError(errors.create(nls.localize('authFailed', "Authentication failed on the git remote."))); - } - - return Promise.wrapError(err); - }); - } -} - -export class SyncAction extends GitAction { - - static ID = 'workbench.action.git.sync'; - static LABEL = 'Sync'; - - constructor(id: string, label: string, - @IGitService gitService: IGitService, - @IConfigurationService private configurationService: IConfigurationService, - @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, - @IChoiceService private choiceService: IChoiceService - ) { - super(id, label, 'git-action sync', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - var model = this.gitService.getModel(); - var HEAD = model.getHEAD(); - - if (!HEAD || !HEAD.name || !HEAD.upstream) { - return false; - } - - return true; - } - - public run(context?: any): Promise { - if (!this.enabled) { - return TPromise.as(null); - } - - const shouldPrompt = this.configurationService.getConfiguration('git').confirmSync; - - if (!shouldPrompt) { - return this.sync(); - } - - - const model = this.gitService.getModel(); - const HEAD = model.getHEAD(); - const message = nls.localize('sync is unpredictable', "This action will push and pull commits to and from '{0}'.", HEAD.upstream); - const options = [nls.localize('ok', "OK"), nls.localize('cancel', "Cancel"), nls.localize('never again', "OK, Never Show Again")]; - - return this.choiceService.choose(Severity.Warning, message, options, 1).then(choice => { - switch (choice) { - case 0: - return this.sync(); - case 1: - return TPromise.as(null); - case 2: - return this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: 'git.confirmSync', value: false }) - .then(() => this.sync()); - default: - return TPromise.as(null); - } - }); - } - - private sync(): TPromise { - return this.gitService.sync().then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return Promise.wrapError(errors.create(nls.localize('authFailed', "Authentication failed on the git remote."))); - } - - return Promise.wrapError(err); - }); - } -} - -export class UndoLastCommitAction extends GitAction { - - static ID = 'workbench.action.git.undoLastCommit'; - static LABEL = nls.localize('undoLastCommit', "Undo Last Commit"); - - constructor( - id = UndoLastCommitAction.ID, - label = UndoLastCommitAction.LABEL, - @IGitService gitService: IGitService - ) { - super(UndoLastCommitAction.ID, UndoLastCommitAction.LABEL, 'git-action undo-last-commit', gitService); - } - - protected isEnabled(): boolean { - if (!super.isEnabled()) { - return false; - } - - if (!this.gitService.isIdle()) { - return false; - } - - const model = this.gitService.getModel(); - const HEAD = model.getHEAD(); - - return !!(HEAD && HEAD.commit); - } - - public run(): Promise { - return this.gitService.reset('HEAD~'); - } -} - -export class StartGitCheckoutAction extends Action { - - public static ID = 'workbench.action.git.startGitCheckout'; - public static LABEL = 'Checkout'; - private quickOpenService: IQuickOpenService; - - constructor(id: string, label: string, @IQuickOpenService quickOpenService: IQuickOpenService) { - super(id, label); - this.quickOpenService = quickOpenService; - } - - public run(event?: any): Promise { - this.quickOpenService.show('git checkout '); - return TPromise.as(null); - } -} - -export class StartGitBranchAction extends Action { - - public static ID = 'workbench.action.git.startGitBranch'; - public static LABEL = 'Branch'; - private quickOpenService: IQuickOpenService; - - constructor(id: string, label: string, @IQuickOpenService quickOpenService: IQuickOpenService) { - super(id, label); - this.quickOpenService = quickOpenService; - } - - public run(event?: any): Promise { - this.quickOpenService.show('git branch '); - return TPromise.as(null); - } -} diff --git a/src/vs/workbench/parts/git/browser/gitEditorContributions.ts b/src/vs/workbench/parts/git/browser/gitEditorContributions.ts deleted file mode 100644 index c303f0d05eb..00000000000 --- a/src/vs/workbench/parts/git/browser/gitEditorContributions.ts +++ /dev/null @@ -1,181 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; -import { IModel, IModelDeltaDecoration, IModelDecorationOptions, OverviewRulerLane, IEditorContribution, TrackedRangeStickiness } from 'vs/editor/common/editorCommon'; -import { IGitService, ModelEvents, StatusType } from 'vs/workbench/parts/git/common/git'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Delayer } from 'vs/base/common/async'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; - -const pattern = /^<<<<<<<|^=======|^>>>>>>>/; - -function decorate(model: IModel): IModelDeltaDecoration[] { - const options = MergeDecorator.DECORATION_OPTIONS; - - return model.getLinesContent() - .map((line, i) => pattern.test(line) ? i : null) - .filter(i => i !== null) - .map(i => ({ startLineNumber: i + 1, startColumn: 1, endLineNumber: i + 1, endColumn: 1 })) - .map(range => ({ range, options })); -} - -class MergeDecoratorBoundToModel extends Disposable { - - private decorations: string[]; - - constructor( - private editor: ICodeEditor, - private model: IModel, - private filePath: string, - private gitService: IGitService - ) { - super(); - - this.decorations = []; - - const delayer = new Delayer(300); - delayer.trigger(() => this.redecorate()); - - const gitModel = gitService.getModel(); - this._register(model.onDidChangeContent(() => delayer.trigger(() => this.redecorate()))); - this._register(gitModel.addListener(ModelEvents.STATUS_MODEL_UPDATED, () => delayer.trigger(() => this.redecorate()))); - } - - private _setDecorations(newDecorations: IModelDeltaDecoration[]): void { - this.decorations = this.editor.deltaDecorations(this.decorations, newDecorations); - } - - private redecorate(): void { - if (this.model.isDisposed()) { - return; - } - - const gitModel = this.gitService.getModel(); - - if (!gitModel) { - return; - } - - const mergeStatus = gitModel.getStatus().find(this.filePath, StatusType.MERGE); - - if (!mergeStatus) { - return; - } - - this._setDecorations(decorate(this.model)); - } - - dispose(): void { - this._setDecorations([]); - super.dispose(); - } -} - -export class MergeDecorator extends Disposable implements IEditorContribution { - - static ID = 'vs.git.editor.merge.decorator'; - - static DECORATION_OPTIONS: IModelDecorationOptions = { - className: 'git-merge-control-decoration', - isWholeLine: true, - overviewRuler: { - color: 'rgb(197, 118, 0)', - darkColor: 'rgb(197, 118, 0)', - position: OverviewRulerLane.Left - }, - stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges - }; - - private mergeDecorator: MergeDecoratorBoundToModel; - - constructor( - private editor: ICodeEditor, - @IGitService private gitService: IGitService, - @IWorkspaceContextService private contextService: IWorkspaceContextService - ) { - super(); - - this._register(this.editor.onDidChangeModel(() => this.onModelChanged())); - this.mergeDecorator = null; - } - - getId(): string { - return MergeDecorator.ID; - } - - private onModelChanged(): void { - if (this.mergeDecorator) { - this.mergeDecorator.dispose(); - this.mergeDecorator = null; - } - - if (!this.contextService || !this.gitService) { - return; - } - - const model = this.editor.getModel(); - if (!model) { - return; - } - - const resource = model.uri; - if (!resource) { - return; - } - - const path = this.contextService.toWorkspaceRelativePath(resource); - if (!path) { - return; - } - - this.mergeDecorator = new MergeDecoratorBoundToModel(this.editor, model, path, this.gitService); - } - - dispose(): void { - if (this.mergeDecorator) { - this.mergeDecorator.dispose(); - this.mergeDecorator = null; - } - - super.dispose(); - } -} - -// TODO@Joao: remove -@editorContribution -export class MergeDecoratorWrapper extends Disposable implements IEditorContribution { - - static ID = 'vs.git.editor.merge.decoratorwrapper'; - private decorator: MergeDecorator; - - constructor( - private editor: ICodeEditor, - @IInstantiationService instantiationService: IInstantiationService - ) { - super(); - - if (SCMPreview.enabled) { - return; - } - - this.decorator = instantiationService.createInstance(MergeDecorator, editor); - } - - getId(): string { - return MergeDecoratorWrapper.ID; - } - - dispose(): void { - if (this.decorator) { - this.decorator.dispose(); - this.decorator = null; - } - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitEditorInputs.ts b/src/vs/workbench/parts/git/browser/gitEditorInputs.ts deleted file mode 100644 index 3cc7c790f50..00000000000 --- a/src/vs/workbench/parts/git/browser/gitEditorInputs.ts +++ /dev/null @@ -1,160 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 winjs = require('vs/base/common/winjs.base'); -import lifecycle = require('vs/base/common/lifecycle'); -import async = require('vs/base/common/async'); -import WorkbenchEditorCommon = require('vs/workbench/common/editor'); -import stringei = require('vs/workbench/common/editor/stringEditorInput'); -import diffei = require('vs/workbench/common/editor/diffEditorInput'); -import git = require('vs/workbench/parts/git/common/git'); -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorInput } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - -import IGitService = git.IGitService; - -export interface IEditorInputWithStatus { - getFileStatus(): git.IFileStatus; -} - -export function isGitEditorInput(input: IEditorInput): boolean { - return input instanceof GitDiffEditorInput || input instanceof NativeGitIndexStringEditorInput; -} - -export class GitDiffEditorInput - extends diffei.DiffEditorInput - implements IEditorInputWithStatus { - private status: git.IFileStatus; - - constructor(name: string, description: string, originalInput: WorkbenchEditorCommon.EditorInput, modifiedInput: WorkbenchEditorCommon.EditorInput, status: git.IFileStatus) { - super(name, description, originalInput, modifiedInput); - - this.status = status; - } - - public getFileStatus(): git.IFileStatus { - return this.status; - } - - public contains(otherInput: any): boolean { - if (this.matches(otherInput)) { - return true; - } - - var originalInput = this.originalInput; - if (originalInput && originalInput.matches(otherInput)) { - return true; - } - - var modifiedInput = this.modifiedInput; - if (modifiedInput && modifiedInput.matches(otherInput)) { - return true; - } - - return false; - } -} - -export class GitWorkingTreeDiffEditorInput extends GitDiffEditorInput { - - static ID = 'vs.git.workingTreeDiffInput'; - - constructor(name: string, description: string, originalInput: WorkbenchEditorCommon.EditorInput, modifiedInput: WorkbenchEditorCommon.EditorInput, status: git.IFileStatus) { - super(name, description, originalInput, modifiedInput, status); - } - - public getTypeId(): string { - return GitWorkingTreeDiffEditorInput.ID; - } -} - -export class GitIndexDiffEditorInput extends GitDiffEditorInput { - - static ID: string = 'vs.git.indexDiffInput'; - - constructor(name: string, description: string, originalInput: WorkbenchEditorCommon.EditorInput, modifiedInput: WorkbenchEditorCommon.EditorInput, status: git.IFileStatus) { - super(name, description, originalInput, modifiedInput, status); - } - - public getTypeId(): string { - return GitIndexDiffEditorInput.ID; - } -} - -export class NativeGitIndexStringEditorInput - extends stringei.StringEditorInput - implements IEditorInputWithStatus { - public static ID = 'vs.git.stringEditorInput'; - - private gitService: IGitService; - private editorService: IWorkbenchEditorService; - private status: git.IFileStatus; - private path: string; - private treeish: string; - private delayer: async.ThrottledDelayer; - private toDispose: lifecycle.IDisposable[]; - - constructor(name: any, description: string, mime: string, status: git.IFileStatus, path: string, treeish: string, - @IGitService gitService: IGitService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IInstantiationService instantiationService: IInstantiationService - ) { - super(name, description, null, mime, false, instantiationService); - - this.gitService = gitService; - this.editorService = editorService; - this.status = status; - this.path = path; - this.treeish = treeish; - this.delayer = new async.ThrottledDelayer(1000); - - this.toDispose = []; - this.toDispose.push(this.gitService.addListener(git.ServiceEvents.STATE_CHANGED, () => this.onGitServiceStateChange())); - this.toDispose.push(this.gitService.addListener(git.ServiceEvents.OPERATION_END, () => this.onGitServiceStateChange())); - } - - public getTypeId(): string { - return NativeGitIndexStringEditorInput.ID; - } - - public getFileStatus(): git.IFileStatus { - return this.status; - } - - public resolve(refresh?: boolean): winjs.TPromise { - if (refresh || !this.getValue()) { - return this.gitService.buffer(this.path, this.treeish).then(contents => { - if (this.getValue() !== contents) { - this.setValue(contents); - } - - return super.resolve(refresh); - }); - } else { - return super.resolve(refresh); - } - } - - private onGitServiceStateChange(): void { - var isVisible = this.editorService.isVisible(this, true); - if (!isVisible) { - return; - } - - this.delayer.trigger(() => this.resolve(true)); - } - - public dispose(): void { - if (this.delayer) { - this.delayer.cancel(); - this.delayer = null; - } - - this.toDispose = lifecycle.dispose(this.toDispose); - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/git/browser/gitOperations.ts b/src/vs/workbench/parts/git/browser/gitOperations.ts deleted file mode 100644 index 669c5a92320..00000000000 --- a/src/vs/workbench/parts/git/browser/gitOperations.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { IGitOperation, IRawStatus } from 'vs/workbench/parts/git/common/git'; -import { TPromise } from 'vs/base/common/winjs.base'; - -export class GitOperation implements IGitOperation { - - id: string; - - constructor(id: string, private fn: () => TPromise) { - this.id = id; - } - - run(): TPromise { - return this.fn(); - } - - dispose(): void { - // noop - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitOutput.ts b/src/vs/workbench/parts/git/browser/gitOutput.ts deleted file mode 100644 index f760e2e3d33..00000000000 --- a/src/vs/workbench/parts/git/browser/gitOutput.ts +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IGitService, ServiceEvents } from 'vs/workbench/parts/git/common/git'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; - -export class GitOutput implements IWorkbenchContribution { - - static ID = 'vs.git.output'; - - private outputListener: IDisposable; - private gitService: IGitService; - private outputService: IOutputService; - - constructor( @IGitService gitService: IGitService, @IOutputService outputService: IOutputService) { - this.gitService = gitService; - this.outputService = outputService; - - const listener = gitService.addListener(ServiceEvents.OPERATION_START, () => { - this.outputListener = this.gitService.onOutput(output => this.onOutput(output)); - listener.dispose(); - }); - } - - getId(): string { - return GitOutput.ID; - } - - private onOutput(output: string): void { - this.outputService.getChannel('Git').append(output); - } - - dispose(): void { - this.outputListener = dispose(this.outputListener); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitQuickOpen.ts b/src/vs/workbench/parts/git/browser/gitQuickOpen.ts deleted file mode 100644 index bbe0a035bac..00000000000 --- a/src/vs/workbench/parts/git/browser/gitQuickOpen.ts +++ /dev/null @@ -1,271 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { localize } from 'vs/nls'; -import { matchesContiguousSubString } from 'vs/base/common/filters'; -import { TPromise } from 'vs/base/common/winjs.base'; -import Severity from 'vs/base/common/severity'; -import { IGitService, RefType, IRef, IGitConfiguration } from 'vs/workbench/parts/git/common/git'; -import { ICommand, CommandQuickOpenHandler } from 'vs/workbench/browser/quickopen'; -import { Mode } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenEntry, IHighlight, IContext, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - -class AbstractRefEntry extends QuickOpenEntry { - - protected gitService: IGitService; - protected messageService: IMessageService; - protected ref: IRef; - - constructor(gitService: IGitService, messageService: IMessageService, ref: IRef, highlights: IHighlight[]) { - super(highlights); - - this.gitService = gitService; - this.messageService = messageService; - this.ref = ref; - } - - getIcon(): string { return 'git'; } - getLabel(): string { return this.ref.name; } - getDescription(): string { return ''; } - getAriaLabel(): string { return localize('refAriaLabel', "{0}, git", this.getLabel()); } - - run(mode: Mode, context: IContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - return true; - } -} - -class CheckoutHeadEntry extends AbstractRefEntry { - - getDescription(): string { return localize('checkoutBranch', "Branch at {0}", this.ref.commit.substr(0, 8)); } - - run(mode: Mode, context: IContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - this.gitService.checkout(this.ref.name).done(null, e => this.messageService.show(Severity.Error, e)); - return true; - } -} - -class CheckoutRemoteHeadEntry extends AbstractRefEntry { - - getDescription(): string { return localize('checkoutRemoteBranch', "Remote branch at {0}", this.ref.commit.substr(0, 8)); } - - run(mode: Mode, context: IContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - const match = /^[^/]+\/(.*)$/.exec(this.ref.name); - const name = match ? match[1] : this.ref.name; - - this.gitService.checkout(name).done(null, e => this.messageService.show(Severity.Error, e)); - return true; - } -} - -class CheckoutTagEntry extends AbstractRefEntry { - - getDescription(): string { return localize('checkoutTag', "Tag at {0}", this.ref.commit.substr(0, 8)); } - - run(mode: Mode, context: IContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - this.gitService.checkout(this.ref.name).done(null, e => this.messageService.show(Severity.Error, e)); - return true; - } -} - -class CurrentHeadEntry extends AbstractRefEntry { - getDescription(): string { return localize('alreadyCheckedOut', "Branch {0} is already the current branch", this.ref.name); } -} - -class BranchEntry extends QuickOpenEntry { - - private gitService: IGitService; - private messageService: IMessageService; - private name: string; - - constructor(gitService: IGitService, messageService: IMessageService, name: string) { - super([{ start: 0, end: name.length }]); - - this.gitService = gitService; - this.messageService = messageService; - - // sanitize name - this.name = name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-'); - } - - getIcon(): string { return 'git'; } - getLabel(): string { return this.name; } - getAriaLabel(): string { return localize({ key: 'branchAriaLabel', comment: ['the branch name'] }, "{0}, git branch", this.getLabel()); } - getDescription(): string { return localize('createBranch', "Create branch {0}", this.name); } - - run(mode: Mode, context: IContext): boolean { - if (mode === Mode.PREVIEW) { - return false; - } - - this.gitService.branch(this.name, true).done(null, e => this.messageService.show(Severity.Error, e)); - return true; - } -} - -// Commands - -class CheckoutCommand implements ICommand { - - aliases = ['checkout', 'co']; - icon = 'git'; - - constructor(private gitService: IGitService, private messageService: IMessageService, private configurationService: IConfigurationService) { - // noop - } - - getResults(input: string): TPromise { - input = input.trim(); - - const config = this.configurationService.getConfiguration('git'); - const checkoutType = config.checkoutType; - const includeTags = checkoutType === 'all' || checkoutType === 'tags'; - const includeRemotes = checkoutType === 'all' || checkoutType === 'remote'; - - const gitModel = this.gitService.getModel(); - const currentHead = gitModel.getHEAD(); - const refs = gitModel.getRefs(); - const heads = refs.filter(ref => ref.type === RefType.Head); - const tags = includeTags ? refs.filter(ref => ref.type === RefType.Tag) : []; - const remoteHeads = includeRemotes ? refs.filter(ref => ref.type === RefType.RemoteHead) : []; - - const headMatches = heads - .map(head => ({ head, highlights: matchesContiguousSubString(input, head.name) })) - .filter(({ highlights }) => !!highlights); - - const headEntries: QuickOpenEntry[] = headMatches - .filter(({ head }) => head.name !== currentHead.name) - .map(({ head, highlights }) => new CheckoutHeadEntry(this.gitService, this.messageService, head, highlights)); - - const tagMatches = tags - .map(head => ({ head, highlights: matchesContiguousSubString(input, head.name) })) - .filter(({ highlights }) => !!highlights); - - const tagEntries = tagMatches - .filter(({ head }) => head.name !== currentHead.name) - .map(({ head, highlights }) => new CheckoutTagEntry(this.gitService, this.messageService, head, highlights)); - - const checkoutEntries = headEntries - .concat(tagEntries) - .sort((a, b) => a.getLabel().localeCompare(b.getLabel())); - - const remoteHeadMatches = remoteHeads - .map(head => ({ head, highlights: matchesContiguousSubString(input, head.name) })) - .filter(({ highlights }) => !!highlights); - - const remoteHeadEntries: QuickOpenEntry[] = remoteHeadMatches - .filter(({ head }) => head.name !== currentHead.name) - .map(({ head, highlights }) => new CheckoutRemoteHeadEntry(this.gitService, this.messageService, head, highlights)) - .sort((a, b) => a.getLabel().localeCompare(b.getLabel())); - - if (checkoutEntries.length > 0) { - checkoutEntries[0] = new QuickOpenEntryGroup(checkoutEntries[0], 'checkout', false); - } - - if (remoteHeadEntries.length > 0) { - remoteHeadEntries[0] = new QuickOpenEntryGroup(remoteHeadEntries[0], 'checkout remote', checkoutEntries.length > 0); - } - - const entries = checkoutEntries - .sort((a, b) => a.getLabel().localeCompare(b.getLabel())) - .concat(remoteHeadEntries); - - const allMatches = headMatches.concat(tagMatches).concat(remoteHeadMatches); - const exactMatches = allMatches.filter(({ head }) => head.name === input); - const currentHeadMatches = exactMatches.filter(({ head }) => head.name === currentHead.name); - - if (currentHeadMatches.length > 0) { - entries.unshift(new CurrentHeadEntry(this.gitService, this.messageService, currentHeadMatches[0].head, currentHeadMatches[0].highlights)); - - } else if (exactMatches.length === 0 && input) { - const branchEntry = new BranchEntry(this.gitService, this.messageService, input); - entries.push(new QuickOpenEntryGroup(branchEntry, 'branch', checkoutEntries.length > 0 || remoteHeadEntries.length > 0)); - } - - return TPromise.as(entries); - } - - getEmptyLabel(input: string): string { - return localize('noBranches', "No other branches"); - } -} - -class BranchCommand implements ICommand { - - aliases = ['branch']; - icon = 'git'; - - constructor(private gitService: IGitService, private messageService: IMessageService) { - // noop - } - - getResults(input: string): TPromise { - input = input.trim(); - - if (!input) { - return TPromise.as([]); - } - - const gitModel = this.gitService.getModel(); - const currentHead = gitModel.getHEAD(); - - const matches = gitModel.getRefs() - .map(head => ({ head, highlights: matchesContiguousSubString(input, head.name) })) - .filter(({ highlights }) => !!highlights); - - const exactMatches = matches.filter(({ head }) => head.name === input); - const headMatches = exactMatches.filter(({ head }) => head.name === currentHead.name); - - if (headMatches.length > 0) { - return TPromise.as([new CurrentHeadEntry(this.gitService, this.messageService, headMatches[0].head, headMatches[0].highlights)]); - } else if (exactMatches.length > 0) { - return TPromise.as([new CheckoutHeadEntry(this.gitService, this.messageService, exactMatches[0].head, exactMatches[0].highlights)]); - } - - const branchEntry = new BranchEntry(this.gitService, this.messageService, input); - return TPromise.as([new QuickOpenEntryGroup(branchEntry, 'branch', false)]); - } - - getEmptyLabel(input: string): string { - return localize('notValidBranchName', "Please provide a valid branch name"); - } -} - -export class GitCommandQuickOpenHandler extends CommandQuickOpenHandler { - - constructor( - @IQuickOpenService quickOpenService: IQuickOpenService, - @IGitService gitService: IGitService, - @IMessageService messageService: IMessageService, - @IConfigurationService configurationService: IConfigurationService - ) { - super(quickOpenService, { - prefix: 'git', - commands: [ - new CheckoutCommand(gitService, messageService, configurationService), - new BranchCommand(gitService, messageService) - ] - }); - } -} diff --git a/src/vs/workbench/parts/git/browser/gitScm.ts b/src/vs/workbench/parts/git/browser/gitScm.ts deleted file mode 100644 index b0c345413e4..00000000000 --- a/src/vs/workbench/parts/git/browser/gitScm.ts +++ /dev/null @@ -1,125 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import Event, { Emitter } from 'vs/base/common/event'; -import { dispose } from 'vs/base/common/lifecycle'; -import URI from 'vs/base/common/uri'; -import { IModel } from 'vs/editor/common/editorCommon'; -import { ISCMService, ISCMProvider, ISCMResource, ISCMResourceGroup } from 'vs/workbench/services/scm/common/scm'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { Throttler } from 'vs/base/common/async'; -import * as paths from 'vs/base/common/paths'; -import { IGitService, StatusType, ServiceEvents, ServiceOperations, ServiceState } from 'vs/workbench/parts/git/common/git'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; - -// TODO@Joao: remove -export class GitSCMProvider implements IWorkbenchContribution, ISCMProvider, ITextModelContentProvider { - - get id() { return 'git-internal'; } - get label() { return 'Git'; } - get resources() { return []; } - - private _onDidChange = new Emitter(); - get onDidChange(): Event { - return this._onDidChange.event; - } - - constructor( - @ITextModelResolverService textModelResolverService: ITextModelResolverService, - @IModelService private modelService: IModelService, - @IGitService private gitService: IGitService, - @ISCMService scmService: ISCMService - ) { - scmService.registerSCMProvider(this); - textModelResolverService.registerTextModelContentProvider('git', this); - } - - getId(): string { - return 'git.contentprovider'; - } - - open(uri: ISCMResource): TPromise { - return TPromise.wrapError('not implemented'); - } - - acceptChanges(): TPromise { - return TPromise.wrapError('not implemented'); - } - - drag(from: ISCMResource, to: ISCMResourceGroup): TPromise { - return TPromise.wrapError('not implemented'); - } - - getOriginalResource(uri: URI): TPromise { - if (uri.scheme !== 'file') { - return TPromise.as(null); - } - - return TPromise.as(uri.with({ scheme: 'git' })); - } - - provideTextContent(uri: URI): TPromise { - const model = this.modelService.createModel('', null, uri); - const throttler = new Throttler(); - - const setModelContents = contents => { - if (model.isDisposed()) { - return; - } - - model.setValue(contents || ''); - }; - - const updateModel = () => { - const gitModel = this.gitService.getModel(); - const root = gitModel.getRepositoryRoot(); - - if (!root) { - return TPromise.as(null); - } - - const path = uri.fsPath; - const relativePath = paths.relative(root, path).replace(/\\/g, '/'); - - if (/^\.\./.test(relativePath)) { - return TPromise.as(null); - } - - const treeish = gitModel.getStatus().find(relativePath, StatusType.INDEX) ? '~' : 'HEAD'; - - return this.gitService.buffer(path, treeish).then(setModelContents); - }; - - const triggerModelUpdate = () => { - if (this.gitService.getState() !== ServiceState.OK) { - return; - } - - throttler.queue(updateModel); - }; - - const disposables = [ - this.gitService.addListener(ServiceEvents.STATE_CHANGED, triggerModelUpdate), - this.gitService.addListener(ServiceEvents.OPERATION_END, e => { - if (e.operation.id !== ServiceOperations.BACKGROUND_FETCH) { - triggerModelUpdate(); - } - }) - ]; - - model.onWillDispose(() => dispose(disposables)); - triggerModelUpdate(); - - return TPromise.as(model); - } - - dispose(): void { - - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitServices.ts b/src/vs/workbench/parts/git/browser/gitServices.ts deleted file mode 100644 index f494f7ef3b4..00000000000 --- a/src/vs/workbench/parts/git/browser/gitServices.ts +++ /dev/null @@ -1,908 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { localize } from 'vs/nls'; -import * as platform from 'vs/base/common/platform'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { Action } from 'vs/base/common/actions'; -import { isPromiseCanceledError, create as createError } from 'vs/base/common/errors'; -import * as mime from 'vs/base/common/mime'; -import * as paths from 'vs/base/common/paths'; -import Event, { once } from 'vs/base/common/event'; -import { EventEmitter } from 'vs/base/common/eventEmitter'; -import { EditorInput } from 'vs/workbench/common/editor'; -import { - IFileStatus, IGitServiceError, GitErrorCodes, Status, StatusType, AutoFetcherState, IGitConfiguration, IAutoFetcher, ServiceEvents, ServiceState, - IModel, IGitOperation, IRawGitService, IGitService, RawServiceState, ServiceOperations, IPushOptions, ICommit, IRawStatus -} from 'vs/workbench/parts/git/common/git'; -import { Model } from 'vs/workbench/parts/git/common/gitModel'; -import { NativeGitIndexStringEditorInput, GitIndexDiffEditorInput, GitWorkingTreeDiffEditorInput, GitDiffEditorInput } from 'vs/workbench/parts/git/browser/gitEditorInputs'; -import { GitOperation } from 'vs/workbench/parts/git/browser/gitOperations'; -import { TextFileModelChangeEvent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IFileService, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files'; -import { ThrottledDelayer, PeriodThrottledDelayer } from 'vs/base/common/async'; -import severity from 'vs/base/common/severity'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService, CloseAction } from 'vs/platform/message/common/message'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import URI from 'vs/base/common/uri'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { domEvent } from 'vs/base/browser/event'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; - -function toReadablePath(path: string): string { - if (!platform.isWindows) { - return path; - } - - return path.replace(/\//g, '\\'); -} - -class EditorInputCache { - private gitService: GitService; - private fileService: IFileService; - private instantiationService: IInstantiationService; - private editorService: IWorkbenchEditorService; - private editorGroupService: IEditorGroupService; - private contextService: IWorkspaceContextService; - private cache: { [key: string]: TPromise }; - private toDispose: IDisposable[]; - - constructor(gitService: GitService, - @IInstantiationService instantiationService: IInstantiationService, - @IFileService fileService: IFileService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IEditorGroupService editorGroupService: IEditorGroupService, - @IWorkspaceContextService contextService: IWorkspaceContextService - ) { - this.instantiationService = instantiationService; - this.fileService = fileService; - this.editorService = editorService; - this.editorGroupService = editorGroupService; - this.contextService = contextService; - - this.gitService = gitService; - - this.cache = {}; - this.toDispose = []; - - this.toDispose.push(this.gitService.getModel().addListener('fileStatus:dispose', (fileStatus: IFileStatus) => this.onFileStatusDispose(fileStatus))); - } - - getInput(status: IFileStatus): TPromise { - var result = this.cache[status.getId()]; - - if (result) { - return result; - } - - result = this.createInput(status); - this.cache[status.getId()] = result; - return result; - } - - private createInput(status: IFileStatus): TPromise { - return TPromise.join([this.createLeftInput(status), this.createRightInput(status)]).then((result) => { - var leftInput = result[0]; - var rightInput = result[1]; - - var fileSegment: string; - var folderSegment: string; - - if (status.getStatus() === Status.INDEX_RENAMED) { - let pathComponents = status.getRename().split('/'); - fileSegment = pathComponents[pathComponents.length - 1]; - folderSegment = toReadablePath(pathComponents.slice(0, pathComponents.length - 1).join('/')); - } else { - let pathComponents = status.getPathComponents(); - fileSegment = pathComponents[pathComponents.length - 1]; - folderSegment = toReadablePath(pathComponents.slice(0, pathComponents.length - 1).join('/')); - } - - if (!leftInput) { - if (!rightInput) { - var error = new Error(localize('cantOpen', "Can't open this git resource.")); - (error).gitErrorCode = GitErrorCodes.CantOpenResource; - return TPromise.wrapError(error); - } - - return TPromise.as(rightInput); - } - - switch (status.getStatus()) { - case Status.INDEX_MODIFIED: - return TPromise.as(new GitIndexDiffEditorInput(localize('gitIndexChanges', "{0} (index) ↔ {1}", fileSegment, fileSegment), localize('gitIndexChangesDesc', "{0} - Changes on index", folderSegment), leftInput, rightInput, status)); - case Status.INDEX_RENAMED: - return TPromise.as(new GitIndexDiffEditorInput(localize('gitIndexChangesRenamed', "{0} ↠{1}", status.getRename(), status.getPath()), localize('gitIndexChangesRenamedDesc', "{0} - Renamed - Changes on index", folderSegment), leftInput, rightInput, status)); - case Status.MODIFIED: - return TPromise.as(new GitWorkingTreeDiffEditorInput(localize('workingTreeChanges', "{0} (HEAD) ↔ {1}", fileSegment, fileSegment), localize('workingTreeChangesDesc', "{0} - Changes on working tree", folderSegment), leftInput, rightInput, status)); - default: - return TPromise.as(new GitDiffEditorInput(localize('gitMergeChanges', "{0} (merge) ↔ {1}", fileSegment, fileSegment), localize('gitMergeChangesDesc', "{0} - Merge changes", folderSegment), leftInput, rightInput, status)); - } - }).then((editorInput: EditorInput) => { - const onceDispose = once(editorInput.onDispose); - onceDispose(() => { - delete this.cache[status.getId()]; - }); - - return editorInput; - }, (errs) => { - return TPromise.wrapError(Array.isArray(errs) ? errs[0] || errs[1] : errs); - }); - } - - private createLeftInput(status: IFileStatus): TPromise { - var path = status.getPath(); - var model = this.gitService.getModel(); - - switch (status.getStatus()) { - case Status.INDEX_MODIFIED: - case Status.INDEX_RENAMED: - return this.gitService.show(path, status, 'HEAD', status.getMimetype()); - - case Status.MODIFIED: - var indexStatus = model.getStatus().find(path, StatusType.INDEX); - - if (indexStatus && indexStatus.getStatus() === Status.INDEX_RENAMED) { - return this.gitService.show(indexStatus.getRename(), status, '~', status.getMimetype()); - } - - if (indexStatus) { - return this.gitService.show(path, status, '~', status.getMimetype()); - } - - return this.gitService.show(path, status, 'HEAD', status.getMimetype()); - - default: - return TPromise.as(null); - } - } - - private createRightInput(status: IFileStatus): TPromise { - const model = this.gitService.getModel(); - const path = status.getPath(); - let resource = URI.file(paths.join(model.getRepositoryRoot(), path)); - - switch (status.getStatus()) { - case Status.INDEX_MODIFIED: - case Status.INDEX_ADDED: - case Status.INDEX_COPIED: - return this.gitService.show(path, status, '~', status.getMimetype()); - - case Status.INDEX_RENAMED: - return this.gitService.show(status.getRename(), status, '~', status.getMimetype()); - - case Status.INDEX_DELETED: - case Status.DELETED: - return this.gitService.show(path, status, 'HEAD', status.getMimetype()); - - case Status.MODIFIED: - case Status.UNTRACKED: - case Status.IGNORED: - var indexStatus = model.getStatus().find(path, StatusType.INDEX); - - if (indexStatus && indexStatus.getStatus() === Status.INDEX_RENAMED) { - resource = URI.file(paths.join(model.getRepositoryRoot(), indexStatus.getRename())); - } - - return TPromise.as(this.editorService.createInput({ resource }) as EditorInput); - - case Status.BOTH_MODIFIED: - return TPromise.as(this.editorService.createInput({ resource }) as EditorInput); - - default: - return TPromise.as(null); - } - } - - private onFileStatusDispose(fileStatus: IFileStatus): void { - var id = fileStatus.getId(); - var editorInputPromise = this.cache[id]; - - if (editorInputPromise) { - editorInputPromise.done((editorInput) => { this.eventuallyDispose(editorInput); }); - } - } - - /** - * If the disposed status is the same as this input's status, we must try to dispose the input. - * But we should not do it while the input is still open. This method will eventually call dispose - * when the editor input goes out of the visible editors. - */ - private eventuallyDispose(editorInput: EditorInput): void { - if (!this.maybeDispose(editorInput)) { - var listener = this.editorGroupService.onEditorsChanged(() => { - if (this.maybeDispose(editorInput)) { - listener.dispose(); - } - }); - } - } - - private maybeDispose(editorInput: EditorInput): boolean { - if (!editorInput.isDirty() && !this.editorService.getVisibleEditors().some((editor) => editor.input && editor.input.matches(editorInput))) { - editorInput.dispose(); - return true; - } - - return false; - } - - dispose(): void { - Object.keys(this.cache).forEach(key => { - this.cache[key].done((editorInput) => { editorInput.dispose(); }); - delete this.cache[key]; - }); - - this.toDispose = dispose(this.toDispose); - } -} - -export class AutoFetcher implements IAutoFetcher, IDisposable { - private static MIN_TIMEOUT = 2 * 60 * 1000; // every two minutes - private static MAX_TIMEOUT = 5 * 60 * 1000; // every five minutes - - private _state: AutoFetcherState; - private gitService: GitService; - private messageService: IMessageService; - private configurationService: IConfigurationService; - private instantiationService: IInstantiationService; - private currentRequest: TPromise; - private timeout: number; - private toDispose: IDisposable[]; - private gitServiceStateDisposable: IDisposable; - - constructor(gitService: GitService, // gitService passed as argument, not by injection - @IMessageService messageService: IMessageService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IConfigurationService configurationService: IConfigurationService, - @IInstantiationService instantiationService: IInstantiationService - ) { - this._state = AutoFetcherState.Disabled; - this.gitService = gitService; - this.messageService = messageService; - this.configurationService = configurationService; - this.instantiationService = instantiationService; - this.currentRequest = null; - this.timeout = AutoFetcher.MIN_TIMEOUT; - - this.toDispose = []; - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfiguration(e.config.git))); - this.onConfiguration(configurationService.getConfiguration('git')); - } - - get state(): AutoFetcherState { - return this._state; - } - - private onConfiguration(config: IGitConfiguration): void { - if (config.autofetch === false) { - this.disable(); - } else { - this.enable(); - } - } - - enable(): void { - if (this._state !== AutoFetcherState.Disabled) { - return; - } - - this.gitServiceStateDisposable = this.gitService.addListener(ServiceEvents.STATE_CHANGED, (e) => this.onGitServiceStateChange(e)); - this._state = AutoFetcherState.Active; - this.onGitServiceStateChange(this.gitService.getState()); - } - - disable(): void { - if (this.gitServiceStateDisposable) { - this.gitServiceStateDisposable.dispose(); - this.gitServiceStateDisposable = null; - } - - this.deactivate(); - this._state = AutoFetcherState.Disabled; - } - - private onGitServiceStateChange(state: ServiceState): void { - if (state === ServiceState.OK) { - this.activate(); - } else { - this.deactivate(); - } - } - - activate(): void { - if (this.currentRequest) { - this.currentRequest.cancel(); - } - - this._state = AutoFetcherState.Active; - this.loop(); - } - - deactivate(): void { - if (!this.currentRequest) { - return; - } - - this._state = AutoFetcherState.Inactive; - this.currentRequest.cancel(); - this.currentRequest = null; - } - - private loop(): void { - this._state = AutoFetcherState.Fetching; - - const model = this.gitService.getModel(); - const remotes = model ? model.getRemotes() : []; - - if (remotes.length === 0) { - this.timeout = AutoFetcher.MIN_TIMEOUT; - this.currentRequest = TPromise.as(null); - } else { - this.currentRequest = this.gitService.fetch().then(() => { - this.timeout = AutoFetcher.MIN_TIMEOUT; - }, (err) => { - if (isPromiseCanceledError(err)) { - return TPromise.wrapError(err); - } else if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) { - return TPromise.wrapError(err); - } else { - this.timeout = Math.min(Math.round(this.timeout * 1.2), AutoFetcher.MAX_TIMEOUT); // backoff - } - return undefined; - }); - } - - this.currentRequest.then(() => { - this._state = AutoFetcherState.Active; - this.currentRequest = TPromise.timeout(this.timeout); - return this.currentRequest; - }).then(() => this.loop(), (err) => this.deactivate()); - } - - dispose(): void { - this.disable(); - } -} - -const IgnoreOldGitStorageKey = 'settings.workspace.git.ignoreOld'; - -export class GitService extends EventEmitter - implements - IGitService { - - _serviceBrand: any; - - private contextService: IWorkspaceContextService; - private messageService: IMessageService; - private textFileService: ITextFileService; - private instantiationService: IInstantiationService; - private editorService: IWorkbenchEditorService; - private lifecycleService: ILifecycleService; - private outputService: IOutputService; - protected raw: IRawGitService; - - private state: ServiceState; - private operations: IGitOperation[]; - private model: IModel; - private inputCache: EditorInputCache; - private toDispose: IDisposable[]; - private needsRefresh: boolean; - private statusDelayer: ThrottledDelayer; - private reactiveStatusDelayer: PeriodThrottledDelayer; - private autoFetcher: AutoFetcher; - private isStatusPending = false; - - private _allowHugeRepositories: boolean; - get allowHugeRepositories(): boolean { return this._allowHugeRepositories; } - set allowHugeRepositories(value: boolean) { - this._allowHugeRepositories = value; - - if (value && this.state === ServiceState.Huge) { - this.transition(ServiceState.OK); - } - } - - get onOutput(): Event { return this.raw.onOutput; } - - constructor( - raw: IRawGitService, - @IInstantiationService instantiationService: IInstantiationService, - @IFileService private fileService: IFileService, - @IMessageService messageService: IMessageService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IOutputService outputService: IOutputService, - @ITextFileService textFileService: ITextFileService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @ILifecycleService lifecycleService: ILifecycleService, - @IStorageService storageService: IStorageService, - @IConfigurationService private configurationService: IConfigurationService - ) { - super(); - - this.instantiationService = instantiationService; - this.messageService = messageService; - this.editorService = editorService; - this.textFileService = textFileService; - this.outputService = outputService; - this.contextService = contextService; - this.lifecycleService = lifecycleService; - - this.raw = raw; - this.state = ServiceState.NotInitialized; - this.operations = []; - this.model = new Model(); - this.toDispose = []; - - this.needsRefresh = false; - this.statusDelayer = new ThrottledDelayer(500); - this.reactiveStatusDelayer = new PeriodThrottledDelayer(500, 10000); - this.autoFetcher = this.instantiationService.createInstance(AutoFetcher, this); - this._allowHugeRepositories = false; - - this.registerListeners(); - - this.inputCache = this.instantiationService.createInstance(EditorInputCache, this); - - this.triggerAutoStatus(true); // trigger initial status - - if (!storageService.getBoolean(IgnoreOldGitStorageKey, StorageScope.GLOBAL, false)) { - this.raw.serviceState().done(state => { - if (state !== RawServiceState.OK) { - return undefined; - } - - return this.raw.getVersion().then(version => { - const match = /^(\d+)\.\d+\.\d+/.exec(version || ''); - const major = match && parseInt(match[1]); - - if (major && major < 2) { - messageService.show(severity.Warning, { - message: localize('updateGit', "You seem to have git {0} installed. Code works best with git >=2.0.0.", version), - actions: [ - new Action('downloadLatest', localize('download', "Download"), '', true, () => { - window.open('https://git-scm.com/'); - return null; - }), - new Action('neverShowAgain', localize('neverShowAgain', "Don't show again"), null, true, () => { - storageService.store(IgnoreOldGitStorageKey, true, StorageScope.GLOBAL); - return null; - }), - CloseAction - ] - }); - } - }); - }); - } - } - - private registerListeners(): void { - this.toDispose.push(this.fileService.onFileChanges((e) => this.onFileChanges(e))); - this.toDispose.push(this.textFileService.models.onModelSaved((e) => this.onTextFileChange(e))); - this.toDispose.push(this.textFileService.models.onModelReverted((e) => this.onTextFileChange(e))); - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => { - if (this._allowHugeRepositories) { - return; - } - - const config = this.configurationService.getConfiguration('git'); - this._allowHugeRepositories = config.allowLargeRepositories; - - if (this._allowHugeRepositories) { - this.triggerAutoStatus(); - } - })); - this.lifecycleService.onShutdown(this.dispose, this); - - const focusEvent = domEvent(window, 'focus'); - this.toDispose.push(focusEvent(() => { - if (this.isStatusPending) { - this.triggerAutoStatus(); - } - })); - } - - private onTextFileChange(e: TextFileModelChangeEvent): void { - var shouldTriggerStatus = paths.basename(e.resource.fsPath) === '.gitignore'; - - if (!shouldTriggerStatus) { - return; - } - - this.triggerAutoStatus(); - } - - private onFileChanges(e: FileChangesEvent): void { - var isIdle = this.isIdle(); - - var shouldTriggerStatus = e.changes.some(c => { - var workspacePath = this.contextService.toWorkspaceRelativePath(c.resource); - if (!workspacePath) { - return false; // ignore out of workspace files - } - - // for .gitindex, the service must be idle - if ('.git/index' === workspacePath) { - return isIdle; - } - - // for anything other that .git* - if (!/^\.git/.test(workspacePath)) { - return true; - } - - // added or deleted .git folder - if (workspacePath === '.git') { - return c.type === FileChangeType.ADDED || c.type === FileChangeType.DELETED; - } - - return ['.git/index.lock', '.git/FETCH_HEAD', '.gitignore', '.gitmodules'].indexOf(workspacePath) === -1; - }); - - if (!shouldTriggerStatus) { - return; - } - - this.triggerAutoStatus(); - } - - private onGitServiceOperationEnd(e: { operation: IGitOperation; }): void { - if (e.operation.id === ServiceOperations.COMMAND) { - this.triggerAutoStatus(); - } - } - - getState(): ServiceState { - return this.state; - } - - getModel(): IModel { - return this.model; - } - - status(): TPromise { - return this.statusDelayer.trigger(() => this._status()); - } - - private _status(): TPromise { - const config = this.configurationService.getConfiguration('git'); - - if (this._allowHugeRepositories || config.allowLargeRepositories) { - return this.run(ServiceOperations.STATUS, () => this.raw.status()); - } - - if (this.state === ServiceState.Huge) { - return TPromise.as(this.model); - } - - return this.raw.statusCount().then(count => { - if (count > 5000 && !this._allowHugeRepositories) { - this.transition(ServiceState.Huge); - return TPromise.as(this.model); - } - - return this.run(ServiceOperations.STATUS, () => this.raw.status()); - }); - } - - private triggerAutoStatus(force = false): void { - this.isStatusPending = true; - - if (!document.hasFocus() && !force) { - return; - } - - this.isStatusPending = false; - - const config = this.configurationService.getConfiguration('git'); - - if (!config.autorefresh) { - return; - } - - this.reactiveStatusDelayer.trigger(() => this.status()).done(null, e => { - if (isPromiseCanceledError(e)) { - return; - } - - this.messageService.show(severity.Error, e); - }); - } - - init(): TPromise { - return this.run(ServiceOperations.INIT, () => this.raw.init()); - } - - add(files?: IFileStatus[]): TPromise { - return this.run(ServiceOperations.ADD, () => this.raw.add(GitService.toPaths(files))); - } - - stage(filePath: string, content: string): TPromise { - return this.run(ServiceOperations.STAGE, () => this.raw.stage(filePath, content)); - } - - branch(name: string, checkout: boolean = false): TPromise { - return this.run(ServiceOperations.BRANCH, () => this.raw.branch(name, checkout)); - } - - checkout(treeish: string = '', files: IFileStatus[] = null): TPromise { - return this.run(ServiceOperations.CHECKOUT, () => this.raw.checkout(treeish, GitService.toPaths(files))); - } - - clean(files: IFileStatus[]): TPromise { - return this.run(ServiceOperations.CLEAN, () => this.raw.clean(files.map((s) => s.getPath()))); - } - - undo(): TPromise { - return this.run(ServiceOperations.UNDO, () => this.raw.undo()); - } - - reset(treeish: string, hard?: boolean): TPromise { - return this.run(ServiceOperations.RESET, () => this.raw.reset(treeish, hard)); - } - - revertFiles(treeish: string, files?: IFileStatus[]): TPromise { - return this.run(ServiceOperations.REVERT, () => this.raw.revertFiles(treeish, (files || []).map((s) => s.getPath()))); - } - - fetch(): TPromise { - return this.run(ServiceOperations.BACKGROUND_FETCH, () => this.raw.fetch()); - } - - pull(rebase?: boolean): TPromise { - return this.run(ServiceOperations.PULL, () => this.raw.pull(rebase)); - } - - push(remote?: string, name?: string, options?: IPushOptions): TPromise { - return this.run(ServiceOperations.PUSH, () => this.raw.push(remote, name, options)); - } - - sync(rebase?: boolean): TPromise { - const head = this.model.getHEAD(); - const isAhead = head && head.upstream && !!head.ahead; - - if (!isAhead) { - return this.run(ServiceOperations.SYNC, () => this.raw.pull(rebase)); - } else { - return this.run(ServiceOperations.SYNC, () => this.raw.sync()); - } - } - - commit(message: string, amend: boolean = false, stage: boolean = false, signoff: boolean = false): TPromise { - return this.run(ServiceOperations.COMMIT, () => this.raw.commit(message, amend, stage, signoff)); - } - - getCommitTemplate(): TPromise { - return this.raw.getCommitTemplate(); - } - - getCommit(ref: string): TPromise { - return this.raw.getCommit(ref); - } - - detectMimetypes(path: string, treeish: string = '~'): TPromise { - return this.raw.detectMimetypes(path, treeish); - } - - clone(url: string, parentPath: string): TPromise { - return this.raw.clone(url, parentPath) - .then(null, e => this.wrapGitError(e)); - } - - private run(operationId: string, fn: () => TPromise): TPromise { - return this.raw.serviceState().then(state => { - if (state === RawServiceState.GitNotFound) { - this.transition(ServiceState.NoGit); - return TPromise.as(null); - } else if (state === RawServiceState.Disabled) { - this.transition(ServiceState.Disabled); - return TPromise.as(null); - } else { - return this._run(operationId, fn); - } - }); - } - - private _run(operationId: string, fn: () => TPromise): TPromise { - var operation = new GitOperation(operationId, fn); - - this.operations.push(operation); - this.emit(ServiceEvents.OPERATION_START, operation); - this.emit(ServiceEvents.OPERATION, operation); - - var onDone = (error: any = null) => { - var index = this.operations.indexOf(operation); - - if (index > -1) { - this.operations.splice(index, 1); - } - - var e = { operation: operation, error: error }; - this.emit(ServiceEvents.OPERATION_END, e); - this.onGitServiceOperationEnd(e); - this.emit(ServiceEvents.OPERATION, operation); - }; - - return operation.run().then((status: IRawStatus) => { - this.model.update(status); - - onDone(); - - if (status) { - this.transition(status.state === null || status.state === undefined ? ServiceState.OK : status.state); - } else { - this.transition(ServiceState.NotARepo); - } - - return this.model; - }, (e) => { - onDone(e); - - if (isPromiseCanceledError(e)) { - return TPromise.wrapError(e); - } - - var gitErrorCode: string = e.gitErrorCode || null; - - if (gitErrorCode === GitErrorCodes.NotAtRepositoryRoot) { - this.transition(ServiceState.NotAtRepoRoot); - return TPromise.as(this.model); - } - - this.emit(ServiceEvents.ERROR, e); - this.transition(ServiceState.OK); - - if (gitErrorCode === GitErrorCodes.NoUserNameConfigured || gitErrorCode === GitErrorCodes.NoUserEmailConfigured) { - this.messageService.show(severity.Warning, localize('configureUsernameEmail', "Please configure your git user name and e-mail.")); - - return TPromise.as(null); - - } else if (gitErrorCode === GitErrorCodes.BadConfigFile) { - this.messageService.show(severity.Error, localize('badConfigFile', "Git {0}", e.message)); - return TPromise.as(null); - - } else if (gitErrorCode === GitErrorCodes.UnmergedChanges) { - this.messageService.show(severity.Warning, localize('unmergedChanges', "You should first resolve the unmerged changes before committing your changes.")); - return TPromise.as(null); - } - - return this.wrapGitError(e); - }); - } - - private wrapGitError(e: any): TPromise { - const gitErrorCode: string = e.gitErrorCode || null; - const showOutputAction = new Action('show.gitOutput', localize('showOutput', "Show Output"), null, true, () => this.outputService.getChannel('Git').show()); - const cancelAction = new Action('close.message', localize('cancel', "Cancel"), null, true, () => TPromise.as(true)); - const error = createError( - localize('checkNativeConsole', "There was an issue running a git operation. Please review the output or use a console to check the state of your repository."), - { actions: [cancelAction, showOutputAction] } - ); - - (error).gitErrorCode = gitErrorCode; - (error).stdout = e.stdout; - (error).stderr = e.stderr; - - return TPromise.wrapError(error); - } - - private transition(state: ServiceState): void { - var oldState = this.state; - - this.state = state; - - if (state !== oldState) { - this.emit(ServiceEvents.STATE_CHANGED, state); - } - } - - buffer(path: string, treeish: string = '~'): TPromise { - return this.raw.show(path, treeish); - } - - show(path: string, status: IFileStatus, treeish: string = '~', mimetype: string = 'text/plain'): TPromise { - return this.detectMimetypes(path, treeish).then((mimetypes: string[]) => { - var pathComponents = status.getPathComponents(); - var fileSegment = pathComponents[pathComponents.length - 1]; - var folderSegment = toReadablePath(pathComponents.slice(0, pathComponents.length - 1).join('/')); - - var label: string; - var description: string; - - if (treeish === '~') { - label = localize('changesFromIndex', "{0} (index)", fileSegment); - description = localize('changesFromIndexDesc', "{0} - Changes on index", folderSegment); - } else { - label = localize('changesFromTree', "{0} ({1})", fileSegment, treeish); - description = localize('changesFromTreeDesc', "{0} - Changes on {1}", folderSegment, treeish); - } - - if (mime.isUnspecific(mimetypes)) { - mimetypes = mime.guessMimeTypes(path); // guess from path if our detection did not yield results - } - - // Binary: our story is weak here for binary files on the index. Since we run natively, we do not have a way currently - // to e.g. show images as binary inside the renderer because images need to be served through a URL to show. We could revisit this by - // allowing to use data URLs for resource inputs to render them. However, this would mean potentially loading a large file into memory - // - // Our solution now is to detect binary files and immediately return an input that is flagged as binary unknown mime type. - if (mime.isBinaryMime(mime.guessMimeTypes(path)) || mimetypes.indexOf(mime.MIME_BINARY) >= 0) { - return TPromise.wrapError(new Error('The resource seems to be binary and cannot be displayed')); - } - - // Text - return TPromise.as(this.instantiationService.createInstance(NativeGitIndexStringEditorInput, label, description, mimetypes.join(', '), status, path, treeish)); - }); - } - - getInput(status: IFileStatus): TPromise { - return this.inputCache.getInput(status).then(null, (err) => { - if (err.gitErrorCode = GitErrorCodes.CantOpenResource) { - this.messageService.show(severity.Warning, localize('cantOpenResource', "Can't open this git resource.")); - return TPromise.as(null); - } - - return TPromise.wrapError(err); - }); - } - - isInitialized(): boolean { - return this.state === ServiceState.OK; - } - - isIdle(): boolean { - return this.isInitialized() && !this.operations.some(op => op.id !== ServiceOperations.BACKGROUND_FETCH); - } - - getRunningOperations(): IGitOperation[] { - return this.operations; - } - - getAutoFetcher(): IAutoFetcher { - return this.autoFetcher; - } - - private static toPaths(files: IFileStatus[]): string[] { - if (!files) { - return null; - } - - return files.map((status) => { - /* In the case that a file was renamed in the index and (changed || deleted) in the - working tree, we must use its new name, running the checkout command. - */ - - switch (status.getStatus()) { - case Status.MODIFIED: - case Status.DELETED: - if (status.getRename()) { - return status.getRename(); - } - - default: - return status.getPath(); - } - }); - } - - dispose(): void { - this.emit(ServiceEvents.DISPOSE); - - if (this.model) { - this.model.dispose(); - this.model = null; - } - - super.dispose(); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitViewlet.ts b/src/vs/workbench/parts/git/browser/gitViewlet.ts deleted file mode 100644 index 02b64d84ded..00000000000 --- a/src/vs/workbench/parts/git/browser/gitViewlet.ts +++ /dev/null @@ -1,215 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./media/gitViewlet'; -import winjs = require('vs/base/common/winjs.base'); -import lifecycle = require('vs/base/common/lifecycle'); -import eventemitter = require('vs/base/common/eventEmitter'); -import $ = require('vs/base/browser/builder'); -import actions = require('vs/base/common/actions'); -import viewlet = require('vs/workbench/browser/viewlet'); -import git = require('vs/workbench/parts/git/common/git'); -import contrib = require('vs/workbench/parts/git/browser/gitWorkbenchContributions'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import changes = require('vs/workbench/parts/git/browser/views/changes/changesView'); -import empty = require('vs/workbench/parts/git/browser/views/empty/emptyView'); -import gitless = require('vs/workbench/parts/git/browser/views/gitless/gitlessView'); -import notroot = require('vs/workbench/parts/git/browser/views/notroot/notrootView'); -import noworkspace = require('vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView'); -import { DisabledView } from './views/disabled/disabledView'; -import { HugeView } from './views/huge/hugeView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -import IGitService = git.IGitService; - -export class GitViewlet - extends viewlet.Viewlet - implements view.IController { - private progressService: IProgressService; - private gitService: git.IGitService; - private instantiationService: IInstantiationService; - - private $el: $.Builder; - private currentView: view.IView; - private progressRunner: IProgressRunner; - - private currentDimension: $.Dimension; - private views: { [id: string]: view.IView; }; - - private toDispose: lifecycle.IDisposable[]; - - constructor( @ITelemetryService telemetryService: ITelemetryService, @IProgressService progressService: IProgressService, @IInstantiationService instantiationService: IInstantiationService, @IGitService gitService: IGitService, @IThemeService themeService: IThemeService) { - super(contrib.VIEWLET_ID, telemetryService, themeService); - - this.progressService = progressService; - this.instantiationService = instantiationService; - this.gitService = gitService; - - this.progressRunner = null; - this.views = {}; - this.toDispose = []; - - var views: view.IView[] = [ - this.instantiationService.createInstance(changes.ChangesView, this.getActionRunner()), - this.instantiationService.createInstance(empty.EmptyView, this, this.getActionRunner()), - this.instantiationService.createInstance(gitless.GitlessView), - new notroot.NotRootView(), - this.instantiationService.createInstance(noworkspace.NoWorkspaceView, this.getActionRunner()), - new DisabledView(), - this.instantiationService.createInstance(HugeView) - ]; - - views.forEach(v => { - this.views[v.ID] = v; - this.toDispose.push(v); - }); - - this.toUnbind.push(this.gitService.addBulkListener(() => this.onGitServiceChanges())); - } - - // GitView.IController - - public setView(id: string): winjs.Promise { - if (!this.$el) { - return winjs.TPromise.as(null); - } - - var view = this.views[id]; - - if (!view) { - return winjs.Promise.wrapError(new Error('Could not find view.')); - } - - if (this.currentView === view) { - return winjs.TPromise.as(null); - } - - var promise = winjs.TPromise.as(null); - - if (this.currentView) { - promise = this.currentView.setVisible(false); - } - - var element = view.element; - this.currentView = view; - this.updateTitleArea(); - - var el = this.$el.getHTMLElement(); - while (el.firstChild) { - el.removeChild(el.firstChild); - } - - el.appendChild(element); - view.layout(this.currentDimension); - - return promise.then(() => view.setVisible(true)); - } - - // Viewlet - - public create(parent: $.Builder): winjs.TPromise { - super.create(parent); - - this.$el = parent.div().addClass('git-viewlet'); - - return winjs.TPromise.as(null); - } - - public setVisible(visible: boolean): winjs.TPromise { - if (visible) { - this.onGitServiceChanges(); - - this.gitService.status().done(); - - return super.setVisible(visible).then(() => { - if (this.currentView) { - return this.currentView.setVisible(visible); - } - return undefined; - }); - } else { - return (this.currentView ? this.currentView.setVisible(visible) : winjs.TPromise.as(null)).then(() => { - super.setVisible(visible); - }); - } - } - - public focus(): void { - super.focus(); - - if (this.currentView) { - this.currentView.focus(); - } - } - - public layout(dimension: $.Dimension = this.currentDimension): void { - this.currentDimension = dimension; - - if (this.currentView) { - this.currentView.layout(dimension); - } - } - - public getActions(): actions.IAction[] { - return this.currentView ? this.currentView.getActions() : []; - } - - public getSecondaryActions(): actions.IAction[] { - return this.currentView ? this.currentView.getSecondaryActions() : []; - } - - public getControl(): eventemitter.IEventEmitter { - if (!this.currentView) { - return null; - } - - return this.currentView.getControl(); - } - - // Event handlers - - private onGitServiceChanges(): void { - if (this.progressRunner) { - this.progressRunner.done(); - } - - if (this.gitService.getState() === git.ServiceState.NoGit) { - this.setView('gitless'); - this.progressRunner = null; - } else if (this.gitService.getState() === git.ServiceState.Disabled) { - this.setView('disabled'); - this.progressRunner = null; - } else if (this.gitService.getState() === git.ServiceState.NotARepo) { - this.setView('empty'); - this.progressRunner = null; - } else if (this.gitService.getState() === git.ServiceState.NotAWorkspace) { - this.setView('noworkspace'); - this.progressRunner = null; - } else if (this.gitService.getState() === git.ServiceState.NotAtRepoRoot) { - this.setView('notroot'); - this.progressRunner = null; - } else if (this.gitService.getState() === git.ServiceState.Huge) { - this.setView('huge'); - this.progressRunner = null; - } else if (this.gitService.isIdle()) { - this.setView('changes'); - this.progressRunner = null; - } else { - this.progressRunner = this.progressService.show(true); - } - } - - public dispose(): void { - this.toDispose = lifecycle.dispose(this.toDispose); - this.views = null; - - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/git/browser/gitWidgets.ts b/src/vs/workbench/parts/git/browser/gitWidgets.ts deleted file mode 100644 index d2db61f03d1..00000000000 --- a/src/vs/workbench/parts/git/browser/gitWidgets.ts +++ /dev/null @@ -1,209 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import nls = require('vs/nls'); -import strings = require('vs/base/common/strings'); -import { Delayer } from 'vs/base/common/async'; -import { $, append, show, hide, toggleClass } from 'vs/base/browser/dom'; -import { IAction } from 'vs/base/common/actions'; -import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; -import { IGitService, ServiceState, IBranch, ServiceOperations, IRemote } from 'vs/workbench/parts/git/common/git'; -import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { SyncAction, PublishAction } from './gitActions'; -import Severity from 'vs/base/common/severity'; -import { IMessageService } from 'vs/platform/message/common/message'; - -interface IState { - serviceState: ServiceState; - isBusy: boolean; - isSyncing: boolean; - HEAD: IBranch; - remotes: IRemote[]; - ps1: string; -} - -const DisablementDelay = 500; - -export class GitStatusbarItem implements IStatusbarItem { - - private instantiationService: IInstantiationService; - private gitService: IGitService; - private quickOpenService: IQuickOpenService; - private state: IState; - private element: HTMLElement; - private branchElement: HTMLElement; - private publishElement: HTMLElement; - private syncElement: HTMLElement; - private syncLabelElement: HTMLElement; - private disablementDelayer: Delayer; - - private syncAction: SyncAction; - private publishAction: PublishAction; - - private toDispose: IDisposable[]; - - constructor( - @IInstantiationService instantiationService: IInstantiationService, - @IGitService gitService: IGitService, - @IQuickOpenService quickOpenService: IQuickOpenService, - @IMessageService private messageService: IMessageService, - @ITelemetryService private telemetryService: ITelemetryService - ) { - this.instantiationService = instantiationService; - this.gitService = gitService; - this.quickOpenService = quickOpenService; - this.disablementDelayer = new Delayer(DisablementDelay); - - this.syncAction = instantiationService.createInstance(SyncAction, SyncAction.ID, SyncAction.LABEL); - this.publishAction = instantiationService.createInstance(PublishAction, PublishAction.ID, PublishAction.LABEL); - - this.toDispose = [ - this.syncAction, - this.publishAction - ]; - - this.state = { - serviceState: ServiceState.NotInitialized, - isBusy: false, - isSyncing: false, - HEAD: null, - remotes: [], - ps1: '' - }; - } - - public render(container: HTMLElement): IDisposable { - this.element = append(container, $('.git-statusbar-group')); - - this.branchElement = append(this.element, $('a')); - - this.publishElement = append(this.element, $('a.octicon.octicon-cloud-upload')); - this.publishElement.title = nls.localize('publishBranch', "Publish Branch"); - this.publishElement.onclick = () => this.onPublishClick(); - - this.syncElement = append(this.element, $('a.git-statusbar-sync-item')); - this.syncElement.title = nls.localize('syncBranch', "Synchronize Changes"); - this.syncElement.onclick = () => this.onSyncClick(); - append(this.syncElement, $('span.octicon.octicon-sync')); - - this.syncLabelElement = append(this.syncElement, $('span.ahead-behind')); - - this.setState(this.state); - this.toDispose.push(this.gitService.addBulkListener(() => this.onGitServiceChange())); - return combinedDisposable(this.toDispose); - } - - private onGitServiceChange(): void { - const model = this.gitService.getModel(); - - this.setState({ - serviceState: this.gitService.getState(), - isBusy: this.gitService.getRunningOperations().some(op => op.id === ServiceOperations.CHECKOUT || op.id === ServiceOperations.BRANCH), - isSyncing: this.gitService.getRunningOperations().some(op => op.id === ServiceOperations.SYNC), - HEAD: model.getHEAD(), - remotes: model.getRemotes(), - ps1: model.getPS1() - }); - } - - private setState(state: IState): void { - this.state = state; - - let isGitDisabled = false; - let className = 'git-statusbar-branch-item'; - let textContent: string; - let aheadBehindLabel = ''; - let title = ''; - let onclick: () => void = null; - - if (state.serviceState !== ServiceState.OK) { - isGitDisabled = true; - className += ' disabled'; - title = nls.localize('gitNotEnabled', "Git is not enabled in this workspace."); - textContent = '\u00a0'; - } else { - const HEAD = state.HEAD; - - if (state.isBusy) { - className += ' busy'; - } else { - onclick = () => this.onBranchClick(); - } - - if (!HEAD) { - textContent = state.ps1; - } else if (!HEAD.name) { - textContent = state.ps1; - className += ' headless'; - } else if (!HEAD.commit || !HEAD.upstream || (!HEAD.ahead && !HEAD.behind)) { - textContent = state.ps1; - } else { - textContent = state.ps1; - aheadBehindLabel = strings.format('{0}↓ {1}↑', HEAD.behind, HEAD.ahead); - } - } - - this.branchElement.className = className; - this.branchElement.title = title; - this.branchElement.textContent = textContent; - this.branchElement.onclick = onclick; - this.syncLabelElement.textContent = aheadBehindLabel; - - if (isGitDisabled) { - hide(this.branchElement); - hide(this.publishElement); - hide(this.syncElement); - } else { - show(this.branchElement); - - if (state.HEAD && !!state.HEAD.upstream) { - show(this.syncElement); - toggleClass(this.syncElement, 'syncing', this.state.isSyncing); - toggleClass(this.syncElement, 'empty', !aheadBehindLabel); - this.disablementDelayer.trigger( - () => toggleClass(this.syncElement, 'disabled', !this.syncAction.enabled), - this.syncAction.enabled ? 0 : DisablementDelay - ); - hide(this.publishElement); - } else if (state.remotes.length > 0) { - hide(this.syncElement); - show(this.publishElement); - this.disablementDelayer.trigger( - () => toggleClass(this.publishElement, 'disabled', !this.publishAction.enabled), - this.publishAction.enabled ? 0 : DisablementDelay - ); - } else { - hide(this.syncElement); - hide(this.publishElement); - } - } - } - - private onBranchClick(): void { - this.quickOpenService.show('git checkout '); - } - - private onPublishClick(): void { - this.runAction(this.publishAction); - } - - private onSyncClick(): void { - this.runAction(this.syncAction); - } - - private runAction(action: IAction): void { - if (!action.enabled) { - return; - } - - this.telemetryService.publicLog('workbenchActionExecuted', { id: action.id, from: 'status bar' }); - - action.run() - .done(null, err => this.messageService.show(Severity.Error, err)); - } -} diff --git a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts deleted file mode 100644 index e35495db433..00000000000 --- a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts +++ /dev/null @@ -1,241 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./media/git.contribution'; -import nls = require('vs/nls'); -import async = require('vs/base/common/async'); -import lifecycle = require('vs/base/common/lifecycle'); -import ext = require('vs/workbench/common/contributions'); -import git = require('vs/workbench/parts/git/common/git'); -import viewlet = require('vs/workbench/browser/viewlet'); -import statusbar = require('vs/workbench/browser/parts/statusbar/statusbar'); -import platform = require('vs/platform/platform'); -import widgets = require('vs/workbench/parts/git/browser/gitWidgets'); -import wbar = require('vs/workbench/common/actionRegistry'); -import gitoutput = require('vs/workbench/parts/git/browser/gitOutput'); -import output = require('vs/workbench/parts/output/common/output'); -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import confregistry = require('vs/platform/configuration/common/configurationRegistry'); -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import quickopen = require('vs/workbench/browser/quickopen'); -import 'vs/workbench/parts/git/browser/gitEditorContributions'; -import { IActivityBarService, ProgressBadge, NumberBadge } from 'vs/workbench/services/activity/common/activityBarService'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { GitSCMProvider } from './gitScm'; - -import IGitService = git.IGitService; - -export class StatusUpdater implements ext.IWorkbenchContribution { - static ID = 'vs.git.statusUpdater'; - - private gitService: IGitService; - private activityBarService: IActivityBarService; - private messageService: IMessageService; - private configurationService: IConfigurationService; - private progressBadgeDelayer: async.Delayer; - private badgeHandle: lifecycle.IDisposable; - private toDispose: lifecycle.IDisposable[]; - - constructor( - @IGitService gitService: IGitService, - @IActivityBarService activityBarService: IActivityBarService, - @IMessageService messageService: IMessageService, - @IConfigurationService configurationService: IConfigurationService - ) { - this.gitService = gitService; - this.activityBarService = activityBarService; - this.messageService = messageService; - this.configurationService = configurationService; - - this.progressBadgeDelayer = new async.Delayer(200); - - this.toDispose = []; - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onGitServiceChange())); - this.toDispose.push(this.gitService.addBulkListener(e => this.onGitServiceChange())); - } - - private onGitServiceChange(): void { - - lifecycle.dispose(this.badgeHandle); - - if (this.gitService.getState() !== git.ServiceState.OK) { - this.progressBadgeDelayer.cancel(); - - } else if (this.gitService.isIdle()) { - this.showChangesBadge(); - } else { - this.progressBadgeDelayer.trigger(() => { - this.badgeHandle = this.activityBarService.showActivity('workbench.view.git', new ProgressBadge(() => nls.localize('gitProgressBadge', 'Running git status')), 'git-viewlet-label-progress'); - }); - } - } - - private showChangesBadge(): void { - this.progressBadgeDelayer.cancel(); - - const { countBadge } = this.configurationService.getConfiguration('git'); - - if (countBadge === 'off') { - return; - } - - const filter = countBadge === 'tracked' - ? s => s.getStatus() !== git.Status.UNTRACKED - : () => true; - - const statuses = this.gitService.getModel().getStatus().getGroups() - .map(g => g.all()) - .reduce((r, g) => r.concat(g), []) - .filter(filter); - - const badge = new NumberBadge(statuses.length, num => nls.localize('gitPendingChangesBadge', '{0} pending changes', num)); - this.badgeHandle = this.activityBarService.showActivity('workbench.view.git', badge, 'git-viewlet-label'); - } - - public getId(): string { - return StatusUpdater.ID; - } - - public dispose(): void { - this.toDispose = lifecycle.dispose(this.toDispose); - lifecycle.dispose(this.badgeHandle); - } -} - -export const VIEWLET_ID = 'workbench.view.git'; - -class OpenGitViewletAction extends viewlet.ToggleViewletAction { - public static ID = VIEWLET_ID; - public static LABEL = nls.localize('toggleGitViewlet', "Show Git"); - - constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(id, label, VIEWLET_ID, viewletService, editorService); - } -} - -export function registerContributions(): void { - - // Register Statusbar item - (platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor( - widgets.GitStatusbarItem, - statusbar.StatusbarAlignment.LEFT, - 100 /* High Priority */ - )); - - // Register Output Channel - var outputChannelRegistry = platform.Registry.as(output.Extensions.OutputChannels); - outputChannelRegistry.registerChannel('Git', nls.localize('git', "Git")); - - // Register Git Output - (platform.Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution( - gitoutput.GitOutput - ); - - // Register Viewlet - (platform.Registry.as(viewlet.Extensions.Viewlets)).registerViewlet(new viewlet.ViewletDescriptor( - 'vs/workbench/parts/git/browser/gitViewlet', - 'GitViewlet', - VIEWLET_ID, - nls.localize('git', "Git"), - 'git', - 35 - )); - - // Register Action to Open Viewlet - (platform.Registry.as(wbar.Extensions.WorkbenchActions)).registerWorkbenchAction( - new SyncActionDescriptor(OpenGitViewletAction, OpenGitViewletAction.ID, OpenGitViewletAction.LABEL, { - primary: null, - win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, - linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, - mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_G } - }), - 'View: Show Git', - nls.localize('view', "View") - ); - - // Register StatusUpdater - (platform.Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution( - StatusUpdater - ); - - // Register GitSCMProvider - (platform.Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution( - GitSCMProvider - ); - - // Register Quick Open for git - (platform.Registry.as(quickopen.Extensions.Quickopen)).registerQuickOpenHandler( - new quickopen.QuickOpenHandlerDescriptor( - 'vs/workbench/parts/git/browser/gitQuickOpen', - 'GitCommandQuickOpenHandler', - 'git ', - nls.localize('gitCommands', "Git Commands") - ) - ); - - // Register configuration - var configurationRegistry = platform.Registry.as(confregistry.Extensions.Configuration); - configurationRegistry.registerConfiguration({ - id: 'git', - order: 15, - title: nls.localize('gitConfigurationTitle', "Git"), - type: 'object', - properties: { - 'git.enabled': { - type: 'boolean', - description: nls.localize('gitEnabled', "Is git enabled"), - default: true - }, - 'git.path': { - type: ['string', 'null'], - description: nls.localize('gitPath', "Path to the git executable"), - default: null, - isExecutable: true - }, - 'git.autorefresh': { - type: 'boolean', - description: nls.localize('gitAutoRefresh', "Whether auto refreshing is enabled"), - default: true - }, - 'git.autofetch': { - type: 'boolean', - description: nls.localize('gitAutoFetch', "Whether auto fetching is enabled."), - default: true - }, - 'git.enableLongCommitWarning': { - type: 'boolean', - description: nls.localize('gitLongCommit', "Whether long commit messages should be warned about."), - default: true - }, - 'git.allowLargeRepositories': { - type: 'boolean', - description: nls.localize('gitLargeRepos', "Always allow large repositories to be managed by Code."), - default: false - }, - 'git.confirmSync': { - type: 'boolean', - description: nls.localize('confirmSync', "Confirm before synchronizing git repositories."), - default: true - }, - 'git.countBadge': { - type: 'string', - enum: ['all', 'tracked', 'off'], - default: 'all', - description: nls.localize('countBadge', "Controls the git badge counter."), - }, - 'git.checkoutType': { - type: 'string', - enum: ['all', 'local', 'tags', 'remote'], - default: 'all', - description: nls.localize('checkoutType', "Controls what type of branches are listed."), - } - } - }); -} diff --git a/src/vs/workbench/parts/git/browser/media/Compare.svg b/src/vs/workbench/parts/git/browser/media/Compare.svg deleted file mode 100644 index 3a205509bca..00000000000 --- a/src/vs/workbench/parts/git/browser/media/Compare.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/Compare_inverse.svg b/src/vs/workbench/parts/git/browser/media/Compare_inverse.svg deleted file mode 100644 index c951728abac..00000000000 --- a/src/vs/workbench/parts/git/browser/media/Compare_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/OpenEditor.svg b/src/vs/workbench/parts/git/browser/media/OpenEditor.svg deleted file mode 100644 index 85a001dccc2..00000000000 --- a/src/vs/workbench/parts/git/browser/media/OpenEditor.svg +++ /dev/null @@ -1,3 +0,0 @@ - -]> \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/OpenEditor_inverse.svg b/src/vs/workbench/parts/git/browser/media/OpenEditor_inverse.svg deleted file mode 100644 index f6302185aa4..00000000000 --- a/src/vs/workbench/parts/git/browser/media/OpenEditor_inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/Refresh.svg b/src/vs/workbench/parts/git/browser/media/Refresh.svg deleted file mode 100644 index e0345748192..00000000000 --- a/src/vs/workbench/parts/git/browser/media/Refresh.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/add-focus.svg b/src/vs/workbench/parts/git/browser/media/add-focus.svg deleted file mode 100644 index 5e9f5851e8b..00000000000 --- a/src/vs/workbench/parts/git/browser/media/add-focus.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/add-inverse.svg b/src/vs/workbench/parts/git/browser/media/add-inverse.svg deleted file mode 100644 index 3475c1e1963..00000000000 --- a/src/vs/workbench/parts/git/browser/media/add-inverse.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/add.svg b/src/vs/workbench/parts/git/browser/media/add.svg deleted file mode 100644 index bdecdb0e45b..00000000000 --- a/src/vs/workbench/parts/git/browser/media/add.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/check-inverse.svg b/src/vs/workbench/parts/git/browser/media/check-inverse.svg deleted file mode 100644 index c225b2f597f..00000000000 --- a/src/vs/workbench/parts/git/browser/media/check-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/check.svg b/src/vs/workbench/parts/git/browser/media/check.svg deleted file mode 100644 index d45df06edf8..00000000000 --- a/src/vs/workbench/parts/git/browser/media/check.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/git-dark.svg b/src/vs/workbench/parts/git/browser/media/git-dark.svg deleted file mode 100644 index c08b1c2e403..00000000000 --- a/src/vs/workbench/parts/git/browser/media/git-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/git.contribution.css b/src/vs/workbench/parts/git/browser/media/git.contribution.css deleted file mode 100644 index 80ad1fe1419..00000000000 --- a/src/vs/workbench/parts/git/browser/media/git.contribution.css +++ /dev/null @@ -1,155 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* Appbar */ - -.monaco-workbench .git-action.open-in-diff { - background: url('Compare.svg') center center no-repeat; -} - -.monaco-workbench .git-action.open-in-editor { - background: url('OpenEditor.svg') center center no-repeat; -} - -.vs-dark .monaco-workbench .git-action.open-in-diff, -.hc-black .monaco-workbench .git-action.open-in-diff { - background: url('Compare_inverse.svg') center center no-repeat; -} - -.vs-dark .monaco-workbench .git-action.open-in-editor, -.hc-black .monaco-workbench .git-action.open-in-editor { - background: url('OpenEditor_inverse.svg') center center no-repeat; -} - -/* Activity Bar */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.git { - -webkit-mask: url('git-dark.svg') no-repeat 50% 50%; -} - -/* Status / Quick Open */ -.monaco-shell .git-statusbar-group > .git-statusbar-branch-item, -.vs-dark .monaco-workbench .quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.git { - background-image: url('git-dark.svg'); -} - -/* Git viewlet label */ - -.git-viewlet-label-progress > .badge-content { - background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMiAyIDE0IDE0IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDIgMiAxNCAxNCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTkgMTZjLTMuODYgMC03LTMuMTQtNy03czMuMTQtNyA3LTdjMy44NTkgMCA3IDMuMTQxIDcgN3MtMy4xNDEgNy03IDd6bTAtMTIuNmMtMy4wODggMC01LjYgMi41MTMtNS42IDUuNnMyLjUxMiA1LjYgNS42IDUuNiA1LjYtMi41MTIgNS42LTUuNi0yLjUxMi01LjYtNS42LTUuNnptMy44NiA3LjFsLTMuMTYtMS44OTZ2LTMuODA0aC0xLjR2NC41OTZsMy44NCAyLjMwNS43Mi0xLjIwMXoiLz48L3N2Zz4="); - background-position: center center; - background-repeat: no-repeat; -} - -/* Git merge editor decorations */ -.monaco-editor .git-merge-control-decoration { - background-color: rgba(255, 139, 0, 0.3); -} -.monaco-editor.vs-dark .git-merge-control-decoration { - background-color: rgba(235, 59, 0, 0.3); -} - -.monaco-shell .git-branch-dropdown-menu .action-label.git-action.checkout.HEAD { - font-weight: bold; -} - -.monaco-shell .git-branch-dropdown-menu .monaco-inputbox { - font-size: 12px; - width: 100%; -} - -.monaco-shell .git-branch-dropdown-menu .monaco-inputbox > .wrapper > .input { - background-color: transparent; -} - -.monaco-shell .git-branch-dropdown-menu .monaco-inputbox > .wrapper > .input { - padding: 0.8em 1em; -} - -/* Quick Open */ - -.monaco-workbench .quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.git { - background-size: 100%; -} - -.vs .monaco-workbench .quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.git { - background-image: url('git.svg'); -} - -/* Actions */ - -.monaco-shell .git-action.live-sync.icon { - background: url('sync.svg') 7px center no-repeat; -} - -.monaco-shell .git-action.live-sync.icon.loading { - animation: spin-forever 1.6s linear infinite; -} - -@keyframes spin-forever { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } - -/* High Contrast Theming */ -.hc-black .monaco-workbench > .activitybar .monaco-action-bar .badge.git-viewlet-label-progress .badge-content { - width: 1px; -} - -/* Status bar */ - -.monaco-shell .git-statusbar-group > a { - padding: 0 5px; -} - -.monaco-shell .git-statusbar-group > a.disabled { - opacity: 0.7; -} - -.monaco-shell .git-statusbar-group > a.octicon { - line-height: 22px; - width: 16px; - text-align: center; -} - -.monaco-shell .git-statusbar-group .octicon { - font-size: 14px; -} - -.monaco-shell .git-statusbar-group > .git-statusbar-sync-item:not(.empty) > span.octicon { - margin-right: 6px; -} - -@keyframes spin { - from { transform: rotate(0deg); } - to { transform: rotate(1080deg); } -} - -.monaco-shell .git-statusbar-group > .git-statusbar-sync-item.syncing > .octicon { - animation: 2s ease-in-out infinite spin; -} - -.monaco-shell .git-statusbar-group > .git-statusbar-sync-item.disabled > .ahead-behind, -.monaco-shell .git-statusbar-group > .git-statusbar-sync-item.busy > .ahead-behind { - cursor: default; -} - -.monaco-shell .git-statusbar-group > .git-statusbar-branch-item { - background-repeat: no-repeat; - background-position: 4px 50%; - background-size: 17px; - cursor: default; - padding: 0 5px 0 22px; -} - -.monaco-shell .git-statusbar-group > a:not(.disabled):not(.busy) { - cursor: pointer; -} - -.monaco-shell .git-statusbar-group > .busy, -.monaco-shell .git-statusbar-group > .disabled, { - opacity: 0.6; - cursor: default; -} - -.monaco-shell .git-statusbar-group > .git-statusbar-branch-item.headless { - font-style: italic; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/git.svg b/src/vs/workbench/parts/git/browser/media/git.svg deleted file mode 100644 index d1049a44d0d..00000000000 --- a/src/vs/workbench/parts/git/browser/media/git.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/gitViewlet.css b/src/vs/workbench/parts/git/browser/media/gitViewlet.css deleted file mode 100644 index 10037adab11..00000000000 --- a/src/vs/workbench/parts/git/browser/media/gitViewlet.css +++ /dev/null @@ -1,93 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* Git viewlet */ - -.git-viewlet { - height: 100%; -} - -/* Actionbar actions */ - -.git-action.refresh { - background: url('Refresh.svg') center center no-repeat; -} - -.git-action.smart-commit { - background: url('check.svg') center center no-repeat; -} - -.git-action.run-pull { - background: url('pull.svg') center center no-repeat; -} - -.git-action.run-push { - background: url('push.svg') center center no-repeat; -} - -/* Tree actions */ - -.git-action.stage { - background: url('add.svg') center center no-repeat; -} - -.git-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .git-action.stage { - background: url('add-focus.svg') center center no-repeat; -} - -.git-action.undo { - background: url('undo.svg') center center no-repeat; -} - -.git-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .git-action.undo { - background: url('undo-focus.svg') center center no-repeat; -} - -.git-action.unstage { - background: url('subtract.svg') center center no-repeat; -} - -.git-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .git-action.unstage { - background: url('subtract-focus.svg') center center no-repeat; -} - -/* Dark theme actions */ - -.vs-dark .git-action.refresh, -.hc-black .git-action.refresh { - background: url('refresh-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.commit, -.hc-black .git-action.commit, -.vs-dark .git-action.stage-and-commit, -.hc-black .git-action.stage-and-commit, -.vs-dark .git-action.smart-commit, -.hc-black .git-action.smart-commit { - background: url('check-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.run-pull { - background: url('pull-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.run-push { - background: url('push-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.stage, -.hc-black .git-action.stage { - background: url('add-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.undo, -.hc-black .git-action.undo { - background: url('undo-inverse.svg') center center no-repeat; -} - -.vs-dark .git-action.unstage, -.hc-black .git-action.unstage { - background: url('subtract-inverse.svg') center center no-repeat; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/pull-inverse.svg b/src/vs/workbench/parts/git/browser/media/pull-inverse.svg deleted file mode 100644 index 6f2df243de8..00000000000 --- a/src/vs/workbench/parts/git/browser/media/pull-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/pull.svg b/src/vs/workbench/parts/git/browser/media/pull.svg deleted file mode 100644 index 6d2ccb64649..00000000000 --- a/src/vs/workbench/parts/git/browser/media/pull.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/push-inverse.svg b/src/vs/workbench/parts/git/browser/media/push-inverse.svg deleted file mode 100644 index 5afca6bc64e..00000000000 --- a/src/vs/workbench/parts/git/browser/media/push-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/push.svg b/src/vs/workbench/parts/git/browser/media/push.svg deleted file mode 100644 index 7b57be602b9..00000000000 --- a/src/vs/workbench/parts/git/browser/media/push.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/refresh-inverse.svg b/src/vs/workbench/parts/git/browser/media/refresh-inverse.svg deleted file mode 100644 index d79fdaa4e8e..00000000000 --- a/src/vs/workbench/parts/git/browser/media/refresh-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/subtract-focus.svg b/src/vs/workbench/parts/git/browser/media/subtract-focus.svg deleted file mode 100644 index 64cecb0d222..00000000000 --- a/src/vs/workbench/parts/git/browser/media/subtract-focus.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/subtract-inverse.svg b/src/vs/workbench/parts/git/browser/media/subtract-inverse.svg deleted file mode 100644 index 2de46fcf5b5..00000000000 --- a/src/vs/workbench/parts/git/browser/media/subtract-inverse.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/subtract.svg b/src/vs/workbench/parts/git/browser/media/subtract.svg deleted file mode 100644 index f5d128b2df8..00000000000 --- a/src/vs/workbench/parts/git/browser/media/subtract.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/sync.svg b/src/vs/workbench/parts/git/browser/media/sync.svg deleted file mode 100644 index 5a4bf0799e4..00000000000 --- a/src/vs/workbench/parts/git/browser/media/sync.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/undo-focus.svg b/src/vs/workbench/parts/git/browser/media/undo-focus.svg deleted file mode 100644 index c2d0cda307a..00000000000 --- a/src/vs/workbench/parts/git/browser/media/undo-focus.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/undo-inverse.svg b/src/vs/workbench/parts/git/browser/media/undo-inverse.svg deleted file mode 100644 index 9f175633389..00000000000 --- a/src/vs/workbench/parts/git/browser/media/undo-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/media/undo.svg b/src/vs/workbench/parts/git/browser/media/undo.svg deleted file mode 100644 index 1fa6ba48a19..00000000000 --- a/src/vs/workbench/parts/git/browser/media/undo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/changes/changesView.css b/src/vs/workbench/parts/git/browser/views/changes/changesView.css deleted file mode 100644 index bd5892f7cc4..00000000000 --- a/src/vs/workbench/parts/git/browser/views/changes/changesView.css +++ /dev/null @@ -1,171 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* Commit view */ - -.git-viewlet > .changes-view > .commit-view { - box-sizing: border-box; - padding: 5px 9px 5px 16px; -} - -.git-viewlet > .changes-view > .commit-view > .monaco-inputbox { - width: 100%; -} - -.git-viewlet > .changes-view > .commit-view > .monaco-inputbox > .wrapper > .mirror { - max-height: 134px; -} - -.git-viewlet > .changes-view > .commit-view > .monaco-inputbox > .wrapper > textarea.input { - min-height: 26px; -} - -.git-viewlet > .changes-view > .commit-view.scroll > .monaco-inputbox > .wrapper > textarea.input { - overflow-y: scroll; -} - -/* Status view */ - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .content { - line-height: 22px; - display: flex; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .content .monaco-action-bar { - display: none; - margin-right: 12px; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .content .monaco-action-bar .action-item { - margin-top: 2px; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .content .monaco-action-bar .action-label { - width: 16px; - height: 16px; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row:hover .content .monaco-action-bar, -.git-viewlet > .changes-view > .status-view > .monaco-tree.focused .monaco-tree-row.focused .content .monaco-action-bar { - display: block; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row:hover .content .monaco-count-badge, -.git-viewlet > .changes-view > .status-view > .monaco-tree.focused .monaco-tree-row.focused .content .monaco-count-badge { - display: none; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-rows > .monaco-tree-row > .content:before { - background: none; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group { - font-size: 11px; - font-weight: bold; - text-transform: uppercase; - cursor: default; -} - -/* Bold font style does not go well with CJK fonts */ -.git-viewlet:lang(zh-Hans) > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group, -.git-viewlet:lang(zh-Hant) > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group, -.git-viewlet:lang(ja) > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group, -.git-viewlet:lang(ko) > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group { font-weight: normal; } - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .count-badge-wrapper { - padding-right: 12px; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group, -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status { - overflow: hidden; - text-overflow: ellipsis; - flex: 1; -} - -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .status-group { - color: inherit; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.out-of-workspace { - opacity: 0.5; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .status { - padding: 2px 4px; - font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback"; - font-size: 70%; - color: white; - text-align: center; - border-radius: 0.5em; - vertical-align: bottom; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .name { - margin-left: 0.4em; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.modified .status { background-color: #007ACC; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.added .status { background-color: #2d883e; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted .status { background-color: #B9131A; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.renamed .status { background-color: #4668C5; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.copied .status { background-color: #682079; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.untracked .status { background-color: #6C6C6C; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.ignored .status { background-color: #969696; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.conflict .status { background-color: #9B4F96; } -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row.selected .file-status .status { background-color: #ffffff; color: #666; } - -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.modified .status { background-color: #1B80B2; } -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.added .status { background-color: #3c8746; } -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted .status { background-color: #9E121D; } -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.copied .status { background-color: #692C77; } -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.conflict .status { background-color: #7F4E7E; } -.vs-dark .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row.selected .file-status .status { background-color: #ffffff; color: #666; } - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted .name, -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.both-deleted .name, -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted-by-them .name, -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted-by-us .name { - text-decoration: line-through; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status:not(.renamed) > .rename { - display: none; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .rename-name:not(:empty), -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .rename-arrow { - margin-left: 0.4em; -} - -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .rename-folder:not(:empty), -.git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .folder:not(:empty) { - opacity: 0.7; - font-size: 0.9em; - margin-left: 0.8em; -} - -/* High Contrast Theming */ -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .content { - line-height: 20px; -} - -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status .status { - top: 2px; -} - -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.modified .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.added .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.deleted .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.renamed .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.copied .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.untracked .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.ignored .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row .file-status.conflict .status, -.hc-black .git-viewlet > .changes-view > .status-view > .monaco-tree .monaco-tree-row.selected .file-status .status { - background-color: #000; - color: #fff; - border: 1px solid #6FC3DF; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/changes/changesView.ts b/src/vs/workbench/parts/git/browser/views/changes/changesView.ts deleted file mode 100644 index 6f92d464832..00000000000 --- a/src/vs/workbench/parts/git/browser/views/changes/changesView.ts +++ /dev/null @@ -1,496 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./changesView'; -import nls = require('vs/nls'); -import Platform = require('vs/base/common/platform'); -import Lifecycle = require('vs/base/common/lifecycle'); -import EventEmitter = require('vs/base/common/eventEmitter'); -import Strings = require('vs/base/common/strings'); -import Errors = require('vs/base/common/errors'); -import * as paths from 'vs/base/common/paths'; -import WinJS = require('vs/base/common/winjs.base'); -import Builder = require('vs/base/browser/builder'); -import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import Actions = require('vs/base/common/actions'); -import ActionBar = require('vs/base/browser/ui/actionbar/actionbar'); -import Tree = require('vs/base/parts/tree/browser/tree'); -import TreeImpl = require('vs/base/parts/tree/browser/treeImpl'); -import git = require('vs/workbench/parts/git/common/git'); -import GitView = require('vs/workbench/parts/git/browser/views/view'); -import GitActions = require('vs/workbench/parts/git/browser/gitActions'); -import GitModel = require('vs/workbench/parts/git/common/gitModel'); -import Viewer = require('vs/workbench/parts/git/browser/views/changes/changesViewer'); -import GitEditorInputs = require('vs/workbench/parts/git/browser/gitEditorInputs'); -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import WorkbenchEditorCommon = require('vs/workbench/common/editor'); -import InputBox = require('vs/base/browser/ui/inputbox/inputBox'); -import Severity from 'vs/base/common/severity'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IEditorInput } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { isEqualOrParent } from 'vs/platform/files/common/files'; -import { attachInputBoxStyler, attachListStyler } from 'vs/platform/theme/common/styler'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -import IGitService = git.IGitService; - -var $ = Builder.$; - -export class ChangesView extends EventEmitter.EventEmitter implements GitView.IView, GitActions.ICommitState { - - public ID = 'changes'; - - private static COMMIT_KEYBINDING = Platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter'; - private static NEED_MESSAGE = nls.localize('needMessage', "Please provide a commit message. You can always press **{0}** to commit changes. If there are any staged changes, only those will be committed; otherwise, all changes will.", ChangesView.COMMIT_KEYBINDING); - private static NOTHING_TO_COMMIT = nls.localize('nothingToCommit', "Once there are some changes to commit, type in the commit message and either press **{0}** to commit changes. If there are any staged changes, only those will be committed; otherwise, all changes will.", ChangesView.COMMIT_KEYBINDING); - private static LONG_COMMIT = nls.localize('longCommit', "It is recommended to keep the commit's first line under 50 characters. Feel free to use more lines for extra information."); - - private instantiationService: IInstantiationService; - private editorService: IWorkbenchEditorService; - private messageService: IMessageService; - private contextViewService: IContextViewService; - private contextService: IWorkspaceContextService; - private gitService: IGitService; - private outputService: IOutputService; - - private $el: Builder.Builder; - private $commitView: Builder.Builder; - private $statusView: Builder.Builder; - private commitInputBox: InputBox.InputBox; - private tree: Tree.ITree; - - private visible: boolean; - private currentDimension: Builder.Dimension; - - private smartCommitAction: GitActions.SmartCommitAction; - private actions: Actions.IAction[]; - private secondaryActions: Actions.IAction[]; - private actionRunner: Actions.IActionRunner; - - private toDispose: Lifecycle.IDisposable[]; - - constructor(actionRunner: Actions.IActionRunner, - @IInstantiationService instantiationService: IInstantiationService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IEditorGroupService editorGroupService: IEditorGroupService, - @IMessageService messageService: IMessageService, - @IContextViewService contextViewService: IContextViewService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @IGitService gitService: IGitService, - @IOutputService outputService: IOutputService, - @IConfigurationService private configurationService: IConfigurationService, - @IThemeService private themeService: IThemeService - ) { - super(); - - this.instantiationService = instantiationService; - this.editorService = editorService; - this.messageService = messageService; - this.contextViewService = contextViewService; - this.contextService = contextService; - this.gitService = gitService; - this.outputService = outputService; - - this.visible = false; - this.currentDimension = null; - this.actionRunner = actionRunner; - - this.toDispose = [ - this.smartCommitAction = this.instantiationService.createInstance(GitActions.SmartCommitAction, this), - editorGroupService.onEditorsChanged(() => this.onEditorsChanged(this.editorService.getActiveEditorInput()).done(null, Errors.onUnexpectedError)), - this.gitService.addListener(git.ServiceEvents.OPERATION_START, (e) => this.onGitOperationStart(e)), - this.gitService.addListener(git.ServiceEvents.OPERATION_END, (e) => this.onGitOperationEnd(e)), - this.gitService.getModel().addListener(git.ModelEvents.MODEL_UPDATED, this.onGitModelUpdate.bind(this)) - ]; - } - - // IView - - public get element(): HTMLElement { - this.render(); - return this.$el.getHTMLElement(); - } - - private render(): void { - if (this.$el) { - return; - } - - this.$el = $('.changes-view'); - this.$commitView = $('.commit-view').appendTo(this.$el); - - // Commit view - - this.commitInputBox = new InputBox.InputBox(this.$commitView.getHTMLElement(), this.contextViewService, { - placeholder: nls.localize('commitMessage', "Message (press {0} to commit)", ChangesView.COMMIT_KEYBINDING), - validationOptions: { - showMessage: true, - validation: (value): InputBox.IMessage => { - const config = this.configurationService.getConfiguration('git'); - - if (!config.enableLongCommitWarning) { - return null; - } - - if (/^[^\n]{51}/.test(value)) { - return { - content: ChangesView.LONG_COMMIT, - type: InputBox.MessageType.WARNING - }; - } - - return null; - } - }, - ariaLabel: nls.localize('commitMessageAriaLabel', "Git: Type commit message and press {0} to commit", ChangesView.COMMIT_KEYBINDING), - flexibleHeight: true - }); - this.toDispose.push(attachInputBoxStyler(this.commitInputBox, this.themeService)); - - this.commitInputBox.onDidChange((value) => this.emit('change', value)); - this.commitInputBox.onDidHeightChange((value) => this.emit('heightchange', value)); - - $(this.commitInputBox.inputElement).on('keydown', (e: KeyboardEvent) => { - var keyboardEvent = new StandardKeyboardEvent(e); - - if (keyboardEvent.equals(KeyMod.CtrlCmd | KeyCode.Enter) || keyboardEvent.equals(KeyMod.CtrlCmd | KeyCode.KEY_S)) { - if (this.smartCommitAction.enabled) { - this.actionRunner.run(this.smartCommitAction).done(); - } else { - this.commitInputBox.showMessage({ content: ChangesView.NOTHING_TO_COMMIT, formatContent: true, type: InputBox.MessageType.INFO }); - } - } - }).on('blur', () => { - this.commitInputBox.hideMessage(); - }); - - // Status view - - this.$statusView = $('.status-view').appendTo(this.$el); - - var actionProvider = this.instantiationService.createInstance(Viewer.ActionProvider); - var renderer = this.instantiationService.createInstance(Viewer.Renderer, actionProvider, this.actionRunner); - var dnd = this.instantiationService.createInstance(Viewer.DragAndDrop); - var controller = this.instantiationService.createInstance(Viewer.Controller, actionProvider); - - this.tree = new TreeImpl.Tree(this.$statusView.getHTMLElement(), { - dataSource: new Viewer.DataSource(), - renderer: renderer, - filter: new Viewer.Filter(), - sorter: new Viewer.Sorter(), - accessibilityProvider: new Viewer.AccessibilityProvider(), - dnd: dnd, - controller: controller - }, { - indentPixels: 0, - twistiePixels: 20, - ariaLabel: nls.localize('treeAriaLabel', "Git Changes View") - }); - - this.toDispose.push(attachListStyler(this.tree, this.themeService)); - this.tree.setInput(this.gitService.getModel().getStatus()); - this.tree.expandAll(this.gitService.getModel().getStatus().getGroups()); - - this.toDispose.push(this.tree.addListener('selection', (e) => this.onSelection(e))); - this.toDispose.push(this.commitInputBox.onDidHeightChange(() => this.layout())); - } - - public focus(): void { - var selection = this.tree.getSelection(); - if (selection.length > 0) { - this.tree.reveal(selection[0], 0.5).done(null, Errors.onUnexpectedError); - } - - this.commitInputBox.focus(); - } - - public layout(dimension: Builder.Dimension = this.currentDimension): void { - if (!dimension) { - return; - } - - this.currentDimension = dimension; - - this.commitInputBox.layout(); - var statusViewHeight = dimension.height - (this.commitInputBox.height + 12 /* margin */); - this.$statusView.size(dimension.width, statusViewHeight); - this.tree.layout(statusViewHeight); - - if (this.commitInputBox.height === 134) { - this.$commitView.addClass('scroll'); - } else { - this.$commitView.removeClass('scroll'); - } - } - - public setVisible(visible: boolean): WinJS.TPromise { - this.visible = visible; - - if (visible) { - this.tree.onVisible(); - this.updateCommitInputTemplate(); - return this.onEditorsChanged(this.editorService.getActiveEditorInput()); - } else { - this.tree.onHidden(); - return WinJS.TPromise.as(null); - } - } - - private onUndoLastCommit(commit: git.ICommit): void { - if (this.commitInputBox.value) { - return; - } - - this.commitInputBox.value = commit.message; - } - - private updateCommitInputTemplate(): void { - if (this.commitInputBox.value) { - return; - } - - this.gitService.getCommitTemplate() - .then(template => template && (this.commitInputBox.value = template)) - .done(null, Errors.onUnexpectedError); - } - - public getControl(): Tree.ITree { - return this.tree; - } - - public getActions(): Actions.IAction[] { - if (!this.actions) { - this.actions = [ - this.smartCommitAction, - this.instantiationService.createInstance(GitActions.RefreshAction) - ]; - - this.actions.forEach(a => this.toDispose.push(a)); - } - - return this.actions; - } - - public getSecondaryActions(): Actions.IAction[] { - if (!this.secondaryActions) { - this.secondaryActions = [ - this.instantiationService.createInstance(GitActions.SyncAction, GitActions.SyncAction.ID, GitActions.SyncAction.LABEL), - this.instantiationService.createInstance(GitActions.PullAction, GitActions.PullAction.ID, GitActions.PullAction.LABEL), - this.instantiationService.createInstance(GitActions.PullWithRebaseAction, GitActions.PullWithRebaseAction.ID, GitActions.PullWithRebaseAction.LABEL), - this.instantiationService.createInstance(GitActions.PushAction, GitActions.PushAction.ID, GitActions.PushAction.LABEL), - this.instantiationService.createInstance(GitActions.PushToRemoteAction, GitActions.PushToRemoteAction.ID, GitActions.PushToRemoteAction.LABEL), - new ActionBar.Separator(), - this.instantiationService.createInstance(GitActions.PublishAction, GitActions.PublishAction.ID, GitActions.PublishAction.LABEL), - new ActionBar.Separator(), - this.instantiationService.createInstance(GitActions.CommitAction, this), - this.instantiationService.createInstance(GitActions.CommitSignedOffAction, this), - this.instantiationService.createInstance(GitActions.CommitAmendAction, this), - this.instantiationService.createInstance(GitActions.StageAndCommitAction, this, GitActions.StageAndCommitAction.ID, GitActions.StageAndCommitAction.LABEL, GitActions.StageAndCommitAction.CSSCLASS), - this.instantiationService.createInstance(GitActions.StageAndCommitSignedOffAction, this), - this.instantiationService.createInstance(GitActions.UndoLastCommitAction, GitActions.UndoLastCommitAction.ID, GitActions.UndoLastCommitAction.LABEL), - new ActionBar.Separator(), - this.instantiationService.createInstance(GitActions.GlobalUnstageAction), - this.instantiationService.createInstance(GitActions.GlobalUndoAction), - new ActionBar.Separator(), - new Actions.Action('show.gitOutput', nls.localize('showOutput', "Show Git Output"), null, true, () => this.outputService.getChannel('Git').show()) - ]; - - this.secondaryActions.forEach(a => this.toDispose.push(a)); - } - - return this.secondaryActions; - } - - // ICommitState - - public getCommitMessage(): string { - return Strings.trim(this.commitInputBox.value); - } - - public onEmptyCommitMessage(): void { - this.commitInputBox.focus(); - this.commitInputBox.showMessage({ content: ChangesView.NEED_MESSAGE, formatContent: true, type: InputBox.MessageType.INFO }); - } - - // Events - - private onGitModelUpdate(): void { - if (this.tree) { - this.tree.refresh().done(() => { - return this.tree.expandAll(this.gitService.getModel().getStatus().getGroups()); - }); - } - } - - private onEditorsChanged(input: IEditorInput): WinJS.TPromise { - if (!this.tree) { - return WinJS.TPromise.as(null); - } - - var status = this.getStatusFromInput(input); - - if (!status) { - this.tree.clearSelection(); - } - - if (this.visible && this.tree.getSelection().indexOf(status) === -1) { - return this.tree.reveal(status, 0.5).then(() => { - this.tree.setSelection([status], { origin: 'implicit' }); - }); - } - - return WinJS.TPromise.as(null); - } - - private onSelection(e: Tree.ISelectionEvent): void { - if (e.payload && e.payload && e.payload.origin === 'implicit') { - return; - } - - if (e.selection.length !== 1) { - return; - } - - var element = e.selection[0]; - - if (!(element instanceof GitModel.FileStatus)) { - return; - } - - if (e.payload && e.payload.origin === 'keyboard' && !(e.payload.originalEvent).equals(KeyCode.Enter)) { - return; - } - - var isMouseOrigin = e.payload && (e.payload.origin === 'mouse'); - - if (isMouseOrigin && (e.payload.originalEvent.metaKey || e.payload.originalEvent.shiftKey)) { - return; - } - - var isDoubleClick = isMouseOrigin && e.payload.originalEvent && e.payload.originalEvent.detail === 2; - - var status = element; - - this.gitService.getInput(status).done((input) => { - var options = new WorkbenchEditorCommon.TextDiffEditorOptions(); - - if (isMouseOrigin) { - options.preserveFocus = true; - - var originalEvent: MouseEvent = e && e.payload && e.payload.origin === 'mouse' && e.payload.originalEvent; - if (originalEvent && originalEvent.detail === 2) { - options.preserveFocus = false; - originalEvent.preventDefault(); // focus moves to editor, we need to prevent default - } - } - - options.forceOpen = true; - options.pinned = isDoubleClick; - - var sideBySide = (e && e.payload && e.payload.originalEvent && e.payload.originalEvent.altKey); - - return this.editorService.openEditor(input, options, sideBySide); - }, (e) => { - if (e.gitErrorCode === git.GitErrorCodes.CantOpenResource) { - this.messageService.show(Severity.Warning, e); - return; - } - - this.messageService.show(Severity.Error, e); - }); - } - - private onGitOperationStart(operation: git.IGitOperation): void { - if (operation.id === git.ServiceOperations.COMMIT) { - if (this.commitInputBox) { - this.commitInputBox.disable(); - } - } else if (operation.id === git.ServiceOperations.RESET) { - const promise = this.gitService.getCommit('HEAD'); - const listener = this.gitService.addListener(git.ServiceEvents.OPERATION_END, e => { - if (e.operation.id === git.ServiceOperations.RESET && !e.error) { - promise.done(c => this.onUndoLastCommit(c)); - listener.dispose(); - } - }); - } - } - - private onGitOperationEnd(e: { operation: git.IGitOperation; error: any; }): void { - if (e.operation.id === git.ServiceOperations.COMMIT) { - if (this.commitInputBox) { - this.commitInputBox.enable(); - - if (!e.error) { - this.commitInputBox.value = ''; - this.updateCommitInputTemplate(); - } - } - } - } - - // Misc - - private getStatusFromInput(input: IEditorInput): git.IFileStatus { - if (!input) { - return null; - } - - if (input instanceof GitEditorInputs.GitDiffEditorInput) { - return (input).getFileStatus(); - } - - if (input instanceof GitEditorInputs.NativeGitIndexStringEditorInput) { - return (input).getFileStatus() || null; - } - - const resource = WorkbenchEditorCommon.toResource(input, { filter: 'file' }); - if (resource) { - const workspaceRoot = this.contextService.getWorkspace().resource.fsPath; - if (!workspaceRoot || !isEqualOrParent(resource.fsPath, workspaceRoot, !Platform.isLinux /* ignorecase */)) { - return null; // out of workspace not yet supported - } - - const repositoryRoot = this.gitService.getModel().getRepositoryRoot(); - if (!repositoryRoot || !isEqualOrParent(resource.fsPath, repositoryRoot, !Platform.isLinux /* ignorecase */)) { - return null; // out of repository not supported - } - - const repositoryRelativePath = paths.normalize(paths.relative(repositoryRoot, resource.fsPath)); - - var status = this.gitService.getModel().getStatus().getWorkingTreeStatus().find(repositoryRelativePath); - if (status && (status.getStatus() === git.Status.UNTRACKED || status.getStatus() === git.Status.IGNORED)) { - return status; - } - - status = this.gitService.getModel().getStatus().getMergeStatus().find(repositoryRelativePath); - if (status) { - return status; - } - } - - return null; - } - - public dispose(): void { - if (this.$el) { - this.$el.dispose(); - this.$el = null; - } - - this.toDispose = Lifecycle.dispose(this.toDispose); - - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/git/browser/views/changes/changesViewer.ts b/src/vs/workbench/parts/git/browser/views/changes/changesViewer.ts deleted file mode 100644 index 4dd5130e987..00000000000 --- a/src/vs/workbench/parts/git/browser/views/changes/changesViewer.ts +++ /dev/null @@ -1,921 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 winjs = require('vs/base/common/winjs.base'); -import nls = require('vs/nls'); -import platform = require('vs/base/common/platform'); -import paths = require('vs/base/common/paths'); -import severity from 'vs/base/common/severity'; -import lifecycle = require('vs/base/common/lifecycle'); -import dom = require('vs/base/browser/dom'); -import keyboard = require('vs/base/browser/keyboardEvent'); -import mouse = require('vs/base/browser/mouseEvent'); -import comparers = require('vs/base/common/comparers'); -import actions = require('vs/base/common/actions'); -import actionbar = require('vs/base/browser/ui/actionbar/actionbar'); -import countbadge = require('vs/base/browser/ui/countBadge/countBadge'); -import tree = require('vs/base/parts/tree/browser/tree'); -import treednd = require('vs/base/parts/tree/browser/treeDnd'); -import treedefaults = require('vs/base/parts/tree/browser/treeDefaults'); -import * as git from 'vs/workbench/parts/git/common/git'; -import gitmodel = require('vs/workbench/parts/git/common/gitModel'); -import gitactions = require('vs/workbench/parts/git/browser/gitActions'); -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import URI from 'vs/base/common/uri'; - -import IGitService = git.IGitService; - -function toReadablePath(path: string): string { - if (!platform.isWindows) { - return path; - } - - return path.replace(/\//g, '\\'); -} - -const $ = dom.$; - -export class ActionContainer implements lifecycle.IDisposable { - - private cache: { [actionId: string]: actions.IAction; }; - private instantiationService: IInstantiationService; - - constructor(instantiationService: IInstantiationService) { - this.cache = {}; - this.instantiationService = instantiationService; - } - - protected getAction(ctor: any, ...args: any[]): any { - var action = this.cache[ctor.ID]; - - if (!action) { - args.unshift(ctor); - action = this.cache[ctor.ID] = this.instantiationService.createInstance.apply(this.instantiationService, args); - } - - return action; - } - - public dispose(): void { - Object.keys(this.cache).forEach(k => { - this.cache[k].dispose(); - }); - - this.cache = null; - } -} - -export class DataSource implements tree.IDataSource { - - public getId(tree: tree.ITree, element: any): string { - if (element instanceof gitmodel.StatusModel) { - return 'root'; - } else if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - - switch (statusGroup.getType()) { - case git.StatusType.INDEX: return 'index'; - case git.StatusType.WORKING_TREE: return 'workingTree'; - case git.StatusType.MERGE: return 'merge'; - default: throw new Error('Invalid group type'); - } - } - - var status = element; - return status.getId(); - } - - public hasChildren(tree: tree.ITree, element: any): boolean { - if (element instanceof gitmodel.StatusModel) { - return true; - } else if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - return statusGroup.all().length > 0; - } - return false; - } - - public getChildren(tree: tree.ITree, element: any): winjs.Promise { - if (element instanceof gitmodel.StatusModel) { - var model = element; - return winjs.TPromise.as(model.getGroups()); - - } else if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - return winjs.TPromise.as(statusGroup.all()); - } - - return winjs.TPromise.as([]); - } - - public getParent(tree: tree.ITree, element: any): winjs.Promise { - return winjs.TPromise.as(null); - } -} - -export class ActionProvider extends ActionContainer implements tree.IActionProvider { - - private gitService: git.IGitService; - - constructor( @IInstantiationService instantiationService: IInstantiationService, @IGitService gitService: IGitService) { - super(instantiationService); - this.gitService = gitService; - } - - public hasActions(tree: tree.ITree, element: any): boolean { - if (element instanceof gitmodel.FileStatus) { - return true; - } else if (element instanceof gitmodel.StatusGroup && (element).all().length > 0) { - return true; - } - return false; - } - - public getActions(tree: tree.ITree, element: any): winjs.TPromise { - if (element instanceof gitmodel.StatusGroup) { - return winjs.TPromise.as(this.getActionsForGroupStatusType(element.getType())); - } else { - return winjs.TPromise.as(this.getActionsForFileStatusType(element.getType())); - } - } - - public getActionsForFileStatusType(statusType: git.StatusType): actions.IAction[] { - switch (statusType) { - case git.StatusType.INDEX: - return [this.getAction(gitactions.UnstageAction)]; - case git.StatusType.WORKING_TREE: - return [this.getAction(gitactions.UndoAction), this.getAction(gitactions.StageAction)]; - case git.StatusType.MERGE: - return [this.getAction(gitactions.StageAction)]; - default: - return []; - } - } - - public getActionsForGroupStatusType(statusType: git.StatusType): actions.IAction[] { - switch (statusType) { - case git.StatusType.INDEX: - return [this.getAction(gitactions.GlobalUnstageAction)]; - case git.StatusType.WORKING_TREE: - return [this.getAction(gitactions.GlobalUndoAction), this.getAction(gitactions.GlobalStageAction)]; - case git.StatusType.MERGE: - return [this.getAction(gitactions.StageAction)]; - default: - return []; - } - } - - public hasSecondaryActions(tree: tree.ITree, element: any): boolean { - return this.hasActions(tree, element); - } - - public getSecondaryActions(tree: tree.ITree, element: any): winjs.TPromise { - return this.getActions(tree, element).then((actions: actions.IAction[]) => { - - if (element instanceof gitmodel.FileStatus) { - var fileStatus = element; - var status = fileStatus.getStatus(); - - actions.push(new actionbar.Separator()); - - if (status !== git.Status.DELETED && status !== git.Status.INDEX_DELETED) { - actions.push(this.getAction(gitactions.OpenFileAction)); - } - - actions.push(this.getAction(gitactions.OpenChangeAction)); - } - - actions.reverse(); - return actions; - }); - } - - public getActionItem(tree: tree.ITree, element: any, action: actions.IAction): actionbar.IActionItem { - return null; - } -} - -interface IFileStatusTemplateData { - root: HTMLElement; - status: HTMLElement; - name: HTMLElement; - folder: HTMLElement; - renameName: HTMLElement; - renameFolder: HTMLElement; - actionBar: actionbar.ActionBar; -} - -interface IStatusGroupTemplateData { - root: HTMLElement; - count: countbadge.CountBadge; - actionBar: actionbar.ActionBar; -} - -const STAGED_CHANGES = nls.localize('stagedChanges', "Staged Changes"); -const CHANGES = nls.localize('allChanges', "Changes"); -const MERGE_CHANGES = nls.localize('mergeChanges', "Merge Changes"); - -export class Renderer implements tree.IRenderer { - - constructor( - private actionProvider: ActionProvider, - private actionRunner: actions.IActionRunner, - @IMessageService private messageService: IMessageService, - @IGitService private gitService: IGitService, - @IWorkspaceContextService private contextService: IWorkspaceContextService - ) { - // noop - } - - public getHeight(tree: tree.ITree, element: any): number { - return 22; - } - - public getTemplateId(tree: tree.ITree, element: any): string { - if (element instanceof gitmodel.StatusGroup) { - switch (element.getType()) { - case git.StatusType.INDEX: return 'index'; - case git.StatusType.WORKING_TREE: return 'workingTree'; - case git.StatusType.MERGE: return 'merge'; - } - } - - if (element instanceof gitmodel.FileStatus) { - switch (element.getType()) { - case git.StatusType.INDEX: return 'file:index'; - case git.StatusType.WORKING_TREE: return 'file:workingTree'; - case git.StatusType.MERGE: return 'file:merge'; - } - } - - return null; - } - - public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): any { - if (/^file:/.test(templateId)) { - return this.renderFileStatusTemplate(Renderer.templateIdToStatusType(templateId), container); - } else { - return this.renderStatusGroupTemplate(Renderer.templateIdToStatusType(templateId), container); - } - } - - private renderStatusGroupTemplate(statusType: git.StatusType, container: HTMLElement): IStatusGroupTemplateData { - var data: IStatusGroupTemplateData = Object.create(null); - - data.root = dom.append(container, $('.status-group')); - - switch (statusType) { - case git.StatusType.INDEX: data.root.textContent = STAGED_CHANGES; break; - case git.StatusType.WORKING_TREE: data.root.textContent = CHANGES; break; - case git.StatusType.MERGE: data.root.textContent = MERGE_CHANGES; break; - } - - const wrapper = dom.append(container, $('.count-badge-wrapper')); - data.count = new countbadge.CountBadge(wrapper); - - data.actionBar = new actionbar.ActionBar(container, { actionRunner: this.actionRunner }); - data.actionBar.push(this.actionProvider.getActionsForGroupStatusType(statusType), { icon: true, label: false }); - data.actionBar.addListener('run', e => e.error && this.onError(e.error)); - - return data; - } - - private renderFileStatusTemplate(statusType: git.StatusType, container: HTMLElement): IFileStatusTemplateData { - var data: IFileStatusTemplateData = Object.create(null); - - data.root = dom.append(container, $('.file-status')); - data.status = dom.append(data.root, $('span.status')); - data.name = dom.append(data.root, $('a.name.plain')); - data.folder = dom.append(data.root, $('span.folder')); - - var rename = dom.append(data.root, $('span.rename')); - var arrow = dom.append(rename, $('span.rename-arrow')); - arrow.textContent = 'â†'; - - data.renameName = dom.append(rename, $('span.rename-name')); - data.renameFolder = dom.append(rename, $('span.rename-folder')); - - data.actionBar = new actionbar.ActionBar(container, { actionRunner: this.actionRunner }); - data.actionBar.push(this.actionProvider.getActionsForFileStatusType(statusType), { icon: true, label: false }); - data.actionBar.addListener('run', e => e.error && this.onError(e.error)); - - return data; - } - - public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void { - if (/^file:/.test(templateId)) { - this.renderFileStatus(tree, element, templateData); - } else { - Renderer.renderStatusGroup(element, templateData); - } - } - - private static renderStatusGroup(statusGroup: git.IStatusGroup, data: IStatusGroupTemplateData): void { - data.actionBar.context = statusGroup; - data.count.setCount(statusGroup.all().length); - } - - private renderFileStatus(tree: tree.ITree, fileStatus: git.IFileStatus, data: IFileStatusTemplateData): void { - data.actionBar.context = { - tree: tree, - fileStatus: fileStatus - }; - - const repositoryRoot = this.gitService.getModel().getRepositoryRoot(); - - const status = fileStatus.getStatus(); - const renamePath = fileStatus.getRename(); - const path = fileStatus.getPath(); - const lastSlashIndex = path.lastIndexOf('/'); - const name = lastSlashIndex === -1 ? path : path.substr(lastSlashIndex + 1, path.length); - const folder = (lastSlashIndex === -1 ? '' : path.substr(0, lastSlashIndex)); - - data.root.className = 'file-status ' + Renderer.statusToClass(status); - data.status.textContent = Renderer.statusToChar(status); - data.status.title = Renderer.statusToTitle(status); - - const resource = URI.file(paths.normalize(paths.join(repositoryRoot, path))); - let isInWorkspace = this.contextService.isInsideWorkspace(resource); - - let rename = ''; - let renameFolder = ''; - - if (renamePath) { - const renameLastSlashIndex = renamePath.lastIndexOf('/'); - rename = renameLastSlashIndex === -1 ? renamePath : renamePath.substr(renameLastSlashIndex + 1, renamePath.length); - renameFolder = (renameLastSlashIndex === -1 ? '' : renamePath.substr(0, renameLastSlashIndex)); - - data.renameName.textContent = name; - data.renameFolder.textContent = folder; - - const resource = URI.file(paths.normalize(paths.join(repositoryRoot, renamePath))); - isInWorkspace = this.contextService.isInsideWorkspace(resource); - } - - if (isInWorkspace) { - data.root.title = ''; - } else { - data.root.title = nls.localize('outsideOfWorkspace', "This file is located outside the current workspace."); - data.root.className += ' out-of-workspace'; - } - - data.name.textContent = rename || name; - data.name.title = renamePath || path; - data.folder.textContent = toReadablePath(renameFolder || folder); - } - - public disposeTemplate(tree: tree.ITree, templateId: string, templateData: any): void { - if (/^file:/.test(templateId)) { - Renderer.disposeFileStatusTemplate(templateData); - } - } - - private static disposeFileStatusTemplate(templateData: IFileStatusTemplateData): void { - templateData.actionBar.dispose(); - } - - private static statusToChar(status: git.Status): string { - switch (status) { - case git.Status.INDEX_MODIFIED: return nls.localize('modified-char', "M"); - case git.Status.MODIFIED: return nls.localize('modified-char', "M"); - case git.Status.INDEX_ADDED: return nls.localize('added-char', "A"); - case git.Status.INDEX_DELETED: return nls.localize('deleted-char', "D"); - case git.Status.DELETED: return nls.localize('deleted-char', "D"); - case git.Status.INDEX_RENAMED: return nls.localize('renamed-char', "R"); - case git.Status.INDEX_COPIED: return nls.localize('copied-char', "C"); - case git.Status.UNTRACKED: return nls.localize('untracked-char', "U"); - case git.Status.IGNORED: return nls.localize('ignored-char', "!"); - case git.Status.BOTH_DELETED: return nls.localize('deleted-char', "D"); - case git.Status.ADDED_BY_US: return nls.localize('added-char', "A"); - case git.Status.DELETED_BY_THEM: return nls.localize('deleted-char', "D"); - case git.Status.ADDED_BY_THEM: return nls.localize('added-char', "A"); - case git.Status.DELETED_BY_US: return nls.localize('deleted-char', "D"); - case git.Status.BOTH_ADDED: return nls.localize('added-char', "A"); - case git.Status.BOTH_MODIFIED: return nls.localize('modified-char', "M"); - default: return ''; - } - } - - public static statusToTitle(status: git.Status): string { - switch (status) { - case git.Status.INDEX_MODIFIED: return nls.localize('title-index-modified', "Modified in index"); - case git.Status.MODIFIED: return nls.localize('title-modified', "Modified"); - case git.Status.INDEX_ADDED: return nls.localize('title-index-added', "Added to index"); - case git.Status.INDEX_DELETED: return nls.localize('title-index-deleted', "Deleted in index"); - case git.Status.DELETED: return nls.localize('title-deleted', "Deleted"); - case git.Status.INDEX_RENAMED: return nls.localize('title-index-renamed', "Renamed in index"); - case git.Status.INDEX_COPIED: return nls.localize('title-index-copied', "Copied in index"); - case git.Status.UNTRACKED: return nls.localize('title-untracked', "Untracked"); - case git.Status.IGNORED: return nls.localize('title-ignored', "Ignored"); - case git.Status.BOTH_DELETED: return nls.localize('title-conflict-both-deleted', "Conflict: both deleted"); - case git.Status.ADDED_BY_US: return nls.localize('title-conflict-added-by-us', "Conflict: added by us"); - case git.Status.DELETED_BY_THEM: return nls.localize('title-conflict-deleted-by-them', "Conflict: deleted by them"); - case git.Status.ADDED_BY_THEM: return nls.localize('title-conflict-added-by-them', "Conflict: added by them"); - case git.Status.DELETED_BY_US: return nls.localize('title-conflict-deleted-by-us', "Conflict: deleted by us"); - case git.Status.BOTH_ADDED: return nls.localize('title-conflict-both-added', "Conflict: both added"); - case git.Status.BOTH_MODIFIED: return nls.localize('title-conflict-both-modified', "Conflict: both modified"); - default: return ''; - } - } - - private static statusToClass(status: git.Status): string { - switch (status) { - case git.Status.INDEX_MODIFIED: return 'modified'; - case git.Status.MODIFIED: return 'modified'; - case git.Status.INDEX_ADDED: return 'added'; - case git.Status.INDEX_DELETED: return 'deleted'; - case git.Status.DELETED: return 'deleted'; - case git.Status.INDEX_RENAMED: return 'renamed'; - case git.Status.INDEX_COPIED: return 'copied'; - case git.Status.UNTRACKED: return 'untracked'; - case git.Status.IGNORED: return 'ignored'; - case git.Status.BOTH_DELETED: return 'conflict both-deleted'; - case git.Status.ADDED_BY_US: return 'conflict added-by-us'; - case git.Status.DELETED_BY_THEM: return 'conflict deleted-by-them'; - case git.Status.ADDED_BY_THEM: return 'conflict added-by-them'; - case git.Status.DELETED_BY_US: return 'conflict deleted-by-us'; - case git.Status.BOTH_ADDED: return 'conflict both-added'; - case git.Status.BOTH_MODIFIED: return 'conflict both-modified'; - default: return ''; - } - } - - private static templateIdToStatusType(templateId: string): git.StatusType { - if (/index$/.test(templateId)) { - return git.StatusType.INDEX; - } else if (/workingTree$/.test(templateId)) { - return git.StatusType.WORKING_TREE; - } else { - return git.StatusType.MERGE; - } - } - - private onError(error: any): void { - this.messageService.show(severity.Error, error); - } -} - -export class Filter implements tree.IFilter { - - public isVisible(tree: tree.ITree, element: any): boolean { - if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - - switch (statusGroup.getType()) { - case git.StatusType.INDEX: - case git.StatusType.MERGE: - return statusGroup.all().length > 0; - case git.StatusType.WORKING_TREE: - return true; - } - } - - return true; - } -} - -export class Sorter implements tree.ISorter { - - public compare(tree: tree.ITree, element: any, otherElement: any): number { - if (!(element instanceof gitmodel.FileStatus && otherElement instanceof gitmodel.FileStatus)) { - return 0; - } - - return Sorter.compareStatus(element, otherElement); - } - - private static compareStatus(element: git.IFileStatus, otherElement: git.IFileStatus): number { - var one = element.getPathComponents(); - var other = otherElement.getPathComponents(); - var lastOne = one.length - 1; - var lastOther = other.length - 1; - - var endOne: boolean, endOther: boolean, onePart: string, otherPart: string; - - for (var i = 0; ; i++) { - endOne = lastOne === i; - endOther = lastOther === i; - - if (endOne && endOther) { - return comparers.compareFileNames(one[i], other[i]); - } else if (endOne) { - return -1; - } else if (endOther) { - return 1; - } else if ((onePart = one[i].toLowerCase()) !== (otherPart = other[i].toLowerCase())) { - return onePart < otherPart ? -1 : 1; - } - } - } -} - -export class DragAndDrop extends ActionContainer implements tree.IDragAndDrop { - - private gitService: git.IGitService; - private messageService: IMessageService; - - constructor( @IInstantiationService instantiationService: IInstantiationService, @IGitService gitService: IGitService, @IMessageService messageService: IMessageService) { - super(instantiationService); - this.gitService = gitService; - this.messageService = messageService; - } - - public getDragURI(tree: tree.ITree, element: any): string { - if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - return 'git:' + statusGroup.getType(); - } else if (element instanceof gitmodel.FileStatus) { - var status = element; - return 'git:' + status.getType() + ':' + status.getPath(); - } - - return null; - } - - getDragLabel(tree: tree.ITree, elements: any[]): string { - if (elements.length > 1) { - return String(elements.length); - } - - const element = elements[0]; - - if (element instanceof gitmodel.StatusGroup) { - const group = element as gitmodel.StatusGroup; - - switch (group.getType()) { - case git.StatusType.INDEX: return STAGED_CHANGES; - case git.StatusType.WORKING_TREE: return CHANGES; - case git.StatusType.MERGE: return MERGE_CHANGES; - } - } - - const status = element as gitmodel.FileStatus; - return paths.basename(status.getPath()); - } - - public onDragStart(tree: tree.ITree, data: tree.IDragAndDropData, originalEvent: mouse.DragMouseEvent): void { - // no-op - } - - public onDragOver(_tree: tree.ITree, data: tree.IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): tree.IDragOverReaction { - if (!this.gitService.isIdle()) { - return tree.DRAG_OVER_REJECT; - } - - if (!(data instanceof treednd.ElementsDragAndDropData)) { - return tree.DRAG_OVER_REJECT; - } - - var elements: any[] = data.getData(); - var element = elements[0]; - - if (element instanceof gitmodel.StatusGroup) { - var statusGroup = element; - return this.onDrag(targetElement, statusGroup.getType()); - - } else if (element instanceof gitmodel.FileStatus) { - var status = element; - return this.onDrag(targetElement, status.getType()); - - } else { - return tree.DRAG_OVER_REJECT; - } - } - - private onDrag(targetElement: any, type: git.StatusType): tree.IDragOverReaction { - if (type === git.StatusType.WORKING_TREE) { - return this.onDragWorkingTree(targetElement); - } else if (type === git.StatusType.INDEX) { - return this.onDragIndex(targetElement); - } else if (type === git.StatusType.MERGE) { - return this.onDragMerge(targetElement); - } else { - return tree.DRAG_OVER_REJECT; - } - } - - private onDragWorkingTree(targetElement: any): tree.IDragOverReaction { - if (targetElement instanceof gitmodel.StatusGroup) { - var targetStatusGroup = targetElement; - return targetStatusGroup.getType() === git.StatusType.INDEX ? tree.DRAG_OVER_ACCEPT_BUBBLE_DOWN(false) : tree.DRAG_OVER_REJECT; - } else if (targetElement instanceof gitmodel.FileStatus) { - var targetStatus = targetElement; - return targetStatus.getType() === git.StatusType.INDEX ? tree.DRAG_OVER_ACCEPT_BUBBLE_UP : tree.DRAG_OVER_REJECT; - } else { - return tree.DRAG_OVER_REJECT; - } - } - - private onDragIndex(targetElement: any): tree.IDragOverReaction { - if (targetElement instanceof gitmodel.StatusGroup) { - var targetStatusGroup = targetElement; - return targetStatusGroup.getType() === git.StatusType.WORKING_TREE ? tree.DRAG_OVER_ACCEPT_BUBBLE_DOWN(false) : tree.DRAG_OVER_REJECT; - } else if (targetElement instanceof gitmodel.FileStatus) { - var targetStatus = targetElement; - return targetStatus.getType() === git.StatusType.WORKING_TREE ? tree.DRAG_OVER_ACCEPT_BUBBLE_UP : tree.DRAG_OVER_REJECT; - } else { - return tree.DRAG_OVER_REJECT; - } - } - - private onDragMerge(targetElement: any): tree.IDragOverReaction { - if (targetElement instanceof gitmodel.StatusGroup) { - var targetStatusGroup = targetElement; - return targetStatusGroup.getType() === git.StatusType.INDEX ? tree.DRAG_OVER_ACCEPT_BUBBLE_DOWN(false) : tree.DRAG_OVER_REJECT; - } else if (targetElement instanceof gitmodel.FileStatus) { - var targetStatus = targetElement; - return targetStatus.getType() === git.StatusType.INDEX ? tree.DRAG_OVER_ACCEPT_BUBBLE_UP : tree.DRAG_OVER_REJECT; - } else { - return tree.DRAG_OVER_REJECT; - } - } - - public drop(tree: tree.ITree, data: tree.IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): void { - var elements: any[] = data.getData(); - var element = elements[0]; - var files: git.IFileStatus[]; - - if (element instanceof gitmodel.StatusGroup) { - files = (element).all(); - // } else if (element instanceof gitmodel.FileStatus) { - // files = [ element ]; - } else { - files = elements; - // throw new Error('Invalid drag and drop data.'); - } - - var targetGroup = targetElement; - - // Add files to index - if (targetGroup.getType() === git.StatusType.INDEX) { - this.getAction(gitactions.StageAction).run(files).done(null, (e: Error) => this.onError(e)); - } - - // Remove files from index - if (targetGroup.getType() === git.StatusType.WORKING_TREE) { - this.getAction(gitactions.UnstageAction).run(files).done(null, (e: Error) => this.onError(e)); - } - } - - private onError(error: any): void { - this.messageService.show(severity.Error, error); - } -} - -export class AccessibilityProvider implements tree.IAccessibilityProvider { - - public getAriaLabel(tree: tree.ITree, element: any): string { - if (element instanceof gitmodel.FileStatus) { - const fileStatus = element; - const status = fileStatus.getStatus(); - const path = fileStatus.getPath(); - const lastSlashIndex = path.lastIndexOf('/'); - const name = lastSlashIndex === -1 ? path : path.substr(lastSlashIndex + 1, path.length); - const folder = (lastSlashIndex === -1 ? '' : path.substr(0, lastSlashIndex)); - - return nls.localize('fileStatusAriaLabel', "File {0} in folder {1} has status: {2}, Git", name, folder, Renderer.statusToTitle(status)); - } - - if (element instanceof gitmodel.StatusGroup) { - switch ((element).getType()) { - case git.StatusType.INDEX: return nls.localize('ariaLabelStagedChanges', "Staged Changes, Git"); - case git.StatusType.WORKING_TREE: return nls.localize('ariaLabelChanges', "Changes, Git"); - case git.StatusType.MERGE: return nls.localize('ariaLabelMerge', "Merge, Git"); - } - } - return undefined; - } -} - -export class Controller extends treedefaults.DefaultController { - - private contextMenuService: IContextMenuService; - private actionProvider: tree.IActionProvider; - - constructor(actionProvider: tree.IActionProvider, @IContextMenuService contextMenuService: IContextMenuService) { - super({ clickBehavior: treedefaults.ClickBehavior.ON_MOUSE_UP }); - - this.actionProvider = actionProvider; - this.contextMenuService = contextMenuService; - - this.downKeyBindingDispatcher.set(KeyMod.Shift | KeyCode.UpArrow, this.onUp.bind(this)); - this.downKeyBindingDispatcher.set(KeyMod.Shift | KeyCode.DownArrow, this.onDown.bind(this)); - this.downKeyBindingDispatcher.set(KeyMod.Shift | KeyCode.PageUp, this.onPageUp.bind(this)); - this.downKeyBindingDispatcher.set(KeyMod.Shift | KeyCode.PageDown, this.onPageDown.bind(this)); - } - - protected onLeftClick(tree: tree.ITree, element: any, event: mouse.IMouseEvent): boolean { - // Status group should never get selected nor expanded/collapsed - if (element instanceof gitmodel.StatusGroup) { - event.preventDefault(); - event.stopPropagation(); - - return true; - } - - if (event.shiftKey) { - var focus = tree.getFocus(); - - if (!(focus instanceof gitmodel.FileStatus) || !(element instanceof gitmodel.FileStatus)) { - return undefined; - } - - var focusStatus = focus; - var elementStatus = element; - - if (focusStatus.getType() !== elementStatus.getType()) { - return undefined; - } - - if (this.canSelect(tree, element)) { - tree.setFocus(element); - if (tree.isSelected(element)) { - tree.deselectRange(focusStatus, elementStatus); - } else { - tree.selectRange(focusStatus, elementStatus); - } - } - - return undefined; - } - - tree.setFocus(element); - - if (platform.isMacintosh ? event.metaKey : event.ctrlKey) { - if (this.canSelect(tree, element)) { - tree.toggleSelection(element, { origin: 'mouse', originalEvent: event }); - } - - return undefined; - } - - return super.onLeftClick(tree, element, event); - } - - protected onEnter(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var element = tree.getFocus(); - - // Status group should never get selected nor expanded/collapsed - if (element instanceof gitmodel.StatusGroup) { - event.preventDefault(); - event.stopPropagation(); - - return true; - } - - return super.onEnter(tree, event); - } - - protected onSpace(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var focus = tree.getFocus(); - - if (!focus) { - event.preventDefault(); - event.stopPropagation(); - return true; - } - - if (!this.canSelect(tree, focus)) { - return false; - } - - tree.toggleSelection(focus, { origin: 'keyboard', originalEvent: event }); - event.preventDefault(); - event.stopPropagation(); - return true; - } - - public onContextMenu(tree: tree.ITree, element: any, event: tree.ContextMenuEvent): boolean { - if (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') { - return false; - } - - event.preventDefault(); - event.stopPropagation(); - - tree.setFocus(element); - - if (this.actionProvider.hasSecondaryActions(tree, element)) { - var anchor = { x: event.posx + 1, y: event.posy }; - var context = { - selection: tree.getSelection(), - focus: element - }; - - this.contextMenuService.showContextMenu({ - getAnchor: () => anchor, - getActions: () => this.actionProvider.getSecondaryActions(tree, element), - getActionItem: this.actionProvider.getActionItem.bind(this.actionProvider, tree, element), - getActionsContext: () => context, - onHide: (wasCancelled?: boolean) => { - if (wasCancelled) { - tree.DOMFocus(); - } - } - }); - - return true; - } - - return false; - } - - protected onLeft(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - return true; - } - - protected onRight(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - return true; - } - - protected onUp(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var oldFocus = tree.getFocus(); - var base = super.onUp(tree, event); - - if (!base || !event.shiftKey) { - return false; - } - - return this.shiftSelect(tree, oldFocus, event); - } - - protected onPageUp(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var oldFocus = tree.getFocus(); - var base = super.onPageUp(tree, event); - - if (!base || !event.shiftKey) { - return false; - } - - return this.shiftSelect(tree, oldFocus, event); - } - - protected onDown(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var oldFocus = tree.getFocus(); - var base = super.onDown(tree, event); - - if (!base || !event.shiftKey) { - return false; - } - - return this.shiftSelect(tree, oldFocus, event); - } - - protected onPageDown(tree: tree.ITree, event: keyboard.IKeyboardEvent): boolean { - var oldFocus = tree.getFocus(); - var base = super.onPageDown(tree, event); - - if (!base || !event.shiftKey) { - return false; - } - - return this.shiftSelect(tree, oldFocus, event); - } - - private canSelect(tree: tree.ITree, ...elements: any[]): boolean { - if (elements.some(e => e instanceof gitmodel.StatusGroup || e instanceof gitmodel.StatusModel)) { - return false; - } - - return elements.every(e => { - var first = tree.getSelection()[0]; - var clicked = e; - return !first || (first.getType() === clicked.getType()); - }); - } - - private shiftSelect(tree: tree.ITree, oldFocus: any, event: keyboard.IKeyboardEvent): boolean { - var payload = { origin: 'keyboard', originalEvent: event }; - var focus = tree.getFocus(); - - if (focus === oldFocus) { - return false; - } - - var oldFocusIsSelected = tree.isSelected(oldFocus); - var focusIsSelected = tree.isSelected(focus); - - if (oldFocusIsSelected && focusIsSelected) { - tree.deselectRange(focus, oldFocus, payload); - } else if (!oldFocusIsSelected && !focusIsSelected) { - if (this.canSelect(tree, oldFocus, focus)) { - tree.selectRange(focus, oldFocus, payload); - } - } else if (oldFocusIsSelected) { - if (this.canSelect(tree, focus)) { - tree.selectRange(focus, oldFocus, payload); - } - } else { - tree.deselectRange(focus, oldFocus, payload); - } - - return true; - } -} diff --git a/src/vs/workbench/parts/git/browser/views/disabled/disabledView.ts b/src/vs/workbench/parts/git/browser/views/disabled/disabledView.ts deleted file mode 100644 index 43351e73218..00000000000 --- a/src/vs/workbench/parts/git/browser/views/disabled/disabledView.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./disabledView'; -import nls = require('vs/nls'); -import winjs = require('vs/base/common/winjs.base'); -import ee = require('vs/base/common/eventEmitter'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import builder = require('vs/base/browser/builder'); -import actions = require('vs/base/common/actions'); - -var $ = builder.$; - -export class DisabledView - extends ee.EventEmitter - implements view.IView { - public ID = 'disabled'; - private _element: HTMLElement; - - public get element(): HTMLElement { - if (!this._element) { - this.render(); - } - - return this._element; - } - - private render(): void { - this._element = $([ - '
', - '

', nls.localize('disabled', "Git is disabled in the settings."), '

', - '
' - ].join('')).getHTMLElement(); - } - - public focus(): void { - return; - } - - public layout(dimension: builder.Dimension): void { - return; - } - - public setVisible(visible: boolean): winjs.TPromise { - return winjs.TPromise.as(null); - } - - public getControl(): ee.IEventEmitter { - return null; - } - - public getActions(): actions.IAction[] { - return []; - } - - public getSecondaryActions(): actions.IAction[] { - return []; - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/empty/emptyView.css b/src/vs/workbench/parts/git/browser/views/empty/emptyView.css deleted file mode 100644 index e7b57f201fd..00000000000 --- a/src/vs/workbench/parts/git/browser/views/empty/emptyView.css +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -.git-viewlet > .empty-view { - padding: 0 20px 0 20px; -} - -.git-viewlet > .empty-view > .section:not(:empty) { - margin: 20px 0; - padding-top: 20px; - border-top: 1px solid rgba(0, 0, 0, 0.05); -} - -.git-viewlet > .empty-view > .section > p:first-child { - margin-top: 0; -} - -.git-viewlet > .empty-view .monaco-inputbox { - width: 100%; - margin-bottom: 10px; -} - -.git-viewlet > .empty-view .combo-box { - width: 100%; - min-width: inherit; - padding: 4px 4px 4px 0; - margin-bottom: 10px; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/empty/emptyView.ts b/src/vs/workbench/parts/git/browser/views/empty/emptyView.ts deleted file mode 100644 index 730837e4a38..00000000000 --- a/src/vs/workbench/parts/git/browser/views/empty/emptyView.ts +++ /dev/null @@ -1,174 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./emptyView'; -import nls = require('vs/nls'); -import Lifecycle = require('vs/base/common/lifecycle'); -import EventEmitter = require('vs/base/common/eventEmitter'); -import DOM = require('vs/base/browser/dom'); -import { Button } from 'vs/base/browser/ui/button/button'; -import WinJS = require('vs/base/common/winjs.base'); -import Builder = require('vs/base/browser/builder'); -import Actions = require('vs/base/common/actions'); -import InputBox = require('vs/base/browser/ui/inputbox/inputBox'); -import GitView = require('vs/workbench/parts/git/browser/views/view'); -import GitActions = require('vs/workbench/parts/git/browser/gitActions'); -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IGitService } from 'vs/workbench/parts/git/common/git'; -import { attachButtonStyler } from 'vs/platform/theme/common/styler'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -var $ = Builder.$; - -export class EmptyView extends EventEmitter.EventEmitter implements GitView.IView { - - public ID = 'empty'; - - private static EMPTY_MESSAGE = nls.localize('noGit', "This workspace isn't yet under git source control."); - - private gitService: IGitService; - private instantiationService: IInstantiationService; - private messageService: IMessageService; - private fileService: IFileService; - - private actionRunner: Actions.IActionRunner; - private refreshAction: Actions.IAction; - private isVisible: boolean; - private needsRender: boolean; - private $el: Builder.Builder; - private urlInputBox: InputBox.InputBox; - private cloneButton: Button; - private initButton: Button; - private controller: GitView.IController; - private toDispose: Lifecycle.IDisposable[]; - - constructor(controller: GitView.IController, actionRunner: Actions.IActionRunner, - @IGitService gitService: IGitService, - @IInstantiationService instantiationService: IInstantiationService, - @IMessageService messageService: IMessageService, - @IFileService fileService: IFileService, - @IThemeService private themeService: IThemeService - ) { - super(); - - this.gitService = gitService; - this.instantiationService = instantiationService; - this.messageService = messageService; - this.fileService = fileService; - - this.actionRunner = actionRunner; - this.isVisible = false; - this.needsRender = false; - this.controller = controller; - this.toDispose = []; - } - - // Properties - - private _initAction: GitActions.InitAction; - private get initAction(): GitActions.InitAction { - if (!this._initAction) { - this._initAction = this.instantiationService.createInstance(GitActions.InitAction); - } - - return this._initAction; - } - - // IView - - public get element(): HTMLElement { - this.render(); - return this.$el.getHTMLElement(); - } - - private render(): void { - if (this.$el) { - return; - } - - this.$el = $('.empty-view'); - - $('p').appendTo(this.$el).text(EmptyView.EMPTY_MESSAGE); - - var initSection = $('.section').appendTo(this.$el); - this.initButton = new Button(initSection); - attachButtonStyler(this.initButton, this.themeService); - this.initButton.label = nls.localize('gitinit', 'Initialize Git Repository'); - this.initButton.addListener('click', (e) => { - DOM.EventHelper.stop(e); - - this.disableUI(); - this.actionRunner.run(this.initAction).done(() => this.enableUI()); - }); - } - - private disableUI(): void { - if (this.urlInputBox) { - this.urlInputBox.disable(); - } - - if (this.cloneButton) { - this.cloneButton.enabled = false; - } - - this.initButton.enabled = false; - } - - private enableUI(): void { - if (this.gitService.getRunningOperations().length > 0) { - return; - } - - if (this.urlInputBox) { - this.urlInputBox.enable(); - this.urlInputBox.validate(); - } - - this.initButton.enabled = true; - } - - public focus(): void { - this.initButton.focus(); - } - - public layout(dimension: Builder.Dimension): void { - // no-op - } - - public setVisible(visible: boolean): WinJS.TPromise { - this.isVisible = visible; - - return WinJS.TPromise.as(null); - } - - public getControl(): EventEmitter.IEventEmitter { - return null; - } - - public getActions(): Actions.IAction[] { - return this.refreshAction ? [this.refreshAction] : []; - } - - public getSecondaryActions(): Actions.IAction[] { - return []; - } - - // Events - - public dispose(): void { - if (this.$el) { - this.$el.dispose(); - this.$el = null; - } - - this.toDispose = Lifecycle.dispose(this.toDispose); - - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/git/browser/views/gitless/gitlessView.ts b/src/vs/workbench/parts/git/browser/views/gitless/gitlessView.ts deleted file mode 100644 index e615cf87e76..00000000000 --- a/src/vs/workbench/parts/git/browser/views/gitless/gitlessView.ts +++ /dev/null @@ -1,98 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./gitlessView'; -import nls = require('vs/nls'); -import platform = require('vs/base/common/platform'); -import winjs = require('vs/base/common/winjs.base'); -import ee = require('vs/base/common/eventEmitter'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import builder = require('vs/base/browser/builder'); -import actions = require('vs/base/common/actions'); - -var $ = builder.$; - -export class GitlessView - extends ee.EventEmitter - implements view.IView { - public ID = 'gitless'; - private _element: HTMLElement; - - constructor() { - super(); - } - - public get element(): HTMLElement { - if (!this._element) { - this.render(); - } - - return this._element; - } - - private render(): void { - var instructions: string; - - if (platform.isMacintosh) { - instructions = nls.localize('macInstallWith', - "You can either install it with {0}, download it from {1} or install the {2} command line developer tools, by simply typing {3} on a Terminal prompt.", - '
Homebrew', - 'git-scm.com', - 'XCode', - 'git' - ); - } else if (platform.isWindows) { - instructions = nls.localize('winInstallWith', - "You can either install it with {0} or download it from {1}.", - 'Chocolatey', - 'git-scm.com' - ); - } else if (platform.isLinux) { - instructions = nls.localize('linuxDownloadFrom', - "You can download it from {0}.", - 'git-scm.com' - ); - } else { - instructions = nls.localize('downloadFrom', - "You can download it from {0}.", - 'git-scm.com' - ); - } - - this._element = $([ - '
', - '

', nls.localize('looksLike', "It looks like git is not installed on your system."), '

', - '

', instructions, '

', - '

', nls.localize('pleaseRestart', "Once git is installed, please restart VSCode."), '

', - '
' - ].join('')).getHTMLElement(); - } - - public focus(): void { - return; - } - - public layout(dimension: builder.Dimension): void { - return; - } - - public setVisible(visible: boolean): winjs.TPromise { - return winjs.TPromise.as(null); - } - - public getControl(): ee.IEventEmitter { - return null; - } - - public getActions(): actions.IAction[] { - return []; - } - - public getSecondaryActions(): actions.IAction[] { - return []; - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/huge/hugeView.ts b/src/vs/workbench/parts/git/browser/views/huge/hugeView.ts deleted file mode 100644 index 7e6173e8422..00000000000 --- a/src/vs/workbench/parts/git/browser/views/huge/hugeView.ts +++ /dev/null @@ -1,86 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./hugeView'; -import nls = require('vs/nls'); -import winjs = require('vs/base/common/winjs.base'); -import ee = require('vs/base/common/eventEmitter'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import builder = require('vs/base/browser/builder'); -import actions = require('vs/base/common/actions'); -import * as dom from 'vs/base/browser/dom'; -import { IGitService } from 'vs/workbench/parts/git/common/git'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Button } from 'vs/base/browser/ui/button/button'; -import { attachButtonStyler } from 'vs/platform/theme/common/styler'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -const $ = dom.$; - -export class HugeView extends ee.EventEmitter implements view.IView { - - ID = 'huge'; - private _element: HTMLElement; - - constructor( @IGitService private gitService: IGitService, @IThemeService private themeService: IThemeService) { - super(); - } - - get element(): HTMLElement { - if (!this._element) { - this.render(); - } - - return this._element; - } - - private render(): void { - this._element = $('.huge-view'); - - dom.append(this._element, $('p')).textContent = nls.localize('huge', "Your repository appears to have many active changes.\nThis can cause Code to become very slow."); - - const settingP = dom.append(this._element, $('p')); - dom.append(settingP, document.createTextNode(nls.localize('setting', "You can permanently disable this warning with the following setting:"))); - dom.append(settingP, document.createTextNode(' ')); - const pre = dom.append(settingP, $('pre')); - pre.style.display = 'inline'; - pre.textContent = 'git.allowLargeRepositories'; - - const button = new Button(this._element); - attachButtonStyler(button, this.themeService); - button.label = nls.localize('allo', "Allow large repositories"); - button.addListener('click', (e) => { - dom.EventHelper.stop(e); - this.gitService.allowHugeRepositories = true; - this.gitService.status().done(null, onUnexpectedError); - }); - } - - focus(): void { - return; - } - - layout(dimension: builder.Dimension): void { - return; - } - - setVisible(visible: boolean): winjs.TPromise { - return winjs.TPromise.as(null); - } - - getControl(): ee.IEventEmitter { - return null; - } - - getActions(): actions.IAction[] { - return []; - } - - getSecondaryActions(): actions.IAction[] { - return []; - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/notroot/notrootView.ts b/src/vs/workbench/parts/git/browser/views/notroot/notrootView.ts deleted file mode 100644 index 2e9263bcb8d..00000000000 --- a/src/vs/workbench/parts/git/browser/views/notroot/notrootView.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./notrootView'; -import nls = require('vs/nls'); -import winjs = require('vs/base/common/winjs.base'); -import ee = require('vs/base/common/eventEmitter'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import builder = require('vs/base/browser/builder'); -import actions = require('vs/base/common/actions'); -const $ = builder.$; - -export class NotRootView - extends ee.EventEmitter - implements view.IView { - public ID = 'notroot'; - private _element: HTMLElement; - - public get element(): HTMLElement { - if (!this._element) { - this.render(); - } - - return this._element; - } - - private render(): void { - this._element = $([ - '
', - '

', nls.localize('wrongRoot', "This directory seems to be contained in a git repository."), '

', - '

', nls.localize('pleaseRestart', "Open the repository's root directory in order to access Git features."), '

', - '
' - ].join('')).getHTMLElement(); - } - - public focus(): void { - return; - } - - public layout(dimension: builder.Dimension): void { - return; - } - - public setVisible(visible: boolean): winjs.TPromise { - return winjs.TPromise.as(null); - } - - public getControl(): ee.IEventEmitter { - return null; - } - - public getActions(): actions.IAction[] { - return []; - } - - public getSecondaryActions(): actions.IAction[] { - return []; - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.ts b/src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.ts deleted file mode 100644 index a75f8f249c6..00000000000 --- a/src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.ts +++ /dev/null @@ -1,95 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/css!./noworkspaceView'; -import nls = require('vs/nls'); -import * as errors from 'vs/base/common/errors'; -import winjs = require('vs/base/common/winjs.base'); -import ee = require('vs/base/common/eventEmitter'); -import env = require('vs/base/common/platform'); -import view = require('vs/workbench/parts/git/browser/views/view'); -import builder = require('vs/base/browser/builder'); -import { Button } from 'vs/base/browser/ui/button/button'; -import { IActionRunner, IAction } from 'vs/base/common/actions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; -import { attachButtonStyler } from 'vs/platform/theme/common/styler'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -const $ = builder.$; - -export class NoWorkspaceView - extends ee.EventEmitter - implements view.IView { - public ID = 'noworkspace'; - private _element: HTMLElement; - private _openFolderButton: Button; - - constructor( - private actionRunner: IActionRunner, - @IInstantiationService private instantiationService: IInstantiationService, - @IThemeService private themeService: IThemeService - ) { - super(); - } - - public get element(): HTMLElement { - if (!this._element) { - this.render(); - } - - return this._element; - } - - private render(): void { - this._element = $([ - '
', - '

', nls.localize('noWorkspaceHelp', "You have not yet opened a folder."), '

', - '

', nls.localize('pleaseRestart', "Open a folder with a Git repository in order to access Git features."), '

', - '
' - ].join('')).getHTMLElement(); - - this._openFolderButton = new Button(this._element); - attachButtonStyler(this._openFolderButton, this.themeService); - this._openFolderButton.label = nls.localize('openFolder', "Open Folder"); - this._openFolderButton.addListener('click', () => { - const actionClass = env.isMacintosh ? OpenFileFolderAction : OpenFolderAction; - const action = this.instantiationService.createInstance(actionClass, actionClass.ID, actionClass.LABEL); - this.actionRunner.run(action).done(() => { - action.dispose(); - }, err => { - action.dispose(); - errors.onUnexpectedError(err); - }); - }); - } - - public focus(): void { - if (this._openFolderButton) { - this._openFolderButton.getElement().focus(); - } - } - - public layout(dimension: builder.Dimension): void { - return; - } - - public setVisible(visible: boolean): winjs.TPromise { - return winjs.TPromise.as(null); - } - - public getControl(): ee.IEventEmitter { - return null; - } - - public getActions(): IAction[] { - return []; - } - - public getSecondaryActions(): IAction[] { - return []; - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/views/view.ts b/src/vs/workbench/parts/git/browser/views/view.ts deleted file mode 100644 index fc0c209607a..00000000000 --- a/src/vs/workbench/parts/git/browser/views/view.ts +++ /dev/null @@ -1,24 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import Lifecycle = require('vs/base/common/lifecycle'); -import WinJS = require('vs/base/common/winjs.base'); -import EventEmitter = require('vs/base/common/eventEmitter'); -import Builder = require('vs/base/browser/builder'); -import Actions = require('vs/base/common/actions'); - -export interface IView extends Lifecycle.IDisposable { - ID: string; - element: HTMLElement; - focus(): void; - layout(dimension: Builder.Dimension): void; - setVisible(visible: boolean): WinJS.Promise; - getControl(): EventEmitter.IEventEmitter; - getActions(): Actions.IAction[]; - getSecondaryActions(): Actions.IAction[]; -} - -export interface IController { - setView(id: string): WinJS.Promise; -} diff --git a/src/vs/workbench/parts/git/common/git.ts b/src/vs/workbench/parts/git/common/git.ts deleted file mode 100644 index 1c5ddfd4875..00000000000 --- a/src/vs/workbench/parts/git/common/git.ts +++ /dev/null @@ -1,342 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { EditorInput } from 'vs/workbench/common/editor'; -import { IEventEmitter } from 'vs/base/common/eventEmitter'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import Event from 'vs/base/common/event'; - -// Model raw interfaces - -export interface IRawFileStatus { - x: string; - y: string; - path: string; - mimetype: string; - rename?: string; -} - -export interface IRemote { - name: string; - url: string; -} - -export enum RefType { - Head, - RemoteHead, - Tag -} - -export interface IRef { - name: string; - commit: string; - type: RefType; - remote?: string; -} - -export interface IBranch extends IRef { - upstream?: string; - ahead?: number; - behind?: number; -} - -export interface IRawStatus { - repositoryRoot: string; - state?: ServiceState; - status: IRawFileStatus[]; - HEAD: IBranch; - refs: IRef[]; - remotes: IRemote[]; -} - -export interface ICommit { - hash: string; - message: string; -} - -// Model enums - -export enum StatusType { - INDEX, - WORKING_TREE, - MERGE -} - -export enum Status { - INDEX_MODIFIED, - INDEX_ADDED, - INDEX_DELETED, - INDEX_RENAMED, - INDEX_COPIED, - - MODIFIED, - DELETED, - UNTRACKED, - IGNORED, - - ADDED_BY_US, - ADDED_BY_THEM, - DELETED_BY_US, - DELETED_BY_THEM, - BOTH_ADDED, - BOTH_DELETED, - BOTH_MODIFIED -} - -// Model events - -export const ModelEvents = { - MODEL_UPDATED: 'ModelUpdated', - STATUS_MODEL_UPDATED: 'StatusModelUpdated', - HEAD_UPDATED: 'HEADUpdated', - REFS_UPDATED: 'RefsUpdated', - REMOTES_UPDATED: 'RemotesUpdated' -}; - -// Model interfaces - -export interface IFileStatus { - getId(): string; - getType(): StatusType; - getPath(): string; - getPathComponents(): string[]; - getMimetype(): string; - getStatus(): Status; - getRename(): string; - clone(): IFileStatus; - update(other: IFileStatus): void; -} - -export interface IStatusGroup extends IEventEmitter { - getType(): StatusType; - update(statusList: IFileStatus[]): void; - all(): IFileStatus[]; - find(path: string): IFileStatus; -} - -export interface IStatusSummary { - hasWorkingTreeChanges: boolean; - hasIndexChanges: boolean; - hasMergeChanges: boolean; -} - -export interface IStatusModel extends IEventEmitter { - getSummary(): IStatusSummary; - update(status: IRawFileStatus[]): void; - getIndexStatus(): IStatusGroup; - getWorkingTreeStatus(): IStatusGroup; - getMergeStatus(): IStatusGroup; - getGroups(): IStatusGroup[]; - find(path: string, type: StatusType): IFileStatus; -} - -export interface IModel extends IEventEmitter { - getRepositoryRoot(): string; - getStatus(): IStatusModel; - getHEAD(): IBranch; - getRefs(): IRef[]; - getRemotes(): IRemote[]; - update(status: IRawStatus): void; - getPS1(): string; -} - -// Service operations - -export interface IGitOperation extends IDisposable { - id: string; - run(): TPromise; -} - -// Service enums - -export enum ServiceState { - NotInitialized, - NotARepo, - NotAtRepoRoot, - OK, - Huge, - NoGit, - Disabled, - NotAWorkspace -} - -export enum RawServiceState { - OK, - GitNotFound, - Disabled -} - -export const GitErrorCodes = { - BadConfigFile: 'BadConfigFile', - AuthenticationFailed: 'AuthenticationFailed', - NoUserNameConfigured: 'NoUserNameConfigured', - NoUserEmailConfigured: 'NoUserEmailConfigured', - NoRemoteRepositorySpecified: 'NoRemoteRepositorySpecified', - NotAGitRepository: 'NotAGitRepository', - NotAtRepositoryRoot: 'NotAtRepositoryRoot', - Conflict: 'Conflict', - UnmergedChanges: 'UnmergedChanges', - PushRejected: 'PushRejected', - RemoteConnectionError: 'RemoteConnectionError', - DirtyWorkTree: 'DirtyWorkTree', - CantOpenResource: 'CantOpenResource', - GitNotFound: 'GitNotFound', - CantCreatePipe: 'CantCreatePipe', - CantAccessRemote: 'CantAccessRemote', - RepositoryNotFound: 'RepositoryNotFound' -}; - -export enum AutoFetcherState { - Disabled, - Inactive, - Active, - Fetching -} - -// Service events - -export const ServiceEvents = { - STATE_CHANGED: 'stateChanged', - REPO_CHANGED: 'repoChanged', - OPERATION_START: 'operationStart', - OPERATION_END: 'operationEnd', - OPERATION: 'operation', - ERROR: 'error', - DISPOSE: 'dispose' -}; - -// Service operations - -export const ServiceOperations = { - STATUS: 'status', - INIT: 'init', - ADD: 'add', - STAGE: 'stage', - BRANCH: 'branch', - CHECKOUT: 'checkout', - CLEAN: 'clean', - UNDO: 'undo', - RESET: 'reset', - REVERT: 'revert', - COMMIT: 'commit', - COMMAND: 'command', - BACKGROUND_FETCH: 'backgroundfetch', - PULL: 'pull', - PUSH: 'push', - SYNC: 'sync' -}; - -// Service config - -export interface IGitConfiguration { - enabled: boolean; - path: string; - autorefresh: boolean; - autofetch: boolean; - enableLongCommitWarning: boolean; - allowLargeRepositories: boolean; - confirmSync: boolean; - countBadge: string; - checkoutType: string; -} - -// Service interfaces - -export interface IAutoFetcher { - state: AutoFetcherState; - activate(): void; - deactivate(): void; -} - -export interface IGitCredentialScope { - protocol: string; - host: string; - path: string; -} - -export interface ICredentials { - username: string; - password: string; -} - -export interface IGitServiceError extends Error { - gitErrorCode: string; -} - -export interface IPushOptions { - setUpstream?: boolean; -} - -export interface IRawGitService { - onOutput: Event; - getVersion(): TPromise; - serviceState(): TPromise; - statusCount(): TPromise; - status(): TPromise; - init(): TPromise; - add(filesPaths?: string[]): TPromise; - stage(filePath: string, content: string): TPromise; - branch(name: string, checkout?: boolean): TPromise; - checkout(treeish?: string, filePaths?: string[]): TPromise; - clean(filePaths: string[]): TPromise; - undo(): TPromise; - reset(treeish: string, hard?: boolean): TPromise; - revertFiles(treeish: string, filePaths?: string[]): TPromise; - fetch(): TPromise; - pull(rebase?: boolean): TPromise; - push(remote?: string, name?: string, options?: IPushOptions): TPromise; - sync(): TPromise; - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise; - detectMimetypes(path: string, treeish?: string): TPromise; - show(path: string, treeish?: string): TPromise; - clone(url: string, parentPath: string): TPromise; - getCommitTemplate(): TPromise; - getCommit(ref: string): TPromise; -} - -export const GIT_SERVICE_ID = 'gitService'; - -export const IGitService = createDecorator(GIT_SERVICE_ID); - -export interface IGitService extends IEventEmitter { - _serviceBrand: any; - allowHugeRepositories: boolean; - onOutput: Event; - status(): TPromise; - init(): TPromise; - add(files?: IFileStatus[]): TPromise; - stage(filePath: string, content: string): TPromise; - branch(name: string, checkout?: boolean): TPromise; - checkout(treeish?: string, files?: IFileStatus[]): TPromise; - clean(files: IFileStatus[]): TPromise; - undo(): TPromise; - reset(treeish: string, hard?: boolean): TPromise; - revertFiles(treeish: string, files?: IFileStatus[]): TPromise; - fetch(): TPromise; - pull(rebase?: boolean): TPromise; - push(remote?: string, name?: string, options?: IPushOptions): TPromise; - sync(): TPromise; - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise; - detectMimetypes(path: string, treeish?: string): TPromise; - buffer(path: string, treeish?: string): TPromise; - clone(url: string, parentPath: string): TPromise; - - getState(): ServiceState; - getModel(): IModel; - getInput(status: IFileStatus): TPromise; - isInitialized(): boolean; - isIdle(): boolean; - getRunningOperations(): IGitOperation[]; - getAutoFetcher(): IAutoFetcher; - getCommitTemplate(): TPromise; - getCommit(ref: string): TPromise; -} - -export interface IAskpassService { - askpass(id: string, host: string, command: string): TPromise; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/common/gitIpc.ts b/src/vs/workbench/parts/git/common/gitIpc.ts deleted file mode 100644 index 6f52b28e5dd..00000000000 --- a/src/vs/workbench/parts/git/common/gitIpc.ts +++ /dev/null @@ -1,267 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; -import Event from 'vs/base/common/event'; -import { - IRawGitService, RawServiceState, IRawStatus, IPushOptions, IAskpassService, ICredentials, - ServiceState, IRawFileStatus, IBranch, RefType, IRef, IRemote, ICommit -} from './git'; - -type ISerializer = { to(a: A): B; from(b: B): A; }; - -export type IPCRawFileStatus = [string, string, string, string, string]; -const RawFileStatusSerializer: ISerializer = { - to: a => [a.x, a.y, a.path, a.mimetype, a.rename], - from: b => ({ x: b[0], y: b[1], path: b[2], mimetype: b[3], rename: b[4] }) -}; - -export type IPCBranch = [string, string, RefType, string, string, number, number]; -const BranchSerializer: ISerializer = { - to: a => [a.name, a.commit, a.type, a.remote, a.upstream, a.ahead, a.behind], - from: b => ({ name: b[0], commit: b[1], type: b[2], remote: b[3], upstream: b[4], ahead: b[5], behind: b[6] }) -}; - -export type IPCRef = [string, string, RefType, string]; -const RefSerializer: ISerializer = { - to: a => [a.name, a.commit, a.type, a.remote], - from: b => ({ name: b[0], commit: b[1], type: b[2], remote: b[3] }) -}; - -export type IPCRemote = [string, string]; -const RemoteSerializer: ISerializer = { - to: a => [a.name, a.url], - from: b => ({ name: b[0], url: b[1] }) -}; - -export type IPCRawStatus = [ - string, - ServiceState, - IPCRawFileStatus[], - IPCBranch, - IPCRef[], - IPCRemote[] -]; - -const RawStatusSerializer: ISerializer = { - to: a => !a ? null : [ - a.repositoryRoot, - a.state, - a.status.map(RawFileStatusSerializer.to), - BranchSerializer.to(a.HEAD), - a.refs.map(RefSerializer.to), - a.remotes.map(RemoteSerializer.to) - ], - from: b => !b ? null : { - repositoryRoot: b[0], - state: b[1], - status: b[2].map(RawFileStatusSerializer.from), - HEAD: BranchSerializer.from(b[3]), - refs: b[4].map(RefSerializer.from), - remotes: b[5].map(RemoteSerializer.from) - } -}; - -export interface IGitChannel extends IChannel { - call(command: 'getVersion'): TPromise; - call(command: 'serviceState'): TPromise; - call(command: 'statusCount'): TPromise; - call(command: 'status'): TPromise; - call(command: 'init'): TPromise; - call(command: 'add', filesPaths?: string[]): TPromise; - call(command: 'stage', args: [string, string]): TPromise; - call(command: 'branch', args: [string, boolean]): TPromise; - call(command: 'checkout', args: [string, string[]]): TPromise; - call(command: 'clean', filePaths: string[]): TPromise; - call(command: 'undo'): TPromise; - call(command: 'reset', args: [string, boolean]): TPromise; - call(command: 'revertFiles', args: [string, string[]]): TPromise; - call(command: 'fetch'): TPromise; - call(command: 'pull', rebase?: boolean): TPromise; - call(command: 'push', args: [string, string, IPushOptions]): TPromise; - call(command: 'sync'): TPromise; - call(command: 'commit', args: [string, boolean, boolean, boolean]): TPromise; - call(command: 'detectMimetypes', args: [string, string]): TPromise; - call(command: 'show', args: [string, string]): TPromise; - call(command: 'clone', args: [string, string]): TPromise; - call(command: 'onOutput'): TPromise; - call(command: 'getCommitTemplate'): TPromise; - call(command: 'getCommit', ref: string): TPromise; - call(command: string, args?: any): TPromise; -} - -export class GitChannel implements IGitChannel { - - constructor(private service: TPromise) { } - - call(command: string, args?: any): TPromise { - switch (command) { - case 'getVersion': return this.service.then(s => s.getVersion()); - case 'serviceState': return this.service.then(s => s.serviceState()); - case 'statusCount': return this.service.then(s => s.statusCount()); - case 'status': return this.service.then(s => s.status()).then(RawStatusSerializer.to); - case 'init': return this.service.then(s => s.init()).then(RawStatusSerializer.to); - case 'add': return this.service.then(s => s.add(args)).then(RawStatusSerializer.to); - case 'stage': return this.service.then(s => s.stage(args[0], args[1])).then(RawStatusSerializer.to); - case 'branch': return this.service.then(s => s.branch(args[0], args[1])).then(RawStatusSerializer.to); - case 'checkout': return this.service.then(s => s.checkout(args[0], args[1])).then(RawStatusSerializer.to); - case 'clean': return this.service.then(s => s.clean(args)).then(RawStatusSerializer.to); - case 'undo': return this.service.then(s => s.undo()).then(RawStatusSerializer.to); - case 'reset': return this.service.then(s => s.reset(args[0], args[1])).then(RawStatusSerializer.to); - case 'revertFiles': return this.service.then(s => s.revertFiles(args[0], args[1])).then(RawStatusSerializer.to); - case 'fetch': return this.service.then(s => s.fetch()).then(RawStatusSerializer.to); - case 'pull': return this.service.then(s => s.pull(args)).then(RawStatusSerializer.to); - case 'push': return this.service.then(s => s.push(args[0], args[1], args[2])).then(RawStatusSerializer.to); - case 'sync': return this.service.then(s => s.sync()).then(RawStatusSerializer.to); - case 'commit': return this.service.then(s => s.commit(args[0], args[1], args[2], args[3])).then(RawStatusSerializer.to); - case 'detectMimetypes': return this.service.then(s => s.detectMimetypes(args[0], args[1])); - case 'show': return this.service.then(s => s.show(args[0], args[1])); - case 'clone': return this.service.then(s => s.clone(args[0], args[1])); - case 'onOutput': return this.service.then(s => eventToCall(s.onOutput)); - case 'getCommitTemplate': return this.service.then(s => s.getCommitTemplate()); - case 'getCommit': return this.service.then(s => s.getCommit(args)); - } - return undefined; - } -} - -export class UnavailableGitChannel implements IGitChannel { - - call(command: string): TPromise { - switch (command) { - case 'serviceState': return TPromise.as(RawServiceState.GitNotFound); - default: return TPromise.as(null); - } - } -} - -export class GitChannelClient implements IRawGitService { - - constructor(private channel: IGitChannel) { } - - private _onOutput = eventFromCall(this.channel, 'onOutput'); - get onOutput(): Event { return this._onOutput; } - - getVersion(): TPromise { - return this.channel.call('getVersion'); - } - - serviceState(): TPromise { - return this.channel.call('serviceState'); - } - - statusCount(): TPromise { - return this.channel.call('statusCount'); - } - - status(): TPromise { - return this.channel.call('status').then(RawStatusSerializer.from); - } - - init(): TPromise { - return this.channel.call('init').then(RawStatusSerializer.from); - } - - add(filesPaths?: string[]): TPromise { - return this.channel.call('add', filesPaths).then(RawStatusSerializer.from); - } - - stage(filePath: string, content: string): TPromise { - return this.channel.call('stage', [filePath, content]).then(RawStatusSerializer.from); - } - - branch(name: string, checkout?: boolean): TPromise { - return this.channel.call('branch', [name, checkout]).then(RawStatusSerializer.from); - } - - checkout(treeish?: string, filePaths?: string[]): TPromise { - return this.channel.call('checkout', [treeish, filePaths]).then(RawStatusSerializer.from); - } - - clean(filePaths: string[]): TPromise { - return this.channel.call('clean', filePaths).then(RawStatusSerializer.from); - } - - undo(): TPromise { - return this.channel.call('undo').then(RawStatusSerializer.from); - } - - reset(treeish: string, hard?: boolean): TPromise { - return this.channel.call('reset', [treeish, hard]).then(RawStatusSerializer.from); - } - - revertFiles(treeish: string, filePaths?: string[]): TPromise { - return this.channel.call('revertFiles', [treeish, filePaths]).then(RawStatusSerializer.from); - } - - fetch(): TPromise { - return this.channel.call('fetch').then(RawStatusSerializer.from); - } - - pull(rebase?: boolean): TPromise { - return this.channel.call('pull', rebase).then(RawStatusSerializer.from); - } - - push(remote?: string, name?: string, options?: IPushOptions): TPromise { - return this.channel.call('push', [remote, name, options]).then(RawStatusSerializer.from); - } - - sync(): TPromise { - return this.channel.call('sync').then(RawStatusSerializer.from); - } - - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise { - return this.channel.call('commit', [message, amend, stage, signoff]).then(RawStatusSerializer.from); - } - - detectMimetypes(path: string, treeish?: string): TPromise { - return this.channel.call('detectMimetypes', [path, treeish]); - } - - show(path: string, treeish?: string): TPromise { - return this.channel.call('show', [path, treeish]); - } - - clone(url: string, parentPath: string): TPromise { - return this.channel.call('clone', [url, parentPath]); - } - - getCommitTemplate(): TPromise { - return this.channel.call('getCommitTemplate'); - } - - getCommit(ref: string): TPromise { - return this.channel.call('getCommit', ref); - } -} - -export interface IAskpassChannel extends IChannel { - call(command: 'askpass', args: [string, string, string]): TPromise; - call(command: string, args: any[]): TPromise; -} - -export class AskpassChannel implements IAskpassChannel { - - constructor(private service: IAskpassService) { } - - call(command: string, args: [string, string, string]): TPromise { - switch (command) { - case 'askpass': return this.service.askpass(args[0], args[1], args[2]); - } - return undefined; - } -} - -export class AskpassChannelClient implements IAskpassService { - - constructor(private channel: IAskpassChannel) { } - - askpass(id: string, host: string, command: string): TPromise { - return this.channel.call('askpass', [id, host, command]); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/common/gitModel.ts b/src/vs/workbench/parts/git/common/gitModel.ts deleted file mode 100644 index 30baf2cf6d2..00000000000 --- a/src/vs/workbench/parts/git/common/gitModel.ts +++ /dev/null @@ -1,412 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { format } from 'vs/base/common/strings'; -import { EventEmitter } from 'vs/base/common/eventEmitter'; -import { - IStatusModel, IStatusSummary, IRawFileStatus, ModelEvents, - IFileStatus, IStatusGroup, Status, StatusType, - IBranch, IRef, IRemote, IModel, IRawStatus, RefType -} from 'vs/workbench/parts/git/common/git'; - -export class FileStatus implements IFileStatus { - - private id: string; - private pathComponents: string[]; - - constructor( - private path: string, - private mimetype: string, - private status: Status, - private rename?: string, - isModifiedInIndex?: boolean - ) { - this.id = FileStatus.typeOf(status) + ':' + path + (rename ? ':' + rename : '') + (isModifiedInIndex ? '$' : ''); - this.pathComponents = path.split('/'); - } - - getPath(): string { - return this.path; - } - - getPathComponents(): string[] { - return this.pathComponents.slice(0); - } - - getMimetype(): string { - return this.mimetype; - } - - getStatus(): Status { - return this.status; - } - - getRename(): string { - return this.rename; - } - - getId(): string { - return this.id; - } - - getType(): StatusType { - switch (FileStatus.typeOf(this.status)) { - case 'index': return StatusType.INDEX; - case 'workingTree': return StatusType.WORKING_TREE; - default: return StatusType.MERGE; - } - } - - clone(): IFileStatus { - return new FileStatus(this.path, this.mimetype, this.status, this.rename); - } - - update(other: FileStatus): void { - this.status = other.getStatus(); - this.rename = other.getRename(); - } - - static typeOf(s: Status): string { - switch (s) { - case Status.INDEX_MODIFIED: - case Status.INDEX_ADDED: - case Status.INDEX_DELETED: - case Status.INDEX_RENAMED: - case Status.INDEX_COPIED: - return 'index'; - - case Status.MODIFIED: - case Status.DELETED: - case Status.UNTRACKED: - case Status.IGNORED: - return 'workingTree'; - - default: - return 'merge'; - } - } -} - -interface IStatusSet { - [path: string]: IFileStatus; -} - -export class StatusGroup extends EventEmitter implements IStatusGroup { - - private type: StatusType; - private statusSet: IStatusSet; - private statusList: IFileStatus[]; - private statusByName: IStatusSet; - private statusByRename: IStatusSet; - - constructor(type: StatusType) { - super(); - - this.type = type; - this.statusSet = Object.create(null); - this.statusList = []; - this.statusByName = Object.create(null); - this.statusByRename = Object.create(null); - } - - getType(): StatusType { - return this.type; - } - - update(statusList: FileStatus[]): void { - const toDelete: IStatusSet = Object.create(null); - - let id: string, path: string, rename: string; - let status: IFileStatus; - - for (id in this.statusSet) { - toDelete[id] = this.statusSet[id]; - } - - for (let i = 0; i < statusList.length; i++) { - status = statusList[i]; - id = status.getId(); - path = status.getPath(); - rename = status.getRename(); - - if (toDelete[id]) { - this.statusSet[id].update(status); - toDelete[id] = null; - - } else { - this.statusSet[id] = status; - } - } - - for (id in toDelete) { - if (status = toDelete[id]) { - this.emit('fileStatus:dispose', status); - delete this.statusSet[id]; - } - } - - this.statusList = []; - this.statusByName = Object.create(null); - this.statusByRename = Object.create(null); - - for (id in this.statusSet) { - status = this.statusSet[id]; - this.statusList.push(status); - - if (status.getRename()) { - this.statusByRename[status.getPath()] = status; - } else { - this.statusByName[status.getPath()] = status; - } - } - } - - all(): IFileStatus[] { - return this.statusList; - } - - find(path: string): IFileStatus { - return this.statusByName[path] || this.statusByRename[path] || null; - } - - dispose(): void { - this.type = null; - this.statusSet = null; - this.statusList = null; - this.statusByName = null; - this.statusByRename = null; - - super.dispose(); - } -} - -export class StatusModel extends EventEmitter implements IStatusModel { - - private indexStatus: StatusGroup; - private workingTreeStatus: StatusGroup; - private mergeStatus: StatusGroup; - private toDispose: IDisposable[]; - - constructor() { - super(); - - this.indexStatus = new StatusGroup(StatusType.INDEX); - this.workingTreeStatus = new StatusGroup(StatusType.WORKING_TREE); - this.mergeStatus = new StatusGroup(StatusType.MERGE); - - this.toDispose = [ - this.addEmitter(this.indexStatus), - this.addEmitter(this.workingTreeStatus), - this.addEmitter(this.mergeStatus) - ]; - } - - getSummary(): IStatusSummary { - return { - hasWorkingTreeChanges: this.getWorkingTreeStatus().all().length > 0, - hasIndexChanges: this.getIndexStatus().all().length > 0, - hasMergeChanges: this.getMergeStatus().all().length > 0 - }; - } - - update(status: IRawFileStatus[]): void { - const index: FileStatus[] = []; - const workingTree: FileStatus[] = []; - const merge: FileStatus[] = []; - - status.forEach(raw => { - switch (raw.x + raw.y) { - case '??': return workingTree.push(new FileStatus(raw.path, raw.mimetype, Status.UNTRACKED)); - case '!!': return workingTree.push(new FileStatus(raw.path, raw.mimetype, Status.IGNORED)); - case 'DD': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.BOTH_DELETED)); - case 'AU': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.ADDED_BY_US)); - case 'UD': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.DELETED_BY_THEM)); - case 'UA': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.ADDED_BY_THEM)); - case 'DU': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.DELETED_BY_US)); - case 'AA': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.BOTH_ADDED)); - case 'UU': return merge.push(new FileStatus(raw.path, raw.mimetype, Status.BOTH_MODIFIED)); - } - - let isModifiedInIndex = false; - - switch (raw.x) { - case 'M': index.push(new FileStatus(raw.path, raw.mimetype, Status.INDEX_MODIFIED)); isModifiedInIndex = true; break; - case 'A': index.push(new FileStatus(raw.path, raw.mimetype, Status.INDEX_ADDED)); break; - case 'D': index.push(new FileStatus(raw.path, raw.mimetype, Status.INDEX_DELETED)); break; - case 'R': index.push(new FileStatus(raw.path, raw.mimetype, Status.INDEX_RENAMED, raw.rename)); break; - case 'C': index.push(new FileStatus(raw.path, raw.mimetype, Status.INDEX_COPIED)); break; - } - - switch (raw.y) { - case 'M': workingTree.push(new FileStatus(raw.path, raw.mimetype, Status.MODIFIED, raw.rename, isModifiedInIndex)); break; - case 'D': workingTree.push(new FileStatus(raw.path, raw.mimetype, Status.DELETED, raw.rename)); break; - } - - return undefined; - }); - - this.indexStatus.update(index); - this.workingTreeStatus.update(workingTree); - this.mergeStatus.update(merge); - - this.emit(ModelEvents.STATUS_MODEL_UPDATED); - } - - getIndexStatus(): IStatusGroup { - return this.indexStatus; - } - - getWorkingTreeStatus(): IStatusGroup { - return this.workingTreeStatus; - } - - getMergeStatus(): IStatusGroup { - return this.mergeStatus; - } - - getGroups(): IStatusGroup[] { - return [this.mergeStatus, this.indexStatus, this.workingTreeStatus]; - } - - find(path: string, type: StatusType): IFileStatus { - switch (type) { - case StatusType.INDEX: - return this.indexStatus.find(path); - case StatusType.WORKING_TREE: - return this.workingTreeStatus.find(path); - case StatusType.MERGE: - return this.mergeStatus.find(path); - default: - return null; - } - } - - dispose(): void { - this.toDispose = dispose(this.toDispose); - - if (this.indexStatus) { - this.indexStatus.dispose(); - this.indexStatus = null; - } - - if (this.workingTreeStatus) { - this.workingTreeStatus.dispose(); - this.workingTreeStatus = null; - } - - if (this.mergeStatus) { - this.mergeStatus.dispose(); - this.mergeStatus = null; - } - - super.dispose(); - } -} - -export class Model extends EventEmitter implements IModel { - - private repositoryRoot: string; - private status: IStatusModel; - private HEAD: IBranch; - private refs: IRef[]; - private remotes: IRemote[]; - private toDispose: IDisposable[]; - - constructor() { - super(); - - this.toDispose = []; - - this.repositoryRoot = null; - this.status = new StatusModel(); - this.toDispose.push(this.addEmitter(this.status)); - - this.HEAD = null; - this.refs = []; - this.remotes = []; - } - - getRepositoryRoot(): string { - return this.repositoryRoot; - } - - getStatus(): IStatusModel { - return this.status; - } - - getHEAD(): IBranch { - return this.HEAD; - } - - getRefs(): IRef[] { - return this.refs; - } - - getRemotes(): IRemote[] { - return this.remotes; - } - - update(status: IRawStatus): void { - if (!status) { - status = { - repositoryRoot: null, - status: [], - HEAD: null, - refs: [], - remotes: [] - }; - } - - this.repositoryRoot = status.repositoryRoot; - this.status.update(status.status); - - this.HEAD = status.HEAD; - this.emit(ModelEvents.HEAD_UPDATED); - - this.refs = status.refs; - this.emit(ModelEvents.REFS_UPDATED); - - this.remotes = status.remotes; - this.emit(ModelEvents.REMOTES_UPDATED); - - this.emit(ModelEvents.MODEL_UPDATED); - } - - getStatusSummary(): IStatusSummary { - const status = this.getStatus(); - - return { - hasWorkingTreeChanges: status.getWorkingTreeStatus().all().length > 0, - hasIndexChanges: status.getIndexStatus().all().length > 0, - hasMergeChanges: status.getMergeStatus().all().length > 0 - }; - } - - getPS1(): string { - if (!this.HEAD) { - return ''; - } - - const tag = this.getRefs().filter(iref => iref.type === RefType.Tag && iref.commit === this.HEAD.commit)[0]; - const tagName = tag && tag.name; - const head = this.HEAD.name || tagName || this.HEAD.commit.substr(0, 8); - - const statusSummary = this.getStatus().getSummary(); - - return format('{0}{1}{2}{3}', - head, - statusSummary.hasWorkingTreeChanges ? '*' : '', - statusSummary.hasIndexChanges ? '+' : '', - statusSummary.hasMergeChanges ? '!' : '' - ); - } - - dispose(): void { - this.toDispose = dispose(this.toDispose); - super.dispose(); - } -} diff --git a/src/vs/workbench/parts/git/common/stageRanges.ts b/src/vs/workbench/parts/git/common/stageRanges.ts deleted file mode 100644 index e4a30f88be3..00000000000 --- a/src/vs/workbench/parts/git/common/stageRanges.ts +++ /dev/null @@ -1,238 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { IChange, IModel, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; -import { Range } from 'vs/editor/common/core/range'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; - -/** - * Represents the selected portion of an IChange, and includes the start/end line numbers of the full change - */ -export class SelectedChange implements IChange { - readonly originalStartLineNumber: number; - readonly originalEndLineNumber: number; - readonly modifiedStartLineNumber: number; - readonly modifiedEndLineNumber: number; - - readonly fullModifiedStartLineNumber: number; - readonly fullModifiedEndLineNumber: number; - - constructor(selected: IChange, full: IChange) { - this.originalStartLineNumber = selected.originalStartLineNumber; - this.originalEndLineNumber = selected.originalEndLineNumber; - this.modifiedStartLineNumber = selected.modifiedStartLineNumber; - this.modifiedEndLineNumber = selected.modifiedEndLineNumber; - - this.fullModifiedStartLineNumber = full.modifiedStartLineNumber; - this.fullModifiedEndLineNumber = full.modifiedEndLineNumber; - } - - /** - * True when the change is entirely selected - */ - get isCompletelySelected(): boolean { - return this.modifiedStartLineNumber === this.fullModifiedStartLineNumber && - this.modifiedEndLineNumber === this.fullModifiedEndLineNumber; - } -} - -function sortChanges(changes: IChange[]): void { - changes.sort((left, right) => { - if (left.originalStartLineNumber < right.originalStartLineNumber) { - return -1; - } else if (left.originalStartLineNumber > right.originalStartLineNumber) { - return 1; - } else if (left.modifiedStartLineNumber < right.modifiedStartLineNumber) { - return -1; - } - return 1; - }); -} - -function sortSelections(selections: Selection[]): void { - selections.sort((left, right) => { - if (left.getStartPosition().lineNumber < right.getStartPosition().lineNumber) { - return -1; - } - return 1; - }); -} - -function isInsertion(change: IChange): boolean { - return change.originalEndLineNumber <= 0; -} - -function isDeletion(change: IChange): boolean { - return change.modifiedEndLineNumber <= 0; -} - - -/** - * Returns an intersection between a change and a selection. - * Returns null if intersection does not exist. - */ -export function intersectChangeAndSelection(change: IChange, selection: Selection) { - var result = { - modifiedStartLineNumber: Math.max(change.modifiedStartLineNumber, selection.startLineNumber), - modifiedEndLineNumber: Math.min(change.modifiedEndLineNumber, selection.endLineNumber), - originalStartLineNumber: change.originalStartLineNumber, - originalEndLineNumber: change.originalEndLineNumber - }; - // Deletions have modifiedEndLineNumber = 0. In that case we can not use the simple check if there is an intersection. - var isDeletionSelected = isDeletion(result) && - (change.modifiedStartLineNumber >= selection.startLineNumber) && (change.modifiedStartLineNumber <= selection.endLineNumber); - - if ((result.modifiedStartLineNumber <= result.modifiedEndLineNumber) || isDeletionSelected) { - return result; - } - return null; -} - -/** - * Returns all selected changes (there can be multiple selections due to multiple cursors). - * If a change is partially selected, the selected part of the change will be returned. - */ -export function getSelectedChanges(changes: IChange[], selections: Selection[]): SelectedChange[] { - sortChanges(changes); - sortSelections(selections); - var result: SelectedChange[] = []; - var currentSelection = 0; - var lastLineAdded = -1; - - for (var i = 0; i < changes.length; ++i) { - // We have to check the previous selection. Since it can contain two changes. - currentSelection = Math.max(0, currentSelection - 1); - // Find all selections that are not after the current change. - while (currentSelection < selections.length && - (selections[currentSelection].startLineNumber <= changes[i].modifiedEndLineNumber || isDeletion(changes[i]))) { - var intersectedChange = intersectChangeAndSelection(changes[i], selections[currentSelection]); - if (intersectedChange !== null) { - // Each change needs to be disjoint so we check if we already added this line. - if (lastLineAdded !== intersectedChange.modifiedStartLineNumber) { - result.push(new SelectedChange(intersectedChange, changes[i])); - lastLineAdded = intersectedChange.modifiedEndLineNumber; - } else { - // Update change such that we do not add same line twice. - intersectedChange.modifiedStartLineNumber++; - if (intersectedChange.modifiedStartLineNumber <= intersectedChange.modifiedEndLineNumber) { - result.push(new SelectedChange(intersectedChange, changes[i])); - lastLineAdded = intersectedChange.modifiedEndLineNumber; - } - } - } - currentSelection++; - } - } - return result; -} - -function appendValueFromRange(base: string, model: IModel, range: Range): string { - var result = base; - if (result !== '') { - result += model.getEOL(); - } - return result + model.getValueInRange(range); -} - -/** - * Applies a list of changes to the original model and returns the new IModel. - * First sorts changes by line number. - */ -export function applyChangesToModel(original: IModel, modified: IModel, changes: IChange[]): string { - sortChanges(changes); - var result = ''; - var positionInOriginal = 1; - - for (var i = 0; i < changes.length; ++i) { - // We have to update orginalStartLineNumber for insertions, their start line is always one line behind. - var originalStartLineUpdated = isInsertion(changes[i]) ? changes[i].originalStartLineNumber + 1 : changes[i].originalStartLineNumber; - if (positionInOriginal < originalStartLineUpdated) { - result = appendValueFromRange(result, original, - new Range(positionInOriginal, 1, originalStartLineUpdated - 1, original.getLineMaxColumn(originalStartLineUpdated - 1))); - positionInOriginal = originalStartLineUpdated; - } - - if (!isDeletion(changes[i])) { - result = appendValueFromRange(result, modified, - new Range(changes[i].modifiedStartLineNumber, 1, changes[i].modifiedEndLineNumber, modified.getLineMaxColumn(changes[i].modifiedEndLineNumber))); - } - // Update position in the original file where we continue to concatanate. - // Only update position if it was not an insertion. - if (!isInsertion(changes[i])) { - positionInOriginal = changes[i].originalEndLineNumber + 1; - } - } - - // Append the last chunk after all the changes. - if (positionInOriginal <= original.getLineCount()) { - result = appendValueFromRange(result, original, - new Range(positionInOriginal, 1, original.getLineCount(), original.getLineMaxColumn(original.getLineCount()))); - } - - return result; -} - -export function getChangeRevertEdits(original: IModel, modified: IModel, changes: SelectedChange[]): IIdentifiedSingleEditOperation[] { - sortChanges(changes); - - const getDeleteOperation = (change: IChange) => { - const fullRange = getLinesRangeWithOneSurroundingNewline(modified, change.modifiedStartLineNumber, change.modifiedEndLineNumber); - return EditOperation.delete(fullRange); - }; - - return changes.map((change, i) => { - if (isInsertion(change)) { - // Delete inserted range - return getDeleteOperation(change); - } else if (isDeletion(change)) { - // Get the original lines and insert at the deleted position - const value = original.getValueInRange(getLinesRangeWithOneSurroundingNewline(original, change.originalStartLineNumber, change.originalEndLineNumber)); - return EditOperation.insert(new Position(change.modifiedStartLineNumber + 1, 1), value); - } else if (change.isCompletelySelected) { - // If the entire change is selected, then revert the whole thing. - const value = original.getValueInRange(new Range(change.originalStartLineNumber, 1, change.originalEndLineNumber + 1, 1)); - return EditOperation.replace(new Range(change.modifiedStartLineNumber, 1, change.modifiedEndLineNumber + 1, 1), value); - } else { - // If only a portion is selected, replace with the matching lines - e.g. if lines 2-4 are selected, replace with lines 2-4 from the original model (if they exist) - const copyOffset = change.modifiedStartLineNumber - change.fullModifiedStartLineNumber; - const numLinesToCopy = change.modifiedEndLineNumber - change.modifiedStartLineNumber; - const copyStartLine = change.originalStartLineNumber + copyOffset; - const copyEndLine = Math.min(copyStartLine + numLinesToCopy, original.getLineCount()); - if (copyStartLine > copyEndLine) { - return getDeleteOperation(change); - } - - // Compute the range to copy, and intersect with the full original range to validate - const originalRange = new Range(change.originalStartLineNumber, 1, change.originalEndLineNumber, original.getLineMaxColumn(change.originalEndLineNumber)); - const rangeToCopy = originalRange.intersectRanges( - new Range(copyStartLine, 1, copyEndLine, original.getLineMaxColumn(copyEndLine))); - - // No intersection, so delete the added text - if (!rangeToCopy) { - return getDeleteOperation(change); - } - - const value = original.getValueInRange(rangeToCopy); - return EditOperation.replace(new Range(change.modifiedStartLineNumber, 1, change.modifiedEndLineNumber, modified.getLineMaxColumn(change.modifiedEndLineNumber)), value); - } - }); -} - -function getLinesRangeWithOneSurroundingNewline(model: IModel, startLine: number, endLine: number): Range { - let startColumn = 1; - let endColumn = model.getLineMaxColumn(endLine); - if (endLine < model.getLineCount()) { - endLine++; - endColumn = 1; - } else if (startLine > 1) { - startLine--; - startColumn = model.getLineMaxColumn(startLine); - } - - return new Range(startLine, startColumn, endLine, endColumn); -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/electron-browser/electronGitService.ts b/src/vs/workbench/parts/git/electron-browser/electronGitService.ts deleted file mode 100644 index 3f6390c51ca..00000000000 --- a/src/vs/workbench/parts/git/electron-browser/electronGitService.ts +++ /dev/null @@ -1,235 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { TPromise } from 'vs/base/common/winjs.base'; -import { IRawGitService, RawServiceState, IGitConfiguration } from 'vs/workbench/parts/git/common/git'; -import { UnscopedGitService } from 'vs/workbench/parts/git/node/unscopedGitService'; -import { GitService } from 'vs/workbench/parts/git/browser/gitServices'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { getDelayedChannel, getNextTickChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Client } from 'vs/base/parts/ipc/node/ipc.cp'; -import { GitChannelClient, UnavailableGitChannel } from 'vs/workbench/parts/git/common/gitIpc'; -import { RawGitService, DelayedRawGitService } from 'vs/workbench/parts/git/node/rawGitService'; -import URI from 'vs/base/common/uri'; -import { spawn, exec } from 'child_process'; -import { join } from 'path'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { readdir } from 'vs/base/node/pfs'; -import { IFileService } from 'vs/platform/files/common/files'; - -interface IGit { - path: string; - version: string; -} - -function parseVersion(raw: string): string { - return raw.replace(/^git version /, ''); -} - -function findSpecificGit(path: string): TPromise { - return new TPromise((c, e) => { - const buffers: Buffer[] = []; - const child = spawn(path, ['--version']); - child.stdout.on('data', b => buffers.push(b as Buffer)); - child.on('error', e); - child.on('exit', code => code ? e(new Error('Not found')) : c({ path, version: parseVersion(Buffer.concat(buffers).toString('utf8').trim()) })); - }); -} - -function findGitDarwin(): TPromise { - return new TPromise((c, e) => { - exec('which git', (err, gitPathBuffer) => { - if (err) { - return e('git not found'); - } - - const path = gitPathBuffer.toString().replace(/^\s+|\s+$/g, ''); - - function getVersion(path: string) { - // make sure git executes - exec('git --version', (err, stdout: Buffer) => { - if (err) { - return e('git not found'); - } - - return c({ path, version: parseVersion(stdout.toString('utf8').trim()) }); - }); - } - - if (path !== '/usr/bin/git') { - return getVersion(path); - } - - // must check if XCode is installed - exec('xcode-select -p', (err: any) => { - if (err && err.code === 2) { - // git is not installed, and launching /usr/bin/git - // will prompt the user to install it - - return e('git not found'); - } - - getVersion(path); - }); - }); - }); -} - -function findSystemGitWin32(base: string): TPromise { - if (!base) { - return TPromise.wrapError('Not found'); - } - - return findSpecificGit(join(base, 'Git', 'cmd', 'git.exe')); -} - -function findGitHubGitWin32(): TPromise { - const github = join(process.env['LOCALAPPDATA'], 'GitHub'); - - return readdir(github).then(children => { - const git = children.filter(child => /^PortableGit/.test(child))[0]; - - if (!git) { - return TPromise.wrapError('Not found'); - } - - return findSpecificGit(join(github, git, 'cmd', 'git.exe')); - }); -} - -function findGitWin32(): TPromise { - return findSystemGitWin32(process.env['ProgramW6432']) - .then(null, () => findSystemGitWin32(process.env['ProgramFiles(x86)'])) - .then(null, () => findSystemGitWin32(process.env['ProgramFiles'])) - .then(null, () => findSpecificGit('git')) - .then(null, () => findGitHubGitWin32()); -} - -function findGit(hint: string): TPromise { - var first = hint ? findSpecificGit(hint) : TPromise.wrapError(null); - - return first.then(null, () => { - switch (process.platform) { - case 'darwin': return findGitDarwin(); - case 'win32': return findGitWin32(); - default: return findSpecificGit('git'); - } - }); -} - -class DisabledRawGitService extends RawGitService { - constructor() { - super(null); - } - - serviceState(): TPromise { - return TPromise.as(RawServiceState.Disabled); - } -} - -function createRemoteRawGitService(gitPath: string, execPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService { - const promise = TPromise.timeout(0) // free event loop cos finding git costs - .then(() => findGit(gitPath)) - .then(({ path, version }) => { - const client = new Client( - URI.parse(require.toUrl('bootstrap')).fsPath, - { - serverName: 'Git', - timeout: 1000 * 60, - args: [path, workspaceRoot, encoding, execPath, version], - env: { - ELECTRON_RUN_AS_NODE: 1, - PIPE_LOGGING: 'true', - AMD_ENTRYPOINT: 'vs/workbench/parts/git/node/gitApp', - VERBOSE_LOGGING: String(verbose) - } - } - ); - - return client.getChannel('git'); - }) - .then(null, () => new UnavailableGitChannel()); - - const channel = getNextTickChannel(getDelayedChannel(promise)); - return new GitChannelClient(channel); -} - -interface IRawGitServiceBootstrap { - createRawGitService(gitPath: string, workspaceRoot: string, defaultEncoding: string, exePath: string, version: string): TPromise; -} - -function createRawGitService(gitPath: string, execPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService { - const requirePromise = new TPromise((c, e) => { - return require(['vs/workbench/parts/git/node/rawGitServiceBootstrap'], c, e); - }); - - const servicePromise = requirePromise.then(({ createRawGitService }) => { - return findGit(gitPath) - .then(({ path, version }) => createRawGitService(path, workspaceRoot, encoding, execPath, version)) - .then(null, () => new RawGitService(null)); - }); - - return new DelayedRawGitService(servicePromise); -} - -function createUnscopedRawGitService(gitPath: string, execPath: string, encoding: string): IRawGitService { - const promise = findGit(gitPath) - .then(({ path, version }) => new UnscopedGitService(path, version, encoding, execPath)) - .then(null, () => new RawGitService(null)); - - return new DelayedRawGitService(promise); -} - -export class ElectronGitService extends GitService { - - private static USE_REMOTE_PROCESS_SERVICE = true; - - constructor( - @IInstantiationService instantiationService: IInstantiationService, - @IFileService fileService: IFileService, - @IMessageService messageService: IMessageService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @IOutputService outputService: IOutputService, - @ITextFileService textFileService: ITextFileService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @ILifecycleService lifecycleService: ILifecycleService, - @IStorageService storageService: IStorageService, - @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationService configurationService: IConfigurationService - ) { - const conf = configurationService.getConfiguration('git'); - const filesConf = configurationService.getConfiguration('files'); - const workspace = contextService.getWorkspace(); - const gitPath = conf.path || null; - const encoding = (filesConf && filesConf.encoding) || 'utf8'; - const verbose = !environmentService.isBuilt || environmentService.verbose; - - let raw: IRawGitService; - - if (!conf.enabled) { - raw = new DisabledRawGitService(); - } else if (!workspace) { - raw = createUnscopedRawGitService(gitPath, environmentService.execPath, encoding); - } else { - const workspaceRoot = workspace.resource.fsPath; - - if (ElectronGitService.USE_REMOTE_PROCESS_SERVICE) { - raw = createRemoteRawGitService(gitPath, environmentService.execPath, workspaceRoot, encoding, verbose); - } else { - raw = createRawGitService(gitPath, environmentService.execPath, workspaceRoot, encoding, verbose); - } - } - - super(raw, instantiationService, fileService, messageService, editorService, outputService, textFileService, contextService, lifecycleService, storageService, configurationService); - } -} diff --git a/src/vs/workbench/parts/git/electron-browser/git.contribution.ts b/src/vs/workbench/parts/git/electron-browser/git.contribution.ts deleted file mode 100644 index 93c3bdb17f3..00000000000 --- a/src/vs/workbench/parts/git/electron-browser/git.contribution.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { localize } from 'vs/nls'; -import { registerContributions } from 'vs/workbench/parts/git/browser/gitWorkbenchContributions'; -import { ElectronGitService } from 'vs/workbench/parts/git/electron-browser/electronGitService'; -import { IGitService } from 'vs/workbench/parts/git/common/git'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { Registry } from 'vs/platform/platform'; -import { CloneAction } from './gitActions'; -import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actionRegistry'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; -import { ToggleViewletAction } from 'vs/workbench/browser/viewlet'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; - -// TODO@joao: remove -class OpenScmViewletAction extends ToggleViewletAction { - - static ID = 'workbench.view.git'; // fake redirect - static LABEL = localize('toggleSCMViewlet', "Show SCM"); - - constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { - super(id, label, 'workbench.view.scm', viewletService, editorService); - } -} - -if (SCMPreview.enabled) { - Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(OpenScmViewletAction, OpenScmViewletAction.ID, OpenScmViewletAction.LABEL), 'View: Show SCM', 'View'); -} else { - registerContributions(); - - // Register Service - registerSingleton(IGitService, ElectronGitService); - - const category = localize('git', "Git"); - - Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(CloneAction, CloneAction.ID, CloneAction.LABEL), 'Git: Clone', category); -} diff --git a/src/vs/workbench/parts/git/electron-browser/gitActions.ts b/src/vs/workbench/parts/git/electron-browser/gitActions.ts deleted file mode 100644 index b168acb47bd..00000000000 --- a/src/vs/workbench/parts/git/electron-browser/gitActions.ts +++ /dev/null @@ -1,92 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { localize } from 'vs/nls'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { always } from 'vs/base/common/async'; -import { Action } from 'vs/base/common/actions'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import Severity from 'vs/base/common/severity'; -import { IGitService } from 'vs/workbench/parts/git/common/git'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import * as url from 'url'; -import { remote } from 'electron'; -import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { isPromiseCanceledError } from 'vs/base/common/errors'; - -const dialog = remote.dialog; - -export class CloneAction extends Action { - - static ID = 'workbench.action.git.clone'; - static LABEL = 'Clone'; - - constructor(id: string, label: string, - @IGitService private gitService: IGitService, - @IQuickOpenService private quickOpenService: IQuickOpenService, - @IMessageService private messageService: IMessageService, - @IWindowsService private windowsService: IWindowsService, - @ITelemetryService private telemetryService: ITelemetryService, - @IWorkspaceContextService private workspaceService: IWorkspaceContextService - ) { - super(id, label); - } - - run(event?: any, data?: ITelemetryData): TPromise { - return this.quickOpenService.input({ - prompt: localize('valid', "Provide a valid git repository URL"), - placeHolder: localize('url', "Repository URL"), - validateInput: input => { - const parsedUrl = url.parse(input); - - if (!parsedUrl.protocol || !parsedUrl.host) { - return TPromise.as(localize('valid', "Provide a valid git repository URL")); - } - - return TPromise.as(''); - } - }) - .then(url => { - if (!url) { - this.telemetryService.publicLog('gitClone', { ...data, outcome: 'no_URL' }); - return TPromise.as(null); - } - - const result = dialog.showOpenDialog(remote.getCurrentWindow(), { - title: localize('directory', "Destination clone directory"), - properties: ['openDirectory', 'createDirectory'] - }); - - if (!result || result.length === 0) { - this.telemetryService.publicLog('gitClone', { ...data, outcome: 'no_directory' }); - return TPromise.as(null); - } - - const promise = TPromise.timeout(200) - .then(() => this.messageService.show(Severity.Info, localize('cloning', "Cloning repository '{0}'...", url))) - .then(close => new TPromise(() => null, close)); - - const clone = always(this.gitService.clone(url, result[0]), () => promise.cancel()); - - return clone.then(path => { - this.telemetryService.publicLog('gitClone', { ...data, outcome: 'success' }); - const forceNewWindow = this.workspaceService.hasWorkspace(); - return this.windowsService.openWindow([path], { forceNewWindow, forceReuseWindow: !forceNewWindow }); - - }).then(null, e => { - if (/already exists and is not an empty directory/.test(e.stderr || '')) { - this.telemetryService.publicLog('gitClone', { ...data, outcome: 'directory_not_empty' }); - return TPromise.wrapError(localize('already exists', "Destination repository already exists, please pick another directory to clone to.")); - } - - this.telemetryService.publicLog('gitClone', { ...data, outcome: isPromiseCanceledError(e) ? 'canceled' : 'error' }); - return TPromise.wrapError(e); - }); - }); - } -} diff --git a/src/vs/workbench/parts/git/electron-main/askpassService.ts b/src/vs/workbench/parts/git/electron-main/askpassService.ts deleted file mode 100644 index dbe43c01379..00000000000 --- a/src/vs/workbench/parts/git/electron-main/askpassService.ts +++ /dev/null @@ -1,75 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as nls from 'vs/nls'; -import { ipcMain as ipc, BrowserWindow } from 'electron'; -import platform = require('vs/base/common/platform'); -import { TPromise } from 'vs/base/common/winjs.base'; -import { IAskpassService } from 'vs/workbench/parts/git/common/git'; - -export interface ICredentials { - username: string; - password: string; -} - -interface ICredentialsResult { - id: number; - credentials: ICredentials; -} - -interface IContext { - credentials: ICredentials; - window: Electron.BrowserWindow; -} - -export class GitAskpassService implements IAskpassService { - - private askpassCache: { [id: string]: IContext } = Object.create(null); - - constructor() { - ipc.on('git:askpass', (event, result: ICredentialsResult) => { - this.askpassCache[result.id].credentials = result.credentials; - }); - } - - public askpass(id: string, host: string, command: string): TPromise { - return new TPromise((c, e) => { - let cachedResult = this.askpassCache[id]; - - if (typeof cachedResult !== 'undefined') { - return c(cachedResult.credentials); - } - - if (command === 'fetch') { - return c({ username: '', password: '' }); - } - - let win = new BrowserWindow({ - alwaysOnTop: true, - skipTaskbar: true, - resizable: false, - width: 450, - height: platform.isWindows ? 280 : 260, - show: true, - title: nls.localize('git', "Git") - }); - - win.setMenuBarVisibility(false); - - this.askpassCache[id] = { - window: win, - credentials: null - }; - - win.loadURL(require.toUrl('vs/workbench/parts/git/electron-main/index.html')); - win.webContents.executeJavaScript('init(' + JSON.stringify({ id, host, command }) + ')'); - - win.once('closed', () => { - c(this.askpassCache[id].credentials); - setTimeout(() => delete this.askpassCache[id], 1000 * 10); - }); - }); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/electron-main/git.svg b/src/vs/workbench/parts/git/electron-main/git.svg deleted file mode 100644 index dfd62bc16c6..00000000000 --- a/src/vs/workbench/parts/git/electron-main/git.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/vs/workbench/parts/git/electron-main/index.html b/src/vs/workbench/parts/git/electron-main/index.html deleted file mode 100644 index 3ae54ce146c..00000000000 --- a/src/vs/workbench/parts/git/electron-main/index.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - -

Authentication Required

-
-

-
-

-

-

- - -

-
-
- -
- - diff --git a/src/vs/workbench/parts/git/node/askpass.sh b/src/vs/workbench/parts/git/node/askpass.sh deleted file mode 100755 index 2f30f91ef9a..00000000000 --- a/src/vs/workbench/parts/git/node/askpass.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -VSCODE_GIT_ASKPASS_PIPE=`mktemp` -AMD_ENTRYPOINT="$VSCODE_GIT_ASKPASS_MODULE_ID" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_BOOTSTRAP" $* -cat $VSCODE_GIT_ASKPASS_PIPE -rm $VSCODE_GIT_ASKPASS_PIPE \ No newline at end of file diff --git a/src/vs/workbench/parts/git/node/askpass.ts b/src/vs/workbench/parts/git/node/askpass.ts deleted file mode 100644 index f2b45f8f1b6..00000000000 --- a/src/vs/workbench/parts/git/node/askpass.ts +++ /dev/null @@ -1,58 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { connect } from 'vs/base/parts/ipc/node/ipc.net'; -import { IAskpassChannel, AskpassChannelClient } from 'vs/workbench/parts/git/common/gitIpc'; -import * as fs from 'fs'; - -function fatal(err: any): void { - console.error(err); - process.exit(1); -} - -function main(argv: string[]): void { - if (argv.length !== 5) { - return fatal('Wrong number of arguments'); - } - - if (!process.env['VSCODE_IPC_HOOK']) { - return fatal('Missing ipc hook'); - } - - if (!process.env['VSCODE_GIT_REQUEST_ID']) { - return fatal('Missing git id'); - } - - if (!process.env['VSCODE_GIT_ASKPASS_PIPE']) { - return fatal('Missing pipe'); - } - - var id = process.env['VSCODE_GIT_REQUEST_ID']; - var output = process.env['VSCODE_GIT_ASKPASS_PIPE']; - var request = argv[2]; - var host = argv[4].substring(1, argv[4].length - 2); - - connect(process.env['VSCODE_IPC_HOOK'], 'askpass') - .then(client => { - const channel = client.getChannel('askpass'); - const service = new AskpassChannelClient(channel); - - return service.askpass(id, host, process.env['MONACO_GIT_COMMAND']).then(result => { - if (result) { - fs.writeFileSync(output, (/^Username$/i.test(request) ? result.username : result.password) + '\n'); - } - - return client; - }); - }) - .done(c => { - c.dispose(); - setTimeout(() => process.exit(0), 0); - }); -} - -main(process.argv); diff --git a/src/vs/workbench/parts/git/node/git.lib.ts b/src/vs/workbench/parts/git/node/git.lib.ts deleted file mode 100644 index 98fdbd0c5d4..00000000000 --- a/src/vs/workbench/parts/git/node/git.lib.ts +++ /dev/null @@ -1,735 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as os from 'os'; -import * as path from 'path'; -import { Promise, TPromise } from 'vs/base/common/winjs.base'; -import * as pfs from 'vs/base/node/pfs'; -import { guessMimeTypes, isBinaryMime } from 'vs/base/common/mime'; -import { IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle'; -import { assign } from 'vs/base/common/objects'; -import { sequence } from 'vs/base/common/async'; -import { v4 as UUIDv4 } from 'vs/base/common/uuid'; -import { localize } from 'vs/nls'; -import { uniqueFilter, index } from 'vs/base/common/arrays'; -import { IRawFileStatus, RefType, IRef, IBranch, IRemote, GitErrorCodes, IPushOptions } from 'vs/workbench/parts/git/common/git'; -import { detectMimesFromStream } from 'vs/base/node/mime'; -import { IFileOperationResult, FileOperationResult } from 'vs/platform/files/common/files'; -import { spawn, ChildProcess } from 'child_process'; -import { decode, encodingExists } from 'vs/base/node/encoding'; - -export interface IExecutionResult { - exitCode: number; - stdout: string; - stderr: string; -} - -function exec(child: ChildProcess, encoding = 'utf8'): TPromise { - const disposables: IDisposable[] = []; - - const once = (ee: NodeJS.EventEmitter, name: string, fn: Function) => { - ee.once(name, fn); - disposables.push(toDisposable(() => ee.removeListener(name, fn))); - }; - - const on = (ee: NodeJS.EventEmitter, name: string, fn: Function) => { - ee.on(name, fn); - disposables.push(toDisposable(() => ee.removeListener(name, fn))); - }; - - return TPromise.join([ - new TPromise((c, e) => { - once(child, 'error', e); - once(child, 'exit', c); - }), - new TPromise(c => { - let buffers: Buffer[] = []; - on(child.stdout, 'data', b => buffers.push(b)); - once(child.stdout, 'close', () => c(decode(Buffer.concat(buffers), encoding))); - }), - new TPromise(c => { - let buffers: Buffer[] = []; - on(child.stderr, 'data', b => buffers.push(b)); - once(child.stderr, 'close', () => c(decode(Buffer.concat(buffers), encoding))); - }) - ]).then(values => { - dispose(disposables); - - return { - exitCode: values[0], - stdout: values[1], - stderr: values[2] - }; - }); -} - -export interface IGitErrorData { - error?: Error; - message?: string; - stdout?: string; - stderr?: string; - exitCode?: number; - gitErrorCode?: string; - gitCommand?: string; -} - -export class GitError { - - error: Error; - message: string; - stdout: string; - stderr: string; - exitCode: number; - gitErrorCode: string; - gitCommand: string; - - constructor(data: IGitErrorData) { - if (data.error) { - this.error = data.error; - this.message = data.error.message; - } else { - this.error = null; - } - - this.message = this.message || data.message || 'Git error'; - this.stdout = data.stdout || null; - this.stderr = data.stderr || null; - this.exitCode = data.exitCode || null; - this.gitErrorCode = data.gitErrorCode || null; - this.gitCommand = data.gitCommand || null; - } - - toString(): string { - let result = this.message + ' ' + JSON.stringify({ - exitCode: this.exitCode, - gitErrorCode: this.gitErrorCode, - gitCommand: this.gitCommand, - stdout: this.stdout, - stderr: this.stderr - }, null, 2); - - if (this.error) { - result += (this.error).stack; - } - - return result; - } -} - -export interface IGitOptions { - gitPath: string; - version: string; - defaultEncoding?: string; - env?: any; -} - -export class Git { - - private gitPath: string; - private _version: string; - private env: any; - private defaultEncoding: string; - private outputListeners: { (output: string): void; }[]; - - constructor(options: IGitOptions) { - this.gitPath = options.gitPath; - this._version = options.version; - - const encoding = options.defaultEncoding || 'utf8'; - this.defaultEncoding = encodingExists(encoding) ? encoding : 'utf8'; - - this.env = options.env || {}; - this.outputListeners = []; - } - - get version(): string { - return this._version; - } - - run(cwd: string, args: string[], options: any = {}): TPromise { - options = assign({ cwd: cwd }, options || {}); - return this.exec(args, options); - } - - stream(cwd: string, args: string[], options: any = {}): ChildProcess { - options = assign({ cwd: cwd }, options || {}); - return this.spawn(args, options); - } - - open(repository: string, env: any = {}): Repository { - return new Repository(this, repository, this.defaultEncoding, env); - } - - clone(url: string, parentPath: string): TPromise { - const folderName = url.replace(/^.*\//, '').replace(/\.git$/, '') || 'repository'; - const folderPath = path.join(parentPath, folderName); - - return this.exec(['clone', url, folderPath]) - .then(() => folderPath); - } - - config(name: string, value: string): Promise { - return this.exec(['config', '--global', name, value]); - } - - private exec(args: string[], options: any = {}): TPromise { - const child = this.spawn(args, options); - - if (options.input) { - child.stdin.end(options.input, 'utf8'); - } - - return exec(child).then(result => { - if (result.exitCode) { - let gitErrorCode: string = null; - - if (/Authentication failed/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.AuthenticationFailed; - } else if (/Not a git repository/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.NotAGitRepository; - } else if (/bad config file/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.BadConfigFile; - } else if (/cannot make pipe for command substitution|cannot create standard input pipe/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.CantCreatePipe; - } else if (/Repository not found/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.RepositoryNotFound; - } else if (/unable to access/.test(result.stderr)) { - gitErrorCode = GitErrorCodes.CantAccessRemote; - } - - if (options.log !== false) { - this.log(result.stderr); - } - - return TPromise.wrapError(new GitError({ - message: 'Failed to execute git', - stdout: result.stdout, - stderr: result.stderr, - exitCode: result.exitCode, - gitErrorCode, - gitCommand: args[0] - })); - } - - return result; - }); - } - - spawn(args: string[], options: any = {}): ChildProcess { - if (!this.gitPath) { - throw new Error('git could not be found in the system.'); - } - - if (!options) { - options = {}; - } - - if (!options.stdio && !options.input) { - options.stdio = ['ignore', null, null]; // Unless provided, ignore stdin and leave default streams for stdout and stderr - } - - options.env = assign({}, options.env || {}, this.env, { - LANG: 'en_US.UTF-8', - VSCODE_GIT_REQUEST_ID: UUIDv4().asHex(), - MONACO_GIT_COMMAND: args[0] - }); - - if (options.log !== false) { - this.log(`git ${args.join(' ')}\n`); - } - - return spawn(this.gitPath, args, options); - } - - onOutput(listener: (output: string) => void): () => void { - this.outputListeners.push(listener); - return () => this.outputListeners.splice(this.outputListeners.indexOf(listener), 1); - } - - private log(output: string): void { - this.outputListeners.forEach(l => l(output)); - } -} - -export interface ICommit { - hash: string; - message: string; -} - -export class Repository { - - constructor( - private _git: Git, - private repository: string, - private defaultEncoding: string, - private env: any = {} - ) { } - - get git(): Git { - return this._git; - } - - get path(): string { - return this.repository; - } - - run(args: string[], options: any = {}): TPromise { - options.env = assign({}, options.env || {}); - options.env = assign(options.env, this.env); - - return this.git.run(this.repository, args, options); - } - - stream(args: string[], options: any = {}): ChildProcess { - options.env = assign({}, options.env || {}); - options.env = assign(options.env, this.env); - - return this.git.stream(this.repository, args, options); - } - - spawn(args: string[], options: any = {}): ChildProcess { - options.env = assign({}, options.env || {}); - options.env = assign(options.env, this.env); - - return this.git.spawn(args, options); - } - - init(): Promise { - return this.run(['init']); - } - - config(scope: string, key: string, value: any, options: any): TPromise { - const args = ['config']; - - if (scope) { - args.push('--' + scope); - } - - args.push(key); - - if (value) { - args.push(value); - } - - return this.run(args, options).then((result) => result.stdout); - } - - show(object: string): ChildProcess { - return this.stream(['show', object]); - } - - buffer(object: string): TPromise { - const child = this.show(object); - - if (!child.stdout) { - return TPromise.wrapError(localize('errorBuffer', "Can't open file from git")); - } - - return detectMimesFromStream(child.stdout, null).then(result => { - return isBinaryMime(result.mimes) ? - TPromise.wrapError({ - message: localize('fileBinaryError', "File seems to be binary and cannot be opened as text"), - fileOperationResult: FileOperationResult.FILE_IS_BINARY - }) : - this.doBuffer(object); - }); - } - - private doBuffer(object: string): TPromise { - const child = this.show(object); - - return exec(child, this.defaultEncoding).then(({ exitCode, stdout }) => { - if (exitCode) { - return TPromise.wrapError(new GitError({ - message: 'Could not buffer object.', - exitCode - })); - } - - return TPromise.as(stdout); - }); - } - - add(paths: string[]): Promise { - const args = ['add', '-A', '--']; - - if (paths && paths.length) { - args.push.apply(args, paths); - } else { - args.push('.'); - } - - return this.run(args); - } - - stage(path: string, data: string): Promise { - const child = this.stream(['hash-object', '--stdin', '-w'], { stdio: [null, null, null] }); - child.stdin.end(data, 'utf8'); - - return exec(child).then(({ exitCode, stdout }) => { - if (exitCode) { - return TPromise.wrapError(new GitError({ - message: 'Could not hash object.', - exitCode: exitCode - })); - } - - return this.run(['update-index', '--cacheinfo', '100644', stdout, path]); - }); - } - - checkout(treeish: string, paths: string[]): Promise { - const args = ['checkout', '-q']; - - if (treeish) { - args.push(treeish); - } - - if (paths && paths.length) { - args.push('--'); - args.push.apply(args, paths); - } - - return this.run(args).then(null, (err: GitError) => { - if (/Please, commit your changes or stash them/.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.DirtyWorkTree; - } - - return Promise.wrapError(err); - }); - } - - commit(message: string, all: boolean, amend: boolean, signoff: boolean): Promise { - const args = ['commit', '--quiet', '--allow-empty-message', '--file', '-']; - - if (all) { - args.push('--all'); - } - - if (amend) { - args.push('--amend'); - } - - if (signoff) { - args.push('--signoff'); - } - - return this.run(args, { input: message || '' }).then(null, (commitErr: GitError) => { - if (/not possible because you have unmerged files/.test(commitErr.stderr)) { - commitErr.gitErrorCode = GitErrorCodes.UnmergedChanges; - return Promise.wrapError(commitErr); - } - - return this.run(['config', '--get-all', 'user.name']).then(null, (err: GitError) => { - err.gitErrorCode = GitErrorCodes.NoUserNameConfigured; - return Promise.wrapError(err); - }).then(() => { - return this.run(['config', '--get-all', 'user.email']).then(null, (err: GitError) => { - err.gitErrorCode = GitErrorCodes.NoUserEmailConfigured; - return Promise.wrapError(err); - }).then(() => { - return Promise.wrapError(commitErr); - }); - }); - }); - } - - branch(name: string, checkout: boolean): Promise { - const args = checkout ? ['checkout', '-q', '-b', name] : ['branch', '-q', name]; - return this.run(args); - } - - clean(paths: string[]): Promise { - const byDirname = index(paths, p => path.dirname(p), (p, r) => (r || []).concat([p])); - const groups = Object.keys(byDirname).map(key => byDirname[key]); - const tasks = groups.map(group => () => this.run(['clean', '-f', '-q', '--'].concat(group))); - - return sequence(tasks); - } - - undo(): Promise { - return this.run(['clean', '-fd']).then(() => { - return this.run(['checkout', '--', '.']).then(null, (err: GitError) => { - if (/did not match any file\(s\) known to git\./.test(err.stderr)) { - return TPromise.as(null); - } - - return Promise.wrapError(err); - }); - }); - } - - reset(treeish: string, hard: boolean = false): Promise { - const args = ['reset']; - - if (hard) { - args.push('--hard'); - } - - args.push(treeish); - - return this.run(args); - } - - revertFiles(treeish: string, paths: string[]): Promise { - return this.run(['branch']).then((result) => { - let args: string[]; - - // In case there are no branches, we must use rm --cached - if (!result.stdout) { - args = ['rm', '--cached', '-r', '--']; - } else { - args = ['reset', '-q', treeish, '--']; - } - - if (paths && paths.length) { - args.push.apply(args, paths); - } else { - args.push('.'); - } - - return this.run(args).then(null, (err: GitError) => { - // In case there are merge conflicts to be resolved, git reset will output - // some "needs merge" data. We try to get around that. - if (/([^:]+: needs merge\n)+/m.test(err.stdout)) { - return TPromise.as(null); - } - - return Promise.wrapError(err); - }); - }); - } - - fetch(): Promise { - return this.run(['fetch']).then(null, (err: GitError) => { - if (/No remote repository specified\./.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.NoRemoteRepositorySpecified; - } else if (/Could not read from remote repository/.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.RemoteConnectionError; - } - - return Promise.wrapError(err); - }); - } - - pull(rebase?: boolean): Promise { - const args = ['pull']; - if (rebase) { args.push('-r'); } - - return this.run(args).then(null, (err: GitError) => { - if (/^CONFLICT \([^)]+\): \b/m.test(err.stdout)) { - err.gitErrorCode = GitErrorCodes.Conflict; - } else if (/Please tell me who you are\./.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.NoUserNameConfigured; - } else if (/Could not read from remote repository/.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.RemoteConnectionError; - } else if (/Pull is not possible because you have unmerged files|Cannot pull with rebase: You have unstaged changes|Your local changes to the following files would be overwritten|Please, commit your changes before you can merge/.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.DirtyWorkTree; - } - - return Promise.wrapError(err); - }); - } - - push(remote?: string, name?: string, options?: IPushOptions): Promise { - const args = ['push']; - if (options && options.setUpstream) { args.push('-u'); } - if (remote) { args.push(remote); } - if (name) { args.push(name); } - - return this.run(args).then(null, (err: GitError) => { - if (/^error: failed to push some refs to\b/m.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.PushRejected; - } else if (/Could not read from remote repository/.test(err.stderr)) { - err.gitErrorCode = GitErrorCodes.RemoteConnectionError; - } - - return Promise.wrapError(err); - }); - } - - sync(): Promise { - return this.pull().then(() => this.push()); - } - - getRoot(): TPromise { - return this.run(['rev-parse', '--show-toplevel'], { log: false }).then(result => result.stdout.trim()); - } - - getStatus(): TPromise { - return this.run(['status', '-z', '-u'], { log: false }).then((executionResult) => { - const status = executionResult.stdout; - const result: IRawFileStatus[] = []; - let current: IRawFileStatus; - let i = 0; - - function readName(): string { - const start = i; - let c: string; - while ((c = status.charAt(i)) !== '\u0000') { i++; } - return status.substring(start, i++); - } - - while (i < status.length) { - current = { - x: status.charAt(i++), - y: status.charAt(i++), - path: null, - mimetype: null - }; - - i++; - - if (current.x === 'R') { - current.rename = readName(); - } - - current.path = readName(); - current.mimetype = guessMimeTypes(current.path)[0]; - - // If path ends with slash, it must be a nested git repo - if (current.path[current.path.length - 1] === '/') { - continue; - } - - result.push(current); - } - - return TPromise.as(result); - }); - } - - getHEAD(): TPromise { - return this.run(['symbolic-ref', '--short', 'HEAD'], { log: false }).then((result) => { - if (!result.stdout) { - return TPromise.wrapError(new Error('Not in a branch')); - } - - return TPromise.as({ name: result.stdout.trim(), commit: void 0, type: RefType.Head }); - }, (err) => { - return this.run(['rev-parse', 'HEAD'], { log: false }).then((result) => { - if (!result.stdout) { - return TPromise.wrapError(new Error('Error parsing HEAD')); - } - - return TPromise.as({ name: void 0, commit: result.stdout.trim(), type: RefType.Head }); - }); - }); - } - - getRefs(): TPromise { - return this.run(['for-each-ref', '--format', '%(refname) %(objectname)'], { log: false }).then(result => { - return result.stdout.trim().split('\n') - .filter(line => !!line) - .map(line => { - let match: RegExpExecArray; - - if (match = /^refs\/heads\/([^ ]+) ([0-9a-f]{40})$/.exec(line)) { - return { name: match[1], commit: match[2], type: RefType.Head }; - } else if (match = /^refs\/remotes\/([^/]+)\/([^ ]+) ([0-9a-f]{40})$/.exec(line)) { - return { name: `${match[1]}/${match[2]}`, commit: match[3], type: RefType.RemoteHead, remote: match[1] }; - } else if (match = /^refs\/tags\/([^ ]+) ([0-9a-f]{40})$/.exec(line)) { - return { name: match[1], commit: match[2], type: RefType.Tag }; - } - - return null; - }) - .filter(ref => !!ref); - }); - } - - getRemotes(): TPromise { - const regex = /^([^\s]+)\s+([^\s]+)\s/; - - return this.run(['remote', '--verbose'], { log: false }) - .then(result => result.stdout - .trim() - .split('\n') - .filter(b => !!b) - .map(line => regex.exec(line)) - .filter(g => !!g) - .map(groups => ({ name: groups[1], url: groups[2] })) - .filter(uniqueFilter<{ name: string; }>(g => g.name)) - ); - } - - getBranch(branch: string): TPromise { - if (branch === 'HEAD') { - return this.getHEAD(); - } - - return this.run(['rev-parse', branch], { log: false }).then((result) => { - if (!result.stdout) { - return TPromise.wrapError(new Error('No such branch')); - } - - const commit = result.stdout.trim(); - - return this.run(['rev-parse', '--symbolic-full-name', '--abbrev-ref', branch + '@{u}'], { log: false }).then((result: IExecutionResult) => { - const upstream = result.stdout.trim(); - - return this.run(['rev-list', '--left-right', branch + '...' + upstream], { log: false }).then((result) => { - let ahead = 0, behind = 0; - let i = 0; - - while (i < result.stdout.length) { - switch (result.stdout.charAt(i)) { - case '<': ahead++; break; - case '>': behind++; break; - default: i++; break; - } - - while (result.stdout.charAt(i++) !== '\n') { /* no-op */ } - } - - return { - name: branch, - commit: commit, - upstream: upstream, - ahead: ahead, - behind: behind - }; - }); - }, () => { - return { name: branch, commit: commit }; - }); - }); - } - - getCommitTemplate(): TPromise { - return this.run(['config', '--get', 'commit.template']).then(result => { - if (!result.stdout) { - return ''; - } - - // https://github.com/git/git/blob/3a0f269e7c82aa3a87323cb7ae04ac5f129f036b/path.c#L612 - const homedir = os.homedir(); - let templatePath = result.stdout.trim() - .replace(/^~([^\/]*)\//, (_, user) => `${user ? path.join(path.dirname(homedir), user) : homedir}/`); - - if (!path.isAbsolute(templatePath)) { - templatePath = path.join(this.repository, templatePath); - } - - return pfs.readFile(templatePath, 'utf8').then(raw => raw.replace(/^\s*#.*$\n?/gm, '').trim()); - }, () => ''); - } - - getCommit(ref: string): TPromise { - return this.run(['show', '-s', '--format=%H\n%B', ref]).then(result => { - const match = /^([0-9a-f]{40})\n([^]*)$/m.exec(result.stdout.trim()); - - if (!match) { - return TPromise.wrapError('bad commit format'); - } - - return { hash: match[1], message: match[2] }; - }); - } - - onOutput(listener: (output: string) => void): () => void { - return this.git.onOutput(listener); - } -} diff --git a/src/vs/workbench/parts/git/node/gitApp.ts b/src/vs/workbench/parts/git/node/gitApp.ts deleted file mode 100644 index 141fa65f2e3..00000000000 --- a/src/vs/workbench/parts/git/node/gitApp.ts +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { Server } from 'vs/base/parts/ipc/node/ipc.cp'; -import { createRawGitService } from './rawGitServiceBootstrap'; -import { GitChannel } from 'vs/workbench/parts/git/common/gitIpc'; - -const server = new Server(); -const service = createRawGitService(process.argv[2], process.argv[3], process.argv[4], process.argv[5], process.argv[6]); -const channel = new GitChannel(service); -server.registerChannel('git', channel); diff --git a/src/vs/workbench/parts/git/node/rawGitService.ts b/src/vs/workbench/parts/git/node/rawGitService.ts deleted file mode 100644 index 1127fc6daef..00000000000 --- a/src/vs/workbench/parts/git/node/rawGitService.ts +++ /dev/null @@ -1,237 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { join, isAbsolute, relative } from 'path'; -import { TPromise, Promise } from 'vs/base/common/winjs.base'; -import { detectMimesFromFile, detectMimesFromStream } from 'vs/base/node/mime'; -import { realpath, exists } from 'vs/base/node/pfs'; -import { Repository, GitError } from 'vs/workbench/parts/git/node/git.lib'; -import { IRawGitService, RawServiceState, IRawStatus, IRef, GitErrorCodes, IPushOptions, ICommit } from 'vs/workbench/parts/git/common/git'; -import Event, { Emitter, delayed } from 'vs/base/common/event'; - -export class RawGitService implements IRawGitService { - - private repo: Repository; - private _repositoryRoot: TPromise; - private _onOutput: Emitter; - get onOutput(): Event { return this._onOutput.event; } - - constructor(repo: Repository) { - this.repo = repo; - - let listener: () => void; - - this._onOutput = new Emitter({ - onFirstListenerAdd: () => { - listener = this.repo.onOutput(output => this._onOutput.fire(output)); - }, - onLastListenerRemove: () => { - listener(); - listener = null; - } - }); - } - - getVersion(): TPromise { - if (!this.repo) { - return TPromise.as(null); - } - - return TPromise.as(this.repo.git.version); - } - - private getRepositoryRoot(): TPromise { - return this._repositoryRoot || (this._repositoryRoot = realpath(this.repo.path)); - } - - serviceState(): TPromise { - return TPromise.as(this.repo - ? RawServiceState.OK - : RawServiceState.GitNotFound - ); - } - - statusCount(): TPromise { - if (!this.repo) { - return TPromise.as(0); - } - - return this.status().then(r => r ? r.status.length : 0); - } - - status(): TPromise { - return this.repo.getStatus() - .then(status => this.repo.getHEAD() - .then(HEAD => { - if (HEAD.name) { - return this.repo.getBranch(HEAD.name).then(null, () => HEAD); - } else { - return HEAD; - } - }, (): IRef => null) - .then(HEAD => Promise.join([this.getRepositoryRoot(), this.repo.getRefs(), this.repo.getRemotes()]).then(r => { - return { - repositoryRoot: r[0], - status: status, - HEAD: HEAD, - refs: r[1], - remotes: r[2] - }; - }))) - .then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.BadConfigFile) { - return Promise.wrapError(err); - } else if (err.gitErrorCode === GitErrorCodes.NotAtRepositoryRoot) { - return Promise.wrapError(err); - } - - return null; - }); - } - - init(): TPromise { - return this.repo.init().then(() => this.status()); - } - - add(filePaths?: string[]): TPromise { - return this.repo.add(filePaths).then(() => this.status()); - } - - stage(filePath: string, content: string): TPromise { - return this.repo.stage(filePath, content).then(() => this.status()); - } - - branch(name: string, checkout?: boolean): TPromise { - return this.repo.branch(name, checkout).then(() => this.status()); - } - - checkout(treeish?: string, filePaths?: string[]): TPromise { - return this.repo.checkout(treeish, filePaths).then(() => this.status()); - } - - clean(filePaths: string[]): TPromise { - return this.repo.clean(filePaths).then(() => this.status()); - } - - undo(): TPromise { - return this.repo.undo().then(() => this.status()); - } - - reset(treeish: string, hard?: boolean): TPromise { - return this.repo.reset(treeish, hard).then(() => this.status()); - } - - revertFiles(treeish: string, filePaths?: string[]): TPromise { - return this.repo.revertFiles(treeish, filePaths).then(() => this.status()); - } - - fetch(): TPromise { - return this.repo.fetch().then(null, (err) => { - if (err.gitErrorCode === GitErrorCodes.NoRemoteRepositorySpecified) { - return TPromise.as(null); - } - - return Promise.wrapError(err); - }).then(() => this.status()); - } - - pull(rebase?: boolean): TPromise { - return this.repo.pull(rebase).then(() => this.status()); - } - - push(remote?: string, name?: string, options?: IPushOptions): TPromise { - return this.repo.push(remote, name, options).then(() => this.status()); - } - - sync(): TPromise { - return this.repo.sync().then(() => this.status()); - } - - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise { - let promise: Promise = TPromise.as(null); - - if (stage) { - promise = this.repo.add(null); - } - - return promise - .then(() => this.repo.commit(message, stage, amend, signoff)) - .then(() => this.status()); - } - - detectMimetypes(filePath: string, treeish?: string): TPromise { - return exists(join(this.repo.path, filePath)).then((exists) => { - if (exists) { - return detectMimesFromFile(join(this.repo.path, filePath)) - .then(result => result.mimes); - } - - const child = this.repo.show(treeish + ':' + filePath); - - return new TPromise((c, e) => - detectMimesFromStream(child.stdout, filePath) - .then(result => result.mimes) - ); - }); - } - - // careful, this buffers the whole object into memory - show(filePath: string, treeish?: string): TPromise { - treeish = (!treeish || treeish === '~') ? '' : treeish; - - if (isAbsolute(filePath)) { - filePath = relative(this.repo.path, filePath).replace(/\\/g, '/'); - } - - return this.repo.buffer(treeish + ':' + filePath).then(null, e => { - if (e instanceof GitError) { - return ''; // mostly untracked files end up in a git error - } - - return TPromise.wrapError(e); - }); - } - - clone(url: string, parentPath: string): TPromise { - return this.repo.git.clone(url, parentPath); - } - - getCommitTemplate(): TPromise { - return this.repo.getCommitTemplate(); - } - - getCommit(ref: string): TPromise { - return this.repo.getCommit(ref); - } -} - -export class DelayedRawGitService implements IRawGitService { - constructor(private raw: TPromise) { } - onOutput: Event = delayed(this.raw.then(r => r.onOutput)); - getVersion(): TPromise { return this.raw.then(r => r.getVersion()); } - serviceState(): TPromise { return this.raw.then(r => r.serviceState()); } - statusCount(): TPromise { return this.raw.then(r => r.statusCount()); } - status(): TPromise { return this.raw.then(r => r.status()); } - init(): TPromise { return this.raw.then(r => r.init()); } - add(filesPaths?: string[]): TPromise { return this.raw.then(r => r.add(filesPaths)); } - stage(filePath: string, content: string): TPromise { return this.raw.then(r => r.stage(filePath, content)); } - branch(name: string, checkout?: boolean): TPromise { return this.raw.then(r => r.branch(name, checkout)); } - checkout(treeish?: string, filePaths?: string[]): TPromise { return this.raw.then(r => r.checkout(treeish, filePaths)); } - clean(filePaths: string[]): TPromise { return this.raw.then(r => r.clean(filePaths)); } - undo(): TPromise { return this.raw.then(r => r.undo()); } - reset(treeish: string, hard?: boolean): TPromise { return this.raw.then(r => r.reset(treeish, hard)); } - revertFiles(treeish: string, filePaths?: string[]): TPromise { return this.raw.then(r => r.revertFiles(treeish, filePaths)); } - fetch(): TPromise { return this.raw.then(r => r.fetch()); } - pull(rebase?: boolean): TPromise { return this.raw.then(r => r.pull(rebase)); } - push(remote?: string, name?: string, options?: IPushOptions): TPromise { return this.raw.then(r => r.push(remote, name, options)); } - sync(): TPromise { return this.raw.then(r => r.sync()); } - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise { return this.raw.then(r => r.commit(message, amend, stage, signoff)); } - detectMimetypes(path: string, treeish?: string): TPromise { return this.raw.then(r => r.detectMimetypes(path, treeish)); } - show(path: string, treeish?: string): TPromise { return this.raw.then(r => r.show(path, treeish)); } - clone(url: string, parentPath: string): TPromise { return this.raw.then(r => r.clone(url, parentPath)); } - getCommitTemplate(): TPromise { return this.raw.then(r => r.getCommitTemplate()); } - getCommit(ref: string): TPromise { return this.raw.then(r => r.getCommit(ref)); } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/node/rawGitServiceBootstrap.ts b/src/vs/workbench/parts/git/node/rawGitServiceBootstrap.ts deleted file mode 100644 index 666250e9fd9..00000000000 --- a/src/vs/workbench/parts/git/node/rawGitServiceBootstrap.ts +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { TPromise } from 'vs/base/common/winjs.base'; -import objects = require('vs/base/common/objects'); -import uri from 'vs/base/common/uri'; -import { GitErrorCodes, IRawGitService } from 'vs/workbench/parts/git/common/git'; -import gitlib = require('vs/workbench/parts/git/node/git.lib'); -import { RawGitService } from 'vs/workbench/parts/git/node/rawGitService'; -import { join, normalize } from 'path'; -import { realpath } from 'vs/base/node/pfs'; - -export function createRawGitService(gitPath: string, workspaceRoot: string, defaultEncoding: string, exePath: string, version: string): TPromise { - if (!gitPath) { - return TPromise.as(new RawGitService(null)); - } - - const gitRootPath = uri.parse(require.toUrl('vs/workbench/parts/git/node')).fsPath; - const bootstrapPath = `${uri.parse(require.toUrl('bootstrap')).fsPath}.js`; - workspaceRoot = normalize(workspaceRoot); - - const env = objects.assign({}, process.env, { - GIT_ASKPASS: join(gitRootPath, 'askpass.sh'), - VSCODE_GIT_ASKPASS_BOOTSTRAP: bootstrapPath, - VSCODE_GIT_ASKPASS_NODE: exePath, - VSCODE_GIT_ASKPASS_MODULE_ID: 'vs/workbench/parts/git/node/askpass' - }); - - const git = new gitlib.Git({ - gitPath, version, - defaultEncoding: defaultEncoding, - env: env - }); - - const repo = git.open(workspaceRoot); - - return repo.getRoot() - .then(null, (err: gitlib.GitError) => { - if (err instanceof gitlib.GitError && err.gitErrorCode === GitErrorCodes.NotAGitRepository) { - return workspaceRoot; - } - - return TPromise.wrapError(err); - }) - .then(root => realpath(root)) - .then(root => git.open(root)) - .then(repo => new RawGitService(repo)); -} diff --git a/src/vs/workbench/parts/git/node/unscopedGitService.ts b/src/vs/workbench/parts/git/node/unscopedGitService.ts deleted file mode 100644 index 158604c7e00..00000000000 --- a/src/vs/workbench/parts/git/node/unscopedGitService.ts +++ /dev/null @@ -1,135 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { IRawGitService, IRawStatus, ServiceState, RawServiceState, ICommit } from 'vs/workbench/parts/git/common/git'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { assign } from 'vs/base/common/objects'; -import Event, { Emitter } from 'vs/base/common/event'; -import uri from 'vs/base/common/uri'; -import { Git } from './git.lib'; - -export class UnscopedGitService implements IRawGitService { - - private git: Git; - - private _onOutput = new Emitter(); - get onOutput(): Event { return this._onOutput.event; } - - private static STATUS: IRawStatus = { - repositoryRoot: null, - state: ServiceState.NotAWorkspace, - status: [], - HEAD: null, - refs: [], - remotes: [] - }; - - constructor(gitPath: string, version: string, defaultEncoding: string, exePath: string) { - const gitRootPath = uri.parse(require.toUrl('vs/workbench/parts/git/node')).fsPath; - const bootstrapPath = `${uri.parse(require.toUrl('bootstrap')).fsPath}.js`; - const env = assign({}, process.env, { - GIT_ASKPASS: path.join(gitRootPath, 'askpass.sh'), - VSCODE_GIT_ASKPASS_BOOTSTRAP: bootstrapPath, - VSCODE_GIT_ASKPASS_NODE: exePath, - VSCODE_GIT_ASKPASS_MODULE_ID: 'vs/workbench/parts/git/node/askpass' - }); - - this.git = new Git({ gitPath, version, defaultEncoding, env }); - } - - getVersion(): TPromise { - return TPromise.as(null); - } - - serviceState(): TPromise { - return TPromise.as(RawServiceState.OK); - } - - statusCount(): TPromise { - return TPromise.as(0); - } - - status(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - init(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - add(filesPaths?: string[]): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - stage(filePath: string, content: string): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - branch(name: string, checkout?: boolean): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - checkout(treeish?: string, filePaths?: string[]): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - clean(filePaths: string[]): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - undo(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - reset(treeish: string, hard?: boolean): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - revertFiles(treeish: string, filePaths?: string[]): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - fetch(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - pull(rebase?: boolean): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - push(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - sync(): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - commit(message: string, amend?: boolean, stage?: boolean, signoff?: boolean): TPromise { - return TPromise.as(UnscopedGitService.STATUS); - } - - detectMimetypes(path: string, treeish?: string): TPromise { - return TPromise.as([]); - } - - show(path: string, treeish?: string): TPromise { - return TPromise.as(null); - } - - clone(url: string, parentPath: string): TPromise { - return this.git.clone(url, parentPath); - } - - getCommitTemplate(): TPromise { - return TPromise.as(null); - } - - getCommit(ref: string): TPromise { - return TPromise.as(null); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/git/test/common/gitModel.test.ts b/src/vs/workbench/parts/git/test/common/gitModel.test.ts deleted file mode 100644 index 8b35789d6e9..00000000000 --- a/src/vs/workbench/parts/git/test/common/gitModel.test.ts +++ /dev/null @@ -1,188 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert = require('assert'); -import Git = require('vs/workbench/parts/git/common/git'); -import Model = require('vs/workbench/parts/git/common/gitModel'); - -suite('Git - StatusModel', () => { - var model: Git.IStatusModel; - - setup(() => { - model = new Model.StatusModel(); - }); - - teardown(() => { - model = null; - }); - - test('simple update', () => { - model.update([ - { path: 'hello', x: '?', y: '?', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 0); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - }); - - test('simple update same file twice', () => { - model.update([ - { path: 'hello', x: '?', y: '?', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 0); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - - model.update([ - { path: 'hello', x: '?', y: '?', mimetype: 'application/octet-stream' } - ]); - - index = model.getIndexStatus().all(); - workingTree = model.getWorkingTreeStatus().all(); - merge = model.getMergeStatus().all(); - - assert.equal(index.length, 0); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - }); - - test('simple update same file twice, first untracked, then ignored', () => { - model.update([ - { path: 'hello', x: '?', y: '?', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 0); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - - model.update([ - { path: 'hello', x: '!', y: '!', mimetype: 'application/octet-stream' } - ]); - - index = model.getIndexStatus().all(); - workingTree = model.getWorkingTreeStatus().all(); - merge = model.getMergeStatus().all(); - - assert.equal(index.length, 0); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - }); - - test('same file, both modified in index, deleted in working tree', () => { - model.update([ - { path: 'hello', x: 'M', y: 'D', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 1); - assert.equal(workingTree.length, 1); - assert.equal(merge.length, 0); - - assert.equal(index[0].getPath(), 'hello'); - assert.equal(index[0].getStatus(), Git.Status.INDEX_MODIFIED); - - assert.equal(workingTree[0].getPath(), 'hello'); - assert.equal(workingTree[0].getStatus(), Git.Status.DELETED); - }); - - test('index and working tree matches', () => { - model.update([ - { path: 'f1', x: 'M', y: ' ', mimetype: 'application/octet-stream' }, - { path: 'f2', x: 'A', y: ' ', mimetype: 'application/octet-stream' }, - { path: 'f3', x: 'R', y: ' ', mimetype: 'application/octet-stream' }, - { path: 'f4', x: 'C', y: ' ', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 4); - assert.equal(workingTree.length, 0); - assert.equal(merge.length, 0); - - assert.equal(index[0].getStatus(), Git.Status.INDEX_MODIFIED); - assert.equal(index[1].getStatus(), Git.Status.INDEX_ADDED); - assert.equal(index[2].getStatus(), Git.Status.INDEX_RENAMED); - assert.equal(index[3].getStatus(), Git.Status.INDEX_COPIED); - }); - - test('work tree changed since index', () => { - model.update([ - { path: 'f1', x: ' ', y: 'M', mimetype: 'application/octet-stream' }, - { path: 'f2', x: 'M', y: 'M', mimetype: 'application/octet-stream' }, - { path: 'f3', x: 'A', y: 'M', mimetype: 'application/octet-stream' }, - { path: 'f4', x: 'R', y: 'M', mimetype: 'application/octet-stream' }, - { path: 'f5', x: 'C', y: 'M', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 4); - assert.equal(workingTree.length, 5); - assert.equal(merge.length, 0); - - assert.equal(index[0].getStatus(), Git.Status.INDEX_MODIFIED); - assert.equal(index[1].getStatus(), Git.Status.INDEX_ADDED); - assert.equal(index[2].getStatus(), Git.Status.INDEX_RENAMED); - assert.equal(index[3].getStatus(), Git.Status.INDEX_COPIED); - - assert.equal(workingTree[0].getStatus(), Git.Status.MODIFIED); - assert.equal(workingTree[1].getStatus(), Git.Status.MODIFIED); - assert.equal(workingTree[2].getStatus(), Git.Status.MODIFIED); - assert.equal(workingTree[3].getStatus(), Git.Status.MODIFIED); - assert.equal(workingTree[3].getStatus(), Git.Status.MODIFIED); - }); - - test('deleted in work tree', () => { - model.update([ - { path: 'f1', x: ' ', y: 'D', mimetype: 'application/octet-stream' }, - { path: 'f2', x: 'M', y: 'D', mimetype: 'application/octet-stream' }, - { path: 'f3', x: 'A', y: 'D', mimetype: 'application/octet-stream' }, - { path: 'f4', x: 'R', y: 'D', mimetype: 'application/octet-stream' }, - { path: 'f5', x: 'C', y: 'D', mimetype: 'application/octet-stream' } - ]); - - var index = model.getIndexStatus().all(); - var workingTree = model.getWorkingTreeStatus().all(); - var merge = model.getMergeStatus().all(); - - assert.equal(index.length, 4); - assert.equal(workingTree.length, 5); - assert.equal(merge.length, 0); - - assert.equal(index[0].getStatus(), Git.Status.INDEX_MODIFIED); - assert.equal(index[1].getStatus(), Git.Status.INDEX_ADDED); - assert.equal(index[2].getStatus(), Git.Status.INDEX_RENAMED); - assert.equal(index[3].getStatus(), Git.Status.INDEX_COPIED); - - assert.equal(workingTree[0].getStatus(), Git.Status.DELETED); - assert.equal(workingTree[1].getStatus(), Git.Status.DELETED); - assert.equal(workingTree[2].getStatus(), Git.Status.DELETED); - assert.equal(workingTree[3].getStatus(), Git.Status.DELETED); - assert.equal(workingTree[3].getStatus(), Git.Status.DELETED); - }); -}); diff --git a/src/vs/workbench/parts/git/test/common/stageRanges.test.ts b/src/vs/workbench/parts/git/test/common/stageRanges.test.ts deleted file mode 100644 index cd8b50cd1c1..00000000000 --- a/src/vs/workbench/parts/git/test/common/stageRanges.test.ts +++ /dev/null @@ -1,475 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { SelectedChange, getSelectedChanges, applyChangesToModel, getChangeRevertEdits } from 'vs/workbench/parts/git/common/stageRanges'; -import { Model } from 'vs/editor/common/model/model'; -import { IChange } from 'vs/editor/common/editorCommon'; -import { Selection } from 'vs/editor/common/core/selection'; - -function changesEqual(actual: IChange[], expected: IChange[]) { - assert.equal(actual.length, expected.length); - if (actual.length === expected.length) { - for (var i = 0; i < actual.length; ++i) { - assert.equal(actual[i].modifiedStartLineNumber, expected[i].modifiedStartLineNumber); - assert.equal(actual[i].modifiedEndLineNumber, expected[i].modifiedEndLineNumber); - assert.equal(actual[i].originalStartLineNumber, expected[i].originalStartLineNumber); - assert.equal(actual[i].originalEndLineNumber, expected[i].originalEndLineNumber); - } - } -} - -function createChange(modifiedStart: number, modifiedEnd: number, originalStart: number, originalEnd: number): IChange { - return { - modifiedStartLineNumber: modifiedStart, - modifiedEndLineNumber: modifiedEnd, - originalStartLineNumber: originalStart, - originalEndLineNumber: originalEnd - }; -} - -function createSelectedChange(modifiedStart: number, modifiedEnd: number, originalStart: number, originalEnd: number, fullModifiedStart = modifiedStart, fullModifiedEnd = modifiedEnd): SelectedChange { - return new SelectedChange( - createChange(modifiedStart, modifiedEnd, originalStart, originalEnd), - createChange(fullModifiedStart, fullModifiedEnd, originalStart, originalEnd)); -} - -suite('Git - Stage ranges', () => { - - test('Get selected changes test - no change selected (selection before changes)', () => { - var selections: Selection[] = []; - selections.push(new Selection(1, 1, 1, 1)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 1)); - var result = getSelectedChanges(changes, selections); - assert.equal(result.length, 0); - }); - - test('Get selected changes test - no change selected (selection after changes)', () => { - var selections: Selection[] = []; - selections.push(new Selection(5, 3, 7, 8)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 1)); - var result = getSelectedChanges(changes, selections); - assert.equal(result.length, 0); - }); - - test('Get selected changes test - one change fully selected', () => { - var selections: Selection[] = []; - selections.push(new Selection(5, 3, 7, 8)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 1), createChange(5, 7, 2, 6)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(5, 7, 2, 6)); - changesEqual(result, expected); - }); - - test('Get selected changes test - one change fully selected(deletion)', () => { - var selections: Selection[] = []; - selections.push(new Selection(5, 3, 7, 8)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 1), createChange(5, 0, 5, 6)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(5, 0, 5, 6)); - changesEqual(result, expected); - }); - - test('Get selected changes test - one change (insertion) partially selected', () => { - var selections: Selection[] = []; - selections.push(new Selection(5, 3, 6, 1)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 0), createChange(5, 7, 2, 0)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(5, 6, 2, 0)); - changesEqual(result, expected); - }); - - test('Get selected changes test - multiple changes selected with one selection', () => { - var selections: Selection[] = []; - selections.push(new Selection(2, 7, 7, 1)); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 1, 1), createChange(5, 7, 2, 6)); - var result = getSelectedChanges(changes, selections); - var expected = changes; - changesEqual(result, expected); - }); - - test('Get selected changes test - one change partially seleceted with multiple selections', () => { - var selections: Selection[] = []; - selections.push(new Selection(2, 2, 5, 5), new Selection(7, 2, 9, 1)); - var changes: IChange[] = []; - changes.push(createChange(1, 15, 1, 10), createChange(120, 127, 122, 126)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(2, 5, 1, 10), createChange(7, 9, 1, 10)); - changesEqual(result, expected); - }); - - test('Get selected changes test - one change partially seleceted with overlapping selections', () => { - var selections: Selection[] = []; - selections.push(new Selection(2, 2, 5, 5), new Selection(5, 2, 9, 1)); - var changes: IChange[] = []; - changes.push(createChange(1, 15, 1, 10), createChange(120, 127, 122, 126)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(2, 5, 1, 10), createChange(6, 9, 1, 10)); - changesEqual(result, expected); - }); - - test('Get selected changes test - multiple changes partially selected with multiple selections', () => { - var selections: Selection[] = []; - selections.push(new Selection(3, 1, 9, 5), new Selection(115, 2, 129, 1)); - var changes: IChange[] = []; - changes.push(createChange(1, 15, 1, 10), createChange(116, 135, 122, 126)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(3, 9, 1, 10), createChange(116, 129, 122, 126)); - changesEqual(result, expected); - }); - - test('Get selected changes test - multiple changes selected with multiple selections. Multiple changes not selected', () => { - var selections: Selection[] = []; - selections.push(new Selection(33, 11, 79, 15), new Selection(155, 21, 189, 11)); - var changes: IChange[] = []; - changes.push(createChange(1, 45, 1, 0), createChange(80, 89, 72, 79), createChange(154, 190, 152, 186), createChange(216, 235, 222, 226)); - var result = getSelectedChanges(changes, selections); - var expected: IChange[] = []; - expected.push(createChange(33, 45, 1, 0), createChange(155, 189, 152, 186)); - changesEqual(result, expected); - }); - - function createModel(text: string): Model { - return Model.createFromString(text); - } - - test('Apply changes to model - no changes', () => { - var original = createModel('One line that is equal. '); - var modified = createModel('One line that is equal. \n Second line is new.'); - var changes: IChange[] = []; - var result = applyChangesToModel(original, modified, changes); - var expected = original; - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Apply changes to model - one line change at the end', () => { - var original = createModel('One line that is equal. '); - var modified = createModel('One line that is equal. \n Second line is new.'); - var changes: IChange[] = []; - changes.push(createChange(2, 2, 2, 2)); - var result = applyChangesToModel(original, modified, changes); - var expected = modified; - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Apply changes to model - one line insertion in the middle', () => { - var original = createModel('One line that is equal. \n Last line same. '); - var modified = createModel('One line that is equal. \n Second line is new. \n Last line same. '); - var changes: IChange[] = []; - changes.push(createChange(2, 2, 1, 0)); - var result = applyChangesToModel(original, modified, changes); - var expected = modified; - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Apply changes to model - three empty lines insertion in the middle', () => { - var original = createModel('hello\n there\n isidor\n'); - var modified = createModel('hello\n there\n \n \n \n isidor\n'); - var changes: IChange[] = []; - changes.push(createChange(3, 5, 2, 0)); - var result = applyChangesToModel(original, modified, changes); - var expected = modified; - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Apply changes to model - one line deletion', () => { - var original = createModel('One line that is equal. \n Second line is old. \n Third line same. \n Forth line not important'); - var modified = createModel('One line that is equal. \n Third line same. '); - var changes: IChange[] = []; - changes.push(createChange(2, 0, 2, 2)); - var result = applyChangesToModel(original, modified, changes); - var expected = createModel('One line that is equal. \n Third line same. \n Forth line not important'); - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Apply changes to model - one multi line change', () => { - var original = createModel('One line that is equal. \n Second line is different. \n Third line also different. \n Forth line is same. \n Fifth line is different.'); - var modified = createModel('One line that is equal. \n 2nd line is different. \n 3rd line also different. \n Forth line is same. \n 5th line is different.'); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 2, 3)); - var result = applyChangesToModel(original, modified, changes); - var expected = createModel('One line that is equal. \n 2nd line is different. \n 3rd line also different. \n Forth line is same. \n Fifth line is different.'); - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Apply changes to model - two overlapping changes', () => { - var original = createModel(' One \n Two \n Three \n Four \n Five \n'); - var modified = createModel(' One \n 2 \n 3 \n 4 \n NotSelected \n'); - var changes: IChange[] = []; - changes.push(createChange(2, 3, 2, 4), createChange(4, 4, 2, 4)); - var result = applyChangesToModel(original, modified, changes); - var expected = createModel(' One \n 2 \n 3 \n 4 \n Five \n'); - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Apply changes to model - multiple small changes', () => { - var original = createModel(' One \n Two \n Three \n Four \n Five \n Six \n Seven \n Eight \n'); - var modified = createModel(' One \n 2 \n Three \n 4 \n 5 \n Six \n 7 \n 8 \n'); - var changes: IChange[] = []; - changes.push(createChange(1, 2, 1, 2), createChange(5, 5, 5, 5), createChange(7, 8, 7, 8)); - var result = applyChangesToModel(original, modified, changes); - var expected = createModel(' One \n 2 \n Three \n Four \n 5 \n Six \n 7 \n 8 \n'); - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Apply changes to model - multiple changes - insertion, deletion and modification', () => { - var original = createModel(' One \n Two \n Three \n Four \n Five \n Six \n Seven \n Eight \n Nine \n Ten'); - var modified = createModel(' 1 \n Three \n 4 \n 5 \n Six \n 7 \n NEWLINE \n Eight '); - var changes: IChange[] = []; - changes.push(createChange(1, 1, 1, 1), createChange(2, 0, 2, 2), createChange(3, 3, 4, 4), createChange(7, 7, 7, 0), createChange(7, 0, 9, 10)); - var result = applyChangesToModel(original, modified, changes); - var expected = createModel(' 1 \n Three \n 4 \n Five \n Six \n Seven \n NEWLINE \n Eight '); - assert.equal(result, expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - no changes', () => { - var original = createModel('One line that is equal. '); - var modified = createModel('One line that is equal. \n Second line is new.'); - var changes: SelectedChange[] = []; - const edits = getChangeRevertEdits(original, modified, changes); - - assert.equal(edits.length, 0); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line insertion at the beginning', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel(' One line that is equal. '); - const modified = createModel('Inserted line is new. \n One line that is equal. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 1, 0, 0)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line insertion in the middle', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Last line same. '); - const modified = createModel('One line that is equal. \n Second line is new. \n Last line same. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(2, 2, 1, 0)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line insertion at the end', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. '); - const modified = createModel('One line that is equal. \n Second line is new.'); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(2, 2, 1, 0)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line deletion at the beginning', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('First line is deleted. \n One line that is equal. '); - const modified = createModel(' One line that is equal. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(0, 0, 1, 1)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line deletion in the middle', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Second line is deleted. \n Last line same. '); - const modified = createModel('One line that is equal. \n Last line same. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 0, 2, 2)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line deletion at the end', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Second line is deleted.'); - const modified = createModel('One line that is equal. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(2, 0, 2, 2)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - three empty lines insertion in the middle', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('hello\n there\n isidor\n'); - const modified = createModel('hello\n there\n \n \n \n isidor\n'); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(3, 5, 2, 0)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - }); - - test('Revert changes on model - one line deletion', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Second line is old. \n Third line same. \n Forth line not important'); - const modified = createModel('One line that is equal. \n Third line same. '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 0, 2, 2)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = createModel('One line that is equal. \n Second line is old. \n Third line same. '); - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - one multi line change', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Second line is different. \n Third line also different. \n Forth line is same. \n Fifth line is different.'); - const modified = createModel('One line that is equal. \n 2nd line is different. \n 3rd line also different. \n Forth line is same. \n 5th line is different.'); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(2, 3, 2, 3)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = createModel('One line that is equal. \n Second line is different. \n Third line also different. \n Forth line is same. \n 5th line is different.'); - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - one multi line change - partial revert', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel('One line that is equal. \n Second line is different. \n Third line also different. \n Forth line is same. \n Fifth line is different.'); - const modified = createModel('One line that is equal. \n 2nd line is different. \n 3rd line also different. \n Forth line is same. \n 5th line is different.'); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(3, 3, 2, 3, 2, 3)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = createModel('One line that is equal. \n 2nd line is different. \n Third line also different. \n Forth line is same. \n 5th line is different.'); - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - multiple small changes', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel(' One \n Two \n Three \n Four \n Five \n Six \n Seven \n Eight \n'); - const modified = createModel(' One \n 2 \n Three \n 4 \n 5 \n Six \n 7 \n 8 \n'); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 2, 1, 2), createSelectedChange(4, 5, 4, 5), createSelectedChange(7, 8, 7, 8)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - multiple changes - insertion, deletion and modification', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel(' One \n Two \n Three \n Four \n Five \n Six \n Seven \n Eight \n Nine \n Ten'); - const modified = createModel(' 1 \n Three \n 4 \n 5 \n Six \n 7 \n NEWLINE \n Eight '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 1, 1, 1), createSelectedChange(1, 0, 2, 2), createSelectedChange(3, 4, 4, 5), createSelectedChange(6, 7, 7, 7), createSelectedChange(8, 0, 9, 10)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); - - test('Revert changes on model - multiple changes - partial revert', () => { - const selections = [new Selection(1, 1, 1, 1)]; - const original = createModel(' One \n Two \n Three \n Four \n Five \n Six \n Seven \n Eight \n Nine \n Ten'); - const modified = createModel(' 1 \n Three \n 4 \n 5 \n Six \n 7 \n NEWLINE \n Eight '); - const changes: SelectedChange[] = []; - changes.push(createSelectedChange(1, 1, 1, 1), createSelectedChange(1, 0, 2, 2), createSelectedChange(3, 4, 4, 5), createSelectedChange(6, 7, 7, 7), createSelectedChange(8, 0, 9, 10)); - const edits = getChangeRevertEdits(original, modified, changes); - - modified.pushEditOperations(selections, edits, () => selections); - const expected = original; - assert.equal(modified.getValue(), expected.getValue()); - original.dispose(); - modified.dispose(); - expected.dispose(); - }); -}); diff --git a/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts b/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts index f310cdcb4d1..038c8c4cd99 100644 --- a/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts +++ b/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts @@ -12,7 +12,6 @@ import { IModel } from 'vs/editor/common/editorCommon'; import { Dimension, Builder } from 'vs/base/browser/builder'; import { empty as EmptyDisposable, IDisposable, dispose, IReference } from 'vs/base/common/lifecycle'; import { EditorOptions, EditorInput } from 'vs/workbench/common/editor'; -import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { Position } from 'vs/platform/editor/common/editor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -24,17 +23,16 @@ import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/se import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; import Webview from './webview'; - +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { WebviewEditor } from 'vs/workbench/browser/parts/editor/webviewEditor'; /** * An implementation of editor for showing HTML content in an IFrame by leveraging the HTML input. */ -export class HtmlPreviewPart extends BaseEditor { +export class HtmlPreviewPart extends WebviewEditor { static ID: string = 'workbench.editor.htmlPreviewPart'; - private _textModelResolverService: ITextModelResolverService; - private _openerService: IOpenerService; private _webview: Webview; private _webviewDisposables: IDisposable[]; private _container: HTMLDivElement; @@ -46,18 +44,19 @@ export class HtmlPreviewPart extends BaseEditor { private _modelChangeSubscription = EmptyDisposable; private _themeChangeSubscription = EmptyDisposable; + private scrollYPercentage: number = 0; + constructor( @ITelemetryService telemetryService: ITelemetryService, - @ITextModelResolverService textModelResolverService: ITextModelResolverService, - @IThemeService protected themeService: IThemeService, - @IOpenerService openerService: IOpenerService, + @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @IThemeService themeService: IThemeService, + @IOpenerService private openerService: IOpenerService, @IWorkspaceContextService contextService: IWorkspaceContextService, - @IPartService private partService: IPartService + @IPartService private partService: IPartService, + @IStorageService storageService: IStorageService ) { - super(HtmlPreviewPart.ID, telemetryService, themeService); + super(HtmlPreviewPart.ID, telemetryService, themeService, storageService); - this._textModelResolverService = textModelResolverService; - this._openerService = openerService; this._baseUrl = contextService.toResource('/'); } @@ -84,11 +83,19 @@ export class HtmlPreviewPart extends BaseEditor { if (!this._webview) { this._webview = new Webview(this._container, this.partService.getContainer(Parts.EDITOR_PART)); this._webview.baseUrl = this._baseUrl && this._baseUrl.toString(true); + if (this.input && this.input instanceof HtmlInput) { + const state = this.loadViewState(this.input.getResource()); + this.scrollYPercentage = state ? state.scrollYPercentage : 0; + this.webview.initialScrollProgress = this.scrollYPercentage; + } this._webviewDisposables = [ this._webview, - this._webview.onDidClickLink(uri => this._openerService.open(uri)), - this._webview.onDidLoadContent(data => this.telemetryService.publicLog('previewHtml', data.stats)) + this._webview.onDidClickLink(uri => this.openerService.open(uri)), + this._webview.onDidLoadContent(data => this.telemetryService.publicLog('previewHtml', data.stats)), + this._webview.onDidScroll(data => { + this.scrollYPercentage = data.scrollYPercentage; + }) ]; } return this._webview; @@ -143,11 +150,25 @@ export class HtmlPreviewPart extends BaseEditor { } public clearInput(): void { + if (this.input instanceof HtmlInput) { + this.saveViewState(this.input.getResource(), { + scrollYPercentage: this.scrollYPercentage + }); + } dispose(this._modelRef); this._modelRef = undefined; super.clearInput(); } + public shutdown(): void { + if (this.input instanceof HtmlInput) { + this.saveViewState(this.input.getResource(), { + scrollYPercentage: this.scrollYPercentage + }); + } + super.shutdown(); + } + public sendMessage(data: any): void { this.webview.sendMessage(data); } @@ -158,6 +179,12 @@ export class HtmlPreviewPart extends BaseEditor { return TPromise.as(undefined); } + if (this.input instanceof HtmlInput) { + this.saveViewState(this.input.getResource(), { + scrollYPercentage: this.scrollYPercentage + }); + } + if (this._modelRef) { this._modelRef.dispose(); } @@ -169,7 +196,7 @@ export class HtmlPreviewPart extends BaseEditor { return super.setInput(input, options).then(() => { const resourceUri = input.getResource(); - return this._textModelResolverService.createModelReference(resourceUri).then(ref => { + return this.textModelResolverService.createModelReference(resourceUri).then(ref => { const model = ref.object; if (model instanceof BaseTextEditorModel) { @@ -182,12 +209,15 @@ export class HtmlPreviewPart extends BaseEditor { this._modelChangeSubscription = this.model.onDidChangeContent(() => { if (this.model) { + this.scrollYPercentage = 0; this.webview.contents = this.model.getLinesContent(); } }); + const state = this.loadViewState(resourceUri); + this.scrollYPercentage = state ? state.scrollYPercentage : 0; this.webview.baseUrl = resourceUri.toString(true); this.webview.contents = this.model.getLinesContent(); - + this.webview.initialScrollProgress = this.scrollYPercentage; return undefined; }); }); diff --git a/src/vs/workbench/parts/html/browser/webview-pre.js b/src/vs/workbench/parts/html/browser/webview-pre.js index da702ba48a0..a371b3f33c0 100644 --- a/src/vs/workbench/parts/html/browser/webview-pre.js +++ b/src/vs/workbench/parts/html/browser/webview-pre.js @@ -2,187 +2,254 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; +// @ts-check +(function () { + 'use strict'; -const ipcRenderer = require('electron').ipcRenderer; + const ipcRenderer = require('electron').ipcRenderer; -var initData = {}; + var firstLoad = true; -function styleBody(body) { - if (!body) { - return - } - body.classList.remove('vscode-light', 'vscode-dark', 'vscode-high-contrast'); - body.classList.add(initData.activeTheme); -} + const initData = { + initialScrollProgress: undefined + }; -function getTarget() { - return document.getElementById('_target'); -} - -function handleInnerClick(event) { - if (!event || !event.view || !event.view.document) { - return; - } - var node = event.target; - while (node) { - if (node.tagName === "A" && node.href) { - var baseElement = event.view.document.getElementsByTagName("base")[0]; - if (node.getAttribute("href") === "#") { - event.view.scrollTo(0, 0); - } else if (node.hash && (node.getAttribute("href") === node.hash || (baseElement && node.href.indexOf(baseElement.href) >= 0))) { - var scrollTarget = event.view.document.getElementById(node.hash.substr(1, node.hash.length - 1)); - if (scrollTarget) { - scrollTarget.scrollIntoView(); - } - } else { - ipcRenderer.sendToHost("did-click-link", node.href); - } - event.preventDefault(); - break; + function styleBody(body) { + if (!body) { + return } - node = node.parentNode; + body.classList.remove('vscode-light', 'vscode-dark', 'vscode-high-contrast'); + body.classList.add(initData.activeTheme); } -} + /** + * @return {HTMLIFrameElement} + */ + function getActiveFrame() { + return document.getElementById('active-frame'); + } -document.addEventListener("DOMContentLoaded", function (event) { - ipcRenderer.on('baseUrl', function (event, value) { - initData.baseUrl = value; - }); + /** + * @return {HTMLIFrameElement} + */ + function getPendingFrame() { + return document.getElementById('pending-frame'); + } - ipcRenderer.on('styles', function (event, value, activeTheme) { - initData.styles = value; - initData.activeTheme = activeTheme; - - // webview - var target = getTarget() - if (!target) { + /** + * @param {MouseEvent} event + */ + function handleInnerClick(event) { + if (!event || !event.view || !event.view.document) { return; } - var body = target.contentDocument.getElementsByTagName('body'); - styleBody(body[0]); - - // iframe - var defaultStyles = target.contentDocument.getElementById('_defaultStyles'); - if (defaultStyles) { - defaultStyles.innerHTML = initData.styles; - } - }); - - // propagate focus - ipcRenderer.on('focus', function () { - const target = getTarget(); - if (target) { - target.contentWindow.focus(); - } - }); - - // update iframe-contents - ipcRenderer.on('content', function (_event, value) { - const text = value.join('\n'); - const newDocument = new DOMParser().parseFromString(text, 'text/html'); - - // know what happens here - const stats = { - scriptTags: newDocument.documentElement.querySelectorAll('script').length, - inputTags: newDocument.documentElement.querySelectorAll('input').length, - styleTags: newDocument.documentElement.querySelectorAll('style').length, - linkStyleSheetTags: newDocument.documentElement.querySelectorAll('link[rel=stylesheet]').length, - stringLen: text.length - }; - - // set base-url if applicable - if (initData.baseUrl && newDocument.head.getElementsByTagName('base').length === 0) { - const baseElement = newDocument.createElement('base'); - baseElement.href = initData.baseUrl; - newDocument.head.appendChild(baseElement); - } - - // apply default styles - const defaultStyles = newDocument.createElement('style'); - defaultStyles.id = '_defaultStyles'; - defaultStyles.innerHTML = initData.styles; - if (newDocument.head.hasChildNodes()) { - newDocument.head.insertBefore(defaultStyles, newDocument.head.firstChild); - } else { - newDocument.head.appendChild(defaultStyles); - } - - styleBody(newDocument.body); - - const frame = getTarget(); - if (frame) { - frame.setAttribute('id', '_oldTarget'); - } - - // keep current scrollTop around and use later - const scrollTop = frame && frame.contentDocument && frame.contentDocument.body ? frame.contentDocument.body.scrollTop : 0; - - const newFrame = document.createElement('iframe'); - newFrame.setAttribute('id', '_target'); - newFrame.setAttribute('frameborder', '0'); - newFrame.setAttribute('sandbox', 'allow-scripts allow-forms allow-same-origin'); - newFrame.style.cssText = "margin: 0; overflow: hidden; position: absolute; width: 100%; height: 100%; display: none"; - document.body.appendChild(newFrame); - - // write new content onto iframe - newFrame.contentDocument.open('text/html', 'replace'); - newFrame.contentWindow.onbeforeunload = function (e) { - console.log('prevented webview navigation'); - return false; - }; - - newFrame.contentWindow.addEventListener('DOMContentLoaded', function (e) { - const contentDocument = e.target; - if (contentDocument.body) { - - // Workaround for https://github.com/Microsoft/vscode/issues/12865 - // check new scrollTop and reset if neccessary - if (scrollTop !== contentDocument.body.scrollTop) { - contentDocument.body.scrollTop = scrollTop; + /** @type {any} */ + var node = event.target; + while (node) { + if (node.tagName === "A" && node.href) { + var baseElement = event.view.document.getElementsByTagName("base")[0]; + if (node.getAttribute("href") === "#") { + event.view.scrollTo(0, 0); + } else if (node.hash && (node.getAttribute("href") === node.hash || (baseElement && node.href.indexOf(baseElement.href) >= 0))) { + var scrollTarget = event.view.document.getElementById(node.hash.substr(1, node.hash.length - 1)); + if (scrollTarget) { + scrollTarget.scrollIntoView(); + } + } else { + ipcRenderer.sendToHost("did-click-link", node.href); } - - // Bubble out link clicks - contentDocument.body.addEventListener('click', handleInnerClick); + event.preventDefault(); + break; } + node = node.parentNode; + } + } - // Clean up old frames - [].forEach.call(document.body.getElementsByTagName('iframe'), function (frame) { - if (frame.id !== '_target') { - document.body.removeChild(frame); - } - }); + var isHandlingScroll = false; + function handleInnerScroll(event) { + if (isHandlingScroll) { + return; + } - const newFrame = document.getElementById('_target'); - if (newFrame.contentDocument === contentDocument) { - newFrame.style.display = 'block'; + const progress = event.target.body.scrollTop / event.target.body.clientHeight; + if (isNaN(progress)) { + return; + } + + isHandlingScroll = true; + window.requestAnimationFrame(function () { + try { + ipcRenderer.sendToHost('did-scroll', progress); + } catch (e) { + // noop + } + isHandlingScroll = false; + }); + } + + document.addEventListener('DOMContentLoaded', function (event) { + ipcRenderer.on('baseUrl', function (event, value) { + initData.baseUrl = value; + }); + + ipcRenderer.on('styles', function (event, value, activeTheme) { + initData.styles = value; + initData.activeTheme = activeTheme; + + // webview + var target = getActiveFrame() + if (!target) { + return; + } + var body = target.contentDocument.getElementsByTagName('body'); + styleBody(body[0]); + + // iframe + var defaultStyles = target.contentDocument.getElementById('_defaultStyles'); + if (defaultStyles) { + defaultStyles.innerHTML = initData.styles; } }); - // set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off - // and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden - newFrame.contentDocument.write(''); - newFrame.contentDocument.write(newDocument.documentElement.innerHTML); - newFrame.contentDocument.close(); + // propagate focus + ipcRenderer.on('focus', function () { + const target = getActiveFrame(); + if (target) { + target.contentWindow.focus(); + } + }); - ipcRenderer.sendToHost('did-set-content', stats); + // update iframe-contents + ipcRenderer.on('content', function (_event, value) { + const text = value.join('\n'); + const newDocument = new DOMParser().parseFromString(text, 'text/html'); + + // know what happens here + const stats = { + scriptTags: newDocument.documentElement.querySelectorAll('script').length, + inputTags: newDocument.documentElement.querySelectorAll('input').length, + styleTags: newDocument.documentElement.querySelectorAll('style').length, + linkStyleSheetTags: newDocument.documentElement.querySelectorAll('link[rel=stylesheet]').length, + stringLen: text.length + }; + + // set base-url if applicable + if (initData.baseUrl && newDocument.head.getElementsByTagName('base').length === 0) { + const baseElement = newDocument.createElement('base'); + baseElement.href = initData.baseUrl; + newDocument.head.appendChild(baseElement); + } + + // apply default styles + const defaultStyles = newDocument.createElement('style'); + defaultStyles.id = '_defaultStyles'; + defaultStyles.innerHTML = initData.styles; + if (newDocument.head.hasChildNodes()) { + newDocument.head.insertBefore(defaultStyles, newDocument.head.firstChild); + } else { + newDocument.head.appendChild(defaultStyles); + } + + styleBody(newDocument.body); + + const frame = getActiveFrame(); + + // keep current scrollTop around and use later + var setInitialScrollPosition; + if (firstLoad) { + firstLoad = false; + setInitialScrollPosition = function (body, window) { + body.scrollTop = 0; + if (!isNaN(initData.initialScrollProgress)) { + window.addEventListener('load', function () { + if (body.scrollTop === 0) { + body.scrollTop = body.clientHeight * initData.initialScrollProgress + } + }); + } + } + } else { + const scrollY = frame.contentDocument && frame.contentDocument.body ? frame.contentDocument.body.scrollTop : 0; + setInitialScrollPosition = function (body) { + if (body.scrollTop === 0) { + body.scrollTop = scrollY; + } + } + } + + // Clean up old pending frames and set current one as new one + const previousPendingFrame = getPendingFrame(); + if (previousPendingFrame) { + previousPendingFrame.setAttribute('id', ''); + document.body.removeChild(previousPendingFrame); + } + + const newFrame = document.createElement('iframe'); + newFrame.setAttribute('id', 'pending-frame'); + newFrame.setAttribute('frameborder', '0'); + newFrame.setAttribute('sandbox', 'allow-scripts allow-forms allow-same-origin'); + newFrame.style.cssText = "margin: 0; overflow: hidden; position: absolute; width: 100%; height: 100%; display: none"; + document.body.appendChild(newFrame); + + // write new content onto iframe + newFrame.contentDocument.open('text/html', 'replace'); + newFrame.contentWindow.onbeforeunload = function (e) { + console.log('prevented webview navigation'); + return false; + }; + + newFrame.contentWindow.addEventListener('DOMContentLoaded', function (e) { + /** @type {any} */ + const contentDocument = e.target; + if (contentDocument.body) { + // Workaround for https://github.com/Microsoft/vscode/issues/12865 + // check new scrollTop and reset if neccessary + setInitialScrollPosition(contentDocument.body, this); + + // Bubble out link clicks + contentDocument.body.addEventListener('click', handleInnerClick); + } + + const newFrame = getPendingFrame(); + if (newFrame && newFrame.contentDocument === contentDocument) { + const oldActiveFrame = getActiveFrame(); + if (oldActiveFrame) { + document.body.removeChild(oldActiveFrame); + } + newFrame.setAttribute('id', 'active-frame'); + newFrame.style.display = 'block'; + this.addEventListener('scroll', handleInnerScroll); + } + }); + + // set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off + // and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden + newFrame.contentDocument.write(''); + newFrame.contentDocument.write(newDocument.documentElement.innerHTML); + newFrame.contentDocument.close(); + + ipcRenderer.sendToHost('did-set-content', stats); + }); + + // Forward message to the embedded iframe + ipcRenderer.on('message', function (event, data) { + const target = getActiveFrame(); + if (target) { + target.contentWindow.postMessage(data, document.location.origin); + } + }); + + ipcRenderer.on('initial-scroll-position', function (event, progress) { + initData.initialScrollProgress = progress; + }); + + // forward messages from the embedded iframe + window.onmessage = function (message) { + ipcRenderer.sendToHost(message.data.command, message.data.data); + }; + + // signal ready + ipcRenderer.sendToHost('webview-ready', process.pid); }); - - // Forward message to the embedded iframe - ipcRenderer.on('message', function (event, data) { - const target = getTarget(); - if (target) { - target.contentWindow.postMessage(data, document.location.origin); - } - }); - - // forward messages from the embedded iframe - window.onmessage = function (message) { - ipcRenderer.sendToHost(message.data.command, message.data.data); - }; - - // signal ready - ipcRenderer.sendToHost('webview-ready', process.pid); -}); +}()); \ No newline at end of file diff --git a/src/vs/workbench/parts/html/browser/webview.ts b/src/vs/workbench/parts/html/browser/webview.ts index 799ca78bef0..b8d6922a844 100644 --- a/src/vs/workbench/parts/html/browser/webview.ts +++ b/src/vs/workbench/parts/html/browser/webview.ts @@ -52,6 +52,8 @@ export default class Webview { private _onDidClickLink = new Emitter(); private _onDidLoadContent = new Emitter<{ stats: any }>(); + private _onDidScroll = new Emitter<{ scrollYPercentage: number }>(); + constructor( private parent: HTMLElement, private _styleElement: Element @@ -91,7 +93,7 @@ export default class Webview { addDisposableListener(this._webview, 'dom-ready', () => { this.layout(); }), - addDisposableListener(this._webview, 'crashed', function () { + addDisposableListener(this._webview, 'crashed', () => { console.error('embedded page crashed'); }), addDisposableListener(this._webview, 'ipc-message', (event) => { @@ -108,6 +110,13 @@ export default class Webview { this.layout(); return; } + + if (event.channel === 'did-scroll') { + if (event.args && typeof event.args[0] === 'number') { + this._onDidScroll.fire({ scrollYPercentage: event.args[0] }); + } + return; + } }) ]; @@ -134,12 +143,20 @@ export default class Webview { return this._onDidLoadContent.event; } + get onDidScroll(): Event<{ scrollYPercentage: number }> { + return this._onDidScroll.event; + } + private _send(channel: string, ...args: any[]): void { this._ready .then(() => this._webview.send(channel, ...args)) .done(void 0, console.error); } + set initialScrollProgress(value: number) { + this._send('initial-scroll-position', value); + } + set contents(value: string[]) { this._send('content', value); } @@ -249,10 +266,14 @@ export default class Webview { return; } const window = contents.getOwnerBrowserWindow(); - if (!window || !window.webContents) { + if (!window || !window.webContents || window.webContents.isDestroyed()) { return; } window.webContents.getZoomFactor(factor => { + if (contents.isDestroyed()) { + return; + } + contents.setZoomFactor(factor); const width = this.parent.clientWidth; diff --git a/src/vs/workbench/parts/html/common/htmlInput.ts b/src/vs/workbench/parts/html/common/htmlInput.ts index 87b699c7853..e66c1e1f350 100644 --- a/src/vs/workbench/parts/html/common/htmlInput.ts +++ b/src/vs/workbench/parts/html/common/htmlInput.ts @@ -7,5 +7,5 @@ import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; export class HtmlInput extends ResourceEditorInput { - // just a marker class + // marker class } diff --git a/src/vs/workbench/parts/markers/browser/markersPanel.ts b/src/vs/workbench/parts/markers/browser/markersPanel.ts index 615851f727f..f771f5dcaf9 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanel.ts @@ -32,7 +32,7 @@ import { CollapseAllAction, FilterAction, FilterInputBoxActionItem } from 'vs/wo import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import Messages from 'vs/workbench/parts/markers/common/messages'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/parts/markers/browser/markersTreeController.ts b/src/vs/workbench/parts/markers/browser/markersTreeController.ts index 0177d325920..9b420131e3c 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeController.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeController.ts @@ -13,7 +13,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMenuService, IMenu, MenuId } from 'vs/platform/actions/common/actions'; import { IAction } from 'vs/base/common/actions'; -import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; @@ -61,17 +60,13 @@ export class Controller extends treedefaults.DefaultController { }, getActionItem: (action) => { - const keybinding = this._keybindingFor(action); + const keybinding = this._keybindingService.lookupKeybinding(action.id); if (keybinding) { return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); } return null; }, - getKeyBinding: (action): ResolvedKeybinding => { - return this._keybindingFor(action); - }, - onHide: (wasCancelled?: boolean) => { if (wasCancelled) { tree.DOMFocus(); @@ -94,8 +89,4 @@ export class Controller extends treedefaults.DefaultController { result.pop(); // remove last separator return result; } - - private _keybindingFor(action: IAction): ResolvedKeybinding { - return this._keybindingService.lookupKeybinding(action.id); - } } diff --git a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts index 4367e3c85de..c78dfb63b68 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts @@ -18,9 +18,13 @@ import { IMarker } from 'vs/platform/markers/common/markers'; import { MarkersModel, Resource, Marker } from 'vs/workbench/parts/markers/common/markersModel'; import Messages from 'vs/workbench/parts/markers/common/messages'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IDisposable } from 'vs/base/common/lifecycle'; interface IAnyResourceTemplateData { count: CountBadge; + styler: IDisposable; } interface IResourceTemplateData extends IAnyResourceTemplateData { @@ -80,7 +84,8 @@ export class Renderer implements IRenderer { constructor(private actionRunner: IActionRunner, private actionProvider: IActionProvider, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IInstantiationService private instantiationService: IInstantiationService + @IInstantiationService private instantiationService: IInstantiationService, + @IThemeService private themeService: IThemeService ) { } @@ -121,6 +126,7 @@ export class Renderer implements IRenderer { const badgeWrapper = dom.append(container, dom.$('.count-badge-wrapper')); data.count = new CountBadge(badgeWrapper); + data.styler = attachBadgeStyler(data.count, this.themeService); return data; } @@ -132,6 +138,7 @@ export class Renderer implements IRenderer { const badgeWrapper = dom.append(container, dom.$('.count-badge-wrapper')); data.count = new CountBadge(badgeWrapper); + data.styler = attachBadgeStyler(data.count, this.themeService); return data; } @@ -193,9 +200,11 @@ export class Renderer implements IRenderer { public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { if (templateId === Renderer.FILE_RESOURCE_TEMPLATE_ID) { (templateData).fileLabel.dispose(); + (templateData).styler.dispose(); } if (templateId === Renderer.RESOURCE_TEMPLATE_ID) { (templateData).resourceLabel.dispose(); + (templateData).styler.dispose(); } } } diff --git a/src/vs/workbench/parts/output/browser/outputPanel.ts b/src/vs/workbench/parts/output/browser/outputPanel.ts index da6f5e9ff4c..217bb1972c6 100644 --- a/src/vs/workbench/parts/output/browser/outputPanel.ts +++ b/src/vs/workbench/parts/output/browser/outputPanel.ts @@ -21,7 +21,7 @@ import { EditorInput, EditorOptions } from 'vs/workbench/common/editor'; import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; import { OutputEditors, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/parts/output/common/output'; import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOutputScrollLockAction } from 'vs/workbench/parts/output/browser/outputActions'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -37,7 +37,7 @@ export class OutputPanel extends TextResourceEditor { @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService, + @IThemeService themeService: IThemeService, @IOutputService private outputService: IOutputService, @IUntitledEditorService untitledEditorService: IUntitledEditorService, @IContextKeyService private contextKeyService: IContextKeyService, diff --git a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts index 9351de679df..820590107e2 100644 --- a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts +++ b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts @@ -5,98 +5,248 @@ 'use strict'; -import { localize } from 'vs/nls'; -import { assign } from 'vs/base/common/objects'; -import { join } from 'path'; -import { generateUuid } from 'vs/base/common/uuid'; -import { virtualMachineHint } from 'vs/base/node/id'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; -import { writeFile } from 'vs/base/node/pfs'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { ITimerService } from 'vs/workbench/services/timer/common/timerService'; -import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions } from 'vs/workbench/common/contributions'; import product from 'vs/platform/node/product'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IExtensionService } from 'vs/platform/extensions/common/extensions'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IMessageService } from 'vs/platform/message/common/message'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { ITimerService } from 'vs/workbench/services/timer/common/timerService'; +import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions } from 'vs/workbench/common/contributions'; +import { Registry } from 'vs/platform/platform'; +import { ReportPerformanceIssueAction } from 'vs/workbench/electron-browser/actions'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { join } from 'path'; +import { localize } from 'vs/nls'; +import { platform, Platform } from 'vs/base/common/platform'; +import { readdir, stat } from 'vs/base/node/pfs'; +import { release } from 'os'; +import { stopProfiling } from 'vs/base/node/profiler'; +import { virtualMachineHint } from 'vs/base/node/id'; +import { forEach } from 'vs/base/common/collections'; +import URI from 'vs/base/common/uri'; -class PerformanceContribution implements IWorkbenchContribution { +class ProfilingHint implements IWorkbenchContribution { + + // p95 to p95 by os&release + static readonly _percentiles: { [key: string]: [number, number] } = { + ['Windows_6.3.9600']: [35782, 35782], + ['Windows_6.1.7601']: [11160, 18366], + ['Windows_10.0.16199']: [10423, 17222], + ['Windows_10.0.16193']: [7503, 11033], + ['Windows_10.0.16188']: [8544, 8807], + ['Windows_10.0.15063']: [11085, 16837], + ['Windows_10.0.14393']: [12585, 32662], + ['Windows_10.0.10586']: [7047, 10944], + ['Windows_10.0.10240']: [16176, 16176], + ['Mac_16.7.0']: [2192, 4050], + ['Mac_16.6.0']: [8043, 10608], + ['Mac_16.5.0']: [4912, 11348], + ['Mac_16.4.0']: [3900, 4200], + ['Mac_16.3.0']: [7327, 7327], + ['Mac_16.1.0']: [6090, 6555], + ['Mac_16.0.0']: [32574, 32574], + ['Mac_15.6.0']: [16082, 17469], + ['Linux_4.9.0-3-amd64']: [2092, 2197], + ['Linux_4.9.0-2-amd64']: [9779, 9779], + ['Linux_4.8.0-52-generic']: [12803, 13257], + ['Linux_4.8.0-51-generic']: [2670, 2797], + ['Linux_4.8.0-040800-generic']: [3954, 3954], + ['Linux_4.4.0-78-generic']: [4218, 5891], + ['Linux_4.4.0-77-generic']: [6166, 6166], + ['Linux_4.11.2']: [1323, 1323], + ['Linux_4.10.15-200.fc25.x86_64']: [9270, 9480], + ['Linux_4.10.13-1-ARCH']: [7116, 8511], + ['Linux_4.10.11-100.fc24.x86_64']: [1845, 1845], + ['Linux_4.10.0-21-generic']: [14805, 16050], + ['Linux_3.19.0-84-generic']: [4840, 4840], + ['Linux_3.11.10-29-desktop']: [1637, 2891], + }; + + private static readonly _myPercentiles = ProfilingHint._percentiles[`${Platform[platform]}_${release()}`]; constructor( - @IWindowsService private _windowsService: IWindowsService, - @ITimerService private _timerService: ITimerService, - @IMessageService private _messageService: IMessageService, - @IEnvironmentService private _envService: IEnvironmentService, - @IStorageService private _storageService: IStorageService, - @IExtensionService extensionService: IExtensionService, + @IWindowsService private readonly _windowsService: IWindowsService, + @ITimerService private readonly _timerService: ITimerService, + @IMessageService private readonly _messageService: IMessageService, + @IEnvironmentService private readonly _envService: IEnvironmentService, + @IStorageService private readonly _storageService: IStorageService, + @ITelemetryService private readonly _telemetryService: ITelemetryService, ) { - const dumpFile = _envService.args['prof-startup-timers']; - if (dumpFile) { - // wait for extensions being loaded - extensionService.onReady() - .then(() => TPromise.timeout(15000)) // time service isn't ready yet because it listens on the same event... - .then(() => this._dumpTimersAndQuit(dumpFile)) - .done(undefined, err => console.error(err)); - - } else if (!_envService.args['prof-startup']) { - // notify user of slow start - setTimeout(() => { - this._checkTimersAndSuggestToProfile(); - }, 5000); - } + setTimeout(() => this._checkTimersAndSuggestToProfile(), 5000); } getId(): string { - return 'performance'; - } - - private _dumpTimersAndQuit(folder: string) { - const metrics = this._timerService.startupMetrics; - const id = generateUuid(); - const all = assign({ id, commit: product.commit }, metrics); - const raw = JSON.stringify(all); - return writeFile(join(folder, `timers-${id}.json`), raw).then(() => this._windowsService.quit()); + return 'performance.ProfilingHint'; } private _checkTimersAndSuggestToProfile() { - const disabled = true; - if (disabled) { - return; - } - //TODO(joh) use better heuristics (70th percentile, not vm, etc) - - const value = this._storageService.get(this.getId(), StorageScope.GLOBAL, undefined); - if (value !== undefined) { + // Only initial startups, not when already profiling + if (!this._timerService.isInitialStartup || this._envService.args['prof-startup']) { return; } - if (virtualMachineHint.value() >= .5) { - // + // Check that we have some data about this + // OS version to which we can compare this startup. + // Then only go for startups between the 90 and + // 95th percentile. + if (!Array.isArray(ProfilingHint._myPercentiles)) { return; } - + const [p80, p90] = ProfilingHint._myPercentiles; const { ellapsed } = this._timerService.startupMetrics; - if (ellapsed > 5000 && Math.ceil(Math.random() * 10) % 3 === 0) { - const profile = this._messageService.confirm({ - type: 'info', - message: localize('slow', "Slow startup detected"), - detail: localize('slow.detail', "Sorry that you just had a slow startup. Please restart '{0}' with profiling enabled, share the profiles with us, and we will work hard to make startup great again.", this._envService.appNameLong), - primaryButton: 'Restart and profile' - }); + if (ellapsed < p80 || ellapsed > p90) { + return; + } - if (profile) { - this._storageService.store(this.getId(), 'didProfile', StorageScope.GLOBAL); - this._windowsService.relaunch({ addArgs: ['--prof-startup'] }); - } else { - this._storageService.store(this.getId(), 'didReject', StorageScope.GLOBAL); - } + // Ignore virtual machines and only ask users + // to profile with a certain propability + if (virtualMachineHint.value() >= .5 || Math.ceil(Math.random() * 50) !== 1) { + return; + } + + // Don't ask for the stable version, only + // ask once per version/build + if (this._envService.appQuality === 'stable') { + // don't ask in stable + return; + } + const mementoKey = `performance.didPromptToProfile.${product.commit}`; + const value = this._storageService.get(mementoKey, StorageScope.GLOBAL, undefined); + if (value !== undefined) { + // only ask once per version + return; + } + + const profile = this._messageService.confirm({ + type: 'info', + message: localize('slow', "Slow startup detected"), + detail: localize('slow.detail', "Sorry that you just had a slow startup. Please restart '{0}' with profiling enabled, share the profiles with us, and we will work hard to make startup great again.", this._envService.appNameLong), + primaryButton: 'Restart and profile' + }); + + this._telemetryService.publicLog('profileStartupInvite', { + acceptedInvite: profile + }); + + if (profile) { + this._storageService.store(mementoKey, 'didProfile', StorageScope.GLOBAL); + this._windowsService.relaunch({ addArgs: ['--prof-startup'] }); + } else { + this._storageService.store(mementoKey, 'didReject', StorageScope.GLOBAL); } } } +class StartupProfiler implements IWorkbenchContribution { + + constructor( + @IWindowsService private readonly _windowsService: IWindowsService, + @IMessageService private readonly _messageService: IMessageService, + @IEnvironmentService private readonly _environmentService: IEnvironmentService, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @IExtensionService extensionService: IExtensionService, + ) { + + extensionService.onReady().then(() => this._stopProfiling()); + } + + getId(): string { + return 'performance.StartupProfiler'; + } + + private _stopProfiling(): void { + + const { profileStartup } = this._environmentService; + if (!profileStartup) { + return; + } + + stopProfiling(profileStartup.dir, profileStartup.prefix).then(() => { + readdir(profileStartup.dir).then(files => { + return files.filter(value => value.indexOf(profileStartup.prefix) === 0); + }).then(files => { + const profileFiles = files.reduce((prev, cur) => `${prev}${join(profileStartup.dir, cur)}\n`, '\n'); + + const primaryButton = this._messageService.confirm({ + type: 'info', + message: localize('prof.message', "Successfully created profiles."), + detail: localize('prof.detail', "Please create an issue and manually attach the following files:\n{0}", profileFiles), + primaryButton: localize('prof.restartAndFileIssue', "Create Issue and Restart"), + secondaryButton: localize('prof.restart', "Restart") + }); + + if (primaryButton) { + const action = this._instantiationService.createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL); + TPromise.join([ + this._windowsService.showItemInFolder(join(profileStartup.dir, files[0])), + action.run(`:warning: Make sure to **attach** these files: :warning:\n${files.map(file => `-\`${join(profileStartup.dir, file)}\``).join('\n')}`) + ]).then(() => { + // keep window stable until restart is selected + this._messageService.confirm({ + type: 'info', + message: localize('prof.thanks', "Thanks for helping us."), + detail: localize('prof.detail.restart', "A final restart is required to continue to use '{0}'. Again, thank you for your contribution.", this._environmentService.appNameLong), + primaryButton: localize('prof.restart', "Restart"), + secondaryButton: null + }); + // now we are ready to restart + this._windowsService.relaunch({ removeArgs: ['--prof-startup'] }); + }); + + } else { + // simply restart + this._windowsService.relaunch({ removeArgs: ['--prof-startup'] }); + } + }); + }); + } +} + +class PerformanceTelemetry implements IWorkbenchContribution { + + constructor( + @ITimerService private readonly _timerService: ITimerService, + @ITelemetryService private readonly _telemetryService: ITelemetryService, + @IExtensionService extensionService: IExtensionService, + ) { + TPromise.join([ + TPromise.timeout(7 * 1000), + extensionService.onReady() + ]).then(() => { + this._sendWorkbenchMainSizeTelemetry(); + this._validateTimers(); + }); + } + + getId(): string { + return 'performance.PerformanceTelemetry'; + } + + private _validateTimers(): void { + const { startupMetrics } = this._timerService; + const invalidTimers: string[] = []; + forEach(startupMetrics.timers, (entry) => { + if (entry.value < 0) { + invalidTimers.push(entry.key); + } + }); + this._telemetryService.publicLog('perf:invalidTimers', { invalidTimers }); + } + + private _sendWorkbenchMainSizeTelemetry(): void { + const { fsPath } = URI.parse(require.toUrl('vs/workbench/electron-browser/workbench.main.js')); + stat(fsPath).then(stats => { + this._telemetryService.publicLog('perf:jsFileSize', { workbenchMain: stats.size }); + }); + } +} + const registry = Registry.as(Extensions.Workbench); -registry.registerWorkbenchContribution(PerformanceContribution); +registry.registerWorkbenchContribution(ProfilingHint); +registry.registerWorkbenchContribution(StartupProfiler); +registry.registerWorkbenchContribution(PerformanceTelemetry); diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts index ff98e9f5bc5..65043dc7561 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts @@ -21,16 +21,18 @@ import { Dimension } from 'vs/base/browser/builder'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; +import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; class KeybindingInputWidget extends Widget { - public readonly inputBox: InputBox; + private readonly inputBox: InputBox; private _acceptChords: boolean; private _firstPart: ResolvedKeybinding; private _chordPart: ResolvedKeybinding; + private _inputValue: string; private _onKeybinding = this._register(new Emitter<[ResolvedKeybinding, ResolvedKeybinding]>()); public readonly onKeybinding: Event<[ResolvedKeybinding, ResolvedKeybinding]> = this._onKeybinding.event; @@ -41,6 +43,9 @@ class KeybindingInputWidget extends Widget { private _onEscape = this._register(new Emitter()); public readonly onEscape: Event = this._onEscape.event; + private _onBlur = this._register(new Emitter()); + public readonly onBlur: Event = this._onBlur.event; + constructor(parent: HTMLElement, private options: IInputOptions, @IContextViewService private contextViewService: IContextViewService, @IKeybindingService private keybindingService: IKeybindingService, @@ -50,11 +55,27 @@ class KeybindingInputWidget extends Widget { this.inputBox = this._register(new InputBox(parent, this.contextViewService, this.options)); this._register(attachInputBoxStyler(this.inputBox, themeService)); this.onkeydown(this.inputBox.inputElement, e => this._onKeyDown(e)); + this.onblur(this.inputBox.inputElement, (e) => this._onBlur.fire()); + + this.oninput(this.inputBox.inputElement, (e) => { + // Prevent other characters from showing up + this.setInputValue(this._inputValue); + }); + this._acceptChords = true; this._firstPart = null; this._chordPart = null; } + public setInputValue(value: string): void { + this._inputValue = value; + this.inputBox.value = this._inputValue; + } + + public focus(): void { + this.inputBox.focus(); + } + public reset() { this._firstPart = null; this._chordPart = null; @@ -106,7 +127,7 @@ class KeybindingInputWidget extends Widget { if (this._chordPart) { value = value + ' ' + this._chordPart.getUserSettingsLabel(); } - this.inputBox.value = value; + this.setInputValue(value); this.inputBox.inputElement.title = info; this._onKeybinding.fire([this._firstPart, this._chordPart]); @@ -128,8 +149,11 @@ export class DefineKeybindingWidget extends Widget { private _onHide = this._register(new Emitter()); - constructor(parent: HTMLElement, @IKeybindingService private keybindingService: IKeybindingService, - @IInstantiationService private instantiationService: IInstantiationService + constructor( + parent: HTMLElement, + @IKeybindingService private keybindingService: IKeybindingService, + @IInstantiationService private instantiationService: IInstantiationService, + @IThemeService private themeService: IThemeService ) { super(); this.create(); @@ -151,9 +175,9 @@ export class DefineKeybindingWidget extends Widget { this._firstPart = null; this._chordPart = null; - this._keybindingInputWidget.inputBox.value = ''; + this._keybindingInputWidget.setInputValue(''); dom.clearNode(this._outputNode); - this._keybindingInputWidget.inputBox.focus(); + this._keybindingInputWidget.focus(); } const disposable = this._onHide.event(() => { if (this._firstPart) { @@ -186,11 +210,21 @@ export class DefineKeybindingWidget extends Widget { this._domNode.setHeight(DefineKeybindingWidget.HEIGHT); dom.append(this._domNode.domNode, dom.$('.message', null, nls.localize('defineKeybinding.initial', "Press desired key combination and ENTER. ESCAPE to cancel."))); + this._register(attachStylerCallback(this.themeService, { editorWidgetBackground, widgetShadow }, colors => { + this._domNode.domNode.style.backgroundColor = colors.editorWidgetBackground; + + if (colors.widgetShadow) { + this._domNode.domNode.style.boxShadow = `0 2px 8px ${colors.widgetShadow}`; + } else { + this._domNode.domNode.style.boxShadow = null; + } + })); + this._keybindingInputWidget = this._register(this.instantiationService.createInstance(KeybindingInputWidget, this._domNode.domNode, {})); this._register(this._keybindingInputWidget.onKeybinding(keybinding => this.printKeybinding(keybinding))); this._register(this._keybindingInputWidget.onEnter(() => this.hide())); this._register(this._keybindingInputWidget.onEscape(() => this.onCancel())); - this._register(dom.addDisposableListener(this._keybindingInputWidget.inputBox.inputElement, 'blur', e => this.onCancel())); + this._register(this._keybindingInputWidget.onBlur(() => this.onCancel())); this._outputNode = dom.append(this._domNode.domNode, dom.$('.output')); } diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index 2b8adf6502f..f0aa2694035 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -33,12 +33,13 @@ import { IKeybindingEditingService } from 'vs/workbench/services/keybinding/comm import { IListService } from 'vs/platform/list/browser/listService'; import { List } from 'vs/base/browser/ui/list/listWidget'; import { IDelegate, IRenderer, IListContextMenuEvent, IListEvent } from 'vs/base/browser/ui/list/list'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IChoiceService, IMessageService, Severity } from 'vs/platform/message/common/message'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { listHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; let $ = DOM.$; @@ -443,8 +444,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor this.createRemoveAction(e.element), this.createResetAction(e.element), new Separator(), - this.createShowConflictsAction(e.element)]), - getKeyBinding: (action) => this.keybindingsService.lookupKeybinding(action.id) + this.createShowConflictsAction(e.element)]) }); } } @@ -797,4 +797,11 @@ class WhenColumn extends Column { private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string { return keybindingItemEntry.keybindingItem.when ? localize('whenAriaLabel', "When is {0}.", keybindingItemEntry.keybindingItem.when) : localize('noWhen', "No when context."); } -} \ No newline at end of file +} + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + const listHighlightForegroundColor = theme.getColor(listHighlightForeground); + if (listHighlightForegroundColor) { + collector.addRule(`.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row > .column .highlight { color: ${listHighlightForegroundColor}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts index e95d1a48d82..d5aaccbae45 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts @@ -15,11 +15,10 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { ServicesAccessor, registerEditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { ServicesAccessor, registerEditorCommand, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; -import { CodeSnippet } from 'vs/editor/contrib/snippet/common/snippet'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { SmartSnippetInserter } from 'vs/workbench/parts/preferences/common/smartSnippetInserter'; import { DefineKeybindingOverlayWidget } from 'vs/workbench/parts/preferences/browser/keybindingWidgets'; import { FloatingClickWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; @@ -27,7 +26,6 @@ import { parseTree, Node } from 'vs/base/common/json'; import { KeybindingIO } from 'vs/workbench/services/keybinding/common/keybindingIO'; import { ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { EditorCommand } from 'vs/editor/common/config/config'; const NLS_LAUNCH_MESSAGE = nls.localize('defineKeybinding.start', "Define Keybinding"); const NLS_KB_LAYOUT_INFO_MESSAGE = nls.localize('defineKeybinding.kbLayoutInfoMessage', "For your current keyboard layout press "); @@ -44,58 +42,88 @@ export class DefineKeybindingController extends Disposable implements editorComm return editor.getContribution(DefineKeybindingController.ID); } - private _keybindingEditorRenderer: KeybindingEditorRenderer; + private _keybindingWidgetRenderer: KeybindingWidgetRenderer; + private _keybindingDecorationRenderer: KeybindingEditorDecorationsRenderer; constructor( private _editor: ICodeEditor, - @IKeybindingService keybindingService: IKeybindingService, - @IInstantiationService private instantiationService: IInstantiationService + @IInstantiationService private _instantiationService: IInstantiationService ) { super(); - this._register(this._editor.onDidChangeModel(e => this._renderKeybindingEditor())); - this._renderKeybindingEditor(); + this._keybindingWidgetRenderer = null; + this._keybindingDecorationRenderer = null; + + this._register(this._editor.onDidChangeModel(e => this._update())); + this._update(); } public getId(): string { return DefineKeybindingController.ID; } - public get keybindingEditorRenderer(): KeybindingEditorRenderer { - return this._keybindingEditorRenderer; + public get keybindingWidgetRenderer(): KeybindingWidgetRenderer { + return this._keybindingWidgetRenderer; } public dispose(): void { - this._disposeKeybindingEditorRenderer(); + this._disposeKeybindingWidgetRenderer(); + this._disposeKeybindingDecorationRenderer(); super.dispose(); } - private _renderKeybindingEditor(): void { - if (isInterestingEditorModel(this._editor)) { - if (!this._keybindingEditorRenderer) { - this._keybindingEditorRenderer = this.instantiationService.createInstance(KeybindingEditorRenderer, this._editor); - } + private _update(): void { + if (!isInterestingEditorModel(this._editor)) { + this._disposeKeybindingWidgetRenderer(); + this._disposeKeybindingDecorationRenderer(); + return; + } + + // Decorations are shown for the default keybindings.json **and** for the user keybindings.json + this._createKeybindingDecorationRenderer(); + + // The button to define keybindings is shown only for the user keybindings.json + if (!this._editor.getConfiguration().readOnly) { + this._createKeybindingWidgetRenderer(); } else { - this._disposeKeybindingEditorRenderer(); + this._disposeKeybindingWidgetRenderer(); } } - private _disposeKeybindingEditorRenderer(): void { - if (this._keybindingEditorRenderer) { - this._keybindingEditorRenderer.dispose(); - this._keybindingEditorRenderer = null; + private _createKeybindingWidgetRenderer(): void { + if (!this._keybindingWidgetRenderer) { + this._keybindingWidgetRenderer = this._instantiationService.createInstance(KeybindingWidgetRenderer, this._editor); + } + } + + private _disposeKeybindingWidgetRenderer(): void { + if (this._keybindingWidgetRenderer) { + this._keybindingWidgetRenderer.dispose(); + this._keybindingWidgetRenderer = null; + } + } + + private _createKeybindingDecorationRenderer(): void { + if (!this._keybindingDecorationRenderer) { + this._keybindingDecorationRenderer = this._instantiationService.createInstance(KeybindingEditorDecorationsRenderer, this._editor); + } + } + + private _disposeKeybindingDecorationRenderer(): void { + if (this._keybindingDecorationRenderer) { + this._keybindingDecorationRenderer.dispose(); + this._keybindingDecorationRenderer = null; } } } -export class KeybindingEditorRenderer extends Disposable { +export class KeybindingWidgetRenderer extends Disposable { private _launchWidget: FloatingClickWidget; private _defineWidget: DefineKeybindingOverlayWidget; constructor( private _editor: ICodeEditor, - @IKeybindingService private _keybindingService: IKeybindingService, @IInstantiationService private _instantiationService: IInstantiationService ) { super(); @@ -103,7 +131,6 @@ export class KeybindingEditorRenderer extends Disposable { this._register(this._launchWidget.onClick(() => this.showDefineKeybindingWidget())); this._defineWidget = this._register(this._instantiationService.createInstance(DefineKeybindingOverlayWidget, this._editor)); - this._register(this._instantiationService.createInstance(KeybindingEditorDecorationsRenderer, this._editor)); this._launchWidget.render(); } @@ -131,7 +158,7 @@ export class KeybindingEditorRenderer extends Disposable { snippetText = smartInsertInfo.prepend + snippetText + smartInsertInfo.append; this._editor.setPosition(smartInsertInfo.position); - SnippetController.get(this._editor).run(CodeSnippet.fromTextmate(snippetText), 0, 0); + SnippetController2.get(this._editor).insert(snippetText, 0, 0); } } } @@ -317,20 +344,17 @@ class DefineKeybindingCommand extends EditorCommand { } public runEditorCommand(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void { - if (!isInterestingEditorModel(editor)) { + if (!isInterestingEditorModel(editor) || editor.getConfiguration().readOnly) { return; } let controller = DefineKeybindingController.get(editor); - if (controller && controller.keybindingEditorRenderer) { - controller.keybindingEditorRenderer.showDefineKeybindingWidget(); + if (controller && controller.keybindingWidgetRenderer) { + controller.keybindingWidgetRenderer.showDefineKeybindingWidget(); } } } function isInterestingEditorModel(editor: editorCommon.ICommonCodeEditor): boolean { - if (editor.getConfiguration().readOnly) { - return false; - } let model = editor.getModel(); if (!model) { return false; @@ -339,4 +363,4 @@ function isInterestingEditorModel(editor: editorCommon.ICommonCodeEditor): boole return INTERESTING_FILE.test(url); } -registerEditorCommand(new DefineKeybindingCommand()); \ No newline at end of file +registerEditorCommand(new DefineKeybindingCommand()); diff --git a/src/vs/workbench/parts/preferences/browser/media/keybindings.css b/src/vs/workbench/parts/preferences/browser/media/keybindings.css index d7dbc15225f..4bdbe2a8bc6 100644 --- a/src/vs/workbench/parts/preferences/browser/media/keybindings.css +++ b/src/vs/workbench/parts/preferences/browser/media/keybindings.css @@ -34,18 +34,6 @@ margin: 0px 4px; } -/* Theming */ -.defineKeybindingWidget { - background-color: #EFEFF2; - box-shadow: 0 2px 8px #A8A8A8; -} - -.hc-black .defineKeybindingWidget, -.vs-dark .defineKeybindingWidget { - background-color: #2D2D30; - box-shadow: 0 2px 8px #000; -} - /* Editor decorations */ .monaco-editor .inlineKeybindingInfo:before { margin: 0.2em 0.1em 0 0.1em; @@ -75,13 +63,4 @@ .monaco-editor .keybindingError { box-shadow: inset 0 0 0 1px #B9B9B9; background-color: rgba(250, 100, 100, 0.2); -} - -/* launcher widget */ -.monaco-editor .defineKeybindingLauncher { - background: #007ACC; - color: white; - padding: 10px; - border-radius: 5px; - cursor: pointer; } \ No newline at end of file diff --git a/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css b/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css index f208709fcc4..94a771ce087 100644 --- a/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css +++ b/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css @@ -38,10 +38,6 @@ height: 30px; } -.keybindings-editor > .keybindings-header .search-container > .settings-search-input > .monaco-inputbox { - border: 1px solid #ddd; -} - .keybindings-editor > .keybindings-header .search-container > .settings-search-input > .monaco-inputbox .input { font-size: 14px; padding-left:10px; @@ -49,7 +45,7 @@ .keybindings-editor > .keybindings-header .open-keybindings-container { margin-top: 10px; - color: #aaa; + opacity: 0.7; display: flex; } @@ -59,17 +55,6 @@ margin-left: 4px; } -/* body styling */ - -.keybindings-editor > .keybindings-body { - border-top: 1px solid #efeff2; -} - -.vs-dark .keybindings-editor > .keybindings-body { - border-top: 1px solid #2d2d2d; -} - - /** List based styling **/ .keybindings-editor > .keybindings-body .keybindings-list-container { @@ -83,20 +68,12 @@ display: flex; } -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header.focused, -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header.selected, -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header:hover, -.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row.keybindings-list-header, .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row.even:not(.focused):not(.selected):not(:hover), .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:not(:focus) .monaco-list-row.focused.even:not(.selected):not(:hover), .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:not(.focused) .monaco-list-row.focused.even:not(.selected):not(:hover) { background-color: rgba(130, 130, 130, 0.04); } -.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row:hover { - background-color: rgba(128, 128, 128, 0.15); -} - .keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row > .header { text-align: left; font-weight: bold; @@ -163,19 +140,9 @@ } .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row > .column .highlight { - color: #007ACC; font-weight: bold; } -.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:focus .monaco-list-row.selected > .column .highlight { - color: #1b3c53; -} - -.vs-dark .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:focus .monaco-list-row.selected > .column .highlight, -.hc-black .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:focus .monaco-list-row.selected > .column .highlight { - color: #049aff; -} - .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row > .column .monaco-action-bar { display: none; flex: 1; diff --git a/src/vs/workbench/parts/preferences/browser/media/preferences.css b/src/vs/workbench/parts/preferences/browser/media/preferences.css index 1bc95c360d3..c5dc62f5524 100644 --- a/src/vs/workbench/parts/preferences/browser/media/preferences.css +++ b/src/vs/workbench/parts/preferences/browser/media/preferences.css @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ .preferences-editor > .preferences-header { - border-bottom: 1px solid #efeff2; display: flex; flex-wrap: wrap; padding-left: 27px; @@ -19,8 +18,8 @@ padding-bottom: 5px; } -.vs-dark .preferences-editor > .preferences-header { - border-bottom: 1px solid #2d2d2d; +.preferences-editor > .preferences-editors-container.side-by-side-preferences-editor { + position: relative; } .settings-tabs-widget { @@ -108,27 +107,12 @@ position: absolute; right: 10px; border-radius: 2px; - background-color: #EFEFF2; } .settings-header-widget > .settings-count-widget.hide { display: none; } -.hc-black .settings-header-widget > .settings-count-widget, -.vs-dark .settings-header-widget > .settings-count-widget { - background-color: #2D2D30; -} - -.settings-header-widget > .settings-count-widget.no-results { - color: #A1260D; -} - -.hc-black .settings-header-widget > .settings-count-widget.no-results, -.vs-dark .settings-header-widget > .settings-count-widget.no-results { - color: #F48771 -} - .settings-header-widget > .settings-search-container { flex: 1; } @@ -150,14 +134,6 @@ padding-left:10px; } -.vs-dark .preferences-editor .side-by-side-preferences-editor > .editable-preferences-editor-container { - box-shadow: -6px 0 5px -5px black; -} - -.preferences-editor .side-by-side-preferences-editor > .editable-preferences-editor-container { - box-shadow: -6px 0 5px -5px #DDD; -} - .monaco-editor .settings-group-title-widget { z-index: 1; } @@ -238,8 +214,6 @@ } .monaco-editor .floating-click-widget { - background: #007ACC; - color: white; padding: 10px; border-radius: 5px; cursor: pointer; diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 9d2702ff6bc..ca535cf3de0 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -32,7 +32,7 @@ import { SearchWidget, SettingsTabsWidget } from 'vs/workbench/parts/preferences import { ContextKeyExpr, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { Command } from 'vs/editor/common/editorCommonExtensions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IStorageService } from 'vs/platform/storage/common/storage'; @@ -53,6 +53,8 @@ import { FindController } from 'vs/editor/contrib/find/browser/find'; import { SelectionHighlighter } from 'vs/editor/contrib/find/common/findController'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { attachStylerCallback } from 'vs/platform/theme/common/styler'; +import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; export class PreferencesEditorInput extends SideBySideEditorInput { public static ID: string = 'workbench.editorinputs.preferencesEditorInput'; @@ -111,7 +113,7 @@ export class PreferencesEditor extends BaseEditor { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IContextKeyService private contextKeyService: IContextKeyService, @IInstantiationService private instantiationService: IInstantiationService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService + @IThemeService themeService: IThemeService ) { super(PreferencesEditor.ID, telemetryService, themeService); this.defaultSettingsEditorContextKey = CONTEXT_SETTINGS_EDITOR.bindTo(this.contextKeyService); @@ -159,7 +161,7 @@ export class PreferencesEditor extends BaseEditor { } public focus(): void { - this.sideBySidePreferencesWidget.focus(); + this.searchWidget.focus(); } public focusSearch(): void { @@ -329,7 +331,7 @@ class SideBySidePreferencesWidget extends Widget { private sash: VSash; - constructor(parent: HTMLElement, @IInstantiationService private instantiationService: IInstantiationService) { + constructor(parent: HTMLElement, @IInstantiationService private instantiationService: IInstantiationService, @IThemeService private themeService: IThemeService) { super(); this.create(parent); } @@ -346,6 +348,15 @@ class SideBySidePreferencesWidget extends Widget { this.editablePreferencesEditorContainer = DOM.append(parentElement, DOM.$('.editable-preferences-editor-container')); this.editablePreferencesEditorContainer.style.position = 'absolute'; + this._register(attachStylerCallback(this.themeService, { scrollbarShadow }, colors => { + const shadow = colors.scrollbarShadow ? colors.scrollbarShadow.toString() : null; + + if (shadow) { + this.editablePreferencesEditorContainer.style.boxShadow = `-6px 0 5px -5px ${shadow}`; + } else { + this.editablePreferencesEditorContainer.style.boxShadow = null; + } + })); } public setInput(defaultPreferencesEditorInput: DefaultPreferencesEditorInput, editablePreferencesEditorInput: EditorInput, options?: EditorOptions): TPromise<{ defaultPreferencesRenderer: IPreferencesRenderer, editablePreferencesRenderer: IPreferencesRenderer }> { @@ -461,7 +472,7 @@ export class DefaultPreferencesEditor extends BaseTextEditor { @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchThemeService themeService: IWorkbenchThemeService, + @IThemeService themeService: IThemeService, @IPreferencesService private preferencesService: IPreferencesService, @IModelService private modelService: IModelService, @IModeService modeService: IModeService, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index ef2c5cbe388..81941633f5d 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -24,7 +24,7 @@ import { IContextMenuService, ContextSubMenu } from 'vs/platform/contextview/bro import { SettingsGroupTitleWidget, EditPreferenceWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; -import { IConfigurationEditingService } from 'vs/workbench/services/configuration/common/configurationEditing'; +import { IConfigurationEditingService, IConfigurationEditingError, ConfigurationEditingErrorCode, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { overrideIdentifierFromKey } from 'vs/platform/configuration/common/model'; import { IMarkerService, IMarkerData } from 'vs/platform/markers/common/markers'; @@ -32,6 +32,7 @@ import { IWorkspaceConfigurationService } from 'vs/workbench/services/configurat import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IPreferencesRenderer extends IDisposable { preferencesModel: IPreferencesEditorModel; @@ -100,8 +101,19 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend public updatePreference(key: string, value: any, source: ISetting): void { this.telemetryService.publicLog('defaultSettingsActions.copySetting', { userConfigurationKeys: [key] }); const overrideIdentifier = source.overrideOf ? overrideIdentifierFromKey(source.overrideOf.key) : null; - this.configurationEditingService.writeConfiguration(this.preferencesModel.configurationTarget, { key, value, overrideIdentifier }, !this.textFileService.isDirty(this.preferencesModel.uri)) - .then(() => this.onSettingUpdated(source), error => this.messageService.show(Severity.Error, error)); + this.configurationEditingService.writeConfiguration(this.preferencesModel.configurationTarget, { key, value, overrideIdentifier }, { donotSave: this.textFileService.isDirty(this.preferencesModel.uri), donotNotifyError: true }) + .then(() => this.onSettingUpdated(source), error => { + this.messageService.show(Severity.Error, this.toErrorMessage(error, this.preferencesModel.configurationTarget)); + }); + } + + private toErrorMessage(error: IConfigurationEditingError, target: ConfigurationTarget): string { + switch (error.code) { + case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: { + return nls.localize('errorInvalidConfiguration', "Unable to write into settings. Correct errors/warnings in the file and try again."); + }; + } + return error.message; } private onModelChanged(): void { @@ -557,13 +569,15 @@ export class HighlightPreferencesRenderer extends Disposable { } } + private static _FIND_MATCH = ModelDecorationOptions.register({ + stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'findMatch' + }); + private createDecoration(range: IRange, model: editorCommon.IModel): editorCommon.IModelDeltaDecoration { return { range, - options: { - stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'findMatch' - } + options: HighlightPreferencesRenderer._FIND_MATCH }; } @@ -670,7 +684,7 @@ class EditSettingRenderer extends Disposable { } private onConfigurationChanged(): void { - if (!this.editor.getRawConfiguration().glyphMargin) { + if (!this.editor.getConfiguration().viewInfo.glyphMargin) { this.editPreferenceWidgetForCusorPosition.hide(); this.editPreferenceWidgetForMouseMove.hide(); } @@ -720,7 +734,7 @@ class EditSettingRenderer extends Disposable { private showEditPreferencesWidget(editPreferencesWidget: EditPreferenceWidget, settings: ISetting[]) { const line = settings[0].valueRange.startLineNumber; - if (this.editor.getRawConfiguration().glyphMargin && this.marginFreeFromOtherDecorations(line)) { + if (this.editor.getConfiguration().viewInfo.glyphMargin && this.marginFreeFromOtherDecorations(line)) { editPreferencesWidget.show(line, nls.localize('editTtile', "Edit"), settings); const editPreferenceWidgetToHide = editPreferencesWidget === this.editPreferenceWidgetForCusorPosition ? this.editPreferenceWidgetForMouseMove : this.editPreferenceWidgetForCusorPosition; editPreferenceWidgetToHide.hide(); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesService.ts b/src/vs/workbench/parts/preferences/browser/preferencesService.ts index 03b8646a1bc..436d010bd46 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesService.ts @@ -325,7 +325,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic } return { lineNumber: setting.valueRange.startLineNumber, column: setting.valueRange.startColumn + 1 }; } - return this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: languageKey, value: {} }, false) + return this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: languageKey, value: {} }, { donotSave: true }) .then(() => { setting = settingsModel.getPreference(languageKey); let content = eol + this.spaces(2, configuration) + eol + this.spaces(1, configuration); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts index 26e55c992fa..52f1edebae3 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts @@ -23,10 +23,11 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { Action } from 'vs/base/common/actions'; -import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; +import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { buttonBackground, buttonForeground, badgeForeground, badgeBackground, contrastBorder, errorForeground } from 'vs/platform/theme/common/colorRegistry'; export class SettingsGroupTitleWidget extends Widget implements IViewZone { @@ -262,6 +263,18 @@ export class SearchWidget extends Widget { this.domNode = DOM.append(parent, DOM.$('div.settings-header-widget')); this.createSearchContainer(DOM.append(this.domNode, DOM.$('div.settings-search-container'))); this.countElement = DOM.append(this.domNode, DOM.$('.settings-count-widget')); + this._register(attachStylerCallback(this.themeService, { badgeBackground, contrastBorder }, colors => { + const background = colors.badgeBackground ? colors.badgeBackground.toString() : null; + const border = colors.contrastBorder ? colors.contrastBorder.toString() : null; + + this.countElement.style.backgroundColor = background; + + this.countElement.style.borderWidth = border ? '1px' : null; + this.countElement.style.borderStyle = border ? 'solid' : null; + this.countElement.style.borderColor = border; + + this.styleCountElementForeground(); + })); this.inputBox.inputElement.setAttribute('aria-live', 'assertive'); } @@ -285,6 +298,13 @@ export class SearchWidget extends Widget { this.inputBox.inputElement.setAttribute('aria-label', message); DOM.toggleClass(this.countElement, 'no-results', count === 0); this.inputBox.inputElement.style.paddingRight = DOM.getTotalWidth(this.countElement) + 20 + 'px'; + this.styleCountElementForeground(); + } + + private styleCountElementForeground() { + const colorId = DOM.hasClass(this.countElement, 'no-results') ? errorForeground : badgeForeground; + const color = this.themeService.getTheme().getColor(colorId); + this.countElement.style.color = color ? color.toString() : null; } public layout(dimension: Dimension) { @@ -360,10 +380,15 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget { private _onClick: Emitter = this._register(new Emitter()); public onClick: Event = this._onClick.event; - constructor(private editor: ICodeEditor, private label: string, private keyBindingAction: string, - @IKeybindingService keybindingService: IKeybindingService + constructor( + private editor: ICodeEditor, + private label: string, + private keyBindingAction: string, + @IKeybindingService keybindingService: IKeybindingService, + @IThemeService private themeService: IThemeService ) { super(); + if (keyBindingAction) { let keybinding = keybindingService.lookupKeybinding(keyBindingAction); if (keybinding) { @@ -374,6 +399,11 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget { public render() { this._domNode = DOM.$('.floating-click-widget'); + this._register(attachStylerCallback(this.themeService, { buttonBackground, buttonForeground }, colors => { + this._domNode.style.backgroundColor = colors.buttonBackground; + this._domNode.style.color = colors.buttonForeground; + })); + DOM.append(this._domNode, DOM.$('')).textContent = this.label; this.onclick(this._domNode, e => this._onClick.fire()); this.editor.addOverlayWidget(this); diff --git a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts index a1f187ccc31..65379a3689f 100644 --- a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts +++ b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts @@ -10,7 +10,7 @@ import * as strings from 'vs/base/common/strings'; import { OperatingSystem, language, LANGUAGE_DEFAULT } from 'vs/base/common/platform'; import { IMatch, IFilter, or, matchesContiguousSubString, matchesPrefix, matchesCamelCase, matchesWords } from 'vs/base/common/filters'; import { Registry } from 'vs/platform/platform'; -import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; +import { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { AriaLabelProvider, UserSettingsLabelProvider, UILabelProvider, ModifierLabels as ModLabels } from 'vs/platform/keybinding/common/keybindingLabels'; import { CommonEditorRegistry, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { MenuRegistry, ILocalizedString, SyncActionDescriptor, ICommandAction } from 'vs/platform/actions/common/actions'; @@ -355,7 +355,7 @@ class KeybindingItemMatches { return this.hasAnyMatch(firstPartMatch) || this.hasAnyMatch(chordPartMatch) ? { firstPart: firstPartMatch, chordPart: chordPartMatch } : null; } - private matchPart(part: ResolvedKeybinding, match: KeybindingMatch, word: string): boolean { + private matchPart(part: ResolvedKeybindingPart, match: KeybindingMatch, word: string): boolean { let matched = false; if (this.matchesMetaModifier(part, word)) { matched = true; @@ -380,11 +380,11 @@ class KeybindingItemMatches { return matched; } - private matchesKeyCode(keybinding: ResolvedKeybinding, word: string): boolean { + private matchesKeyCode(keybinding: ResolvedKeybindingPart, word: string): boolean { if (!keybinding) { return false; } - const ariaLabel = keybinding.getAriaLabelWithoutModifiers(); + const ariaLabel = keybinding.keyAriaLabel; if (ariaLabel.length === 1 || word.length === 1) { if (strings.compareIgnoreCase(ariaLabel, word) === 0) { return true; @@ -397,11 +397,11 @@ class KeybindingItemMatches { return false; } - private matchesMetaModifier(keybinding: ResolvedKeybinding, word: string): boolean { + private matchesMetaModifier(keybinding: ResolvedKeybindingPart, word: string): boolean { if (!keybinding) { return false; } - if (!keybinding.hasMetaModifier()) { + if (!keybinding.metaKey) { return false; } return this.wordMatchesMetaModifier(word); @@ -423,11 +423,11 @@ class KeybindingItemMatches { return false; } - private matchesCtrlModifier(keybinding: ResolvedKeybinding, word: string): boolean { + private matchesCtrlModifier(keybinding: ResolvedKeybindingPart, word: string): boolean { if (!keybinding) { return false; } - if (!keybinding.hasCtrlModifier()) { + if (!keybinding.ctrlKey) { return false; } return this.wordMatchesCtrlModifier(word); @@ -446,11 +446,11 @@ class KeybindingItemMatches { return false; } - private matchesShiftModifier(keybinding: ResolvedKeybinding, word: string): boolean { + private matchesShiftModifier(keybinding: ResolvedKeybindingPart, word: string): boolean { if (!keybinding) { return false; } - if (!keybinding.hasShiftModifier()) { + if (!keybinding.shiftKey) { return false; } return this.wordMatchesShiftModifier(word); @@ -469,11 +469,11 @@ class KeybindingItemMatches { return false; } - private matchesAltModifier(keybinding: ResolvedKeybinding, word: string): boolean { + private matchesAltModifier(keybinding: ResolvedKeybindingPart, word: string): boolean { if (!keybinding) { return false; } - if (!keybinding.hasAltModifier()) { + if (!keybinding.altKey) { return false; } return this.wordMatchesAltModifier(word); @@ -503,42 +503,42 @@ class KeybindingItemMatches { keybindingMatch.keyCode; } - private isCompleteMatch(part: ResolvedKeybinding, match: KeybindingMatch): boolean { + private isCompleteMatch(part: ResolvedKeybindingPart, match: KeybindingMatch): boolean { if (!part) { return true; } if (!match.keyCode) { return false; } - if (part.hasMetaModifier() && !match.metaKey) { + if (part.metaKey && !match.metaKey) { return false; } - if (part.hasAltModifier() && !match.altKey) { + if (part.altKey && !match.altKey) { return false; } - if (part.hasCtrlModifier() && !match.ctrlKey) { + if (part.ctrlKey && !match.ctrlKey) { return false; } - if (part.hasShiftModifier() && !match.shiftKey) { + if (part.shiftKey && !match.shiftKey) { return false; } return true; } - private createCompleteMatch(part: ResolvedKeybinding): KeybindingMatch { + private createCompleteMatch(part: ResolvedKeybindingPart): KeybindingMatch { let match: KeybindingMatch = {}; if (part) { match.keyCode = true; - if (part.hasMetaModifier()) { + if (part.metaKey) { match.metaKey = true; } - if (part.hasAltModifier()) { + if (part.altKey) { match.altKey = true; } - if (part.hasCtrlModifier()) { + if (part.ctrlKey) { match.ctrlKey = true; } - if (part.hasShiftModifier()) { + if (part.shiftKey) { match.shiftKey = true; } } diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index babd5ed62e2..260ab6e1a64 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -20,14 +20,15 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { Registry } from 'vs/platform/platform'; import { QuickOpenHandler, QuickOpenAction } from 'vs/workbench/browser/quickopen'; -import { IEditorAction, IEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { IEditorAction, IEditor, isCommonCodeEditor, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { matchesWords, matchesPrefix, matchesContiguousSubString, or } from 'vs/base/common/filters'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService, Severity, IMessageWithAction } from 'vs/platform/message/common/message'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; +import { editorAction, EditorAction } from 'vs/editor/common/editorCommonExtensions'; export const ALL_COMMANDS_PREFIX = '>'; export const EDITOR_COMMANDS_PREFIX = '$'; @@ -44,13 +45,40 @@ export class ShowAllCommandsAction extends QuickOpenAction { } } +@editorAction +class CommandPaletteEditorAction extends EditorAction { + + constructor() { + super({ + id: ShowAllCommandsAction.ID, + label: nls.localize('showCommands.label', "Command Palette..."), + alias: 'Command Palette', + precondition: null, + menuOpts: { + } + }); + } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise { + const quickOpenService = accessor.get(IQuickOpenService); + + // Show with prefix + quickOpenService.show(ALL_COMMANDS_PREFIX); + + return TPromise.as(null); + } +} + class BaseCommandEntry extends QuickOpenEntryGroup { + private commandId: string; private keyLabel: string; private keyAriaLabel: string; private label: string; + private description: string; private alias: string; constructor( + commandId: string, keyLabel: string, keyAriaLabel: string, label: string, @@ -62,6 +90,7 @@ class BaseCommandEntry extends QuickOpenEntryGroup { ) { super(); + this.commandId = commandId; this.keyLabel = keyLabel; this.keyAriaLabel = keyAriaLabel; this.label = label; @@ -75,10 +104,22 @@ class BaseCommandEntry extends QuickOpenEntryGroup { this.setHighlights(labelHighlights, null, aliasHighlights); } + public getCommandId(): string { + return this.commandId; + } + public getLabel(): string { return this.label; } + public getDescription(): string { + return this.description; + } + + public setDescription(description: string): void { + this.description = description; + } + public getDetail(): string { return this.alias; } @@ -115,14 +156,14 @@ class BaseCommandEntry extends QuickOpenEntryGroup { this.telemetryService.publicLog('workbenchActionExecuted', { id: action.id, from: 'quick open' }); (action.run() || TPromise.as(null)).done(() => { action.dispose(); - }, (err) => this.onError(err)); + }, err => this.onError(err)); } catch (error) { this.onError(error); } } else { this.messageService.show(Severity.Info, nls.localize('actionNotEnabled', "Command '{0}' is not enabled in the current context.", this.getLabel())); } - }, (err) => this.onError(err)); + }, err => this.onError(err)); } } @@ -130,6 +171,7 @@ class CommandEntry extends BaseCommandEntry { private actionDescriptor: SyncActionDescriptor; constructor( + commandId: string, keyLabel: string, keyAriaLabel: string, label: string, @@ -141,7 +183,7 @@ class CommandEntry extends BaseCommandEntry { @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); + super(commandId, keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); this.actionDescriptor = actionDescriptor; } @@ -162,6 +204,7 @@ class EditorActionCommandEntry extends BaseCommandEntry { private action: IEditorAction; constructor( + commandId: string, keyLabel: string, keyAriaLabel: string, label: string, @@ -172,7 +215,7 @@ class EditorActionCommandEntry extends BaseCommandEntry { @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); + super(commandId, keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); this.action = action; } @@ -184,14 +227,14 @@ class EditorActionCommandEntry extends BaseCommandEntry { if (this.action) { try { this.telemetryService.publicLog('workbenchActionExecuted', { id: this.action.id, from: 'quick open' }); - (this.action.run() || TPromise.as(null)).done(null, (err) => this.onError(err)); + (this.action.run() || TPromise.as(null)).done(null, err => this.onError(err)); } catch (error) { this.onError(error); } } else { this.messageService.show(Severity.Info, nls.localize('actionNotEnabled', "Command '{0}' is not enabled in the current context.", this.getLabel())); } - }, (err) => this.onError(err)); + }, err => this.onError(err)); return true; } @@ -205,6 +248,7 @@ class ActionCommandEntry extends BaseCommandEntry { private action: IAction; constructor( + commandId: string, keyLabel: string, keyAriaLabel: string, label: string, @@ -215,7 +259,7 @@ class ActionCommandEntry extends BaseCommandEntry { @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, messageService, telemetryService); + super(commandId, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, messageService, telemetryService); this.action = action; } @@ -283,7 +327,18 @@ export class CommandsHandler extends QuickOpenHandler { let entries = [...workbenchEntries, ...editorEntries, ...commandEntries]; // Remove duplicates - entries = arrays.distinct(entries, (entry) => entry.getLabel() + entry.getGroupLabel()); + entries = arrays.distinct(entries, entry => `${entry.getLabel()}${entry.getGroupLabel()}${entry.getCommandId()}`); + + // Handle label clashes + const commandLabels = new Set(); + entries.forEach(entry => { + const commandLabel = `${entry.getLabel()}${entry.getGroupLabel()}`; + if (commandLabels.has(commandLabel)) { + entry.setDescription(entry.getCommandId()); + } else { + commandLabels.add(commandLabel); + } + }); // Sort by name entries = entries.sort((elementA, elementB) => elementA.getLabel().toLowerCase().localeCompare(elementB.getLabel().toLowerCase())); @@ -315,7 +370,7 @@ export class CommandsHandler extends QuickOpenHandler { const labelHighlights = wordFilter(searchValue, label); const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(CommandEntry, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, actionDescriptor)); + entries.push(this.instantiationService.createInstance(CommandEntry, actionDescriptor.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, actionDescriptor)); } } } @@ -328,6 +383,9 @@ export class CommandsHandler extends QuickOpenHandler { for (let i = 0; i < actions.length; i++) { const action = actions[i]; + if (action.id === ShowAllCommandsAction.ID) { + continue; // avoid duplicates + } const keybinding = this.keybindingService.lookupKeybinding(action.id); const keyLabel = keybinding ? keybinding.getLabel() : ''; @@ -341,7 +399,7 @@ export class CommandsHandler extends QuickOpenHandler { const labelHighlights = wordFilter(searchValue, label); const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(EditorActionCommandEntry, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); + entries.push(this.instantiationService.createInstance(EditorActionCommandEntry, action.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); } } } @@ -376,7 +434,7 @@ export class CommandsHandler extends QuickOpenHandler { } const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(ActionCommandEntry, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); + entries.push(this.instantiationService.createInstance(ActionCommandEntry, action.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); } } } @@ -405,4 +463,4 @@ export class EditorCommandsHandler extends CommandsHandler { protected includeWorkbenchCommands(): boolean { return false; } -} +} \ No newline at end of file diff --git a/src/vs/workbench/parts/scm/browser/scmPreview.ts b/src/vs/workbench/parts/scm/browser/scmPreview.ts deleted file mode 100644 index 0f2db3ad70a..00000000000 --- a/src/vs/workbench/parts/scm/browser/scmPreview.ts +++ /dev/null @@ -1,96 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { Action } from 'vs/base/common/actions'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IWindowService } from 'vs/platform/windows/common/windows'; -import { IMessageService } from 'vs/platform/message/common/message'; - -// tslint:disable -import pkg from 'vs/platform/node/package'; -// tslint:enable - -// Enable this by default -function getDefaultValue(): boolean { - const minorVersion = pkg.version.replace(/^(\d+\.\d+).*$/, '$1'); - const forcedVersion = window.localStorage.getItem('forcedPreviewSCMVersion'); - - if (forcedVersion !== minorVersion) { - window.localStorage.setItem('forcedPreviewSCMVersion', minorVersion); - window.localStorage.setItem('enablePreviewSCM', 'true'); - } - - const value = window.localStorage.getItem('enablePreviewSCM'); - return value !== 'false'; -} - -export default class SCMPreview { - - private static readonly _enabled = getDefaultValue(); - - static get enabled(): boolean { - return this._enabled; - } - - static set enabled(enabled: boolean) { - window.localStorage.setItem('enablePreviewSCM', enabled ? 'true' : 'false'); - } -} - -export class EnableSCMPreviewAction extends Action { - - static ID = 'enablescmpreview'; - static LABEL = 'Disable Legacy Git'; - - constructor( - id = EnableSCMPreviewAction.ID, - label = EnableSCMPreviewAction.LABEL, - @IWindowService private windowService: IWindowService, - @IMessageService private messageService: IMessageService, - ) { - super(EnableSCMPreviewAction.ID, EnableSCMPreviewAction.LABEL, '', true); - } - - run(): TPromise { - const message = 'This will reload this window, do you want to continue?'; - const result = this.messageService.confirm({ message }); - - if (!result) { - return undefined; - } - - SCMPreview.enabled = true; - return this.windowService.reloadWindow(); - } -} - -export class DisableSCMPreviewAction extends Action { - - static ID = 'disablescmpreview'; - static LABEL = 'Enable Legacy Git'; - - constructor( - id = DisableSCMPreviewAction.ID, - label = DisableSCMPreviewAction.LABEL, - @IWindowService private windowService: IWindowService, - @IMessageService private messageService: IMessageService, - ) { - super(DisableSCMPreviewAction.ID, DisableSCMPreviewAction.LABEL, '', true); - } - - run(): TPromise { - const message = 'This will reload this window, do you want to continue?'; - const result = this.messageService.confirm({ message }); - - if (!result) { - return undefined; - } - - SCMPreview.enabled = false; - return this.windowService.reloadWindow(); - } -} \ No newline at end of file diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index bfe34e1fde2..8561d451305 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -22,10 +22,15 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ import URI from 'vs/base/common/uri'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISCMService } from 'vs/workbench/services/scm/common/scm'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { localize } from 'vs/nls'; +import { Color } from 'vs/base/common/color'; class DirtyDiffModelDecorator { - static MODIFIED_DECORATION_OPTIONS: common.IModelDecorationOptions = { + static MODIFIED_DECORATION_OPTIONS = ModelDecorationOptions.register({ linesDecorationsClassName: 'dirty-diff-modified-glyph', isWholeLine: true, overviewRuler: { @@ -33,9 +38,9 @@ class DirtyDiffModelDecorator { darkColor: 'rgba(0, 122, 204, 0.6)', position: common.OverviewRulerLane.Left } - }; + }); - static ADDED_DECORATION_OPTIONS: common.IModelDecorationOptions = { + static ADDED_DECORATION_OPTIONS = ModelDecorationOptions.register({ linesDecorationsClassName: 'dirty-diff-added-glyph', isWholeLine: true, overviewRuler: { @@ -43,9 +48,9 @@ class DirtyDiffModelDecorator { darkColor: 'rgba(0, 122, 204, 0.6)', position: common.OverviewRulerLane.Left } - }; + }); - static DELETED_DECORATION_OPTIONS: common.IModelDecorationOptions = { + static DELETED_DECORATION_OPTIONS = ModelDecorationOptions.register({ linesDecorationsClassName: 'dirty-diff-deleted-glyph', isWholeLine: true, overviewRuler: { @@ -53,7 +58,7 @@ class DirtyDiffModelDecorator { darkColor: 'rgba(0, 122, 204, 0.6)', position: common.OverviewRulerLane.Left } - }; + }); private decorations: string[]; private baselineModel: common.IModel; @@ -265,3 +270,44 @@ export class DirtyDiffDecorator implements ext.IWorkbenchContribution { this.decorators = null; } } + +export const editorGutterModifiedBackground = registerColor('editorGutter.modifiedBackground', { + dark: Color.fromHex('#00bcf2').transparent(0.6), + light: Color.fromHex('#007acc').transparent(0.6), + hc: Color.fromHex('#007acc').transparent(0.6) +}, localize('editorGutterModifiedBackground', "Editor gutter background color for lines that are modified.")); + +export const editorGutterAddedBackground = registerColor('editorGutter.addedBackground', { + dark: Color.fromHex('#7fba00').transparent(0.6), + light: Color.fromHex('#2d883e').transparent(0.6), + hc: Color.fromHex('#2d883e').transparent(0.6) +}, localize('editorGutterAddedBackground', "Editor gutter background color for lines that are added.")); + +export const editorGutteDeletedBackground = registerColor('editorGutter.deletedBackground', { + dark: Color.fromHex('#b9131a').transparent(0.76), + light: Color.fromHex('#b9131a').transparent(0.76), + hc: Color.fromHex('#b9131a').transparent(0.76) +}, localize('editorGutterDeletedBackground', "Editor gutter background color for lines that are deleted.")); + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + const editorGutterModifiedBackgroundColor = theme.getColor(editorGutterModifiedBackground); + if (editorGutterModifiedBackgroundColor) { + collector.addRule(`.monaco-editor .dirty-diff-modified-glyph { border-left: 3px solid ${editorGutterModifiedBackgroundColor}; }`); + } + + const editorGutterAddedBackgroundColor = theme.getColor(editorGutterAddedBackground); + if (editorGutterAddedBackgroundColor) { + collector.addRule(`.monaco-editor .dirty-diff-added-glyph { border-left: 3px solid ${editorGutterAddedBackgroundColor}; }`); + } + + const editorGutteDeletedBackgroundColor = theme.getColor(editorGutteDeletedBackground); + if (editorGutteDeletedBackgroundColor) { + collector.addRule(` + .monaco-editor .dirty-diff-deleted-glyph:after { + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + border-left: 4px solid ${editorGutteDeletedBackgroundColor}; + } + `); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css b/src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css index 31023d7ffa9..beaf772629e 100644 --- a/src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css +++ b/src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css @@ -3,23 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-editor .dirty-diff-modified-glyph { - border-left: 3px solid rgba(0, 122, 204, 0.6); - margin-left: 5px; -} - -.monaco-editor.vs-dark .dirty-diff-modified-glyph { - border-left: 3px solid rgba(0, 188, 242, 0.6); - margin-left: 5px; -} - -.monaco-editor .dirty-diff-added-glyph { - border-left: 3px solid rgba(45, 136, 62, 0.6); - margin-left: 5px; -} - -.monaco-editor.vs-dark .dirty-diff-added-glyph { - border-left: 3px solid rgba(127, 186, 0, 0.6); +.monaco-editor .dirty-diff-modified-glyph, +.monaco-editor .dirty-diff-added-glyph, +.monaco-editor .dirty-diff-deleted-glyph:after { margin-left: 5px; } @@ -27,11 +13,7 @@ content: ''; position: absolute; bottom: -4px; - margin-left: 5px; box-sizing: border-box; - border-left: 4px solid rgba(185, 19, 26, 0.76); - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; width: 4px; height: 0; z-index: 9; diff --git a/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts b/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts index b372695a4bd..e4cedd1923c 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts @@ -11,17 +11,17 @@ import { Action } from 'vs/base/common/actions'; import { Registry } from 'vs/platform/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { DirtyDiffDecorator } from './dirtydiffDecorator'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; +import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ToggleViewletAction } from 'vs/workbench/browser/viewlet'; import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actionRegistry'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; import { ISCMService } from 'vs/workbench/services/scm/common/scm'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { StatusUpdater } from './scmActivity'; -import SCMPreview, { DisableSCMPreviewAction, EnableSCMPreviewAction } from '../browser/scmPreview'; class OpenSCMViewletAction extends ToggleViewletAction { @@ -42,16 +42,29 @@ export class SwitchProvider extends Action { id = SwitchProvider.ID, label = SwitchProvider.LABEL, @ISCMService private scmService: ISCMService, - @IQuickOpenService private quickOpenService: IQuickOpenService + @IQuickOpenService private quickOpenService: IQuickOpenService, + @IViewletService private viewletService: IViewletService ) { super('scm.switchprovider', 'Switch SCM Provider', '', true); } run(): TPromise { - const picks = this.scmService.providers.map(provider => ({ + const picks: IPickOpenEntry[] = this.scmService.providers.map(provider => ({ label: provider.label, run: () => this.scmService.activeProvider = provider })); + picks.push({ + label: localize('installAdditionalSCMProviders', "Install Additional SCM Providers..."), + run: () => { + this.viewletService.openViewlet(EXTENSIONS_VIEWLET_ID, true).then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search('category:"SCM Providers" @sort:installs'); + viewlet.focus(); + }); + return this.scmService.activeProvider; + }, + separator: { border: true } + }); return this.quickOpenService.pick(picks); } @@ -60,40 +73,32 @@ export class SwitchProvider extends Action { Registry.as(WorkbenchExtensions.Workbench) .registerWorkbenchContribution(DirtyDiffDecorator); -if (SCMPreview.enabled) { - const viewletDescriptor = new ViewletDescriptor( - 'vs/workbench/parts/scm/electron-browser/scmViewlet', - 'SCMViewlet', - VIEWLET_ID, - localize('source control', "Source Control"), - 'scm', - 36 - ); +const viewletDescriptor = new ViewletDescriptor( + 'vs/workbench/parts/scm/electron-browser/scmViewlet', + 'SCMViewlet', + VIEWLET_ID, + localize('source control', "Source Control"), + 'scm', + 36 +); - Registry.as(ViewletExtensions.Viewlets) - .registerViewlet(viewletDescriptor); +Registry.as(ViewletExtensions.Viewlets) + .registerViewlet(viewletDescriptor); - Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(StatusUpdater); +Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(StatusUpdater); - // Register Action to Open Viewlet - Registry.as(WorkbenchActionExtensions.WorkbenchActions).registerWorkbenchAction( - new SyncActionDescriptor(OpenSCMViewletAction, VIEWLET_ID, localize('toggleSCMViewlet', "Show SCM"), { - primary: null, - win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, - linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, - mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_G } - }), - 'View: Show SCM', - localize('view', "View") - ); +// Register Action to Open Viewlet +Registry.as(WorkbenchActionExtensions.WorkbenchActions).registerWorkbenchAction( + new SyncActionDescriptor(OpenSCMViewletAction, VIEWLET_ID, localize('toggleSCMViewlet', "Show SCM"), { + primary: null, + win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, + linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G }, + mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_G } + }), + 'View: Show SCM', + localize('view', "View") +); - Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(SwitchProvider, SwitchProvider.ID, SwitchProvider.LABEL), 'SCM: Switch Provider', 'SCM'); - - Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(DisableSCMPreviewAction, DisableSCMPreviewAction.ID, DisableSCMPreviewAction.LABEL), 'SCM: Disable Preview SCM', 'SCM'); -} else { - Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(EnableSCMPreviewAction, EnableSCMPreviewAction.ID, EnableSCMPreviewAction.LABEL), 'SCM: Enable Preview SCM', 'SCM'); -} +Registry.as(WorkbenchActionExtensions.WorkbenchActions) + .registerWorkbenchAction(new SyncActionDescriptor(SwitchProvider, SwitchProvider.ID, SwitchProvider.LABEL), 'SCM: Switch Provider', 'SCM'); diff --git a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts index f5cb2241de7..bfea5b8df9b 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts @@ -16,6 +16,8 @@ import { IAction, Action } from 'vs/base/common/actions'; import { fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { ContextSubMenu } from 'vs/platform/contextview/browser/contextView'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; +import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; import { ISCMService, ISCMProvider, ISCMResource, ISCMResourceGroup } from 'vs/workbench/services/scm/common/scm'; import { getSCMResourceContextKey } from './scmUtil'; @@ -38,6 +40,21 @@ class SwitchProviderAction extends Action { } } +class InstallAdditionalSCMProviders extends Action { + + constructor(private viewletService: IViewletService) { + super('scm.installAdditionalSCMProviders', localize('installAdditionalSCMProviders', "Install Additional SCM Providers..."), '', true); + } + + run(): TPromise { + return this.viewletService.openViewlet(EXTENSIONS_VIEWLET_ID, true).then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search('category:"SCM Providers" @sort:installs'); + viewlet.focus(); + }); + } +} + export class SCMMenus implements IDisposable { private disposables: IDisposable[] = []; @@ -52,7 +69,8 @@ export class SCMMenus implements IDisposable { constructor( @IContextKeyService private contextKeyService: IContextKeyService, @ISCMService private scmService: ISCMService, - @IMenuService private menuService: IMenuService + @IMenuService private menuService: IMenuService, + @IViewletService private viewletService: IViewletService ) { this.setActiveProvider(this.scmService.activeProvider); this.scmService.onDidChangeProvider(this.setActiveProvider, this, this.disposables); @@ -92,7 +110,7 @@ export class SCMMenus implements IDisposable { } getTitleSecondaryActions(): IAction[] { - const providerSwitchActions = this.scmService.providers + const providerSwitchActions: IAction[] = this.scmService.providers .map(p => new SwitchProviderAction(p, this.scmService)); let result = []; @@ -100,14 +118,16 @@ export class SCMMenus implements IDisposable { if (this.titleSecondaryActions.length > 0) { result = result.concat(this.titleSecondaryActions); } + if (providerSwitchActions.length > 0) { + providerSwitchActions.push(new Separator()); + } + providerSwitchActions.push(new InstallAdditionalSCMProviders(this.viewletService)); - if (result.length > 0 && providerSwitchActions.length > 0) { + if (result.length > 0) { result.push(new Separator()); } - if (providerSwitchActions.length > 0) { - result.push(new ContextSubMenu(localize('switch provider', "Switch SCM Provider..."), providerSwitchActions)); - } + result.push(new ContextSubMenu(localize('switch provider', "Switch SCM Provider..."), providerSwitchActions)); return result; } diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 4bf09bf4e11..1d4064b4fb3 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -25,6 +25,8 @@ import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm'; import { FileLabel } from 'vs/workbench/browser/labels'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ISCMService, ISCMProvider, ISCMResourceGroup, ISCMResource } from 'vs/workbench/services/scm/common/scm'; +import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; +import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -42,7 +44,7 @@ import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { IModelService } from 'vs/editor/common/services/modelService'; import { comparePaths } from 'vs/base/common/comparers'; import { isSCMResource } from './scmUtil'; -import { attachInputBoxStyler, attachListStyler } from 'vs/platform/theme/common/styler'; +import { attachInputBoxStyler, attachListStyler, attachBadgeStyler } from 'vs/platform/theme/common/styler'; import Severity from 'vs/base/common/severity'; // TODO@Joao @@ -80,6 +82,7 @@ interface ResourceGroupTemplate { name: HTMLElement; count: CountBadge; actionBar: ActionBar; + dispose: () => void; } class ResourceGroupRenderer implements IRenderer { @@ -89,7 +92,8 @@ class ResourceGroupRenderer implements IRenderer { + actionBar.dispose(); + styler.dispose(); + } + }; } renderElement(group: ISCMResourceGroup, index: number, template: ResourceGroupTemplate): void { @@ -112,7 +122,7 @@ class ResourceGroupRenderer implements IRenderer this.getActionItem(action); const renderers = [ - new ResourceGroupRenderer(this.menus, actionItemProvider), + new ResourceGroupRenderer(this.menus, actionItemProvider, this.themeService), this.instantiationService.createInstance(ResourceRenderer, this.menus, actionItemProvider, () => this.getSelectedResources()), ]; @@ -312,6 +324,11 @@ export class SCMViewlet extends Viewlet { .filter(e => !!e && isSCMResource(e)) .on(this.open, this, this.disposables); + chain(this.list.onPin) + .map(e => e.elements[0]) + .filter(e => !!e && isSCMResource(e)) + .on(this.pin, this, this.disposables); + this.list.onContextMenu(this.onListContextMenu, this, this.disposables); this.disposables.push(this.list); @@ -398,6 +415,12 @@ export class SCMViewlet extends Viewlet { .done(undefined, onUnexpectedError); } + private pin(): void { + const activeEditor = this.editorService.getActiveEditor(); + const activeEditorInput = this.editorService.getActiveEditorInput(); + this.groupService.pinEditor(activeEditor.position, activeEditorInput); + } + getTitle(): string { const title = localize('source control', "Source Control"); const providerLabel = this.scmService.activeProvider && this.scmService.activeProvider.label; diff --git a/src/vs/workbench/parts/search/browser/media/searchviewlet.css b/src/vs/workbench/parts/search/browser/media/searchviewlet.css index c223b283c85..946b5b2edfa 100644 --- a/src/vs/workbench/parts/search/browser/media/searchviewlet.css +++ b/src/vs/workbench/parts/search/browser/media/searchviewlet.css @@ -203,28 +203,6 @@ font-style: italic; } -.search-viewlet .checkbox { - display: inline-block; - visibility: hidden; - border: 1px solid rgba(128, 128, 128, 0.5); - width: 0; - height: 12px; - margin-right: 0; - position: relative; - top: 2px; - transition: width 150ms, margin-right 150ms ease-in; -} - -.search-viewlet .linematch .checkbox.checked { - background-position: -66px -150px; -} - -.search-viewlet .select .linematch .checkbox { - visibility: visible; - width: 12px; - margin-right: 4px; -} - .search-viewlet .query-clear { background: url("action-query-clear.svg") center center no-repeat; } @@ -354,16 +332,8 @@ background: url('excludeSettings-dark.svg') center center no-repeat; } -.search-viewlet .findInFileMatch, -.monaco-editor .findInFileMatch { - background-color: rgba(234, 92, 0, 0.3); - animation-duration: 0; - animation-name: inherit !important; -} - .search-viewlet .replace.findInFileMatch { text-decoration: line-through; - background-color: rgba(255, 0, 0, 0.2); } .search-viewlet .findInFileMatch, @@ -371,45 +341,18 @@ white-space: pre; } -.search-viewlet .replaceMatch { - background-color: rgba(155, 185, 85, 0.5); -} - .hc-black .monaco-workbench .search-viewlet .replaceMatch, -.hc-black .monaco-workbench .search-viewlet .findInFileMatch, -.monaco-editor.hc-black .findInFileMatch { +.hc-black .monaco-workbench .search-viewlet .findInFileMatch { background: none !important; - border: 1px dotted #f38518; box-sizing: border-box; } -.hc-black .monaco-workbench .search-viewlet .replace.findInFileMatch { - border: 1px dashed #FF008F; -} - -.hc-black .monaco-workbench .search-viewlet .replaceMatch { - border: 1px dashed rgb(51, 255, 46); -} - .monaco-workbench .search-viewlet a.prominent { text-decoration: underline; } /* Theming */ -.search-viewlet .highlight { - color: black; - background-color: rgba(234, 92, 0, 0.3); -} - -.vs .search-viewlet .filematch .name { - color: #1E1E1E; -} - -.vs .search-viewlet .monaco-tree.focused .monaco-tree-row.selected .filematch .name { - color: #FFF; -} - .vs .search-viewlet .search-widget .toggle-replace-button:hover { background-color: rgba(0, 0, 0, 0.1) !important; } @@ -426,10 +369,6 @@ background-image: url('expando-expanded.svg'); } -.vs-dark .search-viewlet .monaco-tree .filematch .name { - color: #FFF; -} - .vs-dark .search-viewlet .query-clear { background: url("action-query-clear-dark.svg") center center no-repeat; } @@ -440,7 +379,6 @@ } .vs-dark .search-viewlet .message { - color: #FFF; opacity: .5; } diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts index cb6117d44bc..113adfd286d 100644 --- a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts @@ -7,7 +7,7 @@ import * as arrays from 'vs/base/common/arrays'; import * as objects from 'vs/base/common/objects'; -import { TPromise } from 'vs/base/common/winjs.base'; +import { PPromise, TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); import { ThrottledDelayer } from 'vs/base/common/async'; import types = require('vs/base/common/types'); @@ -91,7 +91,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { private openSymbolHandler: OpenSymbolHandler; private openFileHandler: OpenFileHandler; private searchDelayer: ThrottledDelayer; - private pendingSearch: TPromise; + private pendingSearch: PPromise; private isClosed: boolean; private scorerCache: { [key: string]: number }; private includeSymbols: boolean; @@ -135,7 +135,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { }); } - public getResults(searchValue: string): TPromise { + public getResults(searchValue: string): PPromise { const startTime = Date.now(); this.cancelPendingSearch(); @@ -166,27 +166,23 @@ export class OpenAnythingHandler extends QuickOpenHandler { // Symbol Results (unless disabled or a range or absolute path is specified) if (this.includeSymbols && !searchWithRange) { resultPromises.push(this.openSymbolHandler.getResults(searchValue)); - } else { - resultPromises.push(TPromise.as(new QuickOpenModel())); // We need this empty promise because we are using the throttler below! } - // Join and sort unified - this.pendingSearch = TPromise.join(resultPromises).then(results => { + const handleResult = (result: QuickOpenModel | FileQuickOpenModel) => { this.pendingSearch = null; // If the quick open widget has been closed meanwhile, ignore the result if (this.isClosed) { - return TPromise.as(new QuickOpenModel()); + return new QuickOpenModel(); } - // Combine file results and symbol results (if any) - const mergedResults = [...results[0].entries, ...results[1].entries]; + const entries = result.entries; // Sort const unsortedResultTime = Date.now(); const normalizedSearchValue = strings.stripWildcards(searchValue).toLowerCase(); const compare = (elementA: QuickOpenEntry, elementB: QuickOpenEntry) => QuickOpenEntry.compareByScore(elementA, elementB, searchValue, normalizedSearchValue, this.scorerCache); - const viewResults = arrays.top(mergedResults, compare, OpenAnythingHandler.MAX_DISPLAYED_RESULTS); + const viewResults = arrays.top(entries, compare, OpenAnythingHandler.MAX_DISPLAYED_RESULTS); const sortedResultTime = Date.now(); // Apply range and highlights to file entries @@ -199,29 +195,40 @@ export class OpenAnythingHandler extends QuickOpenHandler { } }); - let fileSearchStats: ISearchStats; - if (results[0] instanceof FileQuickOpenModel) { - fileSearchStats = (results[0]).stats; - } else if (results[1] instanceof FileQuickOpenModel) { - fileSearchStats = (results[1]).stats; + // Telemetry + if (result instanceof FileQuickOpenModel) { + const fileSearchStats = (result).stats; + const duration = new Date().getTime() - startTime; + const data = this.createTimerEventData(startTime, { + searchLength: searchValue.length, + unsortedResultTime, + sortedResultTime, + resultCount: entries.length, + symbols: { fromCache: false }, + files: fileSearchStats + }); + + this.telemetryService.publicLog('openAnything', objects.assign(data, { duration })); } - const duration = new Date().getTime() - startTime; - const data = this.createTimerEventData(startTime, { - searchLength: searchValue.length, - unsortedResultTime, - sortedResultTime, - resultCount: mergedResults.length, - symbols: { fromCache: false }, - files: fileSearchStats + return new QuickOpenModel(viewResults); + }; + + this.pendingSearch = new PPromise((complete, error, progress) => { + // When any of the result promises return, forward the result as progress. + const processed = resultPromises.map(resultPromise => + resultPromise.then(result => { + progress(handleResult(result)); + }) + ); + // Complete the promise when all promises have completed. + TPromise.join(processed).then(() => { + // We already sent the results via progress. + complete(new QuickOpenModel()); + }, error => { + this.pendingSearch = null; + this.messageService.show(Severity.Error, error); }); - - this.telemetryService.publicLog('openAnything', objects.assign(data, { duration })); - - return TPromise.as(new QuickOpenModel(viewResults)); - }, (error: Error) => { - this.pendingSearch = null; - this.messageService.show(Severity.Error, error); }); return this.pendingSearch; @@ -338,7 +345,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { sortedResultDuration: telemetry.sortedResultTime - startTime, resultCount: telemetry.resultCount, symbols: telemetry.symbols, - files: this.createFileEventData(startTime, telemetry.files) + files: telemetry.files && this.createFileEventData(startTime, telemetry.files) }; } diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index aa132bfcf4a..1ff6554fa37 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -21,7 +21,7 @@ import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen'; import { QueryBuilder } from 'vs/workbench/parts/search/common/searchQuery'; -import { EditorInput, getOutOfWorkspaceEditorResources, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; +import { EditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IResourceInput } from 'vs/platform/editor/common/editor'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -31,6 +31,7 @@ import { IQueryOptions, ISearchService, ISearchStats, ISearchQuery } from 'vs/pl import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IRange } from 'vs/editor/common/core/range'; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; export class FileQuickOpenModel extends QuickOpenModel { diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts index 842c9461c05..9ac3c54aa86 100644 --- a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts @@ -25,6 +25,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkspaceSymbolProvider, getWorkspaceSymbols } from 'vs/workbench/parts/search/common/search'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { basename } from 'vs/base/common/paths'; class SymbolEntry extends EditorQuickOpenEntry { @@ -50,11 +51,15 @@ class SymbolEntry extends EditorQuickOpenEntry { } public getDescription(): string { - let result = this._bearing.containerName; - if (!result && this._bearing.location.uri) { - result = labels.getPathLabel(this._bearing.location.uri, this._contextService, this._environmentService); + const containerName = this._bearing.containerName; + if (this._bearing.location.uri) { + if (containerName) { + return `${containerName} — ${basename(this._bearing.location.uri.fsPath)}`; + } else { + return labels.getPathLabel(this._bearing.location.uri, this._contextService, this._environmentService); + } } - return result; + return containerName; } public getIcon(): string { diff --git a/src/vs/workbench/parts/search/browser/patternInputWidget.ts b/src/vs/workbench/parts/search/browser/patternInputWidget.ts index 75bef0a6f43..0657073ca2f 100644 --- a/src/vs/workbench/parts/search/browser/patternInputWidget.ts +++ b/src/vs/workbench/parts/search/browser/patternInputWidget.ts @@ -110,8 +110,6 @@ export class PatternInputWidget extends Widget { return {}; } - const isSearchPath = segment => segment.match(/^\.\//); - let exprSegments: string[]; let searchPaths: string[]; if (isGlobPattern) { @@ -119,21 +117,17 @@ export class PatternInputWidget extends Widget { .map(s => s.trim()) .filter(s => !!s.length); - const groups = collections.groupBy(segments, - segment => isSearchPath(segment) ? 'searchPaths' : 'exprSegments'); - searchPaths = groups.searchPaths || []; - exprSegments = groups.exprSegments || []; + const groups = this.groupByPathsAndExprSegments(segments); + searchPaths = groups.searchPaths; + exprSegments = groups.exprSegments; } else { const segments = pattern.split(',') .map(s => strings.trim(s.trim(), '/')) .filter(s => !!s.length); - const groups = collections.groupBy(segments, - segment => isSearchPath(segment) ? 'searchPaths' : 'exprSegments'); - searchPaths = groups.searchPaths || []; - exprSegments = groups.exprSegments || []; - - exprSegments = exprSegments + const groups = this.groupByPathsAndExprSegments(segments); + searchPaths = groups.searchPaths; + exprSegments = groups.exprSegments .map(p => { if (p[0] === '.') { p = '*' + p; // convert ".js" to "*.js" @@ -147,6 +141,27 @@ export class PatternInputWidget extends Widget { return { expression, searchPaths }; } + private groupByPathsAndExprSegments(segments: string[]) { + const isSearchPath = segment => segment.match(/^\.\//); + + const groups = collections.groupBy(segments, + segment => isSearchPath(segment) ? 'searchPaths' : 'exprSegments'); + groups.searchPaths = groups.searchPaths || []; + groups.exprSegments = groups.exprSegments || []; + + // If a ./searchPath has a glob character, remove ./ and use it as an expression segment + groups.searchPaths = groups.searchPaths.filter(searchPath => { + if (searchPath.match(/[\*\{\}\(\)\[\]\?]/)) { + groups.exprSegments.push(strings.ltrim(searchPath, './')); + return false; + } + + return true; + }); + + return groups; + } + public select(): void { this.inputBox.select(); } diff --git a/src/vs/workbench/parts/search/browser/search.contribution.ts b/src/vs/workbench/parts/search/browser/search.contribution.ts index 9cede51de89..a03f6572e09 100644 --- a/src/vs/workbench/parts/search/browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/browser/search.contribution.ts @@ -15,7 +15,7 @@ import { IAction } from 'vs/base/common/actions'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 5039bded064..c9d95f8e9ab 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -19,6 +19,8 @@ import { Range } from 'vs/editor/common/core/range'; import { SearchViewlet } from 'vs/workbench/parts/search/browser/searchViewlet'; import { RemoveAction, ReplaceAllAction, ReplaceAction } from 'vs/workbench/parts/search/browser/searchActions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; export class SearchDataSource implements IDataSource { @@ -107,8 +109,13 @@ export class SearchRenderer extends Disposable implements IRenderer { private static FILE_MATCH_TEMPLATE_ID = 'fileMatch'; private static MATCH_TEMPLATE_ID = 'match'; - constructor(actionRunner: IActionRunner, private viewlet: SearchViewlet, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IInstantiationService private instantiationService: IInstantiationService) { + constructor( + actionRunner: IActionRunner, + private viewlet: SearchViewlet, + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IInstantiationService private instantiationService: IInstantiationService, + @IThemeService private themeService: IThemeService + ) { super(); } @@ -145,11 +152,11 @@ export class SearchRenderer extends Disposable implements IRenderer { } } - private renderFileMatchTemplate(tree: ITree, templateId: string, container: HTMLElement): IFileMatchTemplate { let fileMatchElement = DOM.append(container, DOM.$('.filematch')); const label = this.instantiationService.createInstance(FileLabel, fileMatchElement, void 0); const badge = new CountBadge(DOM.append(fileMatchElement, DOM.$('.badge'))); + this._register(attachBadgeStyler(badge, this.themeService)); const actions = new ActionBar(fileMatchElement, { animated: false }); return { label, badge, actions }; } @@ -206,6 +213,8 @@ export class SearchRenderer extends Disposable implements IRenderer { templateData.actions.clear(); if (searchModel.isReplaceActive()) { templateData.actions.push([this.instantiationService.createInstance(ReplaceAction, tree, match, this.viewlet), new RemoveAction(tree, match)], { icon: true, label: false }); + } else { + templateData.actions.push([new RemoveAction(tree, match)], { icon: true, label: false }); } } @@ -229,13 +238,15 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider { } if (element instanceof Match) { - let match = element; - let input = tree.getInput(); - if (input.searchModel.isReplaceActive()) { - let preview = match.preview(); - return nls.localize('replacePreviewResultAria', "Replace preview result, {0}", preview.before + match.replaceString + preview.after); + const match = element; + const searchModel: SearchModel = (tree.getInput()).searchModel; + const replace = searchModel.isReplaceActive() && !!searchModel.replaceString; + const preview = match.preview(); + const range = match.range(); + if (replace) { + return nls.localize('replacePreviewResultAria', "Replace term {0} with {1} at column position {2} in line with text {3}", preview.inside, match.replaceString, range.startColumn + 1, match.text()); } - return nls.localize('searchResultAria', "{0}, Search result", match.text()); + return nls.localize('searchResultAria', "Found term {0} at column position {1} in line with text {2}", preview.inside, range.startColumn + 1, match.text()); } return undefined; } diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index 4d12455d04f..9fe88c72d57 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -9,7 +9,7 @@ import 'vs/css!./media/searchviewlet'; import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; import { Emitter, debounceEvent } from 'vs/base/common/event'; -import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { ICommonCodeEditor, isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon'; import lifecycle = require('vs/base/common/lifecycle'); import errors = require('vs/base/common/errors'); import aria = require('vs/base/browser/ui/aria/aria'); @@ -27,7 +27,6 @@ import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { Scope } from 'vs/workbench/common/memento'; import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; -import { getOutOfWorkspaceEditorResources } from 'vs/workbench/common/editor'; import { FileChangeType, FileChangesEvent, IFileService } from 'vs/platform/files/common/files'; import { Viewlet } from 'vs/workbench/browser/viewlet'; import { Match, FileMatch, SearchModel, FileMatchOrMatch, IChangeEvent, ISearchWorkbenchService } from 'vs/workbench/parts/search/common/searchModel'; @@ -42,13 +41,12 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IMessageService } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { KeyCode } from 'vs/base/common/keyCodes'; import { PatternInputWidget, ExcludePatternInputWidget } from 'vs/workbench/parts/search/browser/patternInputWidget'; import { SearchRenderer, SearchDataSource, SearchSorter, SearchAccessibilityProvider, SearchFilter } from 'vs/workbench/parts/search/browser/searchResultsView'; -import { SearchWidget } from 'vs/workbench/parts/search/browser/searchWidget'; +import { SearchWidget, ISearchWidgetOptions } from 'vs/workbench/parts/search/browser/searchWidget'; import { RefreshAction, CollapseAllAction, ClearSearchResultsAction, ConfigureGlobalExclusionsAction } from 'vs/workbench/parts/search/browser/searchActions'; import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; import Severity from 'vs/base/common/severity'; @@ -57,11 +55,12 @@ import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/act import * as Constants from 'vs/workbench/parts/search/common/constants'; import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService, ITheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorFindMatchHighlight } from 'vs/platform/theme/common/colorRegistry'; +import { editorFindMatchHighlight, diffInserted, diffRemoved, diffInsertedOutline, diffRemovedOutline, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import FileResultsNavigation from 'vs/workbench/browser/fileResultsNavigation'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IOutputService } from 'vs/workbench/parts/output/common/output'; import { Color } from 'vs/base/common/color'; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; export class SearchViewlet extends Viewlet { @@ -117,7 +116,6 @@ export class SearchViewlet extends Viewlet { @IWorkspaceContextService private contextService: IWorkspaceContextService, @ISearchWorkbenchService private searchWorkbenchService: ISearchWorkbenchService, @IContextKeyService private contextKeyService: IContextKeyService, - @IKeybindingService private keybindingService: IKeybindingService, @IReplaceService private replaceService: IReplaceService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IPreferencesService private preferencesService: IPreferencesService, @@ -175,6 +173,7 @@ export class SearchViewlet extends Viewlet { const exclusionsUsePattern = this.viewletSettings['query.exclusionsUsePattern']; const includesUsePattern = this.viewletSettings['query.includesUsePattern']; const patternIncludes = this.viewletSettings['query.folderIncludes'] || ''; + const queryDetailsExpanded = this.viewletSettings['query.queryDetailsExpanded'] || ''; const useIgnoreFiles = typeof this.viewletSettings['query.useIgnoreFiles'] === 'boolean' ? this.viewletSettings['query.useIgnoreFiles'] : this.configurationService.getConfiguration().search.useIgnoreFilesByDefault; @@ -268,7 +267,7 @@ export class SearchViewlet extends Viewlet { this.actionRegistry[action.id] = action; }); - if (filePatterns !== '' || patternExclusions !== '' || patternIncludes !== '') { + if (filePatterns !== '' || patternExclusions !== '' || patternIncludes !== '' || queryDetailsExpanded !== '') { this.toggleQueryDetails(true, true, true); } @@ -289,12 +288,12 @@ export class SearchViewlet extends Viewlet { let isWholeWords = this.viewletSettings['query.wholeWords'] === true; let isCaseSensitive = this.viewletSettings['query.caseSensitive'] === true; - this.searchWidget = new SearchWidget(builder, this.contextViewService, this.themeService, { + this.searchWidget = this.instantiationService.createInstance(SearchWidget, builder, { value: contentPattern, isRegex: isRegex, isCaseSensitive: isCaseSensitive, isWholeWords: isWholeWords - }, this.contextKeyService, this.keybindingService, this.instantiationService); + }); if (this.storageService.getBoolean(SearchViewlet.SHOW_REPLACE_STORAGE_KEY, StorageScope.WORKSPACE, true)) { this.searchWidget.toggleReplace(true); @@ -499,7 +498,7 @@ export class SearchViewlet extends Viewlet { } })); - this.toUnbind.push(this.tree.addListener('focus', (event: any) => { + this.toUnbind.push(this.tree.onDOMFocus(e => { const focus = this.tree.getFocus(); this.firstMatchFocussed.set(this.tree.getNavigator().first() === this.tree.getFocus()); this.fileMatchOrMatchFocussed.set(true); @@ -798,7 +797,15 @@ export class SearchViewlet extends Viewlet { return null; } - let editorControl: any = this.editorService.getActiveEditor().getControl(); + let editorControl = this.editorService.getActiveEditor().getControl(); + if (isCommonDiffEditor(editorControl)) { + if (editorControl.getOriginalEditor().isFocused()) { + editorControl = editorControl.getOriginalEditor(); + } else { + editorControl = editorControl.getModifiedEditor(); + } + } + if (!isCommonCodeEditor(editorControl)) { return null; } @@ -849,6 +856,7 @@ export class SearchViewlet extends Viewlet { let cls = 'more'; show = typeof show === 'undefined' ? !dom.hasClass(this.queryDetails, cls) : Boolean(show); + this.viewletSettings['query.queryDetailsExpanded'] = show; skipLayout = Boolean(skipLayout); if (show) { @@ -903,23 +911,10 @@ export class SearchViewlet extends Viewlet { const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive(); const contentPattern = this.searchWidget.searchInput.getValue(); const patternExcludes = this.inputPatternExclusions.getValue().trim(); - const exclusionsUsePattern = this.inputPatternExclusions.isGlobPattern(); const patternIncludes = this.inputPatternIncludes.getValue().trim(); - const includesUsePattern = this.inputPatternIncludes.isGlobPattern(); const useIgnoreFiles = this.inputPatternExclusions.useIgnoreFiles(); const useExcludeSettings = this.inputPatternExclusions.useExcludeSettings(); - // store memento - this.viewletSettings['query.contentPattern'] = contentPattern; - this.viewletSettings['query.regex'] = isRegex; - this.viewletSettings['query.wholeWords'] = isWholeWords; - this.viewletSettings['query.caseSensitive'] = isCaseSensitive; - this.viewletSettings['query.folderExclusions'] = patternExcludes; - this.viewletSettings['query.exclusionsUsePattern'] = exclusionsUsePattern; - this.viewletSettings['query.folderIncludes'] = patternIncludes; - this.viewletSettings['query.includesUsePattern'] = includesUsePattern; - this.viewletSettings['query.useIgnoreFiles'] = useIgnoreFiles; - if (!rerunQuery) { return; } @@ -946,7 +941,8 @@ export class SearchViewlet extends Viewlet { pattern: contentPattern, isRegExp: isRegex, isCaseSensitive: isCaseSensitive, - isWordMatch: isWholeWords + isWordMatch: isWholeWords, + wordSeparators: this.configurationService.getConfiguration().editor.wordSeparators }; const { expression: excludePattern } = this.inputPatternExclusions.getGlob(); @@ -988,7 +984,10 @@ export class SearchViewlet extends Viewlet { let isDone = false; const outputChannel = this.outputService.getChannel('search'); let onComplete = (completed?: ISearchComplete) => { - outputChannel.append('\n'); + if (query.useRipgrep) { + outputChannel.append('\n'); + } + isDone = true; // Complete up to 100% as needed @@ -1102,7 +1101,10 @@ export class SearchViewlet extends Viewlet { }; let onError = (e: any) => { - outputChannel.append('\n'); + if (query.useRipgrep) { + outputChannel.append('\n'); + } + if (errors.isPromiseCanceledError(e)) { onComplete(null); } else { @@ -1341,6 +1343,32 @@ export class SearchViewlet extends Viewlet { ]; } + public shutdown(): void { + const isRegex = this.searchWidget.searchInput.getRegex(); + const isWholeWords = this.searchWidget.searchInput.getWholeWords(); + const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive(); + const contentPattern = this.searchWidget.searchInput.getValue(); + const patternExcludes = this.inputPatternExclusions.getValue().trim(); + const exclusionsUsePattern = this.inputPatternExclusions.isGlobPattern(); + const patternIncludes = this.inputPatternIncludes.getValue().trim(); + const includesUsePattern = this.inputPatternIncludes.isGlobPattern(); + const useIgnoreFiles = this.inputPatternExclusions.useIgnoreFiles(); + + // store memento + this.viewletSettings['query.contentPattern'] = contentPattern; + this.viewletSettings['query.regex'] = isRegex; + this.viewletSettings['query.wholeWords'] = isWholeWords; + this.viewletSettings['query.caseSensitive'] = isCaseSensitive; + this.viewletSettings['query.folderExclusions'] = patternExcludes; + this.viewletSettings['query.exclusionsUsePattern'] = exclusionsUsePattern; + this.viewletSettings['query.folderIncludes'] = patternIncludes; + this.viewletSettings['query.includesUsePattern'] = includesUsePattern; + this.viewletSettings['query.useIgnoreFiles'] = useIgnoreFiles; + this.viewletSettings['query.contentPattern'] = contentPattern; + + super.shutdown(); + } + public dispose(): void { this.isDisposed = true; @@ -1361,9 +1389,35 @@ export class SearchViewlet extends Viewlet { } registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { - let matchHighlightColor = theme.getColor(editorFindMatchHighlight); + const matchHighlightColor = theme.getColor(editorFindMatchHighlight); if (matchHighlightColor) { - collector.addRule(`.search-viewlet .findInFileMatch { background-color: ${matchHighlightColor}; }`); - collector.addRule(`.search-viewlet .highlight { background-color: ${matchHighlightColor}; }`); + collector.addRule(`.monaco-workbench .search-viewlet .findInFileMatch { background-color: ${matchHighlightColor}; }`); + } + + const diffInsertedColor = theme.getColor(diffInserted); + if (diffInsertedColor) { + collector.addRule(`.monaco-workbench .search-viewlet .replaceMatch { background-color: ${diffInsertedColor}; }`); + } + + const diffRemovedColor = theme.getColor(diffRemoved); + if (diffRemovedColor) { + collector.addRule(`.monaco-workbench .search-viewlet .replace.findInFileMatch { background-color: ${diffRemovedColor}; }`); + } + + const diffInsertedOutlineColor = theme.getColor(diffInsertedOutline); + if (diffInsertedOutlineColor) { + collector.addRule(`.monaco-workbench .search-viewlet .replaceMatch:not(:empty) { border: 1px dashed ${diffInsertedOutlineColor}; }`); + } + + const diffRemovedOutlineColor = theme.getColor(diffRemovedOutline); + if (diffRemovedOutlineColor) { + collector.addRule(`.monaco-workbench .search-viewlet .replace.findInFileMatch { border: 1px dashed ${diffRemovedOutlineColor}; }`); + } + + const activeContrastBorderColor = theme.getColor(activeContrastBorder); + if (activeContrastBorderColor) { + collector.addRule(` + .monaco-workbench .search-viewlet .findInFileMatch { border: 1px dashed ${activeContrastBorderColor}; } + `); } }); \ No newline at end of file diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index 69725a9ba8e..c9853dd70a1 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -21,7 +21,6 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import Event, { Emitter } from 'vs/base/common/event'; import { Builder } from 'vs/base/browser/builder'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { isSearchViewletFocussed, appendKeyBindingLabel } from 'vs/workbench/parts/search/browser/searchActions'; import { CONTEXT_FIND_WIDGET_NOT_VISIBLE } from 'vs/editor/contrib/find/common/findController'; @@ -111,8 +110,14 @@ export class SearchWidget extends Widget { private _onReplaceAll = this._register(new Emitter()); public onReplaceAll: Event = this._onReplaceAll.event; - constructor(container: Builder, private contextViewService: IContextViewService, private themeService: IThemeService, options: ISearchWidgetOptions = Object.create(null), - private keyBindingService: IContextKeyService, private keyBindingService2: IKeybindingService, private instantiationService: IInstantiationService) { + constructor( + container: Builder, + options: ISearchWidgetOptions, + @IContextViewService private contextViewService: IContextViewService, + @IThemeService private themeService: IThemeService, + @IContextKeyService private keyBindingService: IContextKeyService, + @IKeybindingService private keyBindingService2: IKeybindingService, + ) { super(); this.searchHistory = new HistoryNavigator(); this.replaceActive = Constants.ReplaceActiveKey.bindTo(this.keyBindingService); diff --git a/src/vs/workbench/parts/search/common/search.ts b/src/vs/workbench/parts/search/common/search.ts index a161f559fd6..a6f98af6b22 100644 --- a/src/vs/workbench/parts/search/common/search.ts +++ b/src/vs/workbench/parts/search/common/search.ts @@ -12,6 +12,10 @@ import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; import { ISearchConfiguration } from 'vs/platform/search/common/search'; import glob = require('vs/base/common/glob'); import { SymbolInformation } from 'vs/editor/common/modes'; +import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import URI from 'vs/base/common/uri'; +import { toResource } from 'vs/workbench/common/editor'; export interface IWorkspaceSymbolProvider { provideWorkspaceSymbols(search: string): TPromise; @@ -79,3 +83,22 @@ export interface IWorkbenchSearchConfiguration extends ISearchConfiguration { useIgnoreFilesByDefault: boolean }; } + +/** + * Helper to return all opened editors with resources not belonging to the currently opened workspace. + */ +export function getOutOfWorkspaceEditorResources(editorGroupService: IEditorGroupService, contextService: IWorkspaceContextService): URI[] { + const resources: URI[] = []; + + editorGroupService.getStacksModel().groups.forEach(group => { + const editors = group.getEditors(); + editors.forEach(editor => { + const fileResource = toResource(editor, { supportSideBySide: true, filter: 'file' }); + if (fileResource && !contextService.isInsideWorkspace(fileResource)) { + resources.push(fileResource); + } + }); + }); + + return resources; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index ed1489ad1ff..114d6657c1a 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -18,12 +18,13 @@ import { ISearchService, ISearchProgressItem, ISearchComplete, ISearchQuery, IPa import { ReplacePattern } from 'vs/platform/search/common/replace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Range } from 'vs/editor/common/core/range'; -import { IModel, IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness, IModelDecorationOptions, FindMatch } from 'vs/editor/common/editorCommon'; +import { IModel, IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness, FindMatch } from 'vs/editor/common/editorCommon'; import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; import { IProgressRunner } from 'vs/platform/progress/common/progress'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class Match { @@ -92,16 +93,28 @@ export class Match { export class FileMatch extends Disposable { - private static getDecorationOption(selected: boolean): IModelDecorationOptions { - return { - stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: selected ? 'currentFindMatch' : 'findMatch', - overviewRuler: { - color: 'rgba(246, 185, 77, 0.7)', - darkColor: 'rgba(246, 185, 77, 0.7)', - position: OverviewRulerLane.Center - } - }; + private static _CURRENT_FIND_MATCH = ModelDecorationOptions.register({ + stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'currentFindMatch', + overviewRuler: { + color: 'rgba(246, 185, 77, 0.7)', + darkColor: 'rgba(246, 185, 77, 0.7)', + position: OverviewRulerLane.Center + } + }); + + private static _FIND_MATCH = ModelDecorationOptions.register({ + stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + className: 'findMatch', + overviewRuler: { + color: 'rgba(246, 185, 77, 0.7)', + darkColor: 'rgba(246, 185, 77, 0.7)', + position: OverviewRulerLane.Center + } + }); + + private static getDecorationOption(selected: boolean): ModelDecorationOptions { + return (selected ? FileMatch._CURRENT_FIND_MATCH : FileMatch._FIND_MATCH); } private _onChange = this._register(new Emitter()); @@ -187,7 +200,7 @@ export class FileMatch extends Disposable { } this._matches = new LinkedMap(); let matches = this._model - .findMatches(this._query.pattern, this._model.getFullModelRange(), this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch, false, this._maxResults); + .findMatches(this._query.pattern, this._model.getFullModelRange(), this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch ? this._query.wordSeparators : null, false, this._maxResults); this.updateMatches(matches, true); } @@ -202,7 +215,7 @@ export class FileMatch extends Disposable { const oldMatches = this._matches.values().filter(match => match.range().startLineNumber === lineNumber); oldMatches.forEach(match => this._matches.delete(match.id())); - const matches = this._model.findMatches(this._query.pattern, range, this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch, false, this._maxResults); + const matches = this._model.findMatches(this._query.pattern, range, this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch ? this._query.wordSeparators : null, false, this._maxResults); this.updateMatches(matches, modelChange); } diff --git a/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts b/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts index f6c7d80a5a4..dcdfe17498a 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts @@ -15,6 +15,8 @@ import { ISnippetsService, ISnippet } from 'vs/workbench/parts/snippets/electron import { IModeService } from 'vs/editor/common/services/modeService'; import { languagesExtPoint } from 'vs/editor/common/services/modeServiceImpl'; import { LanguageIdentifier } from 'vs/editor/common/modes'; +import { SnippetParser, Marker, Placeholder, Variable, Text, walk } from 'vs/editor/contrib/snippet/browser/snippetParser'; +import { EditorSnippetVariableResolver } from 'vs/editor/contrib/snippet/browser/snippetVariables'; interface ISnippetsExtensionPoint { language: string; @@ -79,19 +81,23 @@ export class MainProcessTextMateSnippet implements IWorkbenchContribution { let modeId = snippet.language; let languageIdentifier = this._modeService.getLanguageIdentifier(modeId); if (languageIdentifier) { - readAndRegisterSnippets(this._snippetService, languageIdentifier, normalizedAbsolutePath, extensionName); + readAndRegisterSnippets(this._snippetService, languageIdentifier, normalizedAbsolutePath, extensionName, collector); } } } -export function readAndRegisterSnippets(snippetService: ISnippetsService, languageIdentifier: LanguageIdentifier, filePath: string, extensionName?: string): TPromise { +export function readAndRegisterSnippets( + snippetService: ISnippetsService, languageIdentifier: LanguageIdentifier, filePath: string, + extensionName?: string, collector?: ExtensionMessageCollector +): TPromise { + return readFile(filePath).then(fileContents => { - let snippets = parseSnippetFile(fileContents.toString(), extensionName); + let snippets = parseSnippetFile(fileContents.toString(), extensionName, collector); snippetService.registerSnippets(languageIdentifier.id, snippets, filePath); }); } -function parseSnippetFile(snippetFileContent: string, extensionName?: string): ISnippet[] { +function parseSnippetFile(snippetFileContent: string, extensionName?: string, collector?: ExtensionMessageCollector): ISnippet[] { let snippetsObj = parse(snippetFileContent); if (!snippetsObj || typeof snippetsObj !== 'object') { return []; @@ -102,21 +108,34 @@ function parseSnippetFile(snippetFileContent: string, extensionName?: string): I let processSnippet = (snippet: any, name: string) => { let prefix = snippet['prefix']; - let bodyStringOrArray = snippet['body']; + let body = snippet['body']; - if (Array.isArray(bodyStringOrArray)) { - bodyStringOrArray = bodyStringOrArray.join('\n'); + if (Array.isArray(body)) { + body = body.join('\n'); } - if (typeof prefix === 'string' && typeof bodyStringOrArray === 'string') { - result.push({ - name, - extensionName, - prefix, - description: snippet['description'] || name, - codeSnippet: bodyStringOrArray - }); + if (typeof prefix !== 'string' || typeof body !== 'string') { + return; } + + snippet = { + name, + extensionName, + prefix, + description: snippet['description'] || name, + codeSnippet: body + }; + + const didRewrite = _rewriteBogousVariables(snippet); + if (didRewrite && collector) { + collector.warn(nls.localize( + 'badVariableUse', + "The \"{0}\"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", + name + )); + } + + result.push(snippet); }; topLevelProperties.forEach(topLevelProperty => { @@ -132,3 +151,49 @@ function parseSnippetFile(snippetFileContent: string, extensionName?: string): I }); return result; } + +function _rewriteBogousVariables(snippet: ISnippet): boolean { + const marker = new SnippetParser(true, false).parse(snippet.codeSnippet, false); + + let placeholders = new Map(); + let placeholderMax = 0; + walk(marker, candidate => { + if (candidate instanceof Placeholder) { + placeholderMax = Math.max(placeholderMax, Number(candidate.index)); + } + return true; + }); + + function fixBogousVariables(marker: Marker): string { + if (marker instanceof Text) { + return SnippetParser.escape(marker.string); + + } else if (marker instanceof Placeholder) { + if (marker.defaultValue.length > 0) { + return `\${${marker.index}:${marker.defaultValue.map(fixBogousVariables).join('')}}`; + } else { + return `\$${marker.index}`; + } + } else if (marker instanceof Variable) { + if (marker.defaultValue.length === 0 && !EditorSnippetVariableResolver.VariableNames[marker.name]) { + // a 'variable' without a default value and not being one of our supported + // variables is automatically turing into a placeholder. This is to restore + // a bug we had before. So `${foo}` becomes `${N:foo}` + let index = placeholders.has(marker.name) ? placeholders.get(marker.name) : ++placeholderMax; + placeholders.set(marker.name, index); + return `\${${index++}:${marker.name}}`; + + } else if (marker.defaultValue.length > 0) { + return `\${${marker.name}:${marker.defaultValue.map(fixBogousVariables).join('')}}`; + } else { + return `\$${marker.name}`; + } + } else { + throw new Error('unexpected marker: ' + marker); + } + } + + const placeholderCountBefore = placeholderMax; + snippet.codeSnippet = marker.map(fixBogousVariables).join(''); + return placeholderCountBefore !== placeholderMax; +} diff --git a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts index 1a20a85cf5e..3490f5c2766 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts @@ -8,12 +8,12 @@ import * as nls from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; -import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; import { IModeService } from 'vs/editor/common/services/modeService'; import { LanguageId } from 'vs/editor/common/modes'; import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ISnippetsService, ISnippet } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; interface ISnippetPick extends IPickOpenEntry { @@ -128,7 +128,7 @@ class InsertSnippetAction extends EditorAction { } }).then(snippet => { if (snippet) { - SnippetController.get(editor).insertSnippet(snippet.codeSnippet, 0, 0); + SnippetController2.get(editor).insert(snippet.codeSnippet, 0, 0); } }); } diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts index dacd436e194..fdb96d9beaa 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts @@ -156,7 +156,7 @@ class SnippetsService implements ISnippetsService { registerSingleton(ISnippetsService, SnippetsService); export interface ISimpleModel { - getLineContent(lineNumber): string; + getLineContent(lineNumber: number): string; } export function getNonWhitespacePrefix(model: ISimpleModel, position: Position): string { diff --git a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts index 47a8ea19198..c4a714a0210 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts @@ -15,7 +15,7 @@ import { endsWith } from 'vs/base/common/strings'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { CommonEditorRegistry, commonEditorContribution, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; -import { SnippetController, CONTEXT_SNIPPET_MODE } from 'vs/editor/contrib/snippet/common/snippetController'; +import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { IConfigurationRegistry, Extensions as ConfigExt } from 'vs/platform/configuration/common/configurationRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; @@ -29,7 +29,7 @@ export class TabCompletionController implements editorCommon.IEditorContribution return editor.getContribution(TabCompletionController.ID); } - private _snippetController: SnippetController; + private _snippetController: SnippetController2; private _cursorChangeSubscription: IDisposable; private _currentSnippets: ISnippet[] = []; @@ -38,7 +38,7 @@ export class TabCompletionController implements editorCommon.IEditorContribution @IContextKeyService contextKeyService: IContextKeyService, @ISnippetsService snippetService: ISnippetsService ) { - this._snippetController = SnippetController.get(editor); + this._snippetController = SnippetController2.get(editor); const hasSnippets = TabCompletionController.ContextKey.bindTo(contextKeyService); this._cursorChangeSubscription = editor.onDidChangeCursorSelection(e => { @@ -76,7 +76,7 @@ export class TabCompletionController implements editorCommon.IEditorContribution performSnippetCompletions(): void { if (this._currentSnippets.length === 1) { const snippet = this._currentSnippets[0]; - this._snippetController.insertSnippet(snippet.codeSnippet, snippet.prefix.length, 0); + this._snippetController.insert(snippet.codeSnippet, snippet.prefix.length, 0); // } else { // todo@joh - show suggest widget with proposals } @@ -98,7 +98,7 @@ CommonEditorRegistry.registerEditorCommand(new TabCompletionCommand({ kbExpr: ContextKeyExpr.and( EditorContextKeys.textFocus, EditorContextKeys.tabDoesNotMoveFocus, - CONTEXT_SNIPPET_MODE.toNegated(), + SnippetController2.InSnippetMode.toNegated(), ContextKeyExpr.has('config.editor.tabCompletion') ), primary: KeyCode.Tab diff --git a/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts b/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts new file mode 100644 index 00000000000..e18ef493c51 --- /dev/null +++ b/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts @@ -0,0 +1,143 @@ +/*--------------------------------------------------------------------------------------------- + * 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 nls from 'vs/nls'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { Action } from 'vs/base/common/actions'; +import { language } from 'vs/base/common/platform'; +import { IModelService } from 'vs/editor/common/services/modelService'; +import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { Registry } from 'vs/platform/platform'; +import { IMessageService, Severity } from 'vs/platform/message/common/message'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { FileChangeType, IFileService } from 'vs/platform/files/common/files'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import pkg from 'vs/platform/node/package'; +import product, { ISurveyData } from 'vs/platform/node/product'; + +class LanguageSurvey { + + constructor( + data: ISurveyData, + instantiationService: IInstantiationService, + storageService: IStorageService, + messageService: IMessageService, + telemetryService: ITelemetryService, + fileService: IFileService, + modelService: IModelService + ) { + const SESSION_COUNT_KEY = `${data.surveyId}.sessionCount`; + const LAST_SESSION_DATE_KEY = `${data.surveyId}.lastSessionDate`; + const SKIP_VERSION_KEY = `${data.surveyId}.skipVersion`; + const IS_CANDIDATE_KEY = `${data.surveyId}.isCandidate`; + const EDITED_LANGUAGE_COUNT_KEY = `${data.surveyId}.editedCount`; + const EDITED_LANGUAGE_DATE_KEY = `${data.surveyId}.editedDate`; + + const skipVersion = storageService.get(SKIP_VERSION_KEY, StorageScope.GLOBAL, ''); + if (skipVersion) { + return; + } + const date = new Date().toDateString(); + + if (storageService.getInteger(EDITED_LANGUAGE_COUNT_KEY, StorageScope.GLOBAL, 0) < data.editCount) { + fileService.onFileChanges(e => { + e.getUpdated().forEach(event => { + if (event.type === FileChangeType.UPDATED) { + const model = modelService.getModel(event.resource); + if (model && model.getModeId() === data.languageId && date !== storageService.get(EDITED_LANGUAGE_DATE_KEY, StorageScope.GLOBAL)) { + const editedCount = storageService.getInteger(EDITED_LANGUAGE_COUNT_KEY, StorageScope.GLOBAL, 0) + 1; + storageService.store(EDITED_LANGUAGE_COUNT_KEY, editedCount, StorageScope.GLOBAL); + storageService.store(EDITED_LANGUAGE_DATE_KEY, date, StorageScope.GLOBAL); + } + } + }); + }); + } + + const lastSessionDate = storageService.get(LAST_SESSION_DATE_KEY, StorageScope.GLOBAL, new Date(0).toDateString()); + if (date === lastSessionDate) { + return; + } + + const sessionCount = storageService.getInteger(SESSION_COUNT_KEY, StorageScope.GLOBAL, 0) + 1; + storageService.store(LAST_SESSION_DATE_KEY, date, StorageScope.GLOBAL); + storageService.store(SESSION_COUNT_KEY, sessionCount, StorageScope.GLOBAL); + + if (sessionCount < 9) { + return; + } + if (storageService.getInteger(EDITED_LANGUAGE_COUNT_KEY, StorageScope.GLOBAL, 0) < data.editCount) { + return; + } + + const isCandidate = storageService.getBoolean(IS_CANDIDATE_KEY, StorageScope.GLOBAL, false) + || Math.random() < data.userProbability; + + storageService.store(IS_CANDIDATE_KEY, isCandidate, StorageScope.GLOBAL); + + if (!isCandidate) { + storageService.store(SKIP_VERSION_KEY, pkg.version, StorageScope.GLOBAL); + return; + } + + const message = nls.localize('helpUs', "Help us improve our support for {0}", data.languageId); + + const takeSurveyAction = new Action('takeSurvey', nls.localize('takeShortSurvey', "Take Short Survey"), '', true, () => { + telemetryService.publicLog(`${data.surveyId}.survey/takeShortSurvey`); + return telemetryService.getTelemetryInfo().then(info => { + window.open(`${data.surveyUrl}?o=${encodeURIComponent(process.platform)}&v=${encodeURIComponent(pkg.version)}&m=${encodeURIComponent(info.machineId)}`); + storageService.store(IS_CANDIDATE_KEY, false, StorageScope.GLOBAL); + storageService.store(SKIP_VERSION_KEY, pkg.version, StorageScope.GLOBAL); + }); + }); + + const remindMeLaterAction = new Action('later', nls.localize('remindLater', "Remind Me later"), '', true, () => { + telemetryService.publicLog(`${data.surveyId}.survey/remindMeLater`); + storageService.store(SESSION_COUNT_KEY, sessionCount - 3, StorageScope.GLOBAL); + return TPromise.as(null); + }); + + const neverAgainAction = new Action('never', nls.localize('neverAgain', "Don't Show Again"), '', true, () => { + telemetryService.publicLog(`${data.surveyId}.survey/dontShowAgain`); + storageService.store(IS_CANDIDATE_KEY, false, StorageScope.GLOBAL); + storageService.store(SKIP_VERSION_KEY, pkg.version, StorageScope.GLOBAL); + return TPromise.as(null); + }); + + const actions = [neverAgainAction, remindMeLaterAction, takeSurveyAction]; + telemetryService.publicLog(`${data.surveyId}.survey/userAsked`); + messageService.show(Severity.Info, { message, actions }); + } + +} + +class LanguageSurveysContribution implements IWorkbenchContribution { + + private surveys: LanguageSurvey[]; + + constructor( + @IInstantiationService instantiationService: IInstantiationService, + @IStorageService storageService: IStorageService, + @IMessageService messageService: IMessageService, + @ITelemetryService telemetryService: ITelemetryService, + @IFileService fileService: IFileService, + @IModelService modelService: IModelService + ) { + this.surveys = product.surveys.filter(surveyData => surveyData.surveyId && surveyData.editCount && surveyData.languageId && surveyData.surveyUrl && surveyData.userProbability).map(surveyData => + new LanguageSurvey(surveyData, instantiationService, storageService, messageService, telemetryService, fileService, modelService)); + } + + getId(): string { + return 'languagesurveys.contribution'; + } +} + +if (language === 'en' && product.surveys && product.surveys.length) { + const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); + workbenchRegistry.registerWorkbenchContribution(LanguageSurveysContribution); +} \ No newline at end of file diff --git a/src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts b/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts similarity index 100% rename from src/vs/workbench/parts/nps/electron-browser/nps.contribution.ts rename to src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/parts/tasks/browser/quickOpen.ts index fc2df2f1c40..e4208bafd3a 100644 --- a/src/vs/workbench/parts/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/quickOpen.ts @@ -7,35 +7,52 @@ import nls = require('vs/nls'); import Filters = require('vs/base/common/filters'); import { TPromise } from 'vs/base/common/winjs.base'; +import { Action, IAction } from 'vs/base/common/actions'; import Quickopen = require('vs/workbench/browser/quickopen'); import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen'); import Model = require('vs/base/parts/quickopen/browser/quickOpenModel'); import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { Task } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, TaskSourceKind, computeLabel } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; +import { ActionBarContributor, ContributableActionProvider } from 'vs/workbench/browser/actions'; export class TaskEntry extends Model.QuickOpenEntry { - constructor(protected taskService: ITaskService, protected task: Task, highlights: Model.IHighlight[] = []) { + private _label: string; + + constructor(protected taskService: ITaskService, protected _task: Task, highlights: Model.IHighlight[] = []) { super(highlights); - this.task = task; + this._label = computeLabel(_task); } public getLabel(): string { - return this.task.name; + return this._label; } public getAriaLabel(): string { return nls.localize('entryAriaLabel', "{0}, tasks", this.getLabel()); } + + public get task(): Task { + return this._task; + } +} + +export class TaskGroupEntry extends Model.QuickOpenEntryGroup { + constructor(entry: TaskEntry, groupLabel: string, withBorder: boolean) { + super(entry, groupLabel, withBorder); + } } export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { + private tasks: TPromise; + + constructor( - @IQuickOpenService protected quickOpenService: IQuickOpenService, - @ITaskService protected taskService: ITaskService + protected quickOpenService: IQuickOpenService, + protected taskService: ITaskService, ) { super(); @@ -43,38 +60,126 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { this.taskService = taskService; } + public onOpen(): void { + this.tasks = this.getTasks(); + } + + public onClose(canceled: boolean): void { + this.tasks = undefined; + } + public getResults(input: string): TPromise { - return this.getTasks().then(tasks => tasks - .sort((a, b) => a.name.localeCompare(b.name)) - .map(task => ({ task: task, highlights: Filters.matchesContiguousSubString(input, task.name) })) - .filter(({ highlights }) => !!highlights) - .map(({ task, highlights }) => this.createEntry(this.taskService, task, highlights)) - , _ => []).then(e => new Model.QuickOpenModel(e)); + return this.tasks.then((tasks) => { + let entries: Model.QuickOpenEntry[] = []; + if (tasks.length === 0) { + return new Model.QuickOpenModel(entries); + } + tasks = tasks.sort((a, b) => { + let aKind = a._source.kind; + let bKind = b._source.kind; + if (aKind === bKind) { + if (aKind === TaskSourceKind.Extension) { + let compare = a._source.label.localeCompare(b._source.label); + if (compare !== 0) { + return compare; + } + } + return a.name.localeCompare(b.name); + } + if (aKind === TaskSourceKind.Workspace) { + return -1; + } else { + return +1; + } + }); + let hasWorkspace: boolean = tasks[0]._source.kind === TaskSourceKind.Workspace; + let hasExtension: boolean = tasks[tasks.length - 1]._source.kind === TaskSourceKind.Extension; + let groupWorkspace = hasWorkspace && hasExtension; + let groupExtension = groupWorkspace; + let hadWorkspace = false; + for (let task of tasks) { + let highlights = Filters.matchesContiguousSubString(input, task.name); + if (!highlights) { + continue; + } + if (task._source.kind === TaskSourceKind.Workspace && groupWorkspace) { + groupWorkspace = false; + hadWorkspace = true; + entries.push(new TaskGroupEntry(this.createEntry(this.taskService, task, highlights), nls.localize('configured', 'Configured Tasks'), false)); + } else if (task._source.kind === TaskSourceKind.Extension && groupExtension) { + groupExtension = false; + entries.push(new TaskGroupEntry(this.createEntry(this.taskService, task, highlights), nls.localize('detected', 'Detected Tasks'), hadWorkspace)); + } else { + entries.push(this.createEntry(this.taskService, task, highlights)); + } + } + return new Model.QuickOpenModel(entries, new ContributableActionProvider()); + }); } protected abstract getTasks(): TPromise; protected abstract createEntry(taskService: ITaskService, task: Task, highlights: Model.IHighlight[]): TaskEntry; - public getClass(): string { - return null; - } - - public canRun(): boolean { - return true; - } - public getAutoFocus(input: string): QuickOpen.IAutoFocus { return { autoFocusFirstEntry: !!input }; } +} - public onClose(canceled: boolean): void { - return; +class CustomizeTaskAction extends Action { + + private static ID = 'workbench.action.tasks.customizeTask'; + private static LABEL = nls.localize('customizeTask', "Customize Task"); + + constructor(private taskService: ITaskService, private quickOpenService: IQuickOpenService, private task: Task) { + super(CustomizeTaskAction.ID, CustomizeTaskAction.LABEL); + this.updateClass(); } - public getGroupLabel(): string { - return null; + public updateClass(): void { + this.class = 'quick-open-task-configure'; + } + + public run(context: any): TPromise { + return this.taskService.customize(this.task, true).then(() => { + this.quickOpenService.close(); + }); + } +} + +export class QuickOpenActionContributor extends ActionBarContributor { + + constructor( @ITaskService private taskService: ITaskService, @IQuickOpenService private quickOpenService: IQuickOpenService) { + super(); + } + + public hasActions(context: any): boolean { + let task = this.getTask(context); + + return !!task; + } + + public getActions(context: any): IAction[] { + let actions: Action[] = []; + let task = this.getTask(context); + if (task && task._source.kind === TaskSourceKind.Extension) { + actions.push(new CustomizeTaskAction(this.taskService, this.quickOpenService, task)); + } + return actions; + } + + private getTask(context: any): Task { + if (!context) { + return undefined; + } + let element = context.element; + if (element instanceof TaskEntry) { + return element.task; + } else if (element instanceof TaskGroupEntry) { + return (element.getEntry() as TaskEntry).task; + } + return undefined; } } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts index 9a8ee28964a..95d4d2bd5dd 100644 --- a/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts @@ -20,15 +20,11 @@ class TaskEntry extends base.TaskEntry { super(taskService, task, highlights); } - public getAriaLabel(): string { - return nls.localize('entryAriaLabel', "{0}, tasks", this.getLabel()); - } - public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.restart(this.task._id); + this.taskService.restart(this._task._id); return true; } } diff --git a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts index b7f8e4515e2..b6939d7a77c 100644 --- a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts @@ -22,15 +22,11 @@ class TaskEntry extends base.TaskEntry { super(taskService, task, highlights); } - public getAriaLabel(): string { - return nls.localize('entryAriaLabel', "{0}, tasks", this.getLabel()); - } - public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.run(this.task); + this.taskService.run(this._task); return true; } } diff --git a/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts index 767e872a446..80fc424f5d0 100644 --- a/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts @@ -24,7 +24,7 @@ class TaskEntry extends base.TaskEntry { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.terminate(this.task._id); + this.taskService.terminate(this._task._id); return true; } } diff --git a/src/vs/workbench/parts/tasks/common/task.api.ts b/src/vs/workbench/parts/tasks/common/task.api.ts new file mode 100644 index 00000000000..212047ae084 --- /dev/null +++ b/src/vs/workbench/parts/tasks/common/task.api.ts @@ -0,0 +1,213 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * Defines a problem pattern + */ +export interface ProblemPattern { + + /** + * The regular expression to find a problem in the console output of an + * executed task. + */ + regexp: RegExp; + + /** + * The match group index of the filename. + * + * Defaults to 1 if omitted. + */ + file?: number; + + /** + * The match group index of the problems's location. Valid location + * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). + * If omitted the line and colum properties are used. + */ + location?: number; + + /** + * The match group index of the problem's line in the source file. + * + * Defaults to 2 if omitted. + */ + line?: number; + + /** + * The match group index of the problem's character in the source file. + * + * Defaults to 3 if omitted. + */ + character?: number; + + /** + * The match group index of the problem's end line in the source file. + * + * Defaults to undefined. No end line is captured. + */ + endLine?: number; + + /** + * The match group index of the problem's end character in the source file. + * + * Defaults to undefined. No end column is captured. + */ + endCharacter?: number; + + /** + * The match group index of the problem's severity. + * + * Defaults to undefined. In this case the problem matcher's severity + * is used. + */ + severity?: number; + + /** + * The match group index of the problems's code. + * + * Defaults to undefined. No code is captured. + */ + code?: number; + + /** + * The match group index of the message. If omitted it defaults + * to 4 if location is specified. Otherwise it defaults to 5. + */ + message?: number; + + /** + * Specifies if the last pattern in a multi line problem matcher should + * loop as long as it does match a line consequently. Only valid on the + * last problem pattern in a multi line problem matcher. + */ + loop?: boolean; +} + +/** + * A multi line problem pattern. + */ +export type MultiLineProblemPattern = ProblemPattern[]; + +/** + * The way how the file location is interpreted + */ +export enum FileLocationKind { + /** + * VS Code should decide based on whether the file path found in the + * output is absolute or relative. A relative file path will be treated + * relative to the workspace root. + */ + Auto = 1, + + /** + * Always treat the file path relative. + */ + Relative = 2, + + /** + * Always treat the file path absolute. + */ + Absolute = 3 +} + +/** + * Controls to which kind of documents problems are applied. + */ +export enum ApplyToKind { + /** + * Problems are applied to all documents. + */ + AllDocuments = 1, + + /** + * Problems are applied to open documents only. + */ + OpenDocuments = 2, + + + /** + * Problems are applied to closed documents only. + */ + ClosedDocuments = 3 +} + + +/** + * A background monitor pattern + */ +export interface BackgroundPattern { + /** + * The actual regular expression + */ + regexp: RegExp; + + /** + * The match group index of the filename. If provided the expression + * is matched for that file only. + */ + file?: number; +} + +/** + * A description to control the activity of a problem matcher + * watching a background task. + */ +export interface BackgroundMonitor { + /** + * If set to true the monitor is in active mode when the task + * starts. This is equals of issuing a line that matches the + * beginPattern. + */ + activeOnStart?: boolean; + + /** + * If matched in the output the start of a background activity is signaled. + */ + beginsPattern: RegExp | BackgroundPattern; + + /** + * If matched in the output the end of a background activity is signaled. + */ + endsPattern: RegExp | BackgroundPattern; +} + +/** + * Defines a problem matcher + */ +export interface ProblemMatcher { + /** + * The owner of a problem. Defaults to a generated id + * if omitted. + */ + owner?: string; + + /** + * The type of documents problems detected by this matcher + * apply to. Default to `ApplyToKind.AllDocuments` if omitted. + */ + applyTo?: ApplyToKind; + + /** + * How a file location recognized by a matcher should be interpreted. If omitted the file location + * if `FileLocationKind.Auto`. + */ + fileLocation?: FileLocationKind | string; + + /** + * The actual pattern used by the problem matcher. + */ + pattern: ProblemPattern | MultiLineProblemPattern; + + /** + * The default severity of a detected problem in the output. Used + * if the `ProblemPattern` doesn't define a severity match group. + */ + severity?: any; + + /** + * A background monitor for tasks that are running in the background. + */ + backgound?: BackgroundMonitor; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskConfiguration.ts b/src/vs/workbench/parts/tasks/common/taskConfiguration.ts index abc0a29c2de..862419a7fea 100644 --- a/src/vs/workbench/parts/tasks/common/taskConfiguration.ts +++ b/src/vs/workbench/parts/tasks/common/taskConfiguration.ts @@ -11,7 +11,6 @@ import { IStringDictionary } from 'vs/base/common/collections'; import * as Platform from 'vs/base/common/platform'; import * as Types from 'vs/base/common/types'; import * as UUID from 'vs/base/common/uuid'; -import { Config as ProcessConfig } from 'vs/base/common/processes'; import { ValidationStatus, IProblemReporter as IProblemReporterBase } from 'vs/base/common/parsers'; import { @@ -32,7 +31,37 @@ export class ProblemHandling { public static clean: string = 'cleanMatcherMatchers'; } +export interface ShellConfiguration { + executable: string; + args?: string[]; +} + +export interface CommandOptions { + /** + * The current working directory of the executed program or shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed program or shell. If omitted + * the parent process' environment is used. + */ + env?: IStringDictionary; + + /** + * The shell configuration; + */ + shell?: ShellConfiguration; +} + export interface PlatformTaskDescription { + + /** + * Whether the task is a shell task or a process task. + */ + type?: string; + /** * The command to be executed. Can be an external program or a shell * command. @@ -40,17 +69,18 @@ export interface PlatformTaskDescription { command?: string; /** + * @deprecated use the task type instead. * Specifies whether the command is a shell command and therefore must * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). * * Defaults to false if omitted. */ - isShellCommand?: boolean; + isShellCommand?: boolean | ShellConfiguration; /** * The command options used when the command is executed. Can be omitted. */ - options?: ProcessConfig.CommandOptions; + options?: CommandOptions; /** * The arguments passed to the command or additional arguments passed to the @@ -107,11 +137,18 @@ export interface TaskDescription extends PlatformTaskDescription { promptOnClose?: boolean; /** + * Defines the group the task belongs too. + */ + group?: string; + + /** + * @deprecated Use `group` instead. * Whether this task maps to the default build command. */ isBuildCommand?: boolean; /** + * @deprecated Use `group` instead. * Whether this task maps to the default test command. */ isTestCommand?: boolean; @@ -166,7 +203,7 @@ export interface BaseTaskRunnerConfiguration { /** * The command options used when the command is executed. Can be omitted. */ - options?: ProcessConfig.CommandOptions; + options?: CommandOptions; /** * The arguments passed to the command. Can be omitted. @@ -189,6 +226,21 @@ export interface BaseTaskRunnerConfiguration { */ echoCommand?: boolean; + /** + * Controls the behavior of the used terminal + */ + terminal?: { + /** + * The terminal should echo the run command. + */ + echo?: boolean; + /** + * Controls whether or not the terminal is reveal if a task + * is executed. + */ + reveal?: string; + }; + /** * If set to false the task name is added as an additional argument to the * command when executed. If set to true the task name is suppressed. If @@ -293,7 +345,7 @@ interface ParseContext { } namespace CommandOptions { - export function from(this: void, options: ProcessConfig.CommandOptions, context: ParseContext): Tasks.CommandOptions { + export function from(this: void, options: CommandOptions, context: ParseContext): Tasks.CommandOptions { let result: Tasks.CommandOptions = {}; if (options.cwd !== void 0) { if (Types.isString(options.cwd)) { @@ -305,11 +357,12 @@ namespace CommandOptions { if (options.env !== void 0) { result.env = Objects.clone(options.env); } + result.shell = ShellConfiguration.from(options.shell, context); return isEmpty(result) ? undefined : result; } export function isEmpty(value: Tasks.CommandOptions): boolean { - return !value || value.cwd === void 0 && value.env === void 0; + return !value || value.cwd === void 0 && value.env === void 0 && value.shell === void 0; } export function merge(target: Tasks.CommandOptions, source: Tasks.CommandOptions): Tasks.CommandOptions { @@ -328,6 +381,7 @@ namespace CommandOptions { Object.keys(source.env).forEach(key => env[key = source.env[key]]); target.env = env; } + target.shell = ShellConfiguration.merge(target.shell, source.shell); return target; } @@ -341,6 +395,7 @@ namespace CommandOptions { if (value.cwd === void 0) { value.cwd = '${workspaceRoot}'; } + ShellConfiguration.fillDefaults(value.shell); return value; } @@ -349,14 +404,10 @@ namespace CommandOptions { if (value.env) { Object.freeze(value.env); } + ShellConfiguration.freeze(value.shell); } } -interface ShellConfiguration { - executable: string; - args?: string[]; -} - namespace ShellConfiguration { export function is(value: any): value is ShellConfiguration { let candidate: ShellConfiguration = value; @@ -402,12 +453,20 @@ namespace ShellConfiguration { } namespace CommandConfiguration { + interface TerminalBehavior { + echo?: boolean; + reveal?: string; + } + interface BaseCommandConfiguationShape { command?: string; + type?: string; isShellCommand?: boolean | ShellConfiguration; args?: string[]; - options?: ProcessConfig.CommandOptions; + options?: CommandOptions; echoCommand?: boolean; + showOutput?: string; + terminal?: TerminalBehavior; taskSelector?: string; } @@ -417,6 +476,70 @@ namespace CommandConfiguration { linux?: BaseCommandConfiguationShape; } + export namespace TerminalBehavior { + export function from(this: void, config: BaseCommandConfiguationShape, context: ParseContext): Tasks.TerminalBehavior { + let echo: boolean = undefined; + let reveal: Tasks.RevealKind = undefined; + if (Types.isBoolean(config.echoCommand)) { + echo = config.echoCommand; + } + if (Types.isString(config.showOutput)) { + reveal = Tasks.RevealKind.fromString(config.showOutput); + } + if (config.terminal) { + if (Types.isBoolean(config.terminal.echo)) { + echo = config.terminal.echo; + } + if (Types.isString(config.terminal.reveal)) { + reveal = Tasks.RevealKind.fromString(config.terminal.reveal); + } + } + if (echo === void 0 && reveal === void 0) { + return undefined; + } + return { echo, reveal }; + } + + export function merge(target: Tasks.TerminalBehavior, source: Tasks.TerminalBehavior): Tasks.TerminalBehavior { + if (isEmpty(source)) { + return target; + } + if (isEmpty(target)) { + return source; + } + mergeProperty(target, source, 'echo'); + mergeProperty(target, source, 'reveal'); + return target; + } + + export function fillDefault(value: Tasks.TerminalBehavior): Tasks.TerminalBehavior { + if (value && Object.isFrozen(value)) { + return value; + } + if (value === void 0) { + return { echo: false, reveal: Tasks.RevealKind.Always }; + } + if (value.echo === void 0) { + value.echo = false; + } + if (value.reveal === void 0) { + value.reveal = Tasks.RevealKind.Always; + } + return value; + } + + export function freeze(value: Tasks.TerminalBehavior): void { + if (value === void 0) { + return; + } + Object.freeze(value); + } + + function isEmpty(this: void, value: Tasks.TerminalBehavior): boolean { + return !value || value.echo === void 0 && value.reveal === void 0; + } + } + export function from(this: void, config: CommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { let result: Tasks.CommandConfiguration = fromBase(config, context); @@ -438,21 +561,20 @@ namespace CommandConfiguration { function fromBase(this: void, config: BaseCommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { let result: Tasks.CommandConfiguration = { name: undefined, - isShellCommand: undefined, - echo: undefined + type: undefined, + terminal: undefined }; if (Types.isString(config.command)) { result.name = config.command; } - if (Types.isBoolean(config.isShellCommand)) { - result.isShellCommand = config.isShellCommand; - } else if (ShellConfiguration.is(config.isShellCommand)) { - result.isShellCommand = ShellConfiguration.from(config.isShellCommand, context); - if (!context.isTermnial) { - context.problemReporter.warn(nls.localize('ConfigurationParser.noShell', 'Warning: shell configuration is only supported when executing tasks in the terminal.')); - } + if (Types.isString(config.type)) { + result.type = Tasks.CommandType.fromString(config.type); + } + let isShellConfiguration = ShellConfiguration.is(config.isShellCommand); + if (Types.isBoolean(config.isShellCommand) || isShellConfiguration) { + result.type = Tasks.CommandType.Shell; } else if (config.isShellCommand !== void 0) { - result.isShellCommand = !!config.isShellCommand; + result.type = !!config.isShellCommand ? Tasks.CommandType.Shell : Tasks.CommandType.Process; } if (config.args !== void 0) { if (Types.isStringArray(config.args)) { @@ -463,9 +585,16 @@ namespace CommandConfiguration { } if (config.options !== void 0) { result.options = CommandOptions.from(config.options, context); + if (result.options && result.options.shell === void 0 && isShellConfiguration) { + result.options.shell = ShellConfiguration.from(config.isShellCommand as ShellConfiguration, context); + if (!context.isTermnial) { + context.problemReporter.warn(nls.localize('ConfigurationParser.noShell', 'Warning: shell configuration is only supported when executing tasks in the terminal.')); + } + } } - if (Types.isBoolean(config.echoCommand)) { - result.echo = config.echoCommand; + let terminal = TerminalBehavior.from(config, context); + if (terminal) { + result.terminal = terminal; } if (Types.isString(config.taskSelector)) { result.taskSelector = config.taskSelector; @@ -474,11 +603,13 @@ namespace CommandConfiguration { } export function isEmpty(value: Tasks.CommandConfiguration): boolean { - return !value || value.name === void 0 && value.isShellCommand === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options) && value.echo === void 0; + return !value || value.name === void 0 && value.type === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options) && value.terminal === void 0; } - export function onlyEcho(value: Tasks.CommandConfiguration): boolean { - return value && value.echo !== void 0 && value.name === void 0 && value.isShellCommand === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options); + export function onlyTerminalBehaviour(value: Tasks.CommandConfiguration): boolean { + return value && + value.terminal && (value.terminal.echo !== void 0 || value.terminal.reveal !== void 0) && + value.name === void 0 && value.type === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options); } export function merge(target: Tasks.CommandConfiguration, source: Tasks.CommandConfiguration): Tasks.CommandConfiguration { @@ -489,18 +620,13 @@ namespace CommandConfiguration { return source; } mergeProperty(target, source, 'name'); + mergeProperty(target, source, 'type'); // Merge isShellCommand - if (target.isShellCommand === void 0) { - target.isShellCommand = source.isShellCommand; - } if (Types.isBoolean(target.isShellCommand) && Types.isBoolean(source.isShellCommand)) { - mergeProperty(target, source, 'isShellCommand'); - } else if (ShellConfiguration.is(target.isShellCommand) && ShellConfiguration.is(source.isShellCommand)) { - ShellConfiguration.merge(target.isShellCommand, source.isShellCommand); - } else if (Types.isBoolean(target.isShellCommand) && ShellConfiguration.is(source.isShellCommand)) { - target.isShellCommand = source.isShellCommand; + if (target.type === void 0) { + target.type = source.type; } - mergeProperty(target, source, 'echo'); + target.terminal = TerminalBehavior.merge(target.terminal, source.terminal); mergeProperty(target, source, 'taskSelector'); if (source.args !== void 0) { if (target.args === void 0) { @@ -517,12 +643,10 @@ namespace CommandConfiguration { if (!value || Object.isFrozen(value)) { return; } - if (value.name !== void 0 && value.isShellCommand === void 0) { - value.isShellCommand = false; - } - if (value.echo === void 0) { - value.echo = false; + if (value.name !== void 0 && value.type === void 0) { + value.type = Tasks.CommandType.Process; } + value.terminal = TerminalBehavior.fillDefault(value.terminal); if (value.args === void 0) { value.args = EMPTY_ARRAY; } @@ -539,8 +663,8 @@ namespace CommandConfiguration { if (value.options) { CommandOptions.freeze(value.options); } - if (ShellConfiguration.is(value.isShellCommand)) { - ShellConfiguration.freeze(value.isShellCommand); + if (value.terminal) { + TerminalBehavior.freeze(value.terminal); } } } @@ -631,15 +755,27 @@ namespace ProblemMatcherConverter { } } +interface TaskParseResult { + tasks: Tasks.Task[] | undefined; + annotatingTasks: Tasks.Task[] | undefined; +} + namespace TaskDescription { - export function from(this: void, tasks: TaskDescription[], globals: Globals, context: ParseContext): Tasks.Task[] { + export let source: Tasks.TaskSource = { + kind: Tasks.TaskSourceKind.Workspace, + label: 'Workspace', + detail: '.settins\tasks.json' + }; + + export function from(this: void, tasks: TaskDescription[], globals: Globals, context: ParseContext): TaskParseResult { if (!tasks) { return undefined; } let parsedTasks: Tasks.Task[] = []; - let defaultBuildTask: { task: Tasks.Task; rank: number; } = { task: null, rank: -1 }; - let defaultTestTask: { task: Tasks.Task; rank: number; } = { task: null, rank: -1 }; + let annotatingTasks: Tasks.Task[] = []; + let defaultBuildTask: { task: Tasks.Task; rank: number; } = { task: undefined, rank: -1 }; + let defaultTestTask: { task: Tasks.Task; rank: number; } = { task: undefined, rank: -1 }; tasks.forEach((externalTask) => { let taskName = externalTask.taskName; if (!taskName) { @@ -649,14 +785,16 @@ namespace TaskDescription { let problemMatchers = ProblemMatcherConverter.from(externalTask.problemMatcher, context); let command: Tasks.CommandConfiguration = externalTask.command !== void 0 ? CommandConfiguration.from(externalTask, context) - : externalTask.echoCommand !== void 0 ? { name: undefined, isShellCommand: undefined, echo: !!externalTask.echoCommand } : undefined; + : externalTask.echoCommand !== void 0 + ? { name: undefined, type: undefined, terminal: CommandConfiguration.TerminalBehavior.from(externalTask, context) } + : undefined; let identifer = Types.isString(externalTask.identifier) ? externalTask.identifier : taskName; let task: Tasks.Task = { _id: UUID.generateUuid(), + _source: source, name: taskName, identifier: identifer, - command, - showOutput: undefined + command }; if (externalTask.command === void 0 && Types.isStringArray(externalTask.args)) { task.args = externalTask.args.slice(); @@ -670,8 +808,15 @@ namespace TaskDescription { if (externalTask.promptOnClose !== void 0) { task.promptOnClose = !!externalTask.promptOnClose; } - if (Types.isString(externalTask.showOutput)) { - task.showOutput = Tasks.ShowOutput.fromString(externalTask.showOutput); + if (Tasks.TaskGroup.is(externalTask.group)) { + task.group = externalTask.group; + } + if (task.group === void 0) { + if (Types.isBoolean(externalTask.isBuildCommand) && externalTask.isBuildCommand) { + task.group = Tasks.TaskGroup.Build; + } else if (Types.isBoolean(externalTask.isTestCommand && externalTask.isTestCommand)) { + task.group = Tasks.TaskGroup.Test; + } } if (externalTask.command !== void 0) { // if the task has its own command then we suppress the @@ -690,10 +835,15 @@ namespace TaskDescription { if (problemMatchers) { task.problemMatchers = problemMatchers; } + if (context.isTermnial && isAnnotating(task)) { + mergeGlobalsIntoAnnnotation(task, globals); + annotatingTasks.push(task); + return; + } mergeGlobals(task, globals); fillDefaults(task); let addTask: boolean = true; - if (context.isTermnial && task.command && task.command.name && task.command.isShellCommand && task.command.args && task.command.args.length > 0) { + if (context.isTermnial && task.command && task.command.name && task.command.type === Tasks.CommandType.Shell && task.command.args && task.command.args.length > 0) { if (hasUnescapedSpaces(task.command.name) || task.command.args.some(hasUnescapedSpaces)) { context.problemReporter.warn(nls.localize('taskConfiguration.shellArgs', 'Warning: the task \'{0}\' is a shell command and either the command name or one of its arguments has unescaped spaces. To ensure correct command line quoting please merge args into the command.', task.name)); } @@ -717,32 +867,33 @@ namespace TaskDescription { } if (addTask) { parsedTasks.push(task); - if (!Types.isUndefined(externalTask.isBuildCommand) && externalTask.isBuildCommand && defaultBuildTask.rank < 2) { + if (task.group === Tasks.TaskGroup.Build && defaultBuildTask.rank < 2) { defaultBuildTask.task = task; defaultBuildTask.rank = 2; - } else if (taskName === 'build' && defaultBuildTask.rank < 2) { - defaultBuildTask.task = task; - defaultBuildTask.rank = 1; - } - if (!Types.isUndefined(externalTask.isTestCommand) && externalTask.isTestCommand && defaultTestTask.rank < 2) { + } else if (task.group === Tasks.TaskGroup.Test && defaultTestTask.rank < 2) { defaultTestTask.task = task; defaultTestTask.rank = 2; - } else if (taskName === 'test' && defaultTestTask.rank < 2) { + } else if (task.name === 'build' && defaultBuildTask.rank < 1) { + defaultBuildTask.task = task; + defaultBuildTask.rank = 1; + } else if (task.name === 'test' && defaultTestTask.rank < 1) { defaultTestTask.task = task; defaultTestTask.rank = 1; } } }); - if (defaultBuildTask.task) { + if (defaultBuildTask.rank > -1 && defaultBuildTask.rank < 2) { defaultBuildTask.task.group = Tasks.TaskGroup.Build; - } - if (defaultTestTask.task) { + } else if (defaultTestTask.rank > -1 && defaultTestTask.rank < 2) { defaultTestTask.task.group = Tasks.TaskGroup.Test; } - return parsedTasks.length === 0 ? undefined : parsedTasks; + return { + tasks: parsedTasks.length > 0 ? parsedTasks : undefined, + annotatingTasks: annotatingTasks.length > 0 ? annotatingTasks : undefined + }; } - export function merge(target: Tasks.Task[], source: Tasks.Task[]): Tasks.Task[] { + export function mergeTasks(target: Tasks.Task[], source: Tasks.Task[]): Tasks.Task[] { if (source === void 0 || source.length === 0) { return target; } @@ -777,13 +928,13 @@ namespace TaskDescription { if (CommandConfiguration.isEmpty(task.command) && !CommandConfiguration.isEmpty(globals.command) && globals.command.name !== void 0) { task.command = globals.command; } - if (CommandConfiguration.onlyEcho(task.command)) { + if (CommandConfiguration.onlyTerminalBehaviour(task.command)) { // The globals can have a echo set which would override the local echo // Saves the need of a additional fill method. But might be necessary // at some point. - let oldEcho = task.command.echo; + let oldTerminal = Objects.clone(task.command.terminal); CommandConfiguration.merge(task.command, globals.command); - task.command.echo = oldEcho; + task.command.terminal = oldTerminal; } } // promptOnClose is inferred from isBackground if available @@ -793,9 +944,9 @@ namespace TaskDescription { if (task.suppressTaskName === void 0 && globals.suppressTaskName !== void 0) { task.suppressTaskName = globals.suppressTaskName; } - if (task.showOutput === void 0 && globals.showOutput !== void 0) { - task.showOutput = globals.showOutput; - } + } + + export function mergeGlobalsIntoAnnnotation(task: Tasks.Task, globals: Globals): void { } export function fillDefaults(task: Tasks.Task): void { @@ -812,9 +963,6 @@ namespace TaskDescription { if (task.isBackground === void 0) { task.isBackground = false; } - if (task.showOutput === void 0) { - task.showOutput = Tasks.ShowOutput.Always; - } if (task.problemMatchers === void 0) { task.problemMatchers = EMPTY_ARRAY; } @@ -841,13 +989,35 @@ namespace TaskDescription { return false; } } + + function isAnnotating(task: Tasks.Task): boolean { + return (task.command === void 0 || task.command.name === void 0) && (task.dependsOn === void 0 || task.dependsOn.length === 0); + } + + export function merge(target: Tasks.Task, source: Tasks.Task): Tasks.Task { + if (!target) { + return source; + } + if (!source) { + return target; + } + + mergeProperty(target, source, 'group'); + target.command = CommandConfiguration.merge(target.command, source.command); + mergeProperty(target, source, 'suppressTaskName'); + mergeProperty(target, source, 'args'); + mergeProperty(target, source, 'isBackground'); + mergeProperty(target, source, 'promptOnClose'); + mergeProperty(target, source, 'dependsOn'); + mergeProperty(target, source, 'problemMatchers'); + return target; + } } interface Globals { command?: Tasks.CommandConfiguration; promptOnClose?: boolean; suppressTaskName?: boolean; - showOutput?: Tasks.ShowOutput; } namespace Globals { @@ -876,9 +1046,6 @@ namespace Globals { export function fromBase(this: void, config: BaseTaskRunnerConfiguration, context: ParseContext): Globals { let result: Globals = {}; - if (Types.isString(config.showOutput)) { - result.showOutput = Tasks.ShowOutput.fromString(config.showOutput); - } if (config.suppressTaskName !== void 0) { result.suppressTaskName = !!config.suppressTaskName; } @@ -889,7 +1056,7 @@ namespace Globals { } export function isEmpty(value: Globals): boolean { - return !value || value.command === void 0 && value.promptOnClose === void 0 && value.showOutput === void 0 && value.suppressTaskName === void 0; + return !value || value.command === void 0 && value.promptOnClose === void 0 && value.suppressTaskName === void 0; } export function merge(target: Globals, source: Globals): Globals { @@ -901,7 +1068,6 @@ namespace Globals { } mergeProperty(target, source, 'promptOnClose'); mergeProperty(target, source, 'suppressTaskName'); - mergeProperty(target, source, 'showOutput'); return target; } @@ -912,9 +1078,6 @@ namespace Globals { if (value.suppressTaskName === void 0) { value.suppressTaskName = false; } - if (value.showOutput === void 0) { - value.showOutput = Tasks.ShowOutput.Always; - } if (value.promptOnClose === void 0) { value.promptOnClose = true; } @@ -950,6 +1113,7 @@ export namespace ExecutionEngine { export interface ParseResult { validationStatus: ValidationStatus; tasks: Tasks.Task[]; + annotatingTasks: Tasks.Task[]; engine: Tasks.ExecutionEngine; } @@ -960,7 +1124,6 @@ export interface IProblemReporter extends IProblemReporterBase { class ConfigurationParser { private problemReporter: IProblemReporter; - constructor(problemReporter: IProblemReporter) { this.problemReporter = problemReporter; } @@ -970,21 +1133,27 @@ class ConfigurationParser { if (engine === Tasks.ExecutionEngine.Terminal) { this.problemReporter.clearOutput(); } - let context: ParseContext = { problemReporter: this.problemReporter, namedProblemMatchers: undefined, isTermnial: engine === Tasks.ExecutionEngine.Terminal }; + let context: ParseContext = { + problemReporter: this.problemReporter, + namedProblemMatchers: undefined, + isTermnial: engine === Tasks.ExecutionEngine.Terminal + }; + let taskParseResult = this.createTaskRunnerConfiguration(fileConfig, context); return { validationStatus: this.problemReporter.status, - tasks: this.createTaskRunnerConfiguration(fileConfig, context), + tasks: taskParseResult.tasks, + annotatingTasks: taskParseResult.annotatingTasks, engine }; } - private createTaskRunnerConfiguration(fileConfig: ExternalTaskRunnerConfiguration, context: ParseContext): Tasks.Task[] { + private createTaskRunnerConfiguration(fileConfig: ExternalTaskRunnerConfiguration, context: ParseContext): TaskParseResult { let globals = Globals.from(fileConfig, context); if (this.problemReporter.status.isFatal()) { return undefined; } context.namedProblemMatchers = ProblemMatcherConverter.namedFrom(fileConfig.declares, context); - let globalTasks: Tasks.Task[]; + let globalTasks: TaskParseResult; if (fileConfig.windows && Platform.platform === Platform.Platform.Windows) { globalTasks = TaskDescription.from(fileConfig.windows.tasks, globals, context); } else if (fileConfig.osx && Platform.platform === Platform.Platform.Mac) { @@ -993,36 +1162,43 @@ class ConfigurationParser { globalTasks = TaskDescription.from(fileConfig.linux.tasks, globals, context); } - let tasks: Tasks.Task[]; + let result: TaskParseResult = { tasks: undefined, annotatingTasks: undefined }; if (fileConfig.tasks) { - tasks = TaskDescription.from(fileConfig.tasks, globals, context); + result = TaskDescription.from(fileConfig.tasks, globals, context); + } + if (globalTasks) { + result.tasks = TaskDescription.mergeTasks(result.tasks, globalTasks.tasks); + result.annotatingTasks = TaskDescription.mergeTasks(result.annotatingTasks, globalTasks.annotatingTasks); } - tasks = TaskDescription.merge(tasks, globalTasks); - if (!tasks || tasks.length === 0) { - if (globals.command && globals.command.name) { - let matchers: ProblemMatcher[] = ProblemMatcherConverter.from(fileConfig.problemMatcher, context);; - let isBackground = fileConfig.isBackground ? !!fileConfig.isBackground : fileConfig.isWatching ? !!fileConfig.isWatching : undefined; - let task: Tasks.Task = { - _id: UUID.generateUuid(), - name: globals.command.name, - identifier: globals.command.name, - group: Tasks.TaskGroup.Build, - command: undefined, - isBackground: isBackground, - showOutput: undefined, - suppressTaskName: true, // this must be true since we infer the task from the global data. - problemMatchers: matchers - }; - TaskDescription.mergeGlobals(task, globals); - TaskDescription.fillDefaults(task); - tasks = [task]; - } + if ((!result.tasks || result.tasks.length === 0) && (globals.command && globals.command.name)) { + let matchers: ProblemMatcher[] = ProblemMatcherConverter.from(fileConfig.problemMatcher, context);; + let isBackground = fileConfig.isBackground ? !!fileConfig.isBackground : fileConfig.isWatching ? !!fileConfig.isWatching : undefined; + let task: Tasks.Task = { + _id: UUID.generateUuid(), + _source: TaskDescription.source, + name: globals.command.name, + identifier: globals.command.name, + group: Tasks.TaskGroup.Build, + command: undefined, + isBackground: isBackground, + suppressTaskName: true, // this must be true since we infer the task from the global data. + problemMatchers: matchers + }; + TaskDescription.mergeGlobals(task, globals); + TaskDescription.fillDefaults(task); + result.tasks = [task]; } - return tasks || []; + result.tasks = result.tasks || []; + result.annotatingTasks = result.annotatingTasks || []; + return result; } } export function parse(configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter): ParseResult { return (new ConfigurationParser(logger)).run(configuration); +} + +export function mergeTasks(target: Tasks.Task, source: Tasks.Task): Tasks.Task { + return TaskDescription.merge(target, source); } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskSampleConfig.json b/src/vs/workbench/parts/tasks/common/taskSampleConfig.json deleted file mode 100644 index 5fc7fce47f9..00000000000 --- a/src/vs/workbench/parts/tasks/common/taskSampleConfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - // Use IntelliSense to insert predefined task snippets - -} \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskService.ts b/src/vs/workbench/parts/tasks/common/taskService.ts index 53f92ee18ee..63b2da04137 100644 --- a/src/vs/workbench/parts/tasks/common/taskService.ts +++ b/src/vs/workbench/parts/tasks/common/taskService.ts @@ -43,6 +43,8 @@ export interface ITaskService extends IEventEmitter { terminateAll(): TPromise; tasks(): TPromise; + customize(task: Task, openConfig?: boolean): TPromise; + registerTaskProvider(handle: number, taskProvider: ITaskProvider): void; unregisterTaskProvider(handle: number): boolean; } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskSystem.ts b/src/vs/workbench/parts/tasks/common/taskSystem.ts index cca11d1e6a9..30e51e8a2e3 100644 --- a/src/vs/workbench/parts/tasks/common/taskSystem.ts +++ b/src/vs/workbench/parts/tasks/common/taskSystem.ts @@ -37,6 +37,8 @@ export interface TelemetryEvent { // How the task got trigger. Is either shortcut or command trigger: string; + runner: 'terminal' | 'output'; + // The command triggered command: string; diff --git a/src/vs/workbench/parts/tasks/common/taskTemplates.ts b/src/vs/workbench/parts/tasks/common/taskTemplates.ts index 01d2b68a0d0..ca345475266 100644 --- a/src/vs/workbench/parts/tasks/common/taskTemplates.ts +++ b/src/vs/workbench/parts/tasks/common/taskTemplates.ts @@ -14,111 +14,6 @@ export interface TaskEntry extends IPickOpenEntry { content: string; } -const gulp: TaskEntry = { - id: 'gulp', - label: 'Gulp', - autoDetect: true, - content: [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "gulp",', - '\t"isShellCommand": true,', - '\t"args": ["--no-color"],', - '\t"showOutput": "always"', - '}' - ].join('\n') -}; - -const grunt: TaskEntry = { - id: 'grunt', - label: 'Grunt', - autoDetect: true, - content: [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "grunt",', - '\t"isShellCommand": true,', - '\t"args": ["--no-color"],', - '\t"showOutput": "always"', - '}' - ].join('\n') -}; - -const npm: TaskEntry = { - id: 'npm', - label: 'npm', - sort: 'NPM', - autoDetect: false, - content: [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "npm",', - '\t"isShellCommand": true,', - '\t"showOutput": "always",', - '\t"suppressTaskName": true,', - '\t"tasks": [', - '\t\t{', - '\t\t\t"taskName": "install",', - '\t\t\t"args": ["install"]', - '\t\t},', - '\t\t{', - '\t\t\t"taskName": "update",', - '\t\t\t"args": ["update"]', - '\t\t},', - '\t\t{', - '\t\t\t"taskName": "test",', - '\t\t\t"args": ["run", "test"]', - '\t\t}', - '\t]', - '}' - ].join('\n') -}; - -const tscConfig: TaskEntry = { - id: 'tsc.config', - label: 'TypeScript - tsconfig.json', - autoDetect: false, - description: nls.localize('tsc.config', 'Compiles a TypeScript project'), - content: [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "tsc",', - '\t"isShellCommand": true,', - '\t"args": ["-p", "."],', - '\t"showOutput": "silent",', - '\t"problemMatcher": "$tsc"', - '}' - ].join('\n') -}; - -const tscWatch: TaskEntry = { - id: 'tsc.watch', - label: 'TypeScript - Watch Mode', - autoDetect: false, - description: nls.localize('tsc.watch', 'Compiles a TypeScript project in watch mode'), - content: [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "tsc",', - '\t"isShellCommand": true,', - '\t"args": ["-w", "-p", "."],', - '\t"showOutput": "silent",', - '\t"isBackground": true,', - '\t"problemMatcher": "$tsc-watch"', - '}' - ].join('\n') -}; - const dotnetBuild: TaskEntry = { id: 'dotnetCore', label: '.NET Core', @@ -129,16 +24,16 @@ const dotnetBuild: TaskEntry = { '{', '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "dotnet",', - '\t"isShellCommand": true,', - '\t"args": [],', + '\t"version": "2.0.0",', '\t"tasks": [', '\t\t{', '\t\t\t"taskName": "build",', - '\t\t\t"args": [ ],', - '\t\t\t"isBuildCommand": true,', - '\t\t\t"showOutput": "silent",', + '\t\t\t"command": "dotnet",', + '\t\t\t"isShellCommand": true,', + '\t\t\t"group": "build",', + '\t\t\t"terminal": {', + '\t\t\t\t"reveal": "silent"', + '\t\t\t},', '\t\t\t"problemMatcher": "$msCompile"', '\t\t}', '\t]', @@ -155,19 +50,21 @@ const msbuild: TaskEntry = { '{', '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "msbuild",', - '\t"args": [', - '\t\t// Ask msbuild to generate full paths for file names.', - '\t\t"/property:GenerateFullPaths=true"', - '\t],', - '\t"taskSelector": "/t:",', - '\t"showOutput": "silent",', + '\t"version": "2.0.0",', '\t"tasks": [', '\t\t{', '\t\t\t"taskName": "build",', - '\t\t\t// Show the output window only if unrecognized errors occur.', - '\t\t\t"showOutput": "silent",', + '\t\t\t"command": "msbuild",', + '\t\t\t"args": [', + '\t\t\t\t// Ask msbuild to generate full paths for file names.', + '\t\t\t\t"/property:GenerateFullPaths=true",', + '\t\t\t\t"/t:build"', + '\t\t\t],', + '\t\t\t"group": "build",', + '\t\t\t"terminal": {', + '\t\t\t\t// Reveal the terminal only if unrecognized errors occur.', + '\t\t\t\t"reveal": "silent"', + '\t\t\t},', '\t\t\t// Use the standard MS compiler pattern to detect errors, warnings and infos', '\t\t\t"problemMatcher": "$msCompile"', '\t\t}', @@ -185,11 +82,14 @@ const command: TaskEntry = { '{', '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "echo",', - '\t"isShellCommand": true,', - '\t"args": ["Hello World"],', - '\t"showOutput": "always"', + '\t"version": "2.0.0",', + '\t"tasks": [', + '\t\t{', + '\t\t\t"taskName": "echo",', + '\t\t\t"command": "echo Hello",', + '\t\t\t"isShellCommand": true', + '\t\t}', + '\t]', '}' ].join('\n') }; @@ -204,28 +104,26 @@ const maven: TaskEntry = { '{', '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', '\t// for the documentation about the tasks.json format', - '\t"version": "0.1.0",', - '\t"command": "mvn",', - '\t"isShellCommand": true,', - '\t"showOutput": "always",', - '\t"suppressTaskName": true,', + '\t"version": "2.0.0",', '\t"tasks": [', '\t\t{', '\t\t\t"taskName": "verify",', - '\t\t\t"args": ["-B", "verify"],', - '\t\t\t"isBuildCommand": true', + '\t\t\t"command": "mvn -B verify",', + '\t\t\t"isShellCommand": true,', + '\t\t\t"group": "build"', '\t\t},', '\t\t{', '\t\t\t"taskName": "test",', - '\t\t\t"args": ["-B", "test"],', - '\t\t\t"isTestCommand": true', + '\t\t\t"command": "mvn -B test",', + '\t\t\t"isShellCommand": true,', + '\t\t\t"group": "test"', '\t\t}', '\t]', '}' ].join('\n') }; -export let templates: TaskEntry[] = [gulp, grunt, tscConfig, tscWatch, dotnetBuild, msbuild, npm, maven].sort((a, b) => { +export let templates: TaskEntry[] = [dotnetBuild, msbuild, maven].sort((a, b) => { return (a.sort || a.label).localeCompare(b.sort || b.label); }); templates.push(command); diff --git a/src/vs/workbench/parts/tasks/common/tasks.ts b/src/vs/workbench/parts/tasks/common/tasks.ts index 446ae9ca08c..b798e6314e5 100644 --- a/src/vs/workbench/parts/tasks/common/tasks.ts +++ b/src/vs/workbench/parts/tasks/common/tasks.ts @@ -4,25 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import nls = require('vs/nls'); import * as Types from 'vs/base/common/types'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { ProblemMatcher } from 'vs/platform/markers/common/problemMatcher'; -export interface CommandOptions { - /** - * The current working directory of the executed program or shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The environment of the executed program or shell. If omitted - * the parent process' environment is used. - */ - env?: { [key: string]: string; }; -} - export interface ShellConfiguration { /** * The shell executable. @@ -41,17 +28,102 @@ export namespace ShellConfiguration { } } +export interface CommandOptions { + + /** + * The shell to use if the task is a shell command. + */ + shell?: ShellConfiguration; + + /** + * The current working directory of the executed program or shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The environment of the executed program or shell. If omitted + * the parent process' environment is used. + */ + env?: { [key: string]: string; }; +} + +export enum RevealKind { + /** + * Always brings the terminal to front if the task is executed. + */ + Always = 1, + + /** + * Only brings the terminal to front if a problem is detected executing the task + * (e.g. the task couldn't be started because). + */ + Silent = 2, + + /** + * The terminal never comes to front when the task is executed. + */ + Never = 3 +} + +export namespace RevealKind { + export function fromString(value: string): RevealKind { + switch (value.toLowerCase()) { + case 'always': + return RevealKind.Always; + case 'silent': + return RevealKind.Silent; + case 'never': + return RevealKind.Never; + default: + return RevealKind.Always; + } + } +} + +export interface TerminalBehavior { + /** + * Controls whether the terminal executing a task is brought to front or not. + * Defaults to `RevealKind.Always`. + */ + reveal: RevealKind; + + /** + * Controls whether the executed command is printed to the output window or terminal as well. + */ + echo: boolean; +} + +export enum CommandType { + Shell = 1, + Process = 2 +} + +export namespace CommandType { + export function fromString(value: string): CommandType { + switch (value.toLowerCase()) { + case 'shell': + return CommandType.Shell; + case 'process': + return CommandType.Process; + default: + return CommandType.Process; + } + } +} + export interface CommandConfiguration { + + /** + * The task type + */ + type: CommandType; + /** * The command to execute */ name: string; - /** - * Whether the command is a shell command or not - */ - isShellCommand: boolean | ShellConfiguration; - /** * Additional command options. */ @@ -68,30 +140,9 @@ export interface CommandConfiguration { taskSelector?: string; /** - * Controls whether the executed command is printed to the output windows as well. + * Describes how the terminal is supposed to behave. */ - echo: boolean; -} - -export enum ShowOutput { - Always = 1, - Silent = 2, - Never = 3 -} - -export namespace ShowOutput { - export function fromString(value: string): ShowOutput { - value = value.toLowerCase(); - if (value === 'always') { - return ShowOutput.Always; - } else if (value === 'silent') { - return ShowOutput.Silent; - } else if (value === 'never') { - return ShowOutput.Never; - } else { - return undefined; - } - } + terminal: TerminalBehavior; } export namespace TaskGroup { @@ -103,13 +154,25 @@ export namespace TaskGroup { export const Test: 'test' = 'test'; - export function is(value: string): value is TaskGroup { + export function is(value: string): value is string { return value === Clean || value === Build || value === RebuildAll || value === Test; } } export type TaskGroup = 'clean' | 'build' | 'rebuildAll' | 'test'; +export enum TaskSourceKind { + Workspace = 1, + Extension = 2, + Generic = 3 +} + +export interface TaskSource { + kind: TaskSourceKind; + label: string; + detail?: string; +} + /** * A task description */ @@ -120,6 +183,11 @@ export interface Task { */ _id: string; + /** + * Indicated the source of the task (e.g tasks.json or extension) + */ + _source: TaskSource; + /** * The task's name */ @@ -133,7 +201,7 @@ export interface Task { /** * the task's group; */ - group?: TaskGroup; + group?: string; /** * The command configuration @@ -161,12 +229,6 @@ export interface Task { */ promptOnClose?: boolean; - /** - * Controls whether the output of the running tasks is shown or not. Default - * value is "always". - */ - showOutput: ShowOutput; - /** * The other tasks this task depends on. */ @@ -175,7 +237,7 @@ export interface Task { /** * The problem watchers to use for this task */ - problemMatchers?: ProblemMatcher[]; + problemMatchers?: (string | ProblemMatcher)[]; } export enum ExecutionEngine { @@ -187,4 +249,12 @@ export enum ExecutionEngine { export interface TaskSet { tasks: Task[]; extension?: IExtensionDescription; +} + +export function computeLabel(task: Task): string { + if (task._source.kind === TaskSourceKind.Extension) { + return nls.localize('taskEntry.label', '{0}: {1}', task._source.label, task.name); + } else { + return task.name; + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts index 12350a98ac8..51b794a250a 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts @@ -57,6 +57,7 @@ const schema: IJSONSchema = { shellConfiguration: { type: 'object', additionalProperties: false, + description: nls.localize('JsonSchema.shellConfiguration', 'Configures the shell to be used.'), properties: { executable: { type: 'string', diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index 441507853aa..e12e519fc02 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -10,41 +10,6 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import commonSchema from './jsonSchemaCommon'; -const schema: IJSONSchema = { - oneOf: [ - { - 'allOf': [ - { - 'type': 'object', - 'required': ['version'], - 'properties': { - 'version': { - 'type': 'string', - 'enum': ['2.0.0'], - 'description': nls.localize('JsonSchema.version', 'The config\'s version number') - }, - 'windows': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.windows', 'Windows specific command configuration') - }, - 'osx': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.mac', 'Mac specific command configuration') - }, - 'linux': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.linux', 'Linux specific command configuration') - } - } - }, - { - '$ref': '#/definitions/taskRunnerConfiguration' - } - ] - } - ] -}; - const shellCommand: IJSONSchema = { anyOf: [ { @@ -55,7 +20,8 @@ const shellCommand: IJSONSchema = { { $ref: '#definitions/shellConfiguration' } - ] + ], + deprecationMessage: nls.localize('JsonSchema.tasks.isShellCommand.deprecated', 'The property isShellCommand is deprecated. Use the type property and the shell property in the options instead.') }; const dependsOn: IJSONSchema = { @@ -75,12 +41,103 @@ const dependsOn: IJSONSchema = { ] }; +const terminal: IJSONSchema = { + type: 'object', + default: { + reveal: 'always', + echo: false + }, + description: nls.localize('JsonSchema.tasks.terminal', 'Describe how the terminal used to execute a task behaves.'), + properties: { + echo: { + type: 'boolean', + default: false, + description: nls.localize('JsonSchema.tasks.terminal.echo', 'Controls whether the executed command is echoed to the terminal. Default is false.') + }, + reveal: { + type: 'string', + enum: ['always', 'silent', 'never'], + default: 'always', + description: nls.localize('JsonSchema.tasks.terminal.reveals', 'Controls whether the terminal running the task is revealed or not. Default is \"always\".') + } + } +}; + +const group: IJSONSchema = { + type: 'string', + enum: ['none', 'clean', 'build', 'rebuildAll', 'test'], + default: 'none', + description: nls.localize('JsonSchema.tasks.group', 'Defines to which execution group this task belongs to. If omitted the task belongs to no group.') +}; + +const taskType: IJSONSchema = { + type: 'string', + enum: ['shell', 'process'], + default: 'process', + description: nls.localize('JsonSchema.tasks.type', 'Defines whether the task is run as a process or as a command inside a shell. Default is process.') +}; + +const version: IJSONSchema = { + type: 'string', + enum: ['2.0.0'], + description: nls.localize('JsonSchema.version', 'The config\'s version number.') +}; + +const identifier: IJSONSchema = { + type: 'string', + description: nls.localize('JsonSchema.tasks.identifier', 'A unique identifier of the task.') +}; + +const schema: IJSONSchema = { + oneOf: [ + { + 'allOf': [ + { + type: 'object', + required: ['version'], + properties: { + version: Objects.deepClone(version), + windows: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.windows', 'Windows specific command configuration') + }, + osx: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.mac', 'Mac specific command configuration') + }, + linux: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.linux', 'Linux specific command configuration') + } + } + }, + { + $ref: '#/definitions/taskRunnerConfiguration' + } + ] + } + ] +}; + schema.definitions = Objects.deepClone(commonSchema.definitions); let definitions = schema.definitions; -definitions['commandConfiguration']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); -definitions['taskDescription']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); -definitions['taskDescription']['properties']['dependsOn'] = dependsOn; -definitions['taskRunnerConfiguration']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); +definitions.commandConfiguration.properties.isShellCommand = Objects.deepClone(shellCommand); +definitions.taskDescription.properties.isShellCommand = Objects.deepClone(shellCommand); +definitions.taskDescription.properties.dependsOn = dependsOn; +definitions.showOutputType.deprecationMessage = nls.localize('JsonSchema.tasks.showOputput.deprecated', 'The property showOutput is deprecated. Use the terminal property instead.'); +definitions.taskDescription.properties.echoCommand.deprecationMessage = nls.localize('JsonSchema.tasks.echoCommand.deprecated', 'The property echoCommand is deprecated. Use the terminal property instead.'); +definitions.taskDescription.properties.isBuildCommand.deprecationMessage = nls.localize('JsonSchema.tasks.isBuildCommand.deprecated', 'The property isBuildCommand is deprecated. Use the group property instead.'); +definitions.taskDescription.properties.isTestCommand.deprecationMessage = nls.localize('JsonSchema.tasks.isTestCommand.deprecated', 'The property isTestCommand is deprecated. Use the group property instead.'); +definitions.taskDescription.properties.identifier = identifier; +definitions.taskDescription.properties.type = Objects.deepClone(taskType); +definitions.taskDescription.properties.terminal = terminal; +definitions.taskDescription.properties.group = group; +definitions.options.properties.shell = { + $ref: '#/definitions/shellConfiguration' +}; +definitions.taskRunnerConfiguration.properties.isShellCommand = Objects.deepClone(shellCommand); +definitions.taskRunnerConfiguration.properties.type = Objects.deepClone(taskType); +definitions.taskRunnerConfiguration.properties.version = Objects.deepClone(version); Object.getOwnPropertyNames(definitions).forEach(key => { let newKey = key + '2'; diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg b/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg new file mode 100644 index 00000000000..61baaea2b8b --- /dev/null +++ b/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg b/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg new file mode 100644 index 00000000000..3dec2ba50fd --- /dev/null +++ b/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css index 6b1d8221b62..f8b7e9e67e5 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css +++ b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css @@ -60,4 +60,13 @@ .task-statusbar-item-label > .task-statusbar-item-label-info { -webkit-mask: url('status-info.svg') no-repeat 50% 50%; -webkit-mask-size: 11px; +} + +.monaco-workbench .quick-open-task-configure { + background-image: url('configure.svg'); +} + +.vs-dark .monaco-workbench .quick-open-task-configure, +.hc-black .monaco-workbench .quick-open-task-configure { + background-image: url('configure-inverse.svg'); } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 314a626f91d..540ff68d8ca 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -61,15 +61,17 @@ import Constants from 'vs/workbench/parts/markers/common/constants'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IOutputService, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannel } from 'vs/workbench/parts/output/common/output'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; import { ITaskSystem, ITaskResolver, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TaskSystemEvents } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { Task, TaskSet, TaskGroup, ExecutionEngine, ShowOutput } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, TaskSet, TaskGroup, ExecutionEngine, TaskSourceKind, computeLabel as computeTaskLabel } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskService, TaskServiceEvents, ITaskProvider } from 'vs/workbench/parts/tasks/common/taskService'; import { templates as taskTemplates } from 'vs/workbench/parts/tasks/common/taskTemplates'; @@ -77,38 +79,29 @@ import * as TaskConfig from 'vs/workbench/parts/tasks/common/taskConfiguration'; import { ProcessTaskSystem } from 'vs/workbench/parts/tasks/node/processTaskSystem'; import { TerminalTaskSystem } from './terminalTaskSystem'; import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunnerDetector'; +import { QuickOpenActionContributor } from '../browser/quickOpen'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; + let $ = Builder.$; let tasksCategory = nls.localize('tasksCategory', "Tasks"); abstract class OpenTaskConfigurationAction extends Action { - private configurationService: IConfigurationService; - private fileService: IFileService; - - private editorService: IWorkbenchEditorService; - private contextService: IWorkspaceContextService; - private outputService: IOutputService; - private messageService: IMessageService; - private quickOpenService: IQuickOpenService; - - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, - @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, - @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, - @IEnvironmentService private environmentService: IEnvironmentService, - @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService) { + constructor(id: string, label: string, + private taskService: ITaskService, + private configurationService: IConfigurationService, + private editorService: IWorkbenchEditorService, private fileService: IFileService, + private contextService: IWorkspaceContextService, private outputService: IOutputService, + private messageService: IMessageService, private quickOpenService: IQuickOpenService, + private environmentService: IEnvironmentService, + private configurationResolverService: IConfigurationResolverService, + private extensionService: IExtensionService) { super(id, label); - this.configurationService = configurationService; - this.editorService = editorService; - this.fileService = fileService; - this.contextService = contextService; - this.outputService = outputService; - this.messageService = messageService; - this.quickOpenService = quickOpenService; } public run(event?: any): TPromise { @@ -126,51 +119,13 @@ abstract class OpenTaskConfigurationAction extends Action { if (!selection) { return undefined; } - let contentPromise: TPromise; - if (selection.autoDetect) { - const outputChannel = this.outputService.getChannel(TaskService.OutputChannelId); - outputChannel.show(true); - outputChannel.append(nls.localize('ConfigureTaskRunnerAction.autoDetecting', 'Auto detecting tasks for {0}', selection.id) + '\n'); - let detector = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService); - contentPromise = detector.detect(false, selection.id).then((value) => { - let config = value.config; - if (value.stderr && value.stderr.length > 0) { - value.stderr.forEach((line) => { - outputChannel.append(line + '\n'); - }); - if (config && (!config.tasks || config.tasks.length === 0)) { - this.messageService.show(Severity.Warning, nls.localize('ConfigureTaskRunnerAction.autoDetect', 'Auto detecting the task system failed. Using default template. Consult the task output for details.')); - return selection.content; - } else { - this.messageService.show(Severity.Warning, nls.localize('ConfigureTaskRunnerAction.autoDetectError', 'Auto detecting the task system produced errors. Consult the task output for details.')); - } - } - if (config) { - if (value.stdout && value.stdout.length > 0) { - value.stdout.forEach(line => outputChannel.append(line + '\n')); - } - let content = JSON.stringify(config, null, '\t'); - content = [ - '{', - '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', - '\t// for the documentation about the tasks.json format', - ].join('\n') + content.substr(1); - return content; - } else { - return selection.content; - } - }); - } else { - contentPromise = TPromise.as(selection.content); + let content = selection.content; + let editorConfig = this.configurationService.getConfiguration(); + if (editorConfig.editor.insertSpaces) { + content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize)); } - return contentPromise.then(content => { - let editorConfig = this.configurationService.getConfiguration(); - if (editorConfig.editor.insertSpaces) { - content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize)); - } - configFileCreated = true; - return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content); - }); + configFileCreated = true; + return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content); }); }).then((stat) => { if (!stat) { @@ -194,30 +149,35 @@ class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction { public static ID = 'workbench.action.tasks.configureTaskRunner'; public static TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task Runner"); - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, + constructor(id: string, label: string, + @ITaskService taskService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationResolverService configurationResolverService: IConfigurationResolverService) { - super(id, label, configurationService, editorService, fileService, contextService, - outputService, messageService, quickOpenService, environmentService, configurationResolverService); + @IConfigurationResolverService configurationResolverService: IConfigurationResolverService, + @IExtensionService extensionService) { + super(id, label, taskService, configurationService, editorService, fileService, contextService, + outputService, messageService, quickOpenService, environmentService, configurationResolverService, + extensionService); } - } class ConfigureBuildTaskAction extends OpenTaskConfigurationAction { public static ID = 'workbench.action.tasks.configureBuildTask'; public static TEXT = nls.localize('ConfigureBuildTaskAction.label', "Configure Build Task"); - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, + constructor(id: string, label: string, + @ITaskService taskService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationResolverService configurationResolverService: IConfigurationResolverService) { - super(id, label, configurationService, editorService, fileService, contextService, - outputService, messageService, quickOpenService, environmentService, configurationResolverService); + @IConfigurationResolverService configurationResolverService: IConfigurationResolverService, + @IExtensionService extensionService) { + super(id, label, taskService, configurationService, editorService, fileService, contextService, + outputService, messageService, quickOpenService, environmentService, configurationResolverService, + extensionService); } } @@ -266,7 +226,8 @@ class StatusBarItem extends Themable implements IStatusbarItem { @IOutputService private outputService: IOutputService, @ITaskService private taskService: ITaskService, @IPartService private partService: IPartService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IWorkspaceContextService private contextService: IWorkspaceContextService ) { super(themeService); @@ -278,7 +239,7 @@ class StatusBarItem extends Themable implements IStatusbarItem { super.updateStyles(); this.icons.forEach(icon => { - icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND); + icon.style.backgroundColor = this.getColor(this.contextService.hasWorkspace() ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND); }); } @@ -307,6 +268,7 @@ class StatusBarItem extends Themable implements IStatusbarItem { element.title = nls.localize('problems', "Problems"); Dom.addClass(errorIcon, 'task-statusbar-item-label-error'); + Dom.addClass(errorIcon, 'mask-icon'); label.appendChild(errorIcon); this.icons.push(errorIcon); @@ -315,6 +277,7 @@ class StatusBarItem extends Themable implements IStatusbarItem { label.appendChild(error); Dom.addClass(warningIcon, 'task-statusbar-item-label-warning'); + Dom.addClass(warningIcon, 'mask-icon'); label.appendChild(warningIcon); this.icons.push(warningIcon); @@ -323,6 +286,7 @@ class StatusBarItem extends Themable implements IStatusbarItem { label.appendChild(warning); Dom.addClass(infoIcon, 'task-statusbar-item-label-info'); + Dom.addClass(infoIcon, 'mask-icon'); label.appendChild(infoIcon); this.icons.push(infoIcon); $(infoIcon).hide(); @@ -489,6 +453,10 @@ class ProblemReporter implements TaskConfig.IProblemReporter { interface WorkspaceTaskResult { set: TaskSet; + annotatingTasks: { + byIdentifier: IStringDictionary; + byName: IStringDictionary; + }; hasErrors: boolean; } @@ -508,6 +476,7 @@ class TaskService extends EventEmitter implements ITaskService { private modeService: IModeService; private configurationService: IConfigurationService; + private configurationEditingService: IConfigurationEditingService; private markerService: IMarkerService; private outputService: IOutputService; private messageService: IMessageService; @@ -522,7 +491,8 @@ class TaskService extends EventEmitter implements ITaskService { private _configHasErrors: boolean; private _providers: Map; - private _workspaceTasksPromise: TPromise; + + private _workspaceTasksPromise: TPromise; private _taskSystem: ITaskSystem; private _taskSystemListeners: IDisposable[]; @@ -530,6 +500,7 @@ class TaskService extends EventEmitter implements ITaskService { private _outputChannel: IOutputChannel; constructor( @IModeService modeService: IModeService, @IConfigurationService configurationService: IConfigurationService, + @IConfigurationEditingService configurationEditingService: IConfigurationEditingService, @IMarkerService markerService: IMarkerService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @@ -546,6 +517,7 @@ class TaskService extends EventEmitter implements ITaskService { super(); this.modeService = modeService; this.configurationService = configurationService; + this.configurationEditingService = configurationEditingService; this.markerService = markerService; this.outputService = outputService; this.messageService = messageService; @@ -577,7 +549,7 @@ class TaskService extends EventEmitter implements ITaskService { ? ExecutionEngine.Process : ExecutionEngine.Unknown; if (currentExecutionEngine !== this.getExecutionEngine()) { - this.messageService.show(Severity.Info, nls.localize('TaskSystem.noHotSwap', 'Changing the task execution engine requires to restart VS Code. The change is ignored.')); + this.messageService.show(Severity.Info, nls.localize('TaskSystem.noHotSwap', 'Changing the task execution engine requires restarting VS Code. The change is ignored.')); } }); lifecycleService.onWillShutdown(event => event.veto(this.beforeShutdown())); @@ -714,7 +686,7 @@ class TaskService extends EventEmitter implements ITaskService { toExecute = resolver.resolve(task); } else { requested = task.name; - toExecute = resolver.resolve(task._id); + toExecute = task; } if (!toExecute) { throw new TaskError(Severity.Info, nls.localize('TaskServer.noTask', 'Requested task {0} to execute not found.', requested), TaskErrors.TaskNotFound); @@ -727,81 +699,126 @@ class TaskService extends EventEmitter implements ITaskService { }); } + public customize(task: Task, openConfig: boolean = false): TPromise { + if (task._source.kind !== TaskSourceKind.Extension) { + return TPromise.as(undefined); + } + let configuration = this.getConfiguration(); + if (configuration.hasParseErrors) { + this.messageService.show(Severity.Warning, nls.localize('customizeParseErrors', 'The current task configuration has errors. Please fix the errors first before customizing a task.')); + return TPromise.as(undefined); + } + let fileConfig = configuration.config; + let customize = { taskName: computeTaskLabel(task), identifier: task.identifier }; + if (!fileConfig) { + fileConfig = { + version: '2.0.0', + tasks: [customize] + }; + } else { + if (Array.isArray(fileConfig.tasks)) { + fileConfig.tasks.push(customize); + } else { + fileConfig.tasks = [customize]; + } + }; + return this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, { key: 'tasks', value: fileConfig }).then(() => { + if (openConfig) { + let resource = this.contextService.toResource('.vscode/tasks.json'); + this.editorService.openEditor({ + resource: resource, + options: { + forceOpen: true, + pinned: false + } + }, false); + } + }); + } + private createRunnableTask(sets: TaskSet[], group: TaskGroup): { task: Task; resolver: ITaskResolver } { let uuidMap: IStringDictionary = Object.create(null); + let labelMap: IStringDictionary = Object.create(null); let identifierMap: IStringDictionary = Object.create(null); - let primaryTasks: Task[] = []; + let workspaceTasks: Task[] = []; + let extensionTasks: Task[] = []; sets.forEach((set) => { set.tasks.forEach((task) => { uuidMap[task._id] = task; + labelMap[computeTaskLabel(task)] = task; identifierMap[task.identifier] = task; if (group && task.group === group) { - primaryTasks.push(task); + if (task._source.kind === TaskSourceKind.Workspace) { + workspaceTasks.push(task); + } else { + extensionTasks.push(task); + } } }); }); - if (primaryTasks.length === 0) { - return undefined; - } let resolver: ITaskResolver = { resolve: (id: string) => { - let result = uuidMap[id]; - if (result) { - return result; - } - return identifierMap[id]; + return uuidMap[id] || labelMap[id] || identifierMap[id]; } }; - if (primaryTasks.length === 1) { - return { task: primaryTasks[0], resolver }; + if (workspaceTasks.length > 0) { + if (workspaceTasks.length > 1) { + this._outputChannel.append(nls.localize('moreThanOneBuildTask', 'There are many build tasks defined in the tasks.json. Executing the first one.\n')); + } + return { task: workspaceTasks[0], resolver }; + } + if (extensionTasks.length === 0) { + return undefined; + } + + if (extensionTasks.length === 1) { + return { task: extensionTasks[0], resolver }; } else { let id: string = UUID.generateUuid(); let task: Task = { _id: id, + _source: { kind: TaskSourceKind.Generic, label: 'generic' }, name: id, identifier: id, - dependsOn: primaryTasks.map(task => task._id), + dependsOn: extensionTasks.map(task => task._id), command: undefined, - showOutput: ShowOutput.Never }; return { task, resolver }; } } private createResolver(sets: TaskSet[]): ITaskResolver { - let uuidMap: IStringDictionary = Object.create(null); + let labelMap: IStringDictionary = Object.create(null); let identifierMap: IStringDictionary = Object.create(null); sets.forEach((set) => { set.tasks.forEach((task) => { - uuidMap[task._id] = task; + labelMap[computeTaskLabel(task)] = task; identifierMap[task.identifier] = task; }); }); return { resolve: (id: string) => { - let result = uuidMap[id]; - if (result) { - return result; - } - return identifierMap[id]; + return labelMap[id] || identifierMap[id]; } }; } private executeTask(task: Task, resolver: ITaskResolver): TPromise { - return this.textFileService.saveAll().then((value) => { // make sure all dirty files are saved - let executeResult = this.getTaskSystem().run(task, resolver); - if (executeResult.kind === TaskExecuteKind.Active) { - let active = executeResult.active; - if (active.same && active.background) { - this.messageService.show(Severity.Info, nls.localize('TaskSystem.activeSame', 'The task is already active and in watch mode. To terminate the task use `F1 > terminate task`')); - } else { - throw new TaskError(Severity.Warning, nls.localize('TaskSystem.active', 'There is already a task running. Terminate it first before executing another task.'), TaskErrors.RunningTask); + return ProblemMatcherRegistry.onReady().then(() => { + return this.textFileService.saveAll().then((value) => { // make sure all dirty files are saved + let executeResult = this.getTaskSystem().run(task, resolver); + if (executeResult.kind === TaskExecuteKind.Active) { + let active = executeResult.active; + if (active.same && active.background) { + this.messageService.show(Severity.Info, nls.localize('TaskSystem.activeSame', 'The task is already active and in watch mode. To terminate the task use `F1 > terminate task`')); + } else { + throw new TaskError(Severity.Warning, nls.localize('TaskSystem.active', 'There is already a task running. Terminate it first before executing another task.'), TaskErrors.RunningTask); + } } - } - return executeResult.promise; + return executeResult.promise; + }); }); } @@ -870,52 +887,122 @@ class TaskService extends EventEmitter implements ITaskService { } private getTaskSets(): TPromise { - return new TPromise((resolve, reject) => { - let result: TaskSet[] = []; - let counter: number = 0; - let done = (value: TaskSet) => { - if (value) { - result.push(value); - } - if (--counter === 0) { + return this.extensionService.activateByEvent('onCommand:workbench.action.tasks.runTask').then(() => { + return new TPromise((resolve, reject) => { + let result: TaskSet[] = []; + let counter: number = 0; + let done = (value: TaskSet) => { + if (value) { + result.push(value); + } + if (--counter === 0) { + resolve(result); + } + }; + let error = () => { + if (--counter === 0) { + resolve(result); + } + }; + if (this.getExecutionEngine() === ExecutionEngine.Terminal && this._providers.size > 0) { + this._providers.forEach((provider) => { + counter++; + provider.provideTasks().done(done, error); + }); + } else { resolve(result); } - }; - let error = () => { - if (--counter === 0) { - resolve(result); + }); + }).then((result) => { + return this.getWorkspaceTasks().then((workspaceTaskResult) => { + let workspaceTasksToDelete: Task[] = []; + let annotatingTasks = workspaceTaskResult.annotatingTasks; + let legacyAnnotatingTasks = workspaceTaskResult.set ? this.getLegacyAnnotatingTasks(workspaceTaskResult.set) : undefined; + if (annotatingTasks || legacyAnnotatingTasks) { + for (let set of result) { + for (let task of set.tasks) { + if (annotatingTasks) { + let annotatingTask = annotatingTasks.byIdentifier[task.identifier] || annotatingTasks.byName[task.name]; + if (annotatingTask) { + TaskConfig.mergeTasks(task, annotatingTask); + task.name = annotatingTask.name; + task._source.kind = TaskSourceKind.Workspace; + continue; + } + } + if (legacyAnnotatingTasks) { + let legacyAnnotatingTask = legacyAnnotatingTasks[task.identifier]; + if (legacyAnnotatingTask) { + TaskConfig.mergeTasks(task, legacyAnnotatingTask); + task._source.kind = TaskSourceKind.Workspace; + task.name = legacyAnnotatingTask.name; + workspaceTasksToDelete.push(legacyAnnotatingTask); + continue; + } + } + } + } } - }; - if (this.getExecutionEngine() === ExecutionEngine.Terminal) { - this._providers.forEach((provider) => { - counter++; - provider.provideTasks().done(done, error); - }); - } - // Do this last since the then of a resolved promise returns immediatelly. - counter++; - this.getWorkspaceTasks().done(done, error); + if (workspaceTaskResult.set) { + if (workspaceTasksToDelete.length > 0) { + let tasks = workspaceTaskResult.set.tasks; + let newSet: TaskSet = { + extension: workspaceTaskResult.set.extension, + tasks: [] + }; + let toDelete = workspaceTasksToDelete.reduce>((map, task) => { + map[task._id] = true; + return map; + }, Object.create(null)); + newSet.tasks = tasks.filter(task => !toDelete[task._id]); + result.push(newSet); + } else { + result.push(workspaceTaskResult.set); + } + } + return result; + }, () => { + // If we can't read the tasks.json file provide at least the contributed tasks + return result; + }); }); } - private getWorkspaceTasks(): TPromise { + private getLegacyAnnotatingTasks(workspaceTasks: TaskSet): IStringDictionary { + let result: IStringDictionary; + function getResult() { + if (result) { + return result; + } + result = Object.create(null); + return result; + } + for (let task of workspaceTasks.tasks) { + let commandName = task.command && task.command.name; + // This is for backwards compatibility with the 0.1.0 task annotation code + // if we had a gulp, jake or grunt command a task specification was a annotation + if (commandName === 'gulp' || commandName === 'grunt' || commandName === 'jake') { + getResult()[`${commandName}.${task.name}`] = task; + } + } + return result; + } + + private getWorkspaceTasks(): TPromise { if (this._workspaceTasksPromise) { return this._workspaceTasksPromise; } - this._workspaceTasksPromise = this.computeWorkspaceTasks().then(value => { - this._configHasErrors = value.hasErrors; - if (this._taskSystem instanceof ProcessTaskSystem) { - this._taskSystem.hasErrors(this._configHasErrors); - } - return value.set; - }); + this.updateWorkspaceTasks(); return this._workspaceTasksPromise; } private updateWorkspaceTasks(): void { this._workspaceTasksPromise = this.computeWorkspaceTasks().then(value => { this._configHasErrors = value.hasErrors; - return value.set; + if (this._taskSystem instanceof ProcessTaskSystem) { + this._taskSystem.hasErrors(this._configHasErrors); + } + return value; }); } @@ -955,16 +1042,13 @@ class TaskService extends EventEmitter implements ITaskService { configPromise = TPromise.as({ config, hasErrors: false }); } } else { - configPromise = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService).detect(true).then((value) => { - let hasErrors = this.printStderr(value.stderr); - return { config: value.config, hasErrors }; - }); + configPromise = TPromise.as({ config, hasErrors: false }); } } return configPromise.then((resolved) => { return ProblemMatcherRegistry.onReady().then((): WorkspaceTaskResult => { if (!resolved || !resolved.config) { - return { set: undefined, hasErrors: resolved !== void 0 ? resolved.hasErrors : false }; + return { set: undefined, annotatingTasks: undefined, hasErrors: resolved !== void 0 ? resolved.hasErrors : false }; } let problemReporter = new ProblemReporter(this._outputChannel); let parseResult = TaskConfig.parse(resolved.config, problemReporter); @@ -975,9 +1059,22 @@ class TaskService extends EventEmitter implements ITaskService { } if (problemReporter.status.isFatal()) { problemReporter.fatal(nls.localize('TaskSystem.configurationErrors', 'Error: the provided task configuration has validation errors and can\'t not be used. Please correct the errors first.')); - return { set: undefined, hasErrors }; + return { set: undefined, annotatingTasks: undefined, hasErrors }; } - return { set: { tasks: parseResult.tasks }, hasErrors }; + let annotatingTasks: { byIdentifier: IStringDictionary; byName: IStringDictionary; }; + if (parseResult.annotatingTasks && parseResult.annotatingTasks.length > 0) { + annotatingTasks = { + byIdentifier: Object.create(null), + byName: Object.create(null) + }; + for (let task of parseResult.annotatingTasks) { + annotatingTasks.byIdentifier[task.identifier] = task; + if (task.name) { + annotatingTasks.byName[task.name] = task; + } + } + } + return { set: { tasks: parseResult.tasks }, annotatingTasks: annotatingTasks, hasErrors }; }); }); } @@ -985,7 +1082,7 @@ class TaskService extends EventEmitter implements ITaskService { private getExecutionEngine(): ExecutionEngine { let { config } = this.getConfiguration(); if (!config) { - return ExecutionEngine.Process; + return ExecutionEngine.Terminal; } return TaskConfig.ExecutionEngine.from(config); } @@ -1037,15 +1134,17 @@ class TaskService extends EventEmitter implements ITaskService { } public configureAction(): Action { - return new ConfigureTaskRunnerAction(ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT, + return new ConfigureTaskRunnerAction(ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT, this, this.configurationService, this.editorService, this.fileService, this.contextService, - this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService); + this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService, + this.extensionService); } private configureBuildTask(): Action { - return new ConfigureBuildTaskAction(ConfigureBuildTaskAction.ID, ConfigureBuildTaskAction.TEXT, + return new ConfigureBuildTaskAction(ConfigureBuildTaskAction.ID, ConfigureBuildTaskAction.TEXT, this, this.configurationService, this.editorService, this.fileService, this.contextService, - this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService); + this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService, + this.extensionService); } public beforeShutdown(): boolean | TPromise { @@ -1248,6 +1347,9 @@ quickOpenRegistry.registerQuickOpenHandler( ) ); +const actionBarRegistry = Registry.as(ActionBarExtensions.Actionbar); +actionBarRegistry.registerActionBarContributor(Scope.VIEWER, QuickOpenActionContributor); + // Status bar let statusbarRegistry = Registry.as(StatusbarExtensions.Statusbar); statusbarRegistry.registerStatusbarItem(new StatusbarItemDescriptor(StatusBarItem, StatusbarAlignment.LEFT, 50 /* Medium Priority */)); @@ -1283,8 +1385,6 @@ let schema: IJSONSchema = { import schemaVersion1 from './jsonSchema_v1'; import schemaVersion2 from './jsonSchema_v2'; -import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; schema.definitions = { ...schemaVersion1.definitions, ...schemaVersion2.definitions, diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 4e0d42260d1..04591b40b55 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -24,7 +24,8 @@ import * as TPath from 'vs/base/common/paths'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { ProblemMatcher /*, ProblemPattern, getResource */ } from 'vs/platform/markers/common/problemMatcher'; +import { ProblemMatcher, ProblemMatcherRegistry /*, ProblemPattern, getResource */ } from 'vs/platform/markers/common/problemMatcher'; + import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -32,7 +33,7 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common/output'; import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEvents } from 'vs/workbench/parts/tasks/common/problemCollectors'; -import { Task, ShowOutput, CommandOptions, ShellConfiguration } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, RevealKind, CommandOptions, ShellConfiguration, CommandType } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver, TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType @@ -133,7 +134,8 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { public run(task: Task, resolver: ITaskResolver, trigger: string = Triggers.command): ITaskExecuteResult { let terminalData = this.activeTasks[task._id]; if (terminalData && terminalData.promise) { - if (task.showOutput === ShowOutput.Always) { + let reveal = task.command.terminal.reveal; + if (reveal === RevealKind.Always) { terminalData.terminal.setVisible(true); } return { kind: TaskExecuteKind.Active, active: { same: true, background: task.isBackground }, promise: terminalData.promise }; @@ -287,7 +289,8 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { this.emit(TaskSystemEvents.Inactive, event); } eventCounter = 0; - if (exitCode && exitCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + let reveal = task.command.terminal.reveal; + if (exitCode && exitCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.terminalService.setActiveInstance(terminal); this.terminalService.showPanel(false); } @@ -329,7 +332,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { }); } this.terminalService.setActiveInstance(terminal); - if (task.showOutput === ShowOutput.Always) { + if (task.command.terminal.reveal === RevealKind.Always) { this.terminalService.showPanel(false); } this.activeTasks[task._id] = { terminal, task, promise }; @@ -337,6 +340,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { try { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'terminal', command: this.getSanitizedCommand(executedCommand), success: true, exitCode: summary.exitCode @@ -349,6 +353,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { try { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'terminal', command: this.getSanitizedCommand(executedCommand), success: false }; @@ -363,19 +368,24 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { let options = this.resolveOptions(task.command.options); let { command, args } = this.resolveCommandAndArgs(task); let terminalName = nls.localize('TerminalTaskSystem.terminalName', 'Task - {0}', task.name); - let waitOnExit = task.showOutput !== ShowOutput.Never || !task.isBackground; + let waitOnExit: boolean | string = false; + if (task.command.terminal.reveal !== RevealKind.Never || !task.isBackground) { + waitOnExit = nls.localize('reuseTerminal', 'Terminal will be reused by tasks, press any key to close it.'); + }; let shellLaunchConfig: IShellLaunchConfig = undefined; - if (task.command.isShellCommand) { + let isShellCommand = task.command.type === CommandType.Shell; + if (isShellCommand) { if (Platform.isWindows && ((options.cwd && TPath.isUNC(options.cwd)) || (!options.cwd && TPath.isUNC(process.cwd())))) { throw new TaskError(Severity.Error, nls.localize('TerminalTaskSystem', 'Can\'t execute a shell command on an UNC drive.'), TaskErrors.UnknownError); } shellLaunchConfig = { name: terminalName, executable: null, args: null, waitOnExit }; let shellSpecified: boolean = false; - if (ShellConfiguration.is(task.command.isShellCommand)) { - shellLaunchConfig.executable = task.command.isShellCommand.executable; + let shellOptions: ShellConfiguration = task.command.options && task.command.options.shell; + if (shellOptions && shellOptions.executable) { + shellLaunchConfig.executable = shellOptions.executable; shellSpecified = true; - if (task.command.isShellCommand.args) { - shellLaunchConfig.args = task.command.isShellCommand.args.slice(); + if (shellOptions.args) { + shellLaunchConfig.args = shellOptions.args.slice(); } else { shellLaunchConfig.args = []; } @@ -412,21 +422,21 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { }); shellArgs.push(commandLine); shellLaunchConfig.args = Platform.isWindows ? shellArgs.join(' ') : shellArgs; - if (task.command.echo) { + if (task.command.terminal.echo) { shellLaunchConfig.initialText = `> ${commandLine}`; } } else { let cwd = options && options.cwd ? options.cwd : process.cwd(); // On Windows executed process must be described absolute. Since we allowed command without an // absolute path (e.g. "command": "node") we need to find the executable in the CWD or PATH. - let executable = Platform.isWindows && !task.command.isShellCommand ? this.findExecutable(command, cwd) : command; + let executable = Platform.isWindows && !isShellCommand ? this.findExecutable(command, cwd) : command; shellLaunchConfig = { name: terminalName, executable: executable, args, waitOnExit }; - if (task.command.echo) { + if (task.command.terminal.echo) { let getArgsToEcho = (args: string | string[]): string => { if (!args || args.length === 0) { return ''; @@ -553,15 +563,22 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { return value.map(s => this.resolveVariable(s)); } - private resolveMatchers(values: T[]): T[] { - if (values === void 0 || values === null) { + private resolveMatchers(values: (string | ProblemMatcher)[]): ProblemMatcher[] { + if (values === void 0 || values === null || values.length === 0) { return []; } - if (values.length === 0) { - return values; - } - let result: T[] = []; - values.forEach((matcher) => { + let result: ProblemMatcher[] = []; + values.forEach((value) => { + let matcher: ProblemMatcher; + if (Types.isString(value)) { + matcher = ProblemMatcherRegistry.get(value); + } else { + matcher = value; + } + if (!matcher) { + this.outputChannel.append(nls.localize('unkownProblemMatcher', 'Problem matcher {0} can\'t be resolved. The matcher will be ignored')); + return; + } if (!matcher.filePrefix) { result.push(matcher); } else { diff --git a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts index 513a82606f9..9f4d55278f5 100644 --- a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts @@ -22,14 +22,14 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { ProblemMatcher } from 'vs/platform/markers/common/problemMatcher'; +import { ProblemMatcher, ProblemMatcherRegistry } from 'vs/platform/markers/common/problemMatcher'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEvents } from 'vs/workbench/parts/tasks/common/problemCollectors'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { Task, CommandOptions, ShowOutput, CommandConfiguration } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, CommandOptions, RevealKind, CommandConfiguration, CommandType } from 'vs/workbench/parts/tasks/common/tasks'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -120,6 +120,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { private executeTask(task: Task, trigger: string = Triggers.command): ITaskExecuteResult { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'output', command: 'other', success: true }; @@ -175,14 +176,15 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { } args = this.resolveVariables(args); let command: string = this.resolveVariable(commandConfig.name); - this.childProcess = new LineProcess(command, args, !!commandConfig.isShellCommand, this.resolveOptions(commandConfig.options)); + this.childProcess = new LineProcess(command, args, commandConfig.type === CommandType.Shell, this.resolveOptions(commandConfig.options)); telemetryEvent.command = this.childProcess.getSanitizedCommand(); // we have no problem matchers defined. So show the output log - if (task.showOutput === ShowOutput.Always || (task.showOutput === ShowOutput.Silent && task.problemMatchers.length === 0)) { + let reveal = task.command.terminal.reveal; + if (reveal === RevealKind.Always || (reveal === RevealKind.Silent && task.problemMatchers.length === 0)) { this.showOutput(); } - if (commandConfig.echo) { + if (commandConfig.terminal.echo) { let prompt: string = Platform.isWindows ? '>' : '$'; this.log(`running command${prompt} ${command} ${args.join(' ')}`); } @@ -214,7 +216,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { if (!this.checkTerminated(task, success)) { this.log(nls.localize('TaskRunnerSystem.watchingBuildTaskFinished', '\nWatching build tasks has finished.')); } - if (success.cmdCode && success.cmdCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + if (success.cmdCode && success.cmdCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.showOutput(); } taskSummary.exitCode = success.cmdCode; @@ -258,7 +260,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { startStopProblemMatcher.dispose(); this.checkTerminated(task, success); this.emit(TaskSystemEvents.Inactive, event); - if (success.cmdCode && success.cmdCode === 1 && startStopProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + if (success.cmdCode && success.cmdCode === 1 && startStopProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.showOutput(); } taskSummary.exitCode = success.cmdCode; @@ -335,12 +337,22 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { return value.map(s => this.resolveVariable(s)); } - private resolveMatchers(values: T[]): T[] { - if (values.length === 0) { - return values; + private resolveMatchers(values: (string | ProblemMatcher)[]): ProblemMatcher[] { + if (values === void 0 || values === null || values.length === 0) { + return []; } - let result: T[] = []; - values.forEach((matcher) => { + let result: ProblemMatcher[] = []; + values.forEach((value) => { + let matcher: ProblemMatcher; + if (Types.isString(value)) { + matcher = ProblemMatcherRegistry.get(value); + } else { + matcher = value; + } + if (!matcher) { + this.outputChannel.append(nls.localize('unkownProblemMatcher', 'Problem matcher {0} can\'t be resolved. The matcher will be ignored')); + return; + } if (!matcher.filePrefix) { result.push(matcher); } else { diff --git a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts b/src/vs/workbench/parts/tasks/test/node/configuration.test.ts index fd07989830b..c958d68336b 100644 --- a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts +++ b/src/vs/workbench/parts/tasks/test/node/configuration.test.ts @@ -68,18 +68,40 @@ class ConfiguationBuilder { } } +class TerminalBehaviorBuilder { + + public result: Tasks.TerminalBehavior; + + constructor(public parent: CommandConfigurationBuilder) { + this.result = { echo: false, reveal: Tasks.RevealKind.Always }; + } + + public echo(value: boolean): TerminalBehaviorBuilder { + this.result.echo = value; + return this; + } + + public reveal(value: Tasks.RevealKind): TerminalBehaviorBuilder { + this.result.reveal = value; + return this; + } +} + class CommandConfigurationBuilder { public result: Tasks.CommandConfiguration; + private terminalBuilder: TerminalBehaviorBuilder; + constructor(public parent: TaskBuilder, command: string) { + this.terminalBuilder = new TerminalBehaviorBuilder(this); this.result = { name: command, - isShellCommand: false, + type: Tasks.CommandType.Process, args: [], options: { cwd: '${workspaceRoot}' }, - echo: false + terminal: this.terminalBuilder.result }; } @@ -88,8 +110,8 @@ class CommandConfigurationBuilder { return this; } - public shell(value: boolean): CommandConfigurationBuilder { - this.result.isShellCommand = value; + public type(value: Tasks.CommandType): CommandConfigurationBuilder { + this.result.type = value; return this; } @@ -103,15 +125,14 @@ class CommandConfigurationBuilder { return this; } - public echo(value: boolean): CommandConfigurationBuilder { - this.result.echo = value; - return this; - } - public taskSelector(value: string): CommandConfigurationBuilder { this.result.taskSelector = value; return this; } + + public terminal(): TerminalBehaviorBuilder { + return this.terminalBuilder; + } } class TaskBuilder { @@ -123,10 +144,10 @@ class TaskBuilder { this.commandBuilder = new CommandConfigurationBuilder(this, command); this.result = { _id: name, + _source: { kind: Tasks.TaskSourceKind.Workspace, label: 'workspace' }, identifier: name, name: name, command: this.commandBuilder.result, - showOutput: Tasks.ShowOutput.Always, suppressTaskName: false, isBackground: false, promptOnClose: true, @@ -149,11 +170,6 @@ class TaskBuilder { return this; } - public showOutput(value: Tasks.ShowOutput): TaskBuilder { - this.result.showOutput = value; - return this; - } - public suppressTaskName(value: boolean): TaskBuilder { this.result.suppressTaskName = value; return this; @@ -400,7 +416,6 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) { assert.ok(actual._id); assert.strictEqual(actual.name, expected.name, 'name'); assertCommandConfiguration(actual.command, expected.command); - assert.strictEqual(actual.showOutput, expected.showOutput, 'showOutput'); assert.strictEqual(actual.suppressTaskName, expected.suppressTaskName, 'suppressTaskName'); assert.strictEqual(actual.isBackground, expected.isBackground, 'isBackground'); assert.strictEqual(actual.promptOnClose, expected.promptOnClose, 'promptOnClose'); @@ -416,8 +431,9 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) { function assertCommandConfiguration(actual: Tasks.CommandConfiguration, expected: Tasks.CommandConfiguration) { assert.strictEqual(typeof actual, typeof expected); if (actual && expected) { + assertTerminalBehavior(actual.terminal, expected.terminal); assert.strictEqual(actual.name, expected.name, 'name'); - assert.strictEqual(actual.isShellCommand, expected.isShellCommand, 'isShellCommand'); + assert.strictEqual(actual.type, expected.type, 'task type'); assert.deepEqual(actual.args, expected.args, 'args'); assert.strictEqual(typeof actual.options, typeof expected.options); if (actual.options && expected.options) { @@ -427,27 +443,41 @@ function assertCommandConfiguration(actual: Tasks.CommandConfiguration, expected assert.deepEqual(actual.options.env, expected.options.env, 'env'); } } - assert.strictEqual(actual.echo, expected.echo, 'echo'); assert.strictEqual(actual.taskSelector, expected.taskSelector, 'taskSelector'); } } -function assertProblemMatcher(actual: ProblemMatcher, expected: ProblemMatcher) { - if (expected.owner === ProblemMatcherBuilder.DEFAULT_UUID) { - try { - UUID.parse(actual.owner); - } catch (err) { - assert.fail(actual.owner, 'Owner must be a UUID'); - } - } else { - assert.strictEqual(actual.owner, expected.owner); +function assertTerminalBehavior(actual: Tasks.TerminalBehavior, expected: Tasks.TerminalBehavior) { + assert.strictEqual(typeof actual, typeof expected); + if (actual && expected) { + assert.strictEqual(actual.echo, expected.echo); + assert.strictEqual(actual.reveal, expected.reveal); } - assert.strictEqual(actual.applyTo, expected.applyTo); - assert.strictEqual(actual.severity, expected.severity); - assert.strictEqual(actual.fileLocation, expected.fileLocation); - assert.strictEqual(actual.filePrefix, expected.filePrefix); - if (actual.pattern && expected.pattern) { - assertProblemPatterns(actual.pattern, expected.pattern); +} + +function assertProblemMatcher(actual: string | ProblemMatcher, expected: string | ProblemMatcher) { + assert.strictEqual(typeof actual, typeof expected); + if (typeof actual === 'string' && typeof expected === 'string') { + assert.strictEqual(actual, expected, 'Problem matcher references are different'); + return; + } + if (typeof actual !== 'string' && typeof expected !== 'string') { + if (expected.owner === ProblemMatcherBuilder.DEFAULT_UUID) { + try { + UUID.parse(actual.owner); + } catch (err) { + assert.fail(actual.owner, 'Owner must be a UUID'); + } + } else { + assert.strictEqual(actual.owner, expected.owner); + } + assert.strictEqual(actual.applyTo, expected.applyTo); + assert.strictEqual(actual.severity, expected.severity); + assert.strictEqual(actual.fileLocation, expected.fileLocation); + assert.strictEqual(actual.filePrefix, expected.filePrefix); + if (actual.pattern && expected.pattern) { + assertProblemPatterns(actual.pattern, expected.pattern); + } } } @@ -482,7 +512,7 @@ function assertProblemPattern(actual: ProblemPattern, expected: ProblemPattern) assert.strictEqual(actual.loop, expected.loop); } -suite('Tasks Configuration parsing tests', () => { +suite('Tasks version 0.1.0', () => { test('tasks: all default', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). @@ -501,7 +531,7 @@ suite('Tasks Configuration parsing tests', () => { group(Tasks.TaskGroup.Build). suppressTaskName(true). command(). - shell(true); + type(Tasks.CommandType.Shell); testConfiguration( { version: '0.1.0', @@ -517,7 +547,7 @@ suite('Tasks Configuration parsing tests', () => { task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). suppressTaskName(true). - showOutput(Tasks.ShowOutput.Silent); + command().terminal().reveal(Tasks.RevealKind.Silent); testConfiguration( { version: '0.1.0', @@ -582,7 +612,7 @@ suite('Tasks Configuration parsing tests', () => { task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). suppressTaskName(true). - showOutput(Tasks.ShowOutput.Never); + command().terminal().reveal(Tasks.RevealKind.Never); testConfiguration( { version: '0.1.0', @@ -599,7 +629,7 @@ suite('Tasks Configuration parsing tests', () => { task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). suppressTaskName(true). - command(). + command().terminal(). echo(true); testConfiguration( { @@ -700,7 +730,7 @@ suite('Tasks Configuration parsing tests', () => { group(Tasks.TaskGroup.Build). suppressTaskName(true). command(). - shell(true); + type(Tasks.CommandType.Shell); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -751,8 +781,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - showOutput(Platform.isWindows ? Tasks.ShowOutput.Always : Tasks.ShowOutput.Never). - suppressTaskName(true); + suppressTaskName(true). + command().terminal().reveal(Platform.isWindows ? Tasks.RevealKind.Always : Tasks.RevealKind.Never); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -770,7 +800,7 @@ suite('Tasks Configuration parsing tests', () => { task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). suppressTaskName(true). - command(). + command().terminal(). echo(Platform.isWindows ? false : true); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', @@ -895,12 +925,11 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('test', 'tsc'). group(Tasks.TaskGroup.Test). - showOutput(Tasks.ShowOutput.Never). args(['--p']). isBackground(true). promptOnClose(false). - command(). - echo(true); + command().terminal(). + echo(true).reveal(Tasks.RevealKind.Never); testConfiguration(external, builder); }); @@ -920,9 +949,8 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('test', 'tsc'). group(Tasks.TaskGroup.Test). - showOutput(Tasks.ShowOutput.Never). - command(). - echo(true); + command().terminal(). + echo(true).reveal(Tasks.RevealKind.Never); testConfiguration(external, builder); }); @@ -1252,7 +1280,7 @@ suite('Tasks Configuration parsing tests', () => { }; let builder = new ConfiguationBuilder(); builder.task('taskNameOne', 'tsc').suppressTaskName(true).command(). - shell(true).args(['arg']).options({ cwd: 'cwd', env: { env: 'env' } }); + type(Tasks.CommandType.Shell).args(['arg']).options({ cwd: 'cwd', env: { env: 'env' } }); testConfiguration(external, builder); }); @@ -1327,11 +1355,34 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc').command().shell(false); + builder.task('taskNameOne', 'tsc').command().type(Tasks.CommandType.Process); testConfiguration(external, builder); }); }); +suite('Tasks version 2.0.0', () => { + test('Build workspace task', () => { + let external: ExternalTaskRunnerConfiguration = { + version: '2.0.0', + tasks: [ + { + taskName: 'dir', + command: 'dir', + type: 'shell', + group: 'build' + } + ] + }; + let builder = new ConfiguationBuilder(); + builder.task('dir', 'dir'). + suppressTaskName(true). + group(Tasks.TaskGroup.Build). + command().type(Tasks.CommandType.Shell); + testConfiguration(external, builder); + }); + +}); + suite('Bugs / regression tests', () => { test('Bug 19548', () => { if (Platform.isLinux) { @@ -1384,15 +1435,17 @@ suite('Bugs / regression tests', () => { let builder = new ConfiguationBuilder(); if (Platform.isWindows) { builder.task('composeForDebug', 'powershell'). - suppressTaskName(true).showOutput(Tasks.ShowOutput.Always). + suppressTaskName(true). args(['-ExecutionPolicy', 'RemoteSigned', '.\\dockerTask.ps1', '-ComposeForDebug', '-Environment', 'debug']). - command().echo(true).options({ cwd: '${workspaceRoot}' }); + command().options({ cwd: '${workspaceRoot}' }). + terminal().echo(true).reveal(Tasks.RevealKind.Always); testConfiguration(external, builder); } else if (Platform.isMacintosh) { builder.task('composeForDebug', '/bin/bash'). - suppressTaskName(true).showOutput(Tasks.ShowOutput.Always). + suppressTaskName(true). args(['-c', './dockerTask.sh composeForDebug debug']). - command().options({ cwd: '${workspaceRoot}' }); + command().options({ cwd: '${workspaceRoot}' }). + terminal().reveal(Tasks.RevealKind.Always); testConfiguration(external, builder); } }); diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index 836381fcd12..1093b3ee7e0 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -71,6 +71,8 @@ export interface ITerminalConfigHelper { * Merges the default shell path and args into the provided launch configuration */ mergeDefaultShellPathAndArgs(shell: IShellLaunchConfig): void; + /** Sets whether a workspace shell configuration is allowed or not */ + setWorkspaceShellAllowed(isAllowed: boolean): void; } export interface ITerminalFont { @@ -107,8 +109,10 @@ export interface IShellLaunchConfig { * shell is being launched by an extension). */ ignoreConfigurationCwd?: boolean; + /** Whether to wait for a key press before closing the terminal. */ - waitOnExit?: boolean; + waitOnExit?: boolean | string; + /** * A string including ANSI escape sequences that will be written to the terminal emulator * _before_ the terminal process has launched, a trailing \n is added at the end of the string. @@ -146,6 +150,7 @@ export interface ITerminalService { setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): void; updateConfig(): void; selectDefaultWindowsShell(): TPromise; + setWorkspaceShellAllowed(isAllowed: boolean): void; } export interface ITerminalInstance { diff --git a/src/vs/workbench/parts/terminal/common/terminalService.ts b/src/vs/workbench/parts/terminal/common/terminalService.ts index dafe6cead2a..7dbb40a3233 100644 --- a/src/vs/workbench/parts/terminal/common/terminalService.ts +++ b/src/vs/workbench/parts/terminal/common/terminalService.ts @@ -16,6 +16,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; export abstract class TerminalService implements ITerminalService { public _serviceBrand: any; + protected _isShuttingDown: boolean; protected _terminalFocusContextKey: IContextKey; protected _terminalContainer: HTMLElement; protected _onInstancesChanged: Emitter; @@ -48,6 +49,7 @@ export abstract class TerminalService implements ITerminalService { ) { this._terminalInstances = []; this._activeTerminalInstanceIndex = 0; + this._isShuttingDown = false; this._onActiveInstanceChanged = new Emitter(); this._onInstanceDisposed = new Emitter(); @@ -82,6 +84,7 @@ export abstract class TerminalService implements ITerminalService { } // Dispose all terminal instances and don't veto + this._isShuttingDown = true; this.terminalInstances.forEach(instance => { instance.dispose(); }); @@ -105,7 +108,10 @@ export abstract class TerminalService implements ITerminalService { this.getActiveInstance().focus(true); } } - if (this.terminalInstances.length === 0) { + // Hide the panel if there are no more instances, provided that VS Code is not shutting + // down. When shutting down the panel is locked in place so that it is restored upon next + // launch. + if (this.terminalInstances.length === 0 && !this._isShuttingDown) { this.hidePanel(); } this._onInstancesChanged.fire(); @@ -210,4 +216,8 @@ export abstract class TerminalService implements ITerminalService { public updateConfig(): void { this.terminalInstances.forEach(instance => instance.updateConfig()); } + + public setWorkspaceShellAllowed(isAllowed: boolean): void { + this.configHelper.setWorkspaceShellAllowed(isAllowed); + } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css b/src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css index 1b99a5d61d6..0bff305aae4 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css @@ -5,7 +5,6 @@ .monaco-workbench .panel.integrated-terminal .xterm-viewport { /* Use the hack presented in http://stackoverflow.com/a/38748186/1156119 to get opacity transitions working on the scrollbar */ - background-color: rgba(121, 121, 121, 0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; transition: background-color 800ms linear; @@ -27,12 +26,10 @@ .monaco-workbench .panel.integrated-terminal .xterm:focus .xterm-viewport, .monaco-workbench .panel.integrated-terminal .xterm:hover .xterm-viewport { transition: opacity 100ms linear; - background-color: rgba(121, 121, 121, 0.4); } .monaco-workbench .panel.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:hover { transition: opacity 0ms linear; - background-color: rgba(100, 100, 100, .7); } .monaco-workbench .panel.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:window-inactive { diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css b/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css index 67fe62305c8..f2cc6747e2c 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css @@ -9,17 +9,15 @@ display: flex; flex-direction: column; background-color: transparent!important; - color: #333; - -webkit-user-select: initial; + user-select: initial; position: relative; } -.vs-dark .monaco-workbench .panel.integrated-terminal { color: #CCC; } -.hc-black .monaco-workbench .panel.integrated-terminal { color: #FFF; } .monaco-workbench .panel.integrated-terminal .terminal-outer-container { height: 100%; - padding: 0 20px; + padding-left: 20px; /*Don't use right padding in case xterm.js misbehaves*/ width: 100%; + box-sizing: border-box; } .monaco-workbench .panel.integrated-terminal .terminal-wrapper { @@ -62,6 +60,11 @@ font-weight: normal !important; } +.monaco-workbench .panel.integrated-terminal .xterm a.active { + cursor: pointer; + text-decoration: underline; +} + /* Terminal actions */ /* Light theme */ diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css b/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css index 1db9e3f40ab..2549ad70163 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css @@ -12,8 +12,7 @@ } .monaco-workbench .terminal-message-widget { - /* This font list is sourced from a .monaco-shell style */ - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; + font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; font-size: 14px; line-height: 19px; padding: 4px 5px; diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css index b5b9a339f22..4ee863dbecb 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ .monaco-workbench .panel.integrated-terminal .xterm { - background-color: transparent!important; position: relative; height: 100%; } @@ -52,17 +51,7 @@ .monaco-workbench .panel.integrated-terminal .xterm a { color: inherit; - cursor: text; - text-decoration: none; -} - -.monaco-workbench .panel.integrated-terminal.ctrlcmd-held .xterm a:hover { - cursor: pointer; - text-decoration: underline; -} - -.monaco-workbench .panel.integrated-terminal.ctrlcmd-held .xterm a.xterm-invalid-link:hover { - cursor: text; + cursor: inherit; text-decoration: none; } @@ -154,7 +143,8 @@ overflow-y: scroll; } -.terminal .xterm-wide-char { +.terminal .xterm-wide-char, +.terminal .xterm-normal-char { display: inline-block; } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts index 88e1f59a9fd..17e931a643b 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts @@ -7,9 +7,10 @@ import 'vs/css!./media/scrollbar'; import 'vs/css!./media/terminal'; import 'vs/css!./media/xterm'; import 'vs/css!./media/widgets'; +import * as debugActions from 'vs/workbench/parts/debug/browser/debugActions'; +import * as nls from 'vs/nls'; import * as panel from 'vs/workbench/browser/panel'; import * as platform from 'vs/base/common/platform'; -import nls = require('vs/nls'); import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen.contribution'; import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal'; @@ -17,17 +18,16 @@ import { TERMINAL_DEFAULT_SHELL_LINUX, TERMINAL_DEFAULT_SHELL_OSX, TERMINAL_DEFA import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KillTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, FocusTerminalAtIndexAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; +import { KillTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, FocusTerminalAtIndexAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction, AllowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; import { Registry } from 'vs/platform/platform'; import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { TerminalService } from 'vs/workbench/parts/terminal/electron-browser/terminalService'; import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import debugActions = require('vs/workbench/parts/debug/browser/debugActions'); import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { OpenNextRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction, FocusActiveGroupAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { registerColors } from './terminalColorRegistry'; let configurationRegistry = Registry.as(Extensions.Configuration); @@ -96,7 +96,7 @@ configurationRegistry.registerConfiguration({ 'terminal.integrated.fontSize': { 'description': nls.localize('terminal.integrated.fontSize', "Controls the font size in pixels of the terminal."), 'type': 'number', - 'default': DefaultConfig.editor.fontSize + 'default': EDITOR_FONT_DEFAULTS.fontSize }, 'terminal.integrated.lineHeight': { 'description': nls.localize('terminal.integrated.lineHeight', "Controls the line height of the terminal, this number is multipled by the terminal font size to get the actual line-height in pixels."), @@ -266,5 +266,7 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ClearTerminalAct if (platform.isWindows) { actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectDefaultShellWindowsTerminalAction, SelectDefaultShellWindowsTerminalAction.ID, SelectDefaultShellWindowsTerminalAction.LABEL), 'Terminal: Select Default Shell', category); } +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(AllowWorkspaceShellTerminalCommand, AllowWorkspaceShellTerminalCommand.ID, AllowWorkspaceShellTerminalCommand.LABEL), 'Terminal: Allow Workspace Shell Configuration', category); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisallowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand.ID, DisallowWorkspaceShellTerminalCommand.LABEL), 'Terminal: Disallow Workspace Shell Configuration', category); registerColors(); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index d790e30fd1c..3b62f9642ed 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import nls = require('vs/nls'); -import os = require('os'); +import * as nls from 'vs/nls'; +import * as os from 'os'; import { Action, IAction } from 'vs/base/common/actions'; import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; @@ -496,4 +496,40 @@ export class ClearTerminalAction extends Action { } return TPromise.as(void 0); } -} \ No newline at end of file +} + +export class AllowWorkspaceShellTerminalCommand extends Action { + + public static ID = 'workbench.action.terminal.allowWorkspaceShell'; + public static LABEL = nls.localize('workbench.action.terminal.allowWorkspaceShell', "Allow Workspace Shell Configuration"); + + constructor( + id: string, label: string, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(event?: any): TPromise { + this.terminalService.setWorkspaceShellAllowed(true); + return TPromise.as(void 0); + } +} + +export class DisallowWorkspaceShellTerminalCommand extends Action { + + public static ID = 'workbench.action.terminal.disallowWorkspaceShell'; + public static LABEL = nls.localize('workbench.action.terminal.disallowWorkspaceShell', "Disallow Workspace Shell Configuration"); + + constructor( + id: string, label: string, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(event?: any): TPromise { + this.terminalService.setWorkspaceShellAllowed(false); + return TPromise.as(void 0); + } +} diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts index 16d29e6bf4b..ae1d524a912 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import nls = require('vs/nls'); +import * as nls from 'vs/nls'; import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; @@ -13,6 +13,13 @@ import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRe */ export const ansiColorIdentifiers: ColorIdentifier[] = []; +export const TERMINAL_BACKGROUND_COLOR = registerColor('terminal.background', null, nls.localize('terminal.background', 'The background color of the terminal, this allows coloring the terminal differently to the panel.')); +export const TERMINAL_FOREGROUND_COLOR = registerColor('terminal.foreground', { + light: '#333333', + dark: '#CCCCCC', + hc: 'FFFFFF' +}, nls.localize('terminal.foreground', 'The foreground color of the terminal.')); + const ansiColorMap = { 'terminal.ansiBlack': { index: 0, @@ -147,7 +154,8 @@ const ansiColorMap = { export function registerColors(): void { for (let id in ansiColorMap) { let entry = ansiColorMap[id]; - let colorName = id.substring(12); + let colorName = id.substring(13); ansiColorIdentifiers[entry.index] = registerColor(id, entry.defaults, nls.localize('terminal.ansiColor', '\'{0}\' ansi color in the terminal.', colorName)); } + } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index b356edb05eb..fda8ca9b994 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import * as platform from 'vs/base/common/platform'; -import { IConfiguration as IEditorConfiguration, DefaultConfig } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IChoiceService } from 'vs/platform/message/common/message'; @@ -14,6 +14,10 @@ import { ITerminalConfiguration, ITerminalConfigHelper, ITerminalFont, IShellLau import { Severity } from 'vs/editor/common/standalone/standaloneBase'; import { TPromise } from 'vs/base/common/winjs.base'; +interface IEditorConfiguration { + editor: IEditorOptions; +} + interface IFullTerminalConfiguration { terminal: { integrated: ITerminalConfiguration; @@ -86,7 +90,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { const fontFamily = terminalConfig.fontFamily || editorConfig.fontFamily; let fontSize = this._toInteger(terminalConfig.fontSize, 0); if (fontSize <= 0) { - fontSize = DefaultConfig.editor.fontSize; + fontSize = EDITOR_FONT_DEFAULTS.fontSize; } let lineHeight = terminalConfig.lineHeight <= 0 ? DEFAULT_LINE_HEIGHT : terminalConfig.lineHeight; if (!lineHeight) { @@ -96,6 +100,10 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { return this._measureFont(fontFamily, fontSize, lineHeight); } + public setWorkspaceShellAllowed(isAllowed: boolean): void { + this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, isAllowed, StorageScope.WORKSPACE); + } + public mergeDefaultShellPathAndArgs(shell: IShellLaunchConfig): void { // Check whether there is a workspace setting const platformKey = platform.isWindows ? 'windows' : platform.isMacintosh ? 'osx' : 'linux'; @@ -133,14 +141,12 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { const message = nls.localize('terminal.integrated.allowWorkspaceShell', "Do you allow {0} (defined as a workspace setting) to be launched in the terminal?", changeString); const options = [nls.localize('allow', "Allow"), nls.localize('disallow', "Disallow")]; this._choiceService.choose(Severity.Info, message, options, 1).then(choice => { - switch (choice) { - case 0: - this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, true, StorageScope.WORKSPACE); - case 1: - this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, false, StorageScope.WORKSPACE); - default: - return TPromise.as(null); + if (choice === 0) { + this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, true, StorageScope.WORKSPACE); + } else { + this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, false, StorageScope.WORKSPACE); } + return TPromise.as(null); }); } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 4c75ff54461..3b320363826 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as cp from 'child_process'; +import * as os from 'os'; import * as path from 'path'; -import DOM = require('vs/base/browser/dom'); +import * as lifecycle from 'vs/base/common/lifecycle'; +import * as nls from 'vs/nls'; +import * as platform from 'vs/base/common/platform'; +import * as dom from 'vs/base/browser/dom'; import Event, { Emitter } from 'vs/base/common/event'; -import URI from 'vs/base/common/uri'; -import cp = require('child_process'); -import lifecycle = require('vs/base/common/lifecycle'); -import nls = require('vs/nls'); -import os = require('os'); -import platform = require('vs/base/common/platform'); +import Uri from 'vs/base/common/uri'; import xterm = require('xterm'); import { Dimension } from 'vs/base/browser/builder'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -29,6 +29,8 @@ import { TabFocus } from 'vs/editor/common/config/commonEditorConfig'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; import { TerminalLinkHandler } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from 'vs/platform/theme/common/colorRegistry'; /** The amount of time to consider terminal errors to be related to the launch */ const LAUNCHING_DURATION = 500; @@ -37,7 +39,7 @@ class StandardTerminalProcessFactory implements ITerminalProcessFactory { public create(env: { [key: string]: string }): cp.ChildProcess { return cp.fork('./terminalProcess', [], { env, - cwd: URI.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath + cwd: Uri.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath }); } } @@ -215,10 +217,10 @@ export class TerminalInstance implements ITerminalInstance { this._container = container; this._wrapperElement = document.createElement('div'); - DOM.addClass(this._wrapperElement, 'terminal-wrapper'); + dom.addClass(this._wrapperElement, 'terminal-wrapper'); this._xtermElement = document.createElement('div'); - this._xterm.open(this._xtermElement); + this._xterm.open(this._xtermElement, false); this._xterm.attachCustomKeydownHandler((event: KeyboardEvent) => { // Disable all input if the terminal is exiting if (this._isExiting) { @@ -240,7 +242,7 @@ export class TerminalInstance implements ITerminalInstance { } return undefined; }); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'mouseup', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'mouseup', (event: KeyboardEvent) => { // Wait until mouseup has propogated through the DOM before evaluating the new selection // state. setTimeout(() => { @@ -249,7 +251,7 @@ export class TerminalInstance implements ITerminalInstance { })); // xterm.js currently drops selection on keyup as we need to handle this case. - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => { // Wait until keyup has propogated through the DOM before evaluating the new selection // state. setTimeout(() => { @@ -260,10 +262,10 @@ export class TerminalInstance implements ITerminalInstance { const xtermHelper: HTMLElement = this._xterm.element.querySelector('.xterm-helpers'); const focusTrap: HTMLElement = document.createElement('div'); focusTrap.setAttribute('tabindex', '0'); - DOM.addClass(focusTrap, 'focus-trap'); - this._instanceDisposables.push(DOM.addDisposableListener(focusTrap, 'focus', (event: FocusEvent) => { + dom.addClass(focusTrap, 'focus-trap'); + this._instanceDisposables.push(dom.addDisposableListener(focusTrap, 'focus', (event: FocusEvent) => { let currentElement = focusTrap; - while (!DOM.hasClass(currentElement, 'part')) { + while (!dom.hasClass(currentElement, 'part')) { currentElement = currentElement.parentElement; } const hidePanelElement = currentElement.querySelector('.hide-panel-action'); @@ -271,17 +273,17 @@ export class TerminalInstance implements ITerminalInstance { })); xtermHelper.insertBefore(focusTrap, this._xterm.textarea); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'focus', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'focus', (event: KeyboardEvent) => { this._terminalFocusContextKey.set(true); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'blur', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'blur', (event: KeyboardEvent) => { this._terminalFocusContextKey.reset(); this._refreshSelectionContextKey(); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'focus', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'focus', (event: KeyboardEvent) => { this._terminalFocusContextKey.set(true); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'blur', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'blur', (event: KeyboardEvent) => { this._terminalFocusContextKey.reset(); this._refreshSelectionContextKey(); })); @@ -297,6 +299,12 @@ export class TerminalInstance implements ITerminalInstance { this.layout(new Dimension(width, height)); this.setVisible(this._isVisible); this.updateConfig(); + + // If IShellLaunchConfig.waitOnExit was true and the process finished before the terminal + // panel was initialized. + if (this._xterm.getOption('disableStdin')) { + this._attachPressAnyKeyToCloseListener(); + } } public registerLinkMatcher(regex: RegExp, handler: (url: string) => void, matchIndex?: number, validationCallback?: (uri: string, element: HTMLElement, callback: (isValid: boolean) => void) => void): number { @@ -320,12 +328,15 @@ export class TerminalInstance implements ITerminalInstance { } public clearSelection(): void { - document.getSelection().empty(); + window.getSelection().empty(); } public dispose(): void { + if (this._linkHandler) { + this._linkHandler.dispose(); + } if (this._xterm && this._xterm.element) { - this._hadFocusOnExit = DOM.hasClass(this._xterm.element, 'focus'); + this._hadFocusOnExit = dom.hasClass(this._xterm.element, 'focus'); } if (this._wrapperElement) { this._container.removeChild(this._wrapperElement); @@ -378,7 +389,7 @@ export class TerminalInstance implements ITerminalInstance { public setVisible(visible: boolean): void { this._isVisible = visible; if (this._wrapperElement) { - DOM.toggleClass(this._wrapperElement, 'active', visible); + dom.toggleClass(this._wrapperElement, 'active', visible); } if (visible && this._xterm) { // Trigger a manual scroll event which will sync the viewport and scroll bar. This is @@ -462,9 +473,9 @@ export class TerminalInstance implements ITerminalInstance { } const env = TerminalInstance.createTerminalEnv(process.env, shell, this._getCwd(shell, workspace), locale, this._cols, this._rows); this._title = shell.name || ''; - this._process = cp.fork('./terminalProcess', [], { - env: env, - cwd: URI.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath + this._process = cp.fork(Uri.parse(require.toUrl('bootstrap')).fsPath, ['--type=terminal'], { + env, + cwd: Uri.parse(path.dirname(require.toUrl('../node/terminalProcess'))).fsPath }); if (!shell.name) { // Only listen for process title changes when a name is not provided @@ -492,9 +503,6 @@ export class TerminalInstance implements ITerminalInstance { if (this._widgetManager) { this._widgetManager.closeMessage(); } - if (this._linkHandler) { - this._linkHandler.disposeTooltipListeners(); - } if (this._xterm) { this._xterm.write(message.content); } @@ -521,14 +529,14 @@ export class TerminalInstance implements ITerminalInstance { if (exitCode) { this._xterm.writeln(exitCodeMessage); } - this._xterm.writeln(nls.localize('terminal.integrated.waitOnExit', 'Press any key to close the terminal')); + let message = typeof this._shellLaunchConfig.waitOnExit === 'string' + ? this._shellLaunchConfig.waitOnExit + : nls.localize('terminal.integrated.waitOnExit', 'Press any key to close the terminal'); + this._xterm.writeln(message); // Disable all input if the terminal is exiting and listen for next keypress this._xterm.setOption('disableStdin', true); if (this._xterm.textarea) { - this._processDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'keypress', (event: KeyboardEvent) => { - this.dispose(); - event.preventDefault(); - })); + this._attachPressAnyKeyToCloseListener(); } } else { this.dispose(); @@ -553,6 +561,13 @@ export class TerminalInstance implements ITerminalInstance { } } + private _attachPressAnyKeyToCloseListener() { + this._processDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'keypress', (event: KeyboardEvent) => { + this.dispose(); + event.preventDefault(); + })); + } + public reuseTerminal(shell?: IShellLaunchConfig): void { // Kill and clean up old process if (this._process) { @@ -610,6 +625,7 @@ export class TerminalInstance implements ITerminalInstance { env['PTYCOLS'] = cols.toString(); env['PTYROWS'] = rows.toString(); } + env['AMD_ENTRYPOINT'] = 'vs/workbench/parts/terminal/node/terminalProcess'; return env; } @@ -746,3 +762,26 @@ export class TerminalInstance implements ITerminalInstance { this._terminalProcessFactory = factory; } } + +registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + + // Scrollbar + const scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground); + if (scrollbarSliderBackgroundColor) { + collector.addRule(` + .monaco-workbench .panel.integrated-terminal .xterm.focus .xterm-viewport, + .monaco-workbench .panel.integrated-terminal .xterm:focus .xterm-viewport, + .monaco-workbench .panel.integrated-terminal .xterm:hover .xterm-viewport { background-color: ${scrollbarSliderBackgroundColor}; }` + ); + } + + const scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground); + if (scrollbarSliderHoverBackgroundColor) { + collector.addRule(`.monaco-workbench .panel.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:hover { background-color: ${scrollbarSliderHoverBackgroundColor}; }`); + } + + const scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground); + if (scrollbarSliderActiveBackgroundColor) { + collector.addRule(`.monaco-workbench .panel.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:active { background-color: ${scrollbarSliderActiveBackgroundColor}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index 426d16167ba..16047707ea7 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -55,7 +55,8 @@ export type XtermLinkMatcherHandler = (event: MouseEvent, uri: string) => boolea export type XtermLinkMatcherValidationCallback = (uri: string, element: HTMLElement, callback: (isValid: boolean) => void) => void; export class TerminalLinkHandler { - private _tooltipDisposables: IDisposable[] = []; + private _hoverDisposables: IDisposable[] = []; + private _mouseMoveDisposable: IDisposable; private _widgetManager: TerminalWidgetManager; private _localLinkPattern: RegExp; @@ -109,8 +110,9 @@ export class TerminalLinkHandler { }); } - public disposeTooltipListeners(): void { - this._tooltipDisposables = dispose(this._tooltipDisposables); + public dispose(): void { + this._hoverDisposables = dispose(this._hoverDisposables); + this._mouseMoveDisposable = dispose(this._mouseMoveDisposable); } private _wrapLinkHandler(handler: (uri: string) => boolean | void): XtermLinkMatcherHandler { @@ -165,7 +167,11 @@ export class TerminalLinkHandler { private _addTooltipEventListeners(element: HTMLElement): void { let timeout = null; let isMessageShowing = false; - this._tooltipDisposables.push(dom.addDisposableListener(element, dom.EventType.MOUSE_OVER, () => { + this._hoverDisposables.push(dom.addDisposableListener(element, dom.EventType.MOUSE_OVER, e => { + element.classList.toggle('active', platform.isMacintosh ? e.metaKey : e.ctrlKey); + this._mouseMoveDisposable = dom.addDisposableListener(element, dom.EventType.MOUSE_MOVE, e => { + element.classList.toggle('active', platform.isMacintosh ? e.metaKey : e.ctrlKey); + }); timeout = setTimeout(() => { let message: string; if (platform.isMacintosh) { @@ -177,7 +183,11 @@ export class TerminalLinkHandler { isMessageShowing = true; }, 500); })); - this._tooltipDisposables.push(dom.addDisposableListener(element, dom.EventType.MOUSE_OUT, () => { + this._hoverDisposables.push(dom.addDisposableListener(element, dom.EventType.MOUSE_OUT, () => { + element.classList.remove('active'); + if (this._mouseMoveDisposable) { + this._mouseMoveDisposable.dispose(); + } clearTimeout(timeout); this._widgetManager.closeMessage(); isMessageShowing = false; @@ -216,12 +226,15 @@ export class TerminalLinkHandler { private _resolvePath(link: string): TPromise { link = this._preprocessPath(link); - if (!link) { return TPromise.as(void 0); } const linkUrl = this.extractLinkUrl(link); + if (!linkUrl) { + return TPromise.as(void 0); + } + // Open an editor if the path exists return pfs.fileExists(linkUrl).then(isFile => { if (!isFile) { @@ -282,6 +295,9 @@ export class TerminalLinkHandler { */ public extractLinkUrl(link: string): string { const matches: string[] = this._localLinkRegex.exec(link); + if (!matches) { + return null; + } return matches[1]; } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index 46dee45dc7f..78364b99abf 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import DOM = require('vs/base/browser/dom'); -import nls = require('vs/nls'); -import platform = require('vs/base/common/platform'); +import * as dom from 'vs/base/browser/dom'; +import * as nls from 'vs/nls'; +import * as platform from 'vs/base/common/platform'; import { Action, IAction } from 'vs/base/common/actions'; import { Builder, Dimension } from 'vs/base/browser/builder'; import { IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITerminalService, ITerminalFont, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; -import { ansiColorIdentifiers } from './terminalColorRegistry'; +import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR } from './terminalColorRegistry'; import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceAction, SwitchTerminalInstanceActionItem, CopyTerminalSelectionAction, TerminalPasteAction, ClearTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; import { Panel } from 'vs/workbench/browser/panel'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { TPromise } from 'vs/base/common/winjs.base'; +import URI from 'vs/base/common/uri'; export class TerminalPanel extends Panel { @@ -39,7 +39,6 @@ export class TerminalPanel extends Panel { @IConfigurationService private _configurationService: IConfigurationService, @IContextMenuService private _contextMenuService: IContextMenuService, @IInstantiationService private _instantiationService: IInstantiationService, - @IKeybindingService private _keybindingService: IKeybindingService, @ITerminalService private _terminalService: ITerminalService, @IThemeService protected themeService: IThemeService, @ITelemetryService telemetryService: ITelemetryService @@ -50,12 +49,12 @@ export class TerminalPanel extends Panel { public create(parent: Builder): TPromise { super.create(parent); this._parentDomElement = parent.getHTMLElement(); - DOM.addClass(this._parentDomElement, 'integrated-terminal'); + dom.addClass(this._parentDomElement, 'integrated-terminal'); this._themeStyleElement = document.createElement('style'); this._fontStyleElement = document.createElement('style'); this._terminalContainer = document.createElement('div'); - DOM.addClass(this._terminalContainer, 'terminal-outer-container'); + dom.addClass(this._terminalContainer, 'terminal-outer-container'); this._parentDomElement.appendChild(this._themeStyleElement); this._parentDomElement.appendChild(this._fontStyleElement); this._parentDomElement.appendChild(this._terminalContainer); @@ -151,10 +150,7 @@ export class TerminalPanel extends Panel { } private _attachEventListeners(): void { - this._register(DOM.addDisposableListener(window, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => this._refreshCtrlHeld(e))); - this._register(DOM.addDisposableListener(window, DOM.EventType.KEY_UP, (e: KeyboardEvent) => this._refreshCtrlHeld(e))); - this._register(DOM.addDisposableListener(window, DOM.EventType.FOCUS, (e: KeyboardEvent) => this._refreshCtrlHeld(e))); - this._register(DOM.addDisposableListener(this._parentDomElement, 'mousedown', (event: MouseEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'mousedown', (event: MouseEvent) => { if (this._terminalService.terminalInstances.length === 0) { return; } @@ -172,42 +168,68 @@ export class TerminalPanel extends Panel { } else { terminal.paste(); } + // Clear selection after all click event bubbling is finished on Mac to prevent + // right-click selecting a word which is seemed cannot be disabled. There is a + // flicker when pasting but this appears to give the best experience if the + // setting is enabled. + if (platform.isMacintosh) { + setTimeout(() => { + terminal.clearSelection(); + }, 0); + } this._cancelContextMenu = true; } } })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'contextmenu', (event: MouseEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'contextmenu', (event: MouseEvent) => { if (!this._cancelContextMenu) { const standardEvent = new StandardMouseEvent(event); let anchor: { x: number, y: number } = { x: standardEvent.posx, y: standardEvent.posy }; this._contextMenuService.showContextMenu({ getAnchor: () => anchor, getActions: () => TPromise.as(this._getContextMenuActions()), - getActionsContext: () => this._parentDomElement, - getKeyBinding: (action) => this._keybindingService.lookupKeybinding(action.id) + getActionsContext: () => this._parentDomElement }); } this._cancelContextMenu = false; })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'click', (event) => { - if (this._terminalService.terminalInstances.length === 0) { + this._register(dom.addDisposableListener(this._parentDomElement, 'click', (event) => { + if (event.which === 3) { return; } - if (event.which !== 3) { + const instance = this._terminalService.getActiveInstance(); + if (instance) { this._terminalService.getActiveInstance().focus(); } })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'keyup', (event: KeyboardEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'keyup', (event: KeyboardEvent) => { if (event.keyCode === 27) { // Keep terminal open on escape event.stopPropagation(); } })); - } + this._register(dom.addDisposableListener(this._parentDomElement, dom.EventType.DROP, (e: DragEvent) => { + if (e.target === this._parentDomElement || dom.isAncestor(e.target as HTMLElement, this._parentDomElement)) { + if (!e.dataTransfer) { + return; + } - private _refreshCtrlHeld(e: KeyboardEvent): void { - this._parentDomElement.classList.toggle('ctrlcmd-held', platform.isMacintosh ? e.metaKey : e.ctrlKey); + // Check if the file was dragged from the tree explorer + const url = e.dataTransfer.getData('URL'); + let filePath = URI.parse(url).path; + + // Check if the file was dragged from the filesystem + if (!filePath && e.dataTransfer.files.length > 0) { + filePath = e.dataTransfer.files[0].path; + } + + if (filePath) { + const terminal = this._terminalService.getActiveInstance(); + terminal.sendText(this._wrapPathInQuotes(filePath), false); + } + } + })); } private _updateTheme(theme?: ITheme): void { @@ -221,11 +243,21 @@ export class TerminalPanel extends Panel { let color = theme.getColor(colorId); let rgba = color.transparent(0.996); css += `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index} { color: ${color}; }` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index}::selection { background-color: ${rgba}; }` + + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index}::selection,` + + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index} *::selection { background-color: ${rgba}; }` + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index} { background-color: ${color}; }` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index}::selection { color: ${color}; }`; + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index}::selection,` + + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index} *::selection { color: ${color}; }`; } }); + const bgColor = theme.getColor(TERMINAL_BACKGROUND_COLOR); + if (bgColor) { + css += `.monaco-workbench .panel.integrated-terminal .terminal-outer-container { background-color: ${bgColor}; }`; + } + const fgColor = theme.getColor(TERMINAL_FOREGROUND_COLOR); + if (fgColor) { + css += `.monaco-workbench .panel.integrated-terminal .xterm { color: ${fgColor}; }`; + } this._themeStyleElement.innerHTML = css; } @@ -235,8 +267,8 @@ export class TerminalPanel extends Panel { return; } let newFont = this._terminalService.configHelper.getFont(); - DOM.toggleClass(this._parentDomElement, 'enable-ligatures', this._terminalService.configHelper.config.fontLigatures); - DOM.toggleClass(this._parentDomElement, 'disable-bold', !this._terminalService.configHelper.config.enableBold); + dom.toggleClass(this._parentDomElement, 'enable-ligatures', this._terminalService.configHelper.config.fontLigatures); + dom.toggleClass(this._parentDomElement, 'disable-bold', !this._terminalService.configHelper.config.enableBold); if (!this._font || this._fontsDiffer(this._font, newFont)) { this._fontStyleElement.innerHTML = '.monaco-workbench .panel.integrated-terminal .xterm {' + `font-family: ${newFont.fontFamily};` + @@ -255,4 +287,14 @@ export class TerminalPanel extends Panel { a.fontSize !== b.fontSize || a.lineHeight !== b.lineHeight; } + + /** + * Adds quotes to a path if it contains whitespaces + */ + private _wrapPathInQuotes(path: string) { + if (/\s+/.test(path)) { + return `"${path}"`; + } + return path; + } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcess.js b/src/vs/workbench/parts/terminal/node/terminalProcess.ts similarity index 88% rename from src/vs/workbench/parts/terminal/electron-browser/terminalProcess.js rename to src/vs/workbench/parts/terminal/node/terminalProcess.ts index 8cfea5673f1..ab1589b4dcf 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcess.js +++ b/src/vs/workbench/parts/terminal/node/terminalProcess.ts @@ -3,21 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var fs = require('fs'); -var os = require('os'); -var path = require('path'); -var ptyJs = require('node-pty'); +import * as os from 'os'; +import * as path from 'path'; +import * as pty from 'node-pty'; // The pty process needs to be run in its own child process to get around maxing out CPU on Mac, // see https://github.com/electron/electron/issues/38 - -var name; +var shellName: string; if (os.platform() === 'win32') { - name = path.basename(process.env.PTYSHELL); + shellName = path.basename(process.env.PTYSHELL); } else { // Using 'xterm-256color' here helps ensure that the majority of Linux distributions will use a // color prompt as defined in the default ~/.bashrc file. - name = 'xterm-256color'; + shellName = 'xterm-256color'; } var shell = process.env.PTYSHELL; var args = getArgs(); @@ -29,16 +27,24 @@ var currentTitle = ''; setupPlanB(process.env.PTYPID); cleanEnv(); -var options = { - name: name, - cwd: cwd +interface IOptions { + name: string; + cwd: string; + cols?: number; + rows?: number; +} + +var options: IOptions = { + name: shellName, + cwd }; if (cols && rows) { options.cols = parseInt(cols, 10); options.rows = parseInt(rows, 10); } -var ptyProcess = ptyJs.fork(shell, args, options); +var ptyProcess = pty.fork(shell, args, options); + var closeTimeout; var exitCode; @@ -93,6 +99,7 @@ function getArgs() { function cleanEnv() { var keys = [ + 'AMD_ENTRYPOINT', 'ELECTRON_RUN_AS_NODE', 'PTYCWD', 'PTYPID', diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts index 7a6317a7295..f2a9ca2fa52 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts @@ -20,7 +20,7 @@ function getMockTheme(type: ThemeType): ITheme { label: '', type: type, getColor: (colorId) => themingRegistry.resolveDefaultColor(colorId, theme), - isDefault: () => true + defines: () => true }; return theme; } diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index 0943c00e0fd..2e0b9c5831d 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -10,7 +10,7 @@ import { IConfigurationService, getConfigurationValue } from 'vs/platform/config import { Platform } from 'vs/base/common/platform'; import { TPromise } from 'vs/base/common/winjs.base'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; class MockConfigurationService implements IConfigurationService { @@ -97,7 +97,7 @@ suite('Workbench - TerminalConfigHelper', () => { }); configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); configHelper.panelContainer = fixture; - assert.equal(configHelper.getFont().fontSize, `${DefaultConfig.editor.fontSize}px`, 'The default editor font size should be used when editor.fontSize is 0 and terminal.integrated.fontSize not set'); + assert.equal(configHelper.getFont().fontSize, `${EDITOR_FONT_DEFAULTS.fontSize}px`, 'The default editor font size should be used when editor.fontSize is 0 and terminal.integrated.fontSize not set'); configurationService = new MockConfigurationService({ editor: { @@ -113,7 +113,7 @@ suite('Workbench - TerminalConfigHelper', () => { }); configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, null, null, null); configHelper.panelContainer = fixture; - assert.equal(configHelper.getFont().fontSize, `${DefaultConfig.editor.fontSize}px`, 'The default editor font size should be used when editor.fontSize is < 0 and terminal.integrated.fontSize not set'); + assert.equal(configHelper.getFont().fontSize, `${EDITOR_FONT_DEFAULTS.fontSize}px`, 'The default editor font size should be used when editor.fontSize is < 0 and terminal.integrated.fontSize not set'); }); test('TerminalConfigHelper - getFont lineHeight', function () { diff --git a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts index b66dcb4352b..9dfc911fc99 100644 --- a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts +++ b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts @@ -65,13 +65,12 @@ export class SelectColorThemeAction extends Action { this.themeService.setColorTheme(theme.id, target).done(null, err => { - this.messageService.show(Severity.Info, localize('problemChangingTheme', "Problem setting theme: {0}", err)); this.themeService.setColorTheme(currentTheme.id, null); } ); }; - const placeHolder = localize('themes.selectTheme', "Select Color Theme"); + const placeHolder = localize('themes.selectTheme', "Select Color Theme (Up/Down Keys to Preview)"); const autoFocusIndex = firstIndex(picks, p => p.id === currentTheme.id); const delayer = new Delayer(100); @@ -198,7 +197,7 @@ class GenerateColorThemeAction extends Action { colors: resultingColors, tokenColors: theme.tokenColors }, null, '\t'); - return this.editorService.openEditor({ contents, language: 'json', filePath: 'custom-color-theme.json' }); + return this.editorService.openEditor({ contents, language: 'json' }); } } diff --git a/src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.css b/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css similarity index 73% rename from src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.css rename to src/vs/workbench/parts/update/electron-browser/media/update.contribution.css index c9e3e1780c0..a12923fce44 100644 --- a/src/vs/workbench/parts/git/browser/views/noworkspace/noworkspaceView.css +++ b/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css @@ -3,10 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.git-viewlet > .noworkspace-view { - padding: 0 20px 0 20px; -} - -.git-viewlet > .noworkspace-view > p { - line-height: 1.5em; -} +.update-activity { + -webkit-mask: url('update.svg') no-repeat 50% 50%; + -webkit-mask-size: 22px; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/update/electron-browser/media/update.svg b/src/vs/workbench/parts/update/electron-browser/media/update.svg new file mode 100644 index 00000000000..3dec2ba50fd --- /dev/null +++ b/src/vs/workbench/parts/update/electron-browser/media/update.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts index 89c44b66a9e..7f9174f7ca6 100644 --- a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts @@ -10,7 +10,6 @@ import { marked } from 'vs/base/common/marked/marked'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { Builder } from 'vs/base/browser/builder'; import { append, $ } from 'vs/base/browser/dom'; -import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ReleaseNotesInput } from './releaseNotesInput'; @@ -20,6 +19,8 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IModeService } from 'vs/editor/common/services/modeService'; import { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; +import { WebviewEditor } from 'vs/workbench/browser/parts/editor/webviewEditor'; +import { IStorageService } from 'vs/platform/storage/common/storage'; function renderBody(body: string): string { return ` @@ -33,7 +34,7 @@ function renderBody(body: string): string { `; } -export class ReleaseNotesEditor extends BaseEditor { +export class ReleaseNotesEditor extends WebviewEditor { static ID: string = 'workbench.editor.releaseNotes'; @@ -41,15 +42,17 @@ export class ReleaseNotesEditor extends BaseEditor { private webview: WebView; private contentDisposables: IDisposable[] = []; + private scrollYPercentage: number = 0; constructor( @ITelemetryService telemetryService: ITelemetryService, @IThemeService protected themeService: IThemeService, @IOpenerService private openerService: IOpenerService, @IModeService private modeService: IModeService, - @IPartService private partService: IPartService + @IPartService private partService: IPartService, + @IStorageService storageService: IStorageService ) { - super(ReleaseNotesEditor.ID, telemetryService, themeService); + super(ReleaseNotesEditor.ID, telemetryService, themeService, storageService); } createEditor(parent: Builder): void { @@ -92,10 +95,20 @@ export class ReleaseNotesEditor extends BaseEditor { .then(body => { this.webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART)); this.webview.baseUrl = `https://code.visualstudio.com/raw/`; + + if (this.input && this.input instanceof ReleaseNotesInput) { + const state = this.loadViewState(this.input.version); + if (state) { + this.webview.initialScrollProgress = state.scrollYPercentage; + } + } this.webview.style(this.themeService.getTheme()); this.webview.contents = [body]; this.webview.onDidClickLink(link => this.openerService.open(link), null, this.contentDisposables); + this.webview.onDidScroll(event => { + this.scrollYPercentage = event.scrollYPercentage; + }, null, this.contentDisposables); this.themeService.onThemeChange(themeId => this.webview.style(themeId), null, this.contentDisposables); this.contentDisposables.push(this.webview); this.contentDisposables.push(toDisposable(() => this.webview = null)); @@ -120,4 +133,28 @@ export class ReleaseNotesEditor extends BaseEditor { this.contentDisposables = dispose(this.contentDisposables); super.dispose(); } + + protected getViewState() { + return { + scrollYPercentage: this.scrollYPercentage + }; + } + + public clearInput(): void { + if (this.input instanceof ReleaseNotesInput) { + this.saveViewState(this.input.version, { + scrollYPercentage: this.scrollYPercentage + }); + } + super.clearInput(); + } + + public shutdown(): void { + if (this.input instanceof ReleaseNotesInput) { + this.saveViewState(this.input.version, { + scrollYPercentage: this.scrollYPercentage + }); + } + super.shutdown(); + } } diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.ts index 83f6636b877..c7e45a55ebd 100644 --- a/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.ts +++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.ts @@ -13,6 +13,7 @@ export class ReleaseNotesInput extends EditorInput { static get ID() { return 'workbench.releaseNotes.input'; } + get version(): string { return this._version; } get text(): string { return this._text; } diff --git a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts index 52f121006f5..64bba795487 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts @@ -6,20 +6,31 @@ 'use strict'; import * as nls from 'vs/nls'; +import 'vs/css!./media/update.contribution'; import { Registry } from 'vs/platform/platform'; +import product from 'vs/platform/node/product'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { ShowCurrentReleaseNotesAction, UpdateContribution } from 'vs/workbench/parts/update/electron-browser/update'; import { ReleaseNotesEditor } from 'vs/workbench/parts/update/electron-browser/releaseNotesEditor'; import { ReleaseNotesInput } from 'vs/workbench/parts/update/electron-browser/releaseNotesInput'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { IGlobalActivityRegistry, GlobalActivityExtensions } from 'vs/workbench/browser/activity'; import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; +import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, LightUpdateContribution } from './update'; Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(UpdateContribution); + .registerWorkbenchContribution(ProductContribution); + +if (product.quality !== 'stable') { + Registry.as(GlobalActivityExtensions) + .registerActivity(LightUpdateContribution); +} else { + Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(UpdateContribution); +} // Editor const editorDescriptor = new EditorDescriptor( @@ -35,7 +46,6 @@ Registry.as(EditorExtensions.Editors) Registry.as(ActionExtensions.WorkbenchActions) .registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Open Release Notes'); - // Configuration: Update const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); configurationRegistry.registerConfiguration({ diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index 644f7bd40df..c68899b0830 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -8,24 +8,28 @@ import nls = require('vs/nls'); import severity from 'vs/base/common/severity'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Action } from 'vs/base/common/actions'; +import { IAction, Action } from 'vs/base/common/actions'; +import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IMessageService, CloseAction, Severity } from 'vs/platform/message/common/message'; import pkg from 'vs/platform/node/package'; import product from 'vs/platform/node/product'; import URI from 'vs/base/common/uri'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IActivityBarService, TextBadge } from 'vs/workbench/services/activity/common/activityBarService'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ReleaseNotesInput } from 'vs/workbench/parts/update/electron-browser/releaseNotesInput'; +import { IGlobalActivity } from 'vs/workbench/browser/activity'; import { IRequestService } from 'vs/platform/request/node/request'; import { asText } from 'vs/base/node/request'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { KeybindingIO } from 'vs/workbench/services/keybinding/common/keybindingIO'; import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IUpdateService } from 'vs/platform/update/common/update'; +import { IUpdateService, State as UpdateState } from 'vs/platform/update/common/update'; import * as semver from 'semver'; -import { OS } from 'vs/base/common/platform'; +import { OS, isLinux, isWindows } from 'vs/base/common/platform'; class ApplyUpdateAction extends Action { constructor( @IUpdateService private updateService: IUpdateService) { @@ -189,24 +193,22 @@ const LinkAction = (id: string, message: string, licenseUrl: string) => new Acti () => { window.open(licenseUrl); return TPromise.as(null); } ); -export class UpdateContribution implements IWorkbenchContribution { +export class ProductContribution implements IWorkbenchContribution { private static KEY = 'releaseNotes/lastVersion'; - getId() { return 'vs.update'; } + getId() { return 'vs.product'; } constructor( @IStorageService storageService: IStorageService, @IInstantiationService instantiationService: IInstantiationService, @IMessageService messageService: IMessageService, - @IUpdateService updateService: IUpdateService, @IWorkbenchEditorService editorService: IWorkbenchEditorService ) { - const lastVersion = storageService.get(UpdateContribution.KEY, StorageScope.GLOBAL, ''); + const lastVersion = storageService.get(ProductContribution.KEY, StorageScope.GLOBAL, ''); - // was there an update? + // was there an update? if so, open release notes if (product.releaseNotesUrl && lastVersion && pkg.version !== lastVersion) { - instantiationService.invokeFunction(loadReleaseNotes, pkg.version) - .then( + instantiationService.invokeFunction(loadReleaseNotes, pkg.version).then( text => editorService.openEditor(instantiationService.createInstance(ReleaseNotesInput, pkg.version, text), { pinned: true }), () => { messageService.show(Severity.Info, { @@ -230,8 +232,19 @@ export class UpdateContribution implements IWorkbenchContribution { }); } - storageService.store(UpdateContribution.KEY, pkg.version, StorageScope.GLOBAL); + storageService.store(ProductContribution.KEY, pkg.version, StorageScope.GLOBAL); + } +} +export class UpdateContribution implements IWorkbenchContribution { + + getId() { return 'vs.update'; } + + constructor( + @IInstantiationService instantiationService: IInstantiationService, + @IMessageService messageService: IMessageService, + @IUpdateService updateService: IUpdateService + ) { updateService.onUpdateReady(update => { const applyUpdateAction = instantiationService.createInstance(ApplyUpdateAction); const releaseNotesAction = instantiationService.createInstance(ShowReleaseNotesAction, false, update.version); @@ -262,4 +275,73 @@ export class UpdateContribution implements IWorkbenchContribution { updateService.onError(err => messageService.show(severity.Error, err)); } +} + +export class LightUpdateContribution implements IGlobalActivity { + + private static readonly showCommandsId = 'workbench.action.showCommands'; + private static readonly openSettingsId = 'workbench.action.openGlobalSettings'; + private static readonly openKeybindingsId = 'workbench.action.openGlobalKeybindings'; + + get id() { return 'vs.update'; } + get name() { return ''; } + get cssClass() { return 'update-activity'; } + + constructor( + @IStorageService storageService: IStorageService, + @ICommandService private commandService: ICommandService, + @IInstantiationService instantiationService: IInstantiationService, + @IMessageService messageService: IMessageService, + @IUpdateService private updateService: IUpdateService, + @IWorkbenchEditorService editorService: IWorkbenchEditorService, + @IActivityBarService activityBarService: IActivityBarService + ) { + this.updateService.onUpdateReady(() => { + const badge = new TextBadge('\u21e9', () => nls.localize('updateIsReady', "New update available.")); + activityBarService.showGlobalActivity(this.id, badge); + }); + + this.updateService.onError(err => messageService.show(severity.Error, err)); + } + + getActions(): IAction[] { + return [ + new Action(LightUpdateContribution.showCommandsId, nls.localize('commandPalette', "Command Palette..."), undefined, true, () => this.commandService.executeCommand(LightUpdateContribution.showCommandsId)), + new Separator(), + new Action(LightUpdateContribution.openSettingsId, nls.localize('settings', "Settings"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.openSettingsId)), + new Action(LightUpdateContribution.openKeybindingsId, nls.localize('keyboardShortcuts', "Keyboard Shortcuts"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.openKeybindingsId)), + new Separator(), + this.getUpdateAction() + ]; + } + + private getUpdateAction(): IAction { + switch (this.updateService.state) { + case UpdateState.Uninitialized: + return new Action('update.notavailable', nls.localize('not available', "Updates Not Available"), undefined, false); + + case UpdateState.CheckingForUpdate: + return new Action('update.checking', nls.localize('checkingForUpdates', "Checking For Updates..."), undefined, false); + + case UpdateState.UpdateAvailable: + if (isLinux) { + return new Action('update.linux.available', nls.localize('DownloadUpdate', "Download Available Update"), undefined, true, () => + this.updateService.quitAndInstall()); + } + + const updateAvailableLabel = isWindows + ? nls.localize('DownloadingUpdate', "Downloading Update...") + : nls.localize('InstallingUpdate', "Installing Update..."); + + return new Action('update.available', updateAvailableLabel, undefined, false); + + case UpdateState.UpdateDownloaded: + return new Action('update.restart', nls.localize('restartToUpdate', "Restart To Update..."), undefined, true, () => + this.updateService.quitAndInstall()); + + default: + return new Action('update.check', nls.localize('checkForUpdates', "Check For Updates..."), undefined, this.updateService.state === UpdateState.Idle, () => + this.updateService.checkForUpdates(true)); + } + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/media/views.css b/src/vs/workbench/parts/views/browser/media/views.css new file mode 100644 index 00000000000..5eceb636e91 --- /dev/null +++ b/src/vs/workbench/parts/views/browser/media/views.css @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.custom-view-tree-node-item { + display: flex; + height: 22px; + line-height: 22px; +} + +.custom-view-tree-node-item > .custom-view-tree-node-item-icon { + background-size: 16px; + background-position: left center; + background-repeat: no-repeat; + padding-right: 6px; + width: 16px; + height: 22px; + -webkit-font-smoothing: antialiased; +} + +.custom-view-tree-node-item > .custom-view-tree-node-item-label { + flex: 1; + text-overflow: ellipsis; + overflow: hidden; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/treeView.ts b/src/vs/workbench/parts/views/browser/treeView.ts new file mode 100644 index 00000000000..d642e54a3a7 --- /dev/null +++ b/src/vs/workbench/parts/views/browser/treeView.ts @@ -0,0 +1,447 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import 'vs/css!./media/views'; +import Event, { Emitter } from 'vs/base/common/event'; +import { IDisposable, dispose, empty as EmptyDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { CollapsibleViewletView } from 'vs/workbench/browser/viewlet'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { TPromise } from 'vs/base/common/winjs.base'; +import * as DOM from 'vs/base/browser/dom'; +import { Builder, $ } from 'vs/base/browser/builder'; +import { IAction, IActionItem, ActionRunner } from 'vs/base/common/actions'; +import { IMessageService } from 'vs/platform/message/common/message'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IListService } from 'vs/platform/list/browser/listService'; +import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; +import { ClickBehavior, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; +import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; +import { attachListStyler } from 'vs/platform/theme/common/styler'; +import { IThemeService, LIGHT } from 'vs/platform/theme/common/themeService'; +import { createActionItem, fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; +import { IProgressService } from 'vs/platform/progress/common/progress'; +import { ITree, IDataSource, IRenderer, ContextMenuEvent } from 'vs/base/parts/tree/browser/tree'; +import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; +import { ViewsRegistry, ITreeViewDataProvider, IViewOptions, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/browser/views'; +import { IExtensionService } from 'vs/platform/extensions/common/extensions'; +import { CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; +import { ICommandService } from 'vs/platform/commands/common/commands'; + +export class TreeView extends CollapsibleViewletView { + + private menus: Menus; + private viewFocusContext: IContextKey; + private activated: boolean = false; + private treeInputPromise: TPromise; + + private dataProviderRegisteredListener: IDisposable; + private dataProviderElementChangeListener: IDisposable; + private disposables: IDisposable[] = []; + + constructor( + readonly id: string, + private options: IViewOptions, + @IMessageService messageService: IMessageService, + @IKeybindingService keybindingService: IKeybindingService, + @IContextMenuService contextMenuService: IContextMenuService, + @IInstantiationService private instantiationService: IInstantiationService, + @IListService private listService: IListService, + @IThemeService private themeService: IThemeService, + @IContextKeyService private contextKeyService: IContextKeyService, + @IExtensionService private extensionService: IExtensionService, + @ICommandService private commandService: ICommandService + ) { + super(options.actionRunner, options.collapsed, options.name, messageService, keybindingService, contextMenuService); + this.menus = this.instantiationService.createInstance(Menus, this.id); + this.viewFocusContext = this.contextKeyService.createKey(this.id, void 0); + this.menus.onDidChangeTitle(() => this.updateActions(), this, this.disposables); + this.themeService.onThemeChange(() => this.tree.refresh() /* soft refresh */, this, this.disposables); + if (!options.collapsed) { + this.triggerActivation(); + } + } + + public renderHeader(container: HTMLElement): void { + const titleDiv = $('div.title').appendTo(container); + $('span').text(this.options.name).appendTo(titleDiv); + super.renderHeader(container); + } + + public renderBody(container: HTMLElement): void { + this.treeContainer = super.renderViewTree(container); + DOM.addClass(this.treeContainer, 'tree-explorer-viewlet-tree-view'); + + this.tree = this.createViewer($(this.treeContainer)); + } + + protected changeState(state: CollapsibleState): void { + super.changeState(state); + if (state === CollapsibleState.EXPANDED) { + this.triggerActivation(); + } + } + + private triggerActivation() { + if (!this.activated && this.extensionService) { + this.extensionService.activateByEvent(`onView:${this.id}`); + this.activated = true; + } + } + + public createViewer(container: Builder): ITree { + const dataSource = this.instantiationService.createInstance(TreeDataSource, this.id); + const renderer = this.instantiationService.createInstance(TreeRenderer); + const controller = this.instantiationService.createInstance(TreeController, this.id, this.menus); + const tree = new Tree(container.getHTMLElement(), { + dataSource, + renderer, + controller + }, { + keyboardSupport: false + }); + + this.toDispose.push(attachListStyler(tree, this.themeService)); + this.toDispose.push(this.listService.register(tree, [this.viewFocusContext])); + tree.addListener('selection', (event: any) => this.onSelection()); + return tree; + } + + getActions(): IAction[] { + return [...this.menus.getTitleActions()]; + } + + getSecondaryActions(): IAction[] { + return this.menus.getTitleSecondaryActions(); + } + + getActionItem(action: IAction): IActionItem { + return createActionItem(action, this.keybindingService, this.messageService); + } + + public create(): TPromise { + return this.setInput(); + } + + public setVisible(visible: boolean): TPromise { + return super.setVisible(visible); + } + + public setInput(): TPromise { + if (this.listenToDataProvider()) { + this.treeInputPromise = this.tree.setInput(new Root()); + return this.treeInputPromise; + } + this.treeInputPromise = new TPromise((c, e) => { + this.dataProviderRegisteredListener = ViewsRegistry.onTreeViewDataProviderRegistered(id => { + if (this.id === id) { + if (this.listenToDataProvider()) { + this.tree.setInput(new Root()).then(() => c(null)); + this.dataProviderRegisteredListener.dispose(); + } + } + }); + }); + return TPromise.as(null); + } + + private listenToDataProvider(): boolean { + let dataProvider = ViewsRegistry.getTreeViewDataProvider(this.id); + if (dataProvider) { + if (this.dataProviderElementChangeListener) { + this.dataProviderElementChangeListener.dispose(); + } + this.dataProviderElementChangeListener = dataProvider.onDidChange(element => this.refresh(element)); + return true; + } + return false; + } + + public getOptimalWidth(): number { + const parentNode = this.tree.getHTMLElement(); + const childNodes = [].slice.call(parentNode.querySelectorAll('.outline-item-label > a')); + + return DOM.getLargestChildWidth(parentNode, childNodes); + } + + private onSelection(): void { + const selection: ITreeItem = this.tree.getSelection()[0]; + if (selection) { + if (selection.commandId) { + this.commandService.executeCommand(selection.commandId, { treeViewId: this.id, treeItemHandle: selection.handle }); + } + } + } + + private refresh(element?: ITreeItem): void { + element = element ? element : this.tree.getInput(); + element.children = null; + this.tree.refresh(element); + } + + dispose(): void { + if (this.dataProviderRegisteredListener) { + this.dataProviderRegisteredListener.dispose(); + } + dispose(this.disposables); + if (this.dataProviderElementChangeListener) { + this.dataProviderElementChangeListener.dispose(); + } + dispose(this.disposables); + super.dispose(); + } +} + +class Root implements ITreeItem { + label = 'root'; + handle = -1; + collapsibleState = TreeItemCollapsibleState.Expanded; +} + +class TreeDataSource implements IDataSource { + + constructor( + private id: string, + @IProgressService private progressService: IProgressService + ) { + } + + public getId(tree: ITree, node: ITreeItem): string { + return '' + node.handle; + } + + public hasChildren(tree: ITree, node: ITreeItem): boolean { + return node.collapsibleState === TreeItemCollapsibleState.Collapsed || node.collapsibleState === TreeItemCollapsibleState.Expanded; + } + + public getChildren(tree: ITree, node: ITreeItem): TPromise { + if (node.children) { + return TPromise.as(node.children); + } + + const dataProvider = this.getDataProvider(); + if (dataProvider) { + const promise = node instanceof Root ? dataProvider.getElements() : dataProvider.getChildren(node); + this.progressService.showWhile(promise, 100); + return promise.then(children => { + node.children = children; + return children; + }); + } + return TPromise.as(null); + } + + public shouldAutoexpand(tree: ITree, node: ITreeItem): boolean { + return node.collapsibleState === TreeItemCollapsibleState.Expanded; + } + + public getParent(tree: ITree, node: any): TPromise { + return TPromise.as(null); + } + + private getDataProvider(): ITreeViewDataProvider { + return ViewsRegistry.getTreeViewDataProvider(this.id); + } +} + +interface ITreeExplorerTemplateData { + icon: Builder; + label: Builder; +} + +class TreeRenderer implements IRenderer { + + private static ITEM_HEIGHT = 22; + private static TREE_TEMPLATE_ID = 'treeExplorer'; + + constructor( @IThemeService private themeService: IThemeService) { + } + + public getHeight(tree: ITree, element: any): number { + return TreeRenderer.ITEM_HEIGHT; + } + + public getTemplateId(tree: ITree, element: any): string { + return TreeRenderer.TREE_TEMPLATE_ID; + } + + public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): ITreeExplorerTemplateData { + const el = $(container); + const item = $('.custom-view-tree-node-item'); + item.appendTo(el); + + const icon = $('.custom-view-tree-node-item-icon').appendTo(item); + const label = $('.custom-view-tree-node-item-label').appendTo(item); + const link = $('a.label').appendTo(label); + + return { label: link, icon }; + } + + public renderElement(tree: ITree, node: ITreeItem, templateId: string, templateData: ITreeExplorerTemplateData): void { + templateData.label.text(node.label).title(node.label); + + const theme = this.themeService.getTheme(); + const icon = theme.type === LIGHT ? node.icon : node.iconDark; + + if (icon) { + templateData.icon.getHTMLElement().style.backgroundImage = `url('${icon}')`; + DOM.addClass(templateData.icon.getHTMLElement(), 'custom-view-tree-node-item-icon'); + } else { + templateData.icon.getHTMLElement().style.backgroundImage = ''; + DOM.removeClass(templateData.icon.getHTMLElement(), 'custom-view-tree-node-item-icon'); + } + } + + public disposeTemplate(tree: ITree, templateId: string, templateData: ITreeExplorerTemplateData): void { + } +} + +class TreeController extends DefaultController { + + constructor( + private treeViewId: string, + private menus: Menus, + @IContextMenuService private contextMenuService: IContextMenuService, + @IKeybindingService private _keybindingService: IKeybindingService + ) { + super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false }); + } + + public onContextMenu(tree: ITree, node: ITreeItem, event: ContextMenuEvent): boolean { + tree.setFocus(node); + const actions = this.menus.getResourceContextActions(node); + if (!actions.length) { + return true; + } + const anchor = { x: event.posx + 1, y: event.posy }; + this.contextMenuService.showContextMenu({ + getAnchor: () => anchor, + + getActions: () => { + return TPromise.as(actions); + }, + + getActionItem: (action) => { + const keybinding = this._keybindingService.lookupKeybinding(action.id); + if (keybinding) { + return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); + } + return null; + }, + + onHide: (wasCancelled?: boolean) => { + if (wasCancelled) { + tree.DOMFocus(); + } + }, + + getActionsContext: () => ({ treeViewId: this.treeViewId, treeItemHandle: node.handle }), + + actionRunner: new MultipleSelectionActionRunner(() => tree.getSelection()) + }); + + return true; + } +} + +class MultipleSelectionActionRunner extends ActionRunner { + + constructor(private getSelectedResources: () => any[]) { + super(); + } + + runAction(action: IAction, context: any): TPromise { + if (action instanceof MenuItemAction) { + const selection = this.getSelectedResources(); + const filteredSelection = selection.filter(s => s !== context); + + if (selection.length === filteredSelection.length || selection.length === 1) { + return action.run(context); + } + + return action.run(context, ...filteredSelection); + } + + return super.runAction(action, context); + } +} + +class Menus implements IDisposable { + + private disposables: IDisposable[] = []; + private titleDisposable: IDisposable = EmptyDisposable; + private titleActions: IAction[] = []; + private titleSecondaryActions: IAction[] = []; + + private _onDidChangeTitle = new Emitter(); + get onDidChangeTitle(): Event { return this._onDidChangeTitle.event; } + + constructor( + private id: string, + @IContextKeyService private contextKeyService: IContextKeyService, + @IMenuService private menuService: IMenuService + ) { + if (this.titleDisposable) { + this.titleDisposable.dispose(); + this.titleDisposable = EmptyDisposable; + } + + const _contextKeyService = this.contextKeyService.createScoped(); + _contextKeyService.createKey('view', id); + + const titleMenu = this.menuService.createMenu(MenuId.ViewTitle, _contextKeyService); + const updateActions = () => { + this.titleActions = []; + this.titleSecondaryActions = []; + fillInActions(titleMenu, null, { primary: this.titleActions, secondary: this.titleSecondaryActions }); + this._onDidChangeTitle.fire(); + }; + + const listener = titleMenu.onDidChange(updateActions); + updateActions(); + + this.titleDisposable = toDisposable(() => { + listener.dispose(); + titleMenu.dispose(); + _contextKeyService.dispose(); + this.titleActions = []; + this.titleSecondaryActions = []; + }); + } + + getTitleActions(): IAction[] { + return this.titleActions; + } + + getTitleSecondaryActions(): IAction[] { + return this.titleSecondaryActions; + } + + getResourceContextActions(element: ITreeItem): IAction[] { + return this.getActions(MenuId.ViewItemContext, { key: 'viewItem', value: element.contextValue }).secondary; + } + + private getActions(menuId: MenuId, context: { key: string, value: string }): { primary: IAction[]; secondary: IAction[]; } { + const contextKeyService = this.contextKeyService.createScoped(); + contextKeyService.createKey('view', this.id); + contextKeyService.createKey(context.key, context.value); + + const menu = this.menuService.createMenu(menuId, contextKeyService); + const primary = []; + const secondary = []; + const result = { primary, secondary }; + fillInActions(menu, { shouldForwardArgs: true }, result); + + menu.dispose(); + contextKeyService.dispose(); + + return result; + } + + dispose(): void { + this.disposables = dispose(this.disposables); + } +} \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/views.ts b/src/vs/workbench/parts/views/browser/views.ts new file mode 100644 index 00000000000..d5a69e9827d --- /dev/null +++ b/src/vs/workbench/parts/views/browser/views.ts @@ -0,0 +1,146 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { TPromise } from 'vs/base/common/winjs.base'; +import Event, { Emitter } from 'vs/base/common/event'; +import { IActionRunner } from 'vs/base/common/actions'; +import { IViewletView as IView } from 'vs/workbench/browser/viewlet'; + +export class ViewLocation { + + static readonly Explorer = new ViewLocation('explorer'); + + constructor(private _id: string) { + } + + get id(): string { + return this._id; + } +} + +export enum TreeItemCollapsibleState { + None = 0, + Collapsed = 1, + Expanded = 2 +} + +export interface IViewOptions { + name: string; + actionRunner: IActionRunner; + collapsed: boolean; +} + +export interface IViewConstructorSignature { + + new (id: string, options: IViewOptions, ...services: { _serviceBrand: any; }[]): IView; + +} + +export interface IViewDescriptor { + + readonly id: string; + + readonly name: string; + + readonly location: ViewLocation; + + readonly ctor: IViewConstructorSignature; + + readonly order?: number; + +} + +export interface ITreeItem { + + handle: number; + + label: string; + + icon?: string; + + iconDark?: string; + + contextValue?: string; + + commandId?: string; + + children?: ITreeItem[]; + + collapsibleState?: TreeItemCollapsibleState; +} + +export interface ITreeViewDataProvider { + + onDidChange: Event; + + getElements(): TPromise; + + getChildren(element: ITreeItem): TPromise; + +} + +export interface IViewsRegistry { + + readonly onViewsRegistered: Event; + + readonly onTreeViewDataProviderRegistered: Event; + + registerViews(views: IViewDescriptor[]): void; + + registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider): void; + + getViews(loc: ViewLocation): IViewDescriptor[]; + + getTreeViewDataProvider(id: string): ITreeViewDataProvider; + +} + +export const ViewsRegistry: IViewsRegistry = new class { + + private _onViewsRegistered: Emitter = new Emitter(); + readonly onViewsRegistered: Event = this._onViewsRegistered.event; + + private _onTreeViewDataProviderRegistered: Emitter = new Emitter(); + readonly onTreeViewDataProviderRegistered: Event = this._onTreeViewDataProviderRegistered.event; + + private _views: Map = new Map(); + private _treeViewDataPoviders: Map = new Map(); + + registerViews(viewDescriptors: IViewDescriptor[]): void { + if (viewDescriptors.length) { + for (const viewDescriptor of viewDescriptors) { + let views = this._views.get(viewDescriptor.location); + if (!views) { + views = []; + this._views.set(viewDescriptor.location, views); + } + views.push(viewDescriptor); + } + this._onViewsRegistered.fire(viewDescriptors); + } + } + + registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { + if (!this.isViewRegistered(id)) { + // TODO: throw error + } + this._treeViewDataPoviders.set(id, factory); + this._onTreeViewDataProviderRegistered.fire(id); + } + + getViews(loc: ViewLocation): IViewDescriptor[] { + return this._views.get(loc) || []; + } + + getTreeViewDataProvider(id: string): ITreeViewDataProvider { + return this._treeViewDataPoviders.get(id); + } + + private isViewRegistered(id: string): boolean { + let registered = false; + this._views.forEach(views => registered = registered || views.some(view => view.id === id)); + return registered; + } +}; \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts b/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts new file mode 100644 index 00000000000..e7cc066c06a --- /dev/null +++ b/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { localize } from 'vs/nls'; +import { forEach } from 'vs/base/common/collections'; +import { IJSONSchema } from 'vs/base/common/jsonSchema'; +import { ExtensionMessageCollector, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; +import { ViewLocation, ViewsRegistry } from 'vs/workbench/parts/views/browser/views'; +import { TreeView } from 'vs/workbench/parts/views/browser/treeView'; + +namespace schema { + + // --views contribution point + + export interface IUserFriendlyViewDescriptor { + id: string; + name: string; + } + + export function parseLocation(value: string): ViewLocation { + switch (value) { + case ViewLocation.Explorer.id: return ViewLocation.Explorer; + } + return void 0; + } + + export function isValidViewDescriptors(viewDescriptors: IUserFriendlyViewDescriptor[], collector: ExtensionMessageCollector): boolean { + if (!Array.isArray(viewDescriptors)) { + collector.error(localize('requirearray', "views must be an array")); + return false; + } + + for (let descriptor of viewDescriptors) { + if (typeof descriptor.id !== 'string') { + collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'id')); + return false; + } + if (typeof descriptor.name !== 'string') { + collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'label')); + return false; + } + } + + return true; + } + + const viewDescriptor: IJSONSchema = { + type: 'object', + properties: { + id: { + description: localize('vscode.extension.contributes.view.id', 'Identifier of the view. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'), + type: 'string' + }, + name: { + description: localize('vscode.extension.contributes.view.name', 'The human-readable name of the view. Will be shown'), + type: 'string' + } + } + }; + + export const viewsContribution: IJSONSchema = { + description: localize('vscode.extension.contributes.views', "Contributes views to the editor"), + type: 'object', + properties: { + 'explorer': { + description: localize('views.explorer', "Explorer View"), + type: 'array', + items: viewDescriptor + } + } + }; +} + +ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyViewDescriptor[] }>('views', [], schema.viewsContribution).setHandler(extensions => { + for (let extension of extensions) { + const { value, collector } = extension; + + forEach(value, entry => { + if (!schema.isValidViewDescriptors(entry.value, collector)) { + return; + } + + const location = schema.parseLocation(entry.key); + if (!location) { + collector.warn(localize('locationId.invalid', "`{0}` is not a valid view location", entry.key)); + return; + } + + const viewDescriptors = entry.value.map(item => ({ + id: item.id, + name: item.name, + ctor: TreeView, + location + })); + ViewsRegistry.registerViews(viewDescriptors); + }); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts index f57754ba1f9..cdb9eb088b0 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts @@ -69,7 +69,8 @@ export class GettingStarted implements IWorkbenchContribution { ) { this.appName = product.nameLong; - if (product.welcomePage && !environmentService.isExtensionDevelopment /* do not open a browser when we run an extension */) { + /* do not open a browser when we run an extension or --skip-getting-started is provided */ + if (product.welcomePage && !environmentService.isExtensionDevelopment && !environmentService.skipGettingStarted) { this.welcomePageURL = product.welcomePage; this.handleWelcome(); } diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css index 6aa8c04e789..50cf77eafad 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css @@ -10,15 +10,10 @@ height: 100%; width: 100%; z-index: 9999; - background: rgba(0,0,0,0.52); font-size: 10px; transition: font-size .25s; } -.vs .monaco-workbench > .welcomeOverlay { - background: rgba(255,255,255,.52); -} - #workbench\.parts\.editor { transition: filter .25s, opacity .2s; } @@ -40,15 +35,6 @@ font-size: 1.6em; } -.monaco-workbench > .welcomeOverlay > .key { - color: #000; -} - -.vs-dark .monaco-workbench > .welcomeOverlay > .key, -.hc-black .monaco-workbench > .welcomeOverlay > .key { - color: #FFF; -} - .monaco-workbench > .welcomeOverlay > .key > .label { padding: 0 1ex; } @@ -56,7 +42,6 @@ .monaco-workbench > .welcomeOverlay > .key > .shortcut { letter-spacing: 0.15em; font-size: 0.8125em; - color: #d7ba7d; font-family: "Lucida Grande", sans-serif; } diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts index 33a812a71de..d5a435aac22 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts @@ -17,12 +17,13 @@ import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { registerColor, textPreformatForeground } from 'vs/platform/theme/common/colorRegistry'; interface Key { id: string; @@ -50,7 +51,7 @@ const keys: Key[] = [ id: 'git', arrow: '←', label: localize('welcomeOverlay.git', "Source code management"), - command: SCMPreview.enabled ? 'workbench.view.scm' : 'workbench.view.git' + command: 'workbench.view.scm' }, { id: 'debug', @@ -234,3 +235,23 @@ Registry.as(Extensions.WorkbenchActions) Registry.as(Extensions.WorkbenchActions) .registerWorkbenchAction(new SyncActionDescriptor(HideWelcomeOverlayAction, HideWelcomeOverlayAction.ID, HideWelcomeOverlayAction.LABEL, { primary: KeyCode.Escape }, OVERLAY_VISIBLE), 'Help: Hide Interface Overview', localize('help', "Help")); + +// theming + +const foreground = registerColor('welcomeOverlay.foreground', { dark: '#fff', light: '#000', hc: '#fff' }, localize('welcomeOverlay.foreground', 'Foreground color for the Interface Overview.')); +const background = registerColor('welcomeOverlay.background', { dark: '#00000085', light: '#FFFFFF85', hc: '#00000085' }, localize('welcomeOverlay.background', 'Background color for the Interface Overview.')); + +registerThemingParticipant((theme, collector) => { + const key = theme.getColor(foreground); + if (key) { + collector.addRule(`.monaco-workbench > .welcomeOverlay > .key { color: ${key}; }`); + } + const backgroundColor = theme.getColor(background); + if (backgroundColor) { + collector.addRule(`.monaco-workbench > .welcomeOverlay { background: ${backgroundColor}; }`); + } + const shortcut = theme.getColor(textPreformatForeground); + if (shortcut) { + collector.addRule(`.monaco-workbench > .welcomeOverlay > .key > .shortcut { color: ${shortcut}; }`); + } +}); diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts b/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts index c080c0c6040..767ee36747a 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts @@ -14,55 +14,70 @@ export default () => `
-

${escape(localize('welcomePage.vscode', "Visual Studio Code"))}

-

${escape(localize('welcomePage.editingEvolved', "Editing evolved"))}

+

${escape(localize('welcomePage.vscode', "Visual Studio Code"))}

+

${escape(localize('welcomePage.editingEvolved', "Editing evolved"))}

-

${escape(localize('welcomePage.recent', "Recent"))}

+

${escape(localize('welcomePage.recent', "Recent"))}

-

${escape(localize('welcomePage.noRecentFolders', "No recent folders"))}

+

${escape(localize('welcomePage.noRecentFolders', "No recent folders"))}

-

+

-

${escape(localize('welcomePage.quickLinks', "Quick links"))}

-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
+
+

${escape(localize('welcomePage.customize', "Customize"))}

+
    +
  • +
  • +
  • +
+
+
+

${escape(localize('welcomePage.learn', "Learn"))}

+
    +
  • +
  • +
  • +
+
+
diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css index 58d11029b89..a3c2fa3e686 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css @@ -16,9 +16,6 @@ max-width: 1200px; font-size: 10px; } -.vs .monaco-workbench > .part.editor > .content .welcomePage { - color: #6C6C6C; -} .monaco-workbench > .part.editor > .content .welcomePage .row { display: flex; @@ -41,67 +38,36 @@ } .monaco-workbench > .part.editor > .content .welcomePage a { - color: #2e70c0; text-decoration: none; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage a { - color: #4080D0; -} - .monaco-workbench > .part.editor > .content .welcomePage a:focus { outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } -.monaco-workbench > .part.editor > .content .welcomePage a:hover { - color: #6ea0dc; -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage a { - color: #0b9eff; -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage a:hover { - color: #f38518; -} - .monaco-workbench > .part.editor > .content .welcomePage h1 { padding: 0; margin: 0; border: none; - /*font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI Light", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif;*/ font-weight: normal; - color: rgba(0,0,0,.8); font-size: 3.6em; white-space: nowrap; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage h1 { - color: rgba(255,255,255,.76); -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage h1 { - color: white; -} - .monaco-workbench > .part.editor > .content .welcomePage .title { margin-top: 1em; margin-bottom: 1em; flex: 1 100%; } + .monaco-workbench > .part.editor > .content .welcomePage .subtitle { margin-top: .8em; font-size: 2.6em; - color: rgba(0,0,0,.53); display: block; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .subtitle { - color: rgba(255,255,255,.46); -} .hc-black .monaco-workbench > .part.editor > .content .welcomePage .subtitle { - color: white; font-weight: 200; } @@ -139,6 +105,10 @@ display: initial; } +.monaco-workbench > .part.editor > .content .welcomePage .splash .recent li.moreRecent { + margin-top: 5px; +} + .monaco-workbench > .part.editor > .content .welcomePage .splash .recent li { min-width: 0; white-space: nowrap; @@ -147,22 +117,6 @@ } .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { padding-left: 1em; - color: rgba(255,255,255,.46); -} - -.monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: rgba(0,0,0,.53); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: rgba(255,255,255,.46); -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.hc-black .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: white; } .monaco-workbench > .part.editor > .content .welcomePage .splash .title, @@ -204,69 +158,37 @@ margin-bottom: .25em; } -.vs .monaco-workbench > .part.editor > .content .welcomePage .commands li button h3 { - color: #2c2c2c; -} - .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: #6c6c6c; - background:rgba(0,0,0,.04); border: none; } -.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { - background:rgba(0,0,0,.10); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .commands li button > h3 { - color: #ccc; -} .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button > h3 { font-weight: bold; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: #828282; - background: rgba(0, 0, 0, .2); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { - background: rgba(200, 235, 255, .072); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage.extra-dark .commands li button { - background: rgba(200, 235, 255, .042); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage.extra-dark .commands li button:hover { - background: rgba(200, 235, 255, .072); -} - .monaco-workbench > .part.editor > .content .welcomePage .commands li button:focus { outline-style: solid; outline-width: 1px; } .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: white; - background: black; - border-color: #f38518; border-width: 1px; border-style: solid; } .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { - outline: 1px dashed #f38518; + outline-width: 1px; + outline-style: dashed; outline-offset: -5px; } -.monaco-workbench > .part.editor > .content .welcomePage .commands li button .currentKeymap { +.monaco-workbench > .part.editor > .content .welcomePage .commands li button .enabledExtension { display: none; } -.monaco-workbench > .part.editor > .content .welcomePage .commands li button .installKeymap.installed { +.monaco-workbench > .part.editor > .content .welcomePage .commands li button .installExtension.installed { display: none; } -.monaco-workbench > .part.editor > .content .welcomePage .commands li button .currentKeymap.installed { +.monaco-workbench > .part.editor > .content .welcomePage .commands li button .enabledExtension.installed { display: inline; } @@ -302,16 +224,3 @@ .monaco-workbench.linux > .part.editor > .content .welcomePage li.linux-only { display: list-item; } - -.monaco-workbench > .part.editor > .content .welcomePageContainer .scm-only { - display: none; -} -.monaco-workbench > .part.editor > .content .welcomePageContainer.scmEnabled .scm-only { - display: initial; -} -.monaco-workbench > .part.editor > .content .welcomePageContainer.scmEnabled li.scm-only { - display: list-item; -} -.monaco-workbench > .part.editor > .content .welcomePageContainer.scmEnabled .git-only { - display: none; -} \ No newline at end of file diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index 7231ee075f8..86dde1dd27d 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -27,16 +27,16 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { Schemas } from 'vs/base/common/network'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IMessageService, Severity, CloseAction } from 'vs/platform/message/common/message'; -import { getInstalledKeymaps, IKeymapExtension, onKeymapExtensionChanged } from 'vs/workbench/parts/extensions/electron-browser/keymapExtensions'; -import { IExtensionEnablementService, IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; +import { IExtensionEnablementService, IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { used } from 'vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { tildify } from 'vs/base/common/labels'; -import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; -import { Themable } from 'vs/workbench/common/theme'; -import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { isLinux } from 'vs/base/common/platform'; +import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { registerColor, textLinkForeground, foreground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; used(); @@ -101,28 +101,57 @@ const reorderedQuickLinks = [ 'showInteractivePlayground', ]; -class WelcomeTheming extends Themable { - - constructor( - themeService: IThemeService, - private container: HTMLElement - ) { - super(themeService); - this.update(themeService.getTheme()); - } - - protected onThemeChange(theme: ITheme): void { - super.onThemeChange(theme); - this.update(theme); - } - - private update(theme: ITheme): void { - const background = theme.getColor(editorBackground); - const page = this.container.querySelector('.welcomePage') as HTMLElement; - page.classList.toggle('extra-dark', background.getLuminosity() < 0.004); - } +interface ExtensionSuggestion { + name: string; + id: string; + isKeymap?: boolean; } +const extensionPacks: ExtensionSuggestion[] = [ + { name: localize('welcomePage.javaScript', "JavaScript"), id: 'dbaeumer.vscode-eslint' }, + { name: localize('welcomePage.typeScript', "TypeScript"), id: 'eg2.tslint' }, + { name: localize('welcomePage.python', "Python"), id: 'donjayamanne.python' }, + // { name: localize('welcomePage.go', "Go"), id: 'lukehoban.go' }, + { name: localize('welcomePage.php', "PHP"), id: 'felixfbecker.php-pack' }, + { name: localize('welcomePage.docker', "Docker"), id: 'PeterJausovec.vscode-docker' }, +]; + +const keymapExtensions: ExtensionSuggestion[] = [ + { name: localize('welcomePage.vim', "Vim"), id: 'vscodevim.vim', isKeymap: true }, + { name: localize('welcomePage.sublime', "Sublime"), id: 'ms-vscode.sublime-keybindings', isKeymap: true }, + { name: localize('welcomePage.atom', "Atom"), id: 'ms-vscode.atom-keybindings', isKeymap: true }, +]; + +interface Strings { + installEvent: string; + installedEvent: string; + + alreadyInstalled: string; + reloadAfterInstall: string; + installing: string; + extensionNotFound: string; +} + +const extensionPackStrings: Strings = { + installEvent: 'installExtension', + installedEvent: 'installedExtension', + + alreadyInstalled: localize('welcomePage.extensionPackAlreadyInstalled', "Support for {0} is already installed."), + reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingExtensionPack', "The window will reload after installing support for {0}."), + installing: localize('welcomePage.installingExtensionPack', "Installing support for {0}..."), + extensionNotFound: localize('welcomePage.extensionPackNotFound', "Support for {0} with id {1} could not be found."), +}; + +const keymapStrings: Strings = { + installEvent: 'installKeymap', + installedEvent: 'installedKeymap', + + alreadyInstalled: localize('welcomePage.keymapAlreadyInstalled', "The {0} keyboard shortcuts are already installed."), + reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingKeymap', "The window will reload after installing the {0} keyboard shortcuts."), + installing: localize('welcomePage.installingKeymap', "Installing the {0} keyboard shortcuts..."), + extensionNotFound: localize('welcomePage.keymapNotFound', "The {0} keyboard shortcuts with id {1} could not be found."), +}; + class WelcomePage { private disposables: IDisposable[] = []; @@ -140,6 +169,7 @@ class WelcomePage { @IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService, @IExtensionGalleryService private extensionGalleryService: IExtensionGalleryService, @IExtensionManagementService private extensionManagementService: IExtensionManagementService, + @IExtensionTipsService private tipsService: IExtensionTipsService, @ILifecycleService lifecycleService: ILifecycleService, @IThemeService private themeService: IThemeService, @ITelemetryService private telemetryService: ITelemetryService @@ -150,26 +180,25 @@ class WelcomePage { private create() { const recentlyOpened = this.windowService.getRecentlyOpen(); - const installedKeymaps = this.instantiationService.invokeFunction(getInstalledKeymaps); + const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions); const uri = URI.parse(require.toUrl('./vs_code_welcome_page')) .with({ scheme: Schemas.walkThrough, query: JSON.stringify({ moduleId: 'vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page' }) }); - const input = this.instantiationService.createInstance(WalkThroughInput, localize('welcome.title', "Welcome"), '', uri, telemetryFrom, container => this.onReady(container, recentlyOpened, installedKeymaps)); + const input = this.instantiationService.createInstance(WalkThroughInput, localize('welcome.title', "Welcome"), '', uri, telemetryFrom, container => this.onReady(container, recentlyOpened, installedExtensions)); this.editorService.openEditor(input, { pinned: true }, Position.ONE) .then(null, onUnexpectedError); } - private onReady(container: HTMLElement, recentlyOpened: TPromise<{ files: string[]; folders: string[]; }>, installedKeymaps: TPromise): void { + private onReady(container: HTMLElement, recentlyOpened: TPromise<{ files: string[]; folders: string[]; }>, installedExtensions: TPromise): void { const enabled = this.configurationService.lookup(enabledKey).value; const showOnStartup = container.querySelector('#showOnStartup'); if (enabled) { showOnStartup.setAttribute('checked', 'checked'); } showOnStartup.addEventListener('click', e => { - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: enabledKey, value: showOnStartup.checked }) - .then(null, error => this.messageService.show(Severity.Error, error)); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: enabledKey, value: showOnStartup.checked }); }); recentlyOpened.then(({ folders }) => { @@ -183,6 +212,7 @@ class WelcomePage { return; } const ul = container.querySelector('.recent ul'); + const before = ul.firstElementChild; folders.slice(0, 5).forEach(folder => { const li = document.createElement('li'); @@ -210,49 +240,75 @@ class WelcomePage { const span = document.createElement('span'); span.classList.add('path'); + span.classList.add('detail'); span.innerText = tildify(parentFolder, this.environmentService.userHome); span.title = folder; li.appendChild(span); - ul.appendChild(li); + ul.insertBefore(li, before); }); }).then(null, onUnexpectedError); - if (this.telemetryService.getExperiments().reorderQuickLinks) { + const customize = container.querySelector('.commands .section.customize'); + const learn = container.querySelector('.commands .section.learn'); + const quickLinks = container.querySelector('.commands .section.quickLinks'); + if (this.telemetryService.getExperiments().mergeQuickLinks) { + const ul = quickLinks.querySelector('ul'); reorderedQuickLinks.forEach(clazz => { const link = container.querySelector(`.commands .${clazz}`); if (link) { - link.parentElement.appendChild(link); + ul.appendChild(link); } }); + customize.remove(); + learn.remove(); + container.querySelector('.keybindingsReferenceLink').remove(); + } else { + quickLinks.remove(); } - container.addEventListener('click', event => { - for (let node = event.target as HTMLElement; node; node = node.parentNode as HTMLElement) { - if (node instanceof HTMLAnchorElement && node.classList.contains('installKeymap')) { - const keymapName = node.getAttribute('data-keymap-name'); - const keymapIdentifier = node.getAttribute('data-keymap'); - if (keymapName && keymapIdentifier) { - this.installKeymap(keymapName, keymapIdentifier); - event.preventDefault(); - event.stopPropagation(); - } - } - } - }); + this.addExtensionList(container, '.extensionPackList', extensionPacks, extensionPackStrings); + this.addExtensionList(container, '.keymapList', keymapExtensions, keymapStrings); - this.updateInstalledKeymaps(container, installedKeymaps); - this.disposables.push(this.instantiationService.invokeFunction(onKeymapExtensionChanged)(ids => { + this.updateInstalledExtensions(container, installedExtensions); + this.disposables.push(this.instantiationService.invokeFunction(onExtensionChanged)(ids => { for (const id of ids) { - if (container.querySelector(`.installKeymap[data-keymap="${id}"], .currentKeymap[data-keymap="${id}"]`)) { - const installedKeymaps = this.instantiationService.invokeFunction(getInstalledKeymaps); - this.updateInstalledKeymaps(container, installedKeymaps); + if (container.querySelector(`.installExtension[data-extension="${id}"], .enabledExtension[data-extension="${id}"]`)) { + const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions); + this.updateInstalledExtensions(container, installedExtensions); break; } }; })); + } - this.disposables.push(new WelcomeTheming(this.themeService, container)); + private addExtensionList(container: HTMLElement, listSelector: string, suggestions: ExtensionSuggestion[], strings: Strings) { + const list = container.querySelector(listSelector); + if (list) { + suggestions.forEach((extension, i) => { + if (i) { + list.appendChild(document.createTextNode(localize('welcomePage.extensionListSeparator', ", "))); + } + + const a = document.createElement('a'); + a.innerText = extension.name; + a.classList.add('installExtension'); + a.setAttribute('data-extension', extension.id); + a.href = 'javascript:void(0)'; + a.addEventListener('click', e => { + this.installExtension(extension, strings); + e.preventDefault(); + e.stopPropagation(); + }); + list.appendChild(a); + + const span = document.createElement('span'); + span.innerText = localize('welcomePage.installedExtension', "{0} (installed)", extension.name); + span.classList.add('enabledExtension'); + span.setAttribute('data-extension', extension.id); + list.appendChild(span); + }); + } } private pathEquals(path1: string, path2: string): boolean { @@ -264,23 +320,23 @@ class WelcomePage { return path1 === path2; } - private installKeymap(keymapName: string, keymapIdentifier: string): void { - this.telemetryService.publicLog('installKeymap', { + private installExtension(extensionSuggestion: ExtensionSuggestion, strings: Strings): void { + this.telemetryService.publicLog(strings.installEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, }); - this.instantiationService.invokeFunction(getInstalledKeymaps).then(extensions => { - const keymap = arrays.first(extensions, extension => extension.identifier === keymapIdentifier); - if (keymap && keymap.globallyEnabled) { - this.telemetryService.publicLog('installedKeymap', { + this.instantiationService.invokeFunction(getInstalledExtensions).then(extensions => { + const installedExtension = arrays.first(extensions, extension => extension.identifier === extensionSuggestion.id); + if (installedExtension && installedExtension.globallyEnabled) { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, outcome: 'already_enabled', }); - this.messageService.show(Severity.Info, localize('welcomePage.keymapAlreadyInstalled', "The {0} keyboard shortcuts are already installed.", keymapName)); + this.messageService.show(Severity.Info, strings.alreadyInstalled.replace('{0}', extensionSuggestion.name)); return; } - const foundAndInstalled = keymap ? TPromise.as(true) : this.extensionGalleryService.query({ names: [keymapIdentifier] }) + const foundAndInstalled = installedExtension ? TPromise.as(true) : this.extensionGalleryService.query({ names: [extensionSuggestion.id] }) .then(result => { const [extension] = result.firstPage; if (!extension) { @@ -289,52 +345,52 @@ class WelcomePage { return this.extensionManagementService.installFromGallery(extension) .then(() => { // TODO: Do this as part of the install to avoid multiple events. - return this.extensionEnablementService.setEnablement(keymapIdentifier, false); + return this.extensionEnablementService.setEnablement(extensionSuggestion.id, false); }).then(() => { return true; }); }); this.messageService.show(Severity.Info, { - message: localize('welcomePage.willReloadAfterInstallingKeymap', "The window will reload after installing the {0} keyboard shortcuts.", keymapName), + message: strings.reloadAfterInstall.replace('{0}', extensionSuggestion.name), actions: [ new Action('ok', localize('ok', "OK"), null, true, () => { const messageDelay = TPromise.timeout(300); messageDelay.then(() => { this.messageService.show(Severity.Info, { - message: localize('welcomePage.installingKeymap', "Installing the {0} keyboard shortcuts...", keymapName), + message: strings.installing.replace('{0}', extensionSuggestion.name), actions: [CloseAction] }); }); - TPromise.join(extensions.filter(extension => extension.globallyEnabled) + TPromise.join(extensionSuggestion.isKeymap ? extensions.filter(extension => isKeymapExtension(this.tipsService, extension) && extension.globallyEnabled) .map(extension => { return this.extensionEnablementService.setEnablement(extension.identifier, false); - })).then(() => { + }) : []).then(() => { return foundAndInstalled.then(found => { messageDelay.cancel(); if (found) { - return this.extensionEnablementService.setEnablement(keymapIdentifier, true) + return this.extensionEnablementService.setEnablement(extensionSuggestion.id, true) .then(() => { - this.telemetryService.publicLog('installedKeymap', { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, - outcome: keymap ? 'enabled' : 'installed', + extensionId: extensionSuggestion.id, + outcome: installedExtension ? 'enabled' : 'installed', }); return this.windowService.reloadWindow(); }); } else { - this.telemetryService.publicLog('installedKeymap', { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, outcome: 'not_found', }); - this.messageService.show(Severity.Error, localize('welcomePage.keymapNotFound', "The {0} keyboard shortcuts with id {1} could not be found.", keymapName, keymapIdentifier)); + this.messageService.show(Severity.Error, strings.extensionNotFound.replace('{0}', extensionSuggestion.name).replace('{1}', extensionSuggestion.id)); return undefined; } }); }).then(null, err => { - this.telemetryService.publicLog('installedKeymap', { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, outcome: isPromiseCanceledError(err) ? 'canceled' : 'error', error: String(err), }); @@ -343,9 +399,9 @@ class WelcomePage { return TPromise.as(true); }), new Action('cancel', localize('cancel', "Cancel"), null, true, () => { - this.telemetryService.publicLog('installedKeymap', { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, outcome: 'user_canceled', }); return TPromise.as(true); @@ -353,9 +409,9 @@ class WelcomePage { ] }); }).then(null, err => { - this.telemetryService.publicLog('installedKeymap', { + this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, - extensionId: keymapIdentifier, + extensionId: extensionSuggestion.id, outcome: isPromiseCanceledError(err) ? 'canceled' : 'error', error: String(err), }); @@ -363,22 +419,22 @@ class WelcomePage { }); } - private updateInstalledKeymaps(container: HTMLElement, installedKeymaps: TPromise) { - installedKeymaps.then(extensions => { - const elements = container.querySelectorAll('.installKeymap, .currentKeymap'); + private updateInstalledExtensions(container: HTMLElement, installedExtensions: TPromise) { + installedExtensions.then(extensions => { + const elements = container.querySelectorAll('.installExtension, .enabledExtension'); for (let i = 0; i < elements.length; i++) { elements[i].classList.remove('installed'); } extensions.filter(ext => ext.globallyEnabled) .map(ext => ext.identifier) .forEach(id => { - const install = container.querySelector(`.installKeymap[data-keymap="${id}"]`); - if (install) { - install.classList.add('installed'); + const install = container.querySelectorAll(`.installExtension[data-extension="${id}"]`); + for (let i = 0; i < install.length; i++) { + install[i].classList.add('installed'); } - const current = container.querySelector(`.currentKeymap[data-keymap="${id}"]`); - if (current) { - current.classList.add('installed'); + const enabled = container.querySelectorAll(`.enabledExtension[data-extension="${id}"]`); + for (let i = 0; i < enabled.length; i++) { + enabled[i].classList.add('installed'); } }); }).then(null, onUnexpectedError); @@ -388,3 +444,42 @@ class WelcomePage { this.disposables = dispose(this.disposables); } } + +// theming + +const caption = registerColor('welcomePage.caption', { dark: '#FFFFFFC2', light: '#000000D4', hc: foreground }, localize('welcomePage.caption', 'Caption color on the Welcome page.')); +const detail = registerColor('welcomePage.detail', { dark: '#FFFFFF76', light: '#00000088', hc: foreground }, localize('welcomePage.detail', 'Detail color on the Welcome page.')); + +const quickLinkBackground = registerColor('welcomePage.quickLinkBackground', { dark: null, light: null, hc: null }, localize('welcomePage.quickLinkBackground', 'Background color for the quick links on the Welcome page.')); +const quickLinkHoverBackground = registerColor('welcomePage.quickLinkHoverBackground', { dark: null, light: null, hc: null }, localize('welcomePage.quickLinkHoverBackground', 'Hover background color for the quick links on the Welcome page.')); + +registerThemingParticipant((theme, collector) => { + const captionColor = theme.getColor(caption); + if (captionColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .caption { color: ${captionColor}; }`); + } + const detailColor = theme.getColor(detail); + if (detailColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .detail { color: ${detailColor}; }`); + } + const color = getExtraColor(theme, quickLinkBackground, { dark: 'rgba(0, 0, 0, .2)', extra_dark: 'rgba(200, 235, 255, .042)', light: 'rgba(0,0,0,.04)', hc: 'black' }); + if (color) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button { background: ${color}; }`); + } + const hover = getExtraColor(theme, quickLinkHoverBackground, { dark: 'rgba(200, 235, 255, .072)', extra_dark: 'rgba(200, 235, 255, .072)', light: 'rgba(0,0,0,.10)', hc: null }); + if (hover) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { background: ${hover}; }`); + } + const link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage a { color: ${link}; }`); + } + const border = theme.getColor(contrastBorder); + if (border) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button { border-color: ${border}; }`); + } + const activeBorder = theme.getColor(activeContrastBorder); + if (activeBorder) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { outline-color: ${activeBorder}; }`); + } +}); diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md index b311703b479..6dedb7d9978 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md @@ -157,7 +157,7 @@ ul>li.item$*5 ## Thanks! Well if you have got this far then you will have touched on some of the editing features in Visual Studio Code. But don't stop now :) We have lots of additional [documentation](https://code.visualstudio.com/docs) and [introductory videos](https://code.visualstudio.com/docs/getstarted/introvideos) for the product that will help you learn how to use it. And while you are here, here are a few additional things you can try: - Open the Integrated Terminal by pressing kb(workbench.action.terminal.toggleTerminal) then see what's possible by [reviewing the terminal documentation](https://code.visualstudio.com/docs/editor/integrated-terminal) -- Work with version control by pressing kb(workbench.view.git)kb(workbench.view.scm) understand how to stage, commit, change branches, and view diffs and more by reviewing the [version control documentation](https://code.visualstudio.com/docs/editor/versioncontrol) +- Work with version control by pressing kb(workbench.view.scm) understand how to stage, commit, change branches, and view diffs and more by reviewing the [version control documentation](https://code.visualstudio.com/docs/editor/versioncontrol) - Browse thousands of extensions in our integrated gallery by pressing with kb(workbench.view.extensions) the [documentation](https://code.visualstudio.com/docs/editor/extension-gallery) will show you how to see the most popular extensions, disable installed ones and more. OK that's all for now, diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css index 26e474a7ba9..305fece6c6b 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css @@ -17,7 +17,6 @@ } .monaco-workbench > .part.editor > .content .walkThroughContent a { - color: #4080D0; text-decoration: none; } @@ -69,7 +68,6 @@ } .monaco-workbench > .part.editor > .content .walkThroughContent a:hover { - color: #4080D0; text-decoration: underline; } @@ -106,36 +104,11 @@ line-height: 19px; } -/*.monaco-workbench.mac > .part.editor > .content .walkThroughContent code, -.monaco-workbench.mac > .part.editor > .content .walkThroughContent .shortcut { - font-size: 12px; - line-height: 18px; -}*/ - -.vs .monaco-workbench > .part.editor > .content .walkThroughContent code, -.vs .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { - color: #A31515; -} - -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent code, -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { - color: #D7BA7D; -} - .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { margin: 0 7px 0 5px; padding: 0 16px 0 10px; border-left: 5px solid; } -.vs .monaco-workbench > .part.editor > .content .walkThroughContent blockquote, -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { - background: rgba(127, 127, 127, 0.1); - border-color: rgba(0, 122, 204, 0.5); -} -.hc-black .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { - background: transparent; - border-color: #fff; -} .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-tokenized-source { white-space: pre; @@ -161,26 +134,7 @@ display: initial; } -.monaco-workbench > .part.editor > .content .walkThroughContent .scm-only { - display: none; -} -.monaco-workbench > .part.editor > .content .walkThroughContent.scmEnabled .scm-only { - display: initial; -} -.monaco-workbench > .part.editor > .content .walkThroughContent.scmEnabled .git-only { - display: none; -} - -.vs .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background, -.vs .monaco-workbench > .part.editor > .content .walkThroughContent .glyph-margin { - background-color: #eee; -} - -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background, -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent .glyph-margin { - background-color: #111; -} - .hc-black .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor { - border: 1px white solid + border-width: 1px; + border-style: solid; } diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts index 1acc0111dd9..f22fa7e0702 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts @@ -11,14 +11,12 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import * as strings from 'vs/base/common/strings'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { DefaultConfig } from 'vs/editor/common/config/defaultConfig'; import { $, Dimension, Builder } from 'vs/base/browser/builder'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { EditorOptions } from 'vs/workbench/common/editor'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { marked } from 'vs/base/common/marked/marked'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -33,13 +31,15 @@ import { Scope } from 'vs/workbench/common/memento'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { once } from 'vs/base/common/event'; -import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; import { isObject } from 'vs/base/common/types'; import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; -import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; +import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; +import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { registerColor, textLinkForeground, textPreformatForeground, contrastBorder, textBlockQuoteBackground, textBlockQuoteBorder } from 'vs/platform/theme/common/colorRegistry'; +import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; export const WALK_THROUGH_FOCUS = new RawContextKey('interactivePlaygroundFocus', false); @@ -70,9 +70,10 @@ class WalkThroughCodeEditor extends CodeEditor { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IContextKeyService contextKeyService: IContextKeyService + @IContextKeyService contextKeyService: IContextKeyService, + @IThemeService themeService: IThemeService ) { - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, themeService); } getTelemetryData() { @@ -94,7 +95,7 @@ export class WalkThroughPart extends BaseEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService, - @IWorkbenchThemeService protected themeService: IWorkbenchThemeService, + @IThemeService protected themeService: IThemeService, @IOpenerService private openerService: IOpenerService, @IFileService private fileService: IFileService, @IModelService protected modelService: IModelService, @@ -307,8 +308,8 @@ export class WalkThroughPart extends BaseEditor { if (!strings.endsWith(input.getResource().path, '.md')) { this.content.innerHTML = content; this.updateSizeClasses(); - this.updateMarkerClasses(); this.decorateContent(); + this.contentDisposables.push(this.keybindingService.onDidUpdateKeybindings(() => this.decorateContent())); if (input.onReady) { input.onReady(this.content.firstElementChild as HTMLElement); } @@ -328,8 +329,6 @@ export class WalkThroughPart extends BaseEditor { innerContent.classList.add('walkThroughContent'); // only for markdown files const markdown = this.expandMacros(content); innerContent.innerHTML = marked(markdown, { renderer }); - this.style(innerContent); - this.contentDisposables.push(this.themeService.onDidColorThemeChange(() => this.style(innerContent))); this.content.appendChild(innerContent); model.snippets.forEach((snippet, i) => { @@ -378,8 +377,11 @@ export class WalkThroughPart extends BaseEditor { } })); - this.contentDisposables.push(this.themeService.onDidColorThemeChange(theme => editor.updateOptions({ theme: theme.id }))); // TODO@theme this should be done from the editor itself and not from the outside - this.contentDisposables.push(this.configurationService.onDidUpdateConfiguration(() => editor.updateOptions(this.getEditorOptions(snippet.textEditorModel.getModeId())))); + this.contentDisposables.push(this.configurationService.onDidUpdateConfiguration(() => { + if (snippet.textEditorModel) { + editor.updateOptions(this.getEditorOptions(snippet.textEditorModel.getModeId())); + } + })); this.contentDisposables.push(once(editor.onMouseDown)(() => { this.telemetryService.publicLog('walkThroughSnippetInteraction', { @@ -404,7 +406,6 @@ export class WalkThroughPart extends BaseEditor { })); }); this.updateSizeClasses(); - this.updateMarkerClasses(); if (input.onReady) { input.onReady(innerContent); } @@ -419,32 +420,20 @@ export class WalkThroughPart extends BaseEditor { return { ...isObject(config) ? config : Object.create(null), scrollBeyondLastLine: false, - scrollbar: DefaultConfig.editor.scrollbar, + scrollbar: { + verticalScrollbarSize: 14, + horizontal: 'auto', + useShadows: true, + verticalHasArrows: false, + horizontalHasArrows: false + }, overviewRulerLanes: 3, fixedOverflowWidgets: true, lineNumbersMinChars: 1, - theme: this.themeService.getColorTheme().id, minimap: false, }; } - private updateMarkerClasses() { - const innerContent = this.content.firstElementChild; - if (SCMPreview.enabled && innerContent) { - innerContent.classList.add('scmEnabled'); - } - } - - private style(div: HTMLElement) { - const styleElement = this.partService.getContainer(Parts.EDITOR_PART); // TODO@theme styles should come in via theme registry - const { color, backgroundColor, fontFamily, fontWeight, fontSize } = window.getComputedStyle(styleElement); - div.style.color = color; - div.style.backgroundColor = backgroundColor; - div.style.fontFamily = fontFamily; - div.style.fontWeight = fontWeight; - div.style.fontSize = fontSize; - } - private expandMacros(input: string) { return input.replace(/kb\(([a-z.\d\-]+)\)/gi, (match: string, kb: string) => { const keybinding = this.keybindingService.lookupKeybinding(kb); @@ -459,9 +448,19 @@ export class WalkThroughPart extends BaseEditor { const command = key.getAttribute('data-command'); const keybinding = command && this.keybindingService.lookupKeybinding(command); const label = keybinding ? keybinding.getLabel() : UNBOUND_COMMAND; + while (key.firstChild) { + key.removeChild(key.firstChild); + } key.appendChild(document.createTextNode(label)); }); + const ifkeys = this.content.querySelectorAll('.if_shortcut[data-command]'); + Array.prototype.forEach.call(ifkeys, (key: HTMLElement) => { + const command = key.getAttribute('data-command'); + const keybinding = command && this.keybindingService.lookupKeybinding(command); + key.style.display = !keybinding ? 'none' : ''; + }); } + private saveTextEditorViewState(resource: URI): void { const memento = this.getMemento(this.storageService, Scope.WORKSPACE); let editorViewStateMemento = memento[WALK_THROUGH_EDITOR_VIEW_STATE_PREFERENCE_KEY]; @@ -524,3 +523,36 @@ export class WalkThroughPart extends BaseEditor { super.dispose(); } } + +// theming + +const embeddedEditorBackground = registerColor('walkThrough.embeddedEditorBackground', { dark: null, light: null, hc: null }, localize('walkThrough.embeddedEditorBackground', 'Background color for the embedded editors on the Interactive Playground.')); + +registerThemingParticipant((theme, collector) => { + const color = getExtraColor(theme, embeddedEditorBackground, { dark: 'rgba(0, 0, 0, .4)', extra_dark: 'rgba(200, 235, 255, .064)', light: 'rgba(0,0,0,.08)', hc: null }); + if (color) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background, + .monaco-workbench > .part.editor > .content .walkThroughContent .margin-view-overlays { background: ${color}; }`); + } + const link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent a { color: ${link}; }`); + } + const shortcut = theme.getColor(textPreformatForeground); + if (shortcut) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent code, + .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { color: ${shortcut}; }`); + } + const border = theme.getColor(contrastBorder); + if (border) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor { border-color: ${border}; }`); + } + const quoteBackground = theme.getColor(textBlockQuoteBackground); + if (quoteBackground) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent blockquote { background: ${quoteBackground}; }`); + } + const quoteBorder = theme.getColor(textBlockQuoteBorder); + if (quoteBorder) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent blockquote { border-color: ${quoteBorder}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts new file mode 100644 index 00000000000..00d03ceace0 --- /dev/null +++ b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { ITheme } from 'vs/platform/theme/common/themeService'; +import { editorBackground, ColorDefaults, ColorValue } from 'vs/platform/theme/common/colorRegistry'; + +export function getExtraColor(theme: ITheme, colorId: string, defaults: ColorDefaults & { extra_dark: string }): ColorValue { + const color = theme.getColor(colorId); + if (color) { + return color; + } + + if (theme.type === 'dark') { + const background = theme.getColor(editorBackground); + if (background && background.getLuminosity() < 0.004) { + return defaults.extra_dark; + } + } + + return defaults[theme.type]; +} \ No newline at end of file diff --git a/src/vs/workbench/services/activity/common/activityBarService.ts b/src/vs/workbench/services/activity/common/activityBarService.ts index 810b062b63f..5c5b18a2105 100644 --- a/src/vs/workbench/services/activity/common/activityBarService.ts +++ b/src/vs/workbench/services/activity/common/activityBarService.ts @@ -63,6 +63,11 @@ export const IActivityBarService = createDecorator('activit export interface IActivityBarService { _serviceBrand: any; + /** + * Show activity in the activitybar for the given global activity. + */ + showGlobalActivity(globalActivityId: string, badge: IBadge): IDisposable; + /** * Show activity in the activitybar for the given viewlet. */ diff --git a/src/vs/workbench/services/configuration/common/configurationEditing.ts b/src/vs/workbench/services/configuration/common/configurationEditing.ts index 0ba753cef21..d687ee387a3 100644 --- a/src/vs/workbench/services/configuration/common/configurationEditing.ts +++ b/src/vs/workbench/services/configuration/common/configurationEditing.ts @@ -61,6 +61,17 @@ export interface IConfigurationValue { overrideIdentifier?: string; } +export interface IConfigurationEditingOptions { + /** + * If `true`, do not saves the configuration. Default is `false`. + */ + donotSave?: boolean; + /** + * If `true`, do not notifies the error to user by showing the message box. Default is `false`. + */ + donotNotifyError?: boolean; +} + export interface IConfigurationEditingService { _serviceBrand: ServiceIdentifier; @@ -69,5 +80,5 @@ export interface IConfigurationEditingService { * Allows to write the configuration value to either the user or workspace configuration file and save it if asked to save. * The returned promise will be in error state in any of the error cases from [ConfigurationEditingErrorCode](#ConfigurationEditingErrorCode) */ - writeConfiguration(target: ConfigurationTarget, value: IConfigurationValue, save?: boolean): TPromise; + writeConfiguration(target: ConfigurationTarget, value: IConfigurationValue, options?: IConfigurationEditingOptions): TPromise; } \ No newline at end of file diff --git a/src/vs/workbench/services/configuration/node/configurationEditingService.ts b/src/vs/workbench/services/configuration/node/configurationEditingService.ts index 758951c5535..a2ace0b1b2c 100644 --- a/src/vs/workbench/services/configuration/node/configurationEditingService.ts +++ b/src/vs/workbench/services/configuration/node/configurationEditingService.ts @@ -26,9 +26,11 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { keyFromOverrideIdentifier } from 'vs/platform/configuration/common/model'; import { WORKSPACE_CONFIG_DEFAULT_PATH, WORKSPACE_STANDALONE_CONFIGURATIONS } from 'vs/workbench/services/configuration/common/configuration'; import { IFileService } from 'vs/platform/files/common/files'; -import { IConfigurationEditingService, ConfigurationEditingErrorCode, IConfigurationEditingError, ConfigurationTarget, IConfigurationValue } from 'vs/workbench/services/configuration/common/configurationEditing'; +import { IConfigurationEditingService, ConfigurationEditingErrorCode, IConfigurationEditingError, ConfigurationTarget, IConfigurationValue, IConfigurationEditingOptions } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { OVERRIDE_PROPERTY_PATTERN } from 'vs/platform/configuration/common/configurationRegistry'; +import { IChoiceService, IMessageService, Severity } from 'vs/platform/message/common/message'; +import { ICommandService } from 'vs/platform/commands/common/commands'; interface IConfigurationEditOperation extends IConfigurationValue { resource: URI; @@ -40,6 +42,10 @@ interface IValidationResult { exists?: boolean; } +interface ConfigurationEditingOptions extends IConfigurationEditingOptions { + force?: boolean; +} + export class ConfigurationEditingService implements IConfigurationEditingService { public _serviceBrand: any; @@ -52,21 +58,29 @@ export class ConfigurationEditingService implements IConfigurationEditingService @IEnvironmentService private environmentService: IEnvironmentService, @IFileService private fileService: IFileService, @ITextModelResolverService private textModelResolverService: ITextModelResolverService, - @ITextFileService private textFileService: ITextFileService + @ITextFileService private textFileService: ITextFileService, + @IChoiceService private choiceService: IChoiceService, + @IMessageService private messageService: IMessageService, + @ICommandService private commandService: ICommandService ) { this.queue = new Queue(); } - writeConfiguration(target: ConfigurationTarget, value: IConfigurationValue, save: boolean = true): TPromise { - return this.queue.queue(() => this.doWriteConfiguration(target, value, save)); // queue up writes to prevent race conditions + writeConfiguration(target: ConfigurationTarget, value: IConfigurationValue, options: IConfigurationEditingOptions = {}): TPromise { + return this.queue.queue(() => this.doWriteConfiguration(target, value, options) // queue up writes to prevent race conditions + .then(() => null, + error => { + return options.donotNotifyError ? TPromise.wrapError(error) : this.onError(error, target, value); + })); } - private doWriteConfiguration(target: ConfigurationTarget, value: IConfigurationValue, save: boolean): TPromise { + private doWriteConfiguration(target: ConfigurationTarget, value: IConfigurationValue, options: ConfigurationEditingOptions): TPromise { const operation = this.getConfigurationEditOperation(target, value); - return this.resolveAndValidate(target, operation, save) - .then(reference => this.writeToBuffer(reference.object.textEditorModel, operation, save) - .then(() => reference.dispose())); + const checkDirtyConfiguration = !(options.force || options.donotSave); + const saveConfiguration = options.force || !options.donotSave; + return this.resolveAndValidate(target, operation, checkDirtyConfiguration) + .then(reference => this.writeToBuffer(reference.object.textEditorModel, operation, saveConfiguration)); } private writeToBuffer(model: editorCommon.IModel, operation: IConfigurationEditOperation, save: boolean): TPromise { @@ -92,6 +106,48 @@ export class ConfigurationEditingService implements IConfigurationEditingService return false; } + private onError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue): TPromise { + switch (error.code) { + case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: + this.onInvalidConfigurationError(error, target); + break; + case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: + this.onConfigurationFileDirtyError(error, target, value); + break; + default: + this.messageService.show(Severity.Error, error.message); + } + return TPromise.wrapError(error); + } + + private onInvalidConfigurationError(error: IConfigurationEditingError, target: ConfigurationTarget): void { + this.choiceService.choose(Severity.Error, error.message, [nls.localize('open', "Open Settings"), nls.localize('close', "Close")], 1) + .then(option => { + switch (option) { + case 0: + this.openSettings(target); + } + }); + } + + private onConfigurationFileDirtyError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue): void { + this.choiceService.choose(Severity.Error, error.message, [nls.localize('saveAndRetry', "Save Settings and Retry"), nls.localize('open', "Open Settings"), nls.localize('close', "Close")], 2) + .then(option => { + switch (option) { + case 0: + this.writeConfiguration(target, value, { force: true }); + break; + case 1: + this.openSettings(target); + break; + } + }); + } + + private openSettings(target: ConfigurationTarget): void { + this.commandService.executeCommand(ConfigurationTarget.USER === target ? 'workbench.action.openGlobalSettings' : 'workbench.action.openWorkspaceSettings'); + } + private wrapError(code: ConfigurationEditingErrorCode, target: ConfigurationTarget): TPromise { const message = this.toErrorMessage(code, target); @@ -110,20 +166,20 @@ export class ConfigurationEditingService implements IConfigurationEditingService case ConfigurationEditingErrorCode.ERROR_INVALID_TARGET: return nls.localize('errorInvalidTarget', "Unable to write to the configuration file (Invalid Target)"); // User issues - case ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED: return nls.localize('errorNoWorkspaceOpened', "Unable to write settings because no folder is opened. Please open a folder first and try again."); + case ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED: return nls.localize('errorNoWorkspaceOpened', "Unable to write into settings because no folder is opened. Please open a folder first and try again."); case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: { if (target === ConfigurationTarget.USER) { - return nls.localize('errorInvalidConfiguration', "Unable to write settings. Please open **User Settings** to correct errors/warnings in the file and try again."); + return nls.localize('errorInvalidConfiguration', "Unable to write into settings. Please open **User Settings** to correct errors/warnings in the file and try again."); } - return nls.localize('errorInvalidConfigurationWorkspace', "Unable to write settings. Please open **Workspace Settings** to correct errors/warnings in the file and try again."); + return nls.localize('errorInvalidConfigurationWorkspace', "Unable to write into settings. Please open **Workspace Settings** to correct errors/warnings in the file and try again."); }; case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: { if (target === ConfigurationTarget.USER) { - return nls.localize('errorConfigurationFileDirty', "Unable to write settings because the file is dirty. Please save the **User Settings** file and try again."); + return nls.localize('errorConfigurationFileDirty', "Unable to write into settings because the file is dirty. Please save the **User Settings** file and try again."); } - return nls.localize('errorConfigurationFileDirtyWorkspace', "Unable to write settings because the file is dirty. Please save the **Workspace Settings** file and try again."); + return nls.localize('errorConfigurationFileDirtyWorkspace', "Unable to write into settings because the file is dirty. Please save the **Workspace Settings** file and try again."); }; } } @@ -165,7 +221,7 @@ export class ConfigurationEditingService implements IConfigurationEditingService return parseErrors.length > 0; } - private resolveAndValidate(target: ConfigurationTarget, operation: IConfigurationEditOperation, save: boolean): TPromise> { + private resolveAndValidate(target: ConfigurationTarget, operation: IConfigurationEditOperation, checkDirty: boolean): TPromise> { // Any key must be a known setting from the registry (unless this is a standalone config) if (!operation.isWorkspaceStandalone) { @@ -185,18 +241,18 @@ export class ConfigurationEditingService implements IConfigurationEditingService return this.wrapError(ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED, target); } - // Target cannot be dirty if not writing into buffer - const resource = operation.resource; - if (save && this.textFileService.isDirty(resource)) { - return this.wrapError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY, target); - } - return this.resolveModelReference(operation.resource) .then(reference => { const model = reference.object.textEditorModel; + if (this.hasParseErrors(model, operation)) { return this.wrapError(ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION, target); } + + // Target cannot be dirty if not writing into buffer + if (checkDirty && this.textFileService.isDirty(operation.resource)) { + return this.wrapError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY, target); + } return reference; }); } diff --git a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts index 8e0131f17a4..a444ccfb9cf 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -5,6 +5,7 @@ 'use strict'; +import * as sinon from 'sinon'; import assert = require('assert'); import os = require('os'); import path = require('path'); @@ -42,7 +43,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; - +import { IChoiceService, IMessageService } from 'vs/platform/message/common/message'; class SettingsTestEnvironmentService extends EnvironmentService { @@ -55,12 +56,13 @@ class SettingsTestEnvironmentService extends EnvironmentService { suite('ConfigurationEditingService', () => { - let instantiationService; + let instantiationService: TestInstantiationService; let testObject: ConfigurationEditingService; let parentDir; let workspaceDir; let globalSettingsFile; let workspaceSettingsDir; + let choiceService; suiteSetup(() => { const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); @@ -126,6 +128,14 @@ suite('ConfigurationEditingService', () => { instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); instantiationService.stub(ITextModelResolverService, instantiationService.createInstance(TextModelResolverService)); instantiationService.stub(IBackupFileService, new TestBackupFileService()); + choiceService = instantiationService.stub(IChoiceService, { + choose: (severity, message, options, cancelId): TPromise => { + return TPromise.as(cancelId); + } + }); + instantiationService.stub(IMessageService, { + show: (severity, message, options, cancelId): void => { } + }); testObject = instantiationService.createInstance(ConfigurationEditingService); return configurationService.initialize(); @@ -189,6 +199,24 @@ suite('ConfigurationEditingService', () => { (error: IConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY)); }); + test('dirty error is not thrown if not asked to save', () => { + instantiationService.stub(ITextFileService, 'isDirty', true); + return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' }, { donotSave: true }) + .then(() => null, error => assert.fail('Should not fail.')); + }); + + test('do not notify error', () => { + instantiationService.stub(ITextFileService, 'isDirty', true); + const target = sinon.stub(); + instantiationService.stubPromise(IChoiceService, 'choose', target); + return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' }, { donotNotifyError: true }) + .then(() => assert.fail('Should fail with ERROR_CONFIGURATION_FILE_DIRTY error.'), + (error: IConfigurationEditingError) => { + assert.equal(false, target.calledOnce); + assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY); + }); + }); + test('write one setting - empty file', () => { return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' }) .then(() => { diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index e74e57c412a..3caa6312379 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -17,7 +17,6 @@ import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { toResource } from 'vs/workbench/common/editor'; -// TODO@Isidor remove support for env, config. and command. in march export class ConfigurationResolverService implements IConfigurationResolverService { _serviceBrand: any; private _workspaceRoot: string; @@ -34,7 +33,6 @@ export class ConfigurationResolverService implements IConfigurationResolverServi this._workspaceRoot = paths.normalize(workspaceRoot ? workspaceRoot.fsPath : '', true); this._execPath = environmentService.execPath; Object.keys(envVariables).forEach(key => { - this[`env.${key}`] = envVariables[key]; this[`env:${key}`] = envVariables[key]; }); } @@ -141,7 +139,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi if (types.isString(newValue)) { return newValue; } else { - return match && (match.indexOf('env.') > 0 || match.indexOf('env:') > 0) ? '' : match; + return match && match.indexOf('env:') > 0 ? '' : match; } }); @@ -176,7 +174,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } }; - return value.replace(/\$\{config\.(.+?)\}/g, replacer).replace(/\$\{config:(.+?)\}/g, replacer); + return value.replace(/\$\{config:(.+?)\}/g, replacer); } private resolveLiteral(values: IStringDictionary | string[]>): IStringDictionary | string[]> { @@ -223,7 +221,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi if (object[key] && typeof object[key] === 'object') { findInteractiveVariables(object[key]); } else if (typeof object[key] === 'string') { - const matches = /\${command[:\.](.+)}/.exec(object[key]); + const matches = /\${command:(.+)}/.exec(object[key]); if (matches && matches.length === 2) { const interactiveVariable = matches[1]; if (!interactiveVariablesToSubstitutes[interactiveVariable]) { @@ -251,8 +249,6 @@ export class ConfigurationResolverService implements IConfigurationResolverServi interactiveVariablesToSubstitutes[interactiveVariable].forEach(substitute => { if (substitute.object[substitute.key].indexOf(`\${command:${interactiveVariable}}`) >= 0) { substitute.object[substitute.key] = substitute.object[substitute.key].replace(`\${command:${interactiveVariable}}`, result); - } else if (substitute.object[substitute.key].indexOf(`\${command.${interactiveVariable}}`) >= 0) { - substitute.object[substitute.key] = substitute.object[substitute.key].replace(`\${command.${interactiveVariable}}`, result); } }); } else { diff --git a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts index 0815aae6e33..50e56ffac45 100644 --- a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts +++ b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts @@ -87,7 +87,7 @@ export class ContextMenuService implements IContextMenuService { } }; - const keybinding = !!delegate.getKeyBinding ? delegate.getKeyBinding(e) : undefined; + const keybinding = !!delegate.getKeyBinding ? delegate.getKeyBinding(e) : this.keybindingService.lookupKeybinding(e.id); if (keybinding) { const electronAccelerator = keybinding.getElectronAccelerator(); if (electronAccelerator) { diff --git a/src/vs/workbench/services/crashReporter/common/crashReporterService.ts b/src/vs/workbench/services/crashReporter/common/crashReporterService.ts new file mode 100644 index 00000000000..4ce3933901d --- /dev/null +++ b/src/vs/workbench/services/crashReporter/common/crashReporterService.ts @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 nls = require('vs/nls'); +import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; +import { Registry } from 'vs/platform/platform'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; + +export const ICrashReporterService = createDecorator('crashReporterService'); + +export const TELEMETRY_SECTION_ID = 'telemetry'; + +export interface ICrashReporterConfig { + enableCrashReporter: boolean; +} + +const configurationRegistry = Registry.as(Extensions.Configuration); +configurationRegistry.registerConfiguration({ + 'id': TELEMETRY_SECTION_ID, + 'order': 110, + title: nls.localize('telemetryConfigurationTitle', "Telemetry"), + 'type': 'object', + 'properties': { + 'telemetry.enableCrashReporter': { + 'type': 'boolean', + 'description': nls.localize('telemetry.enableCrashReporting', "Enable crash reports to be sent to Microsoft.\nThis option requires restart to take effect."), + 'default': true + } + } +}); + +export interface ICrashReporterService { + _serviceBrand: any; + getChildProcessStartOptions(processName: string): Electron.CrashReporterStartOptions; +} + +export const NullCrashReporterService: ICrashReporterService = { + _serviceBrand: undefined, + getChildProcessStartOptions(processName: string) { return undefined; } +}; \ No newline at end of file diff --git a/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts new file mode 100644 index 00000000000..58cca417c6b --- /dev/null +++ b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { onUnexpectedError } from 'vs/base/common/errors'; +import { assign, clone } from 'vs/base/common/objects'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { crashReporter } from 'electron'; +import product from 'vs/platform/node/product'; +import pkg from 'vs/platform/node/package'; +import * as os from 'os'; +import { ICrashReporterService, TELEMETRY_SECTION_ID, ICrashReporterConfig } from "vs/workbench/services/crashReporter/common/crashReporterService"; +import { isWindows, isMacintosh, isLinux } from "vs/base/common/platform"; + +export class CrashReporterService implements ICrashReporterService { + + public _serviceBrand: any; + + private options: Electron.CrashReporterStartOptions; + + constructor( + @ITelemetryService private telemetryService: ITelemetryService, + @IWindowsService private windowsService: IWindowsService, + @IConfigurationService configurationService: IConfigurationService + ) { + const config = configurationService.getConfiguration(TELEMETRY_SECTION_ID); + if (config.enableCrashReporter) { + this.startCrashReporter(); + } + } + + private startCrashReporter(): void { + + // base options + this.options = { + companyName: product.crashReporter.companyName, + productName: product.crashReporter.productName, + submitURL: this.getSubmitURL() + }; + + // mixin telemetry info and product info + this.telemetryService.getTelemetryInfo() + .then(info => { + assign(this.options, { + extra: { + vscode_sessionId: info.sessionId, + vscode_version: pkg.version, + vscode_commit: product.commit, + vscode_machineId: info.machineId + } + }); + + // start crash reporter right here + crashReporter.start(clone(this.options)); + + // start crash reporter in the main process + return this.windowsService.startCrashReporter(this.options); + }) + .done(null, onUnexpectedError); + } + + private getSubmitURL(): string { + let submitURL: string; + if (isWindows) { + submitURL = product.hockeyApp[`win32-${process.arch}`]; + } else if (isMacintosh) { + submitURL = product.hockeyApp.darwin; + } else if (isLinux) { + submitURL = product.hockeyApp[`linux-${process.arch}`]; + } + + return submitURL; + } + + public getChildProcessStartOptions(name: string): Electron.CrashReporterStartOptions { + + // Experimental attempt on Mac only for now + if (isMacintosh) { + const childProcessOptions = clone(this.options); + childProcessOptions.extra.processName = name; + childProcessOptions.crashesDirectory = os.tmpdir(); + return childProcessOptions; + } + + return void 0; + } +} \ No newline at end of file diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index edf16d9ec26..4dd5a44fe16 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -12,12 +12,11 @@ import { Position, Direction, IEditor } from 'vs/platform/editor/common/editor'; import URI from 'vs/base/common/uri'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, TextEditorOptions } from 'vs/workbench/common/editor'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; -import { StringEditorModel } from 'vs/workbench/common/editor/stringEditorModel'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { workbenchInstantiationService, TestThemeService } from 'vs/workbench/test/workbenchTestServices'; import { DelegatingWorkbenchEditorService, WorkbenchEditorService, IEditorPart } from 'vs/workbench/services/editor/browser/editorService'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; let activeEditor: BaseEditor = { getSelection: function () { @@ -176,20 +175,6 @@ suite('WorkbenchEditorService', () => { const untitledInput = openedEditorInput as UntitledEditorInput; assert.ok(untitledInput.hasAssociatedFilePath); }); - - // Resolve Editor Model (Typed EditorInput) - let input = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'hello world', 'text/plain', false); - input.resolve(true).then((model: StringEditorModel) => { - assert(model instanceof StringEditorModel); - - assert(model.isResolved()); - - input.resolve().then((otherModel) => { - assert(model === otherModel); - - input.dispose(); - }); - }); }); test('caching', function () { @@ -274,7 +259,7 @@ suite('WorkbenchEditorService', () => { } let ed = instantiationService.createInstance(MyEditor, 'my.editor'); - let inp = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'hello world', 'text/plain', false); + let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from('my://resource')); let delegate = instantiationService.createInstance(DelegatingWorkbenchEditorService); delegate.setEditorOpenHandler((input, options?) => { assert.strictEqual(input, inp); diff --git a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts index e5b47ec111d..63a17ea995d 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts @@ -35,7 +35,8 @@ export class ChokidarWatcherService implements IWatcherService { followSymlinks: true, // this is the default of chokidar and supports file events through symlinks ignored: request.ignored, interval: 1000, // while not used in normal cases, if any error causes chokidar to fallback to polling, increase its intervals - binaryInterval: 1000 + binaryInterval: 1000, + disableGlobbing: true // fix https://github.com/Microsoft/vscode/issues/4586 }; // Chokidar fails when the basePath does not match case-identical to the path on disk diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index e745057fb92..c0b7e914c73 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -11,7 +11,7 @@ import objects = require('vs/base/common/objects'); import URI from 'vs/base/common/uri'; import { IEditor } from 'vs/editor/common/editorCommon'; import { IEditor as IBaseEditor, IEditorInput, ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; -import { EditorInput, IGroupEvent, IEditorRegistry, Extensions, toResource, IEditorGroup } from 'vs/workbench/common/editor'; +import { EditorInput, IEditorCloseEvent, IEditorRegistry, Extensions, toResource, IEditorGroup } from 'vs/workbench/common/editor'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { FileChangesEvent, IFileService, FileChangeType } from 'vs/platform/files/common/files'; @@ -61,10 +61,10 @@ export class EditorState { return true; // always let API source win (e.g. "Go to definition" should add a history entry) } - const liftedSelection = Selection.liftSelection(this._selection); - const liftedOtherSelection = Selection.liftSelection(other._selection); + const myLineNumber = Math.min(this._selection.selectionStartLineNumber, this._selection.positionLineNumber); + const otherLineNumber = Math.min(other._selection.selectionStartLineNumber, other._selection.positionLineNumber); - if (Math.abs(liftedSelection.getStartPosition().lineNumber - liftedOtherSelection.getStartPosition().lineNumber) < EditorState.EDITOR_SELECTION_THRESHOLD) { + if (Math.abs(myLineNumber - otherLineNumber) < EditorState.EDITOR_SELECTION_THRESHOLD) { return false; // ignore selection changes in the range of EditorState.EDITOR_SELECTION_THRESHOLD lines } @@ -214,7 +214,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic } } - private onEditorClosed(event: IGroupEvent): void { + private onEditorClosed(event: IEditorCloseEvent): void { // Track closing of pinned editor to support to reopen closed editors if (event.pinned) { diff --git a/src/vs/workbench/services/keybinding/common/keybindingIO.ts b/src/vs/workbench/services/keybinding/common/keybindingIO.ts index 5a432e6d0c1..64037ac9774 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingIO.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingIO.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { USER_SETTINGS, Keybinding, SimpleKeybinding, ChordKeybinding } from 'vs/base/common/keyCodes'; +import { Keybinding, SimpleKeybinding, ChordKeybinding, KeyCodeUtils } from 'vs/base/common/keyCodes'; import { OperatingSystem } from 'vs/base/common/platform'; import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -119,7 +119,7 @@ export class KeybindingIO { private static _readSimpleKeybinding(input: string): [SimpleKeybinding, string] { const mods = this._readModifiers(input); - const keyCode = USER_SETTINGS.toKeyCode(mods.key); + const keyCode = KeyCodeUtils.fromUserSettings(mods.key); return [new SimpleKeybinding(mods.ctrl, mods.shift, mods.alt, mods.meta, keyCode), mods.remains]; } @@ -148,7 +148,7 @@ export class KeybindingIO { const scanCode = ScanCodeUtils.lowerCaseToEnum(strScanCode); return [new ScanCodeBinding(mods.ctrl, mods.shift, mods.alt, mods.meta, scanCode), mods.remains]; } - const keyCode = USER_SETTINGS.toKeyCode(mods.key); + const keyCode = KeyCodeUtils.fromUserSettings(mods.key); return [new SimpleKeybinding(mods.ctrl, mods.shift, mods.alt, mods.meta, keyCode), mods.remains]; } diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index b884e80add2..bf911f28c13 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -6,10 +6,10 @@ 'use strict'; import { OperatingSystem } from 'vs/base/common/platform'; -import { KeyCode, ResolvedKeybinding, KeyCodeUtils, SimpleKeybinding, Keybinding, KeybindingType, USER_SETTINGS } from 'vs/base/common/keyCodes'; +import { KeyCode, ResolvedKeybinding, KeyCodeUtils, SimpleKeybinding, Keybinding, KeybindingType, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE, ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { CharCode } from 'vs/base/common/charCode'; -import { UILabelProvider, AriaLabelProvider, UserSettingsLabelProvider, ElectronAcceleratorLabelProvider, NO_MODIFIERS } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider, AriaLabelProvider, UserSettingsLabelProvider, ElectronAcceleratorLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; @@ -57,13 +57,6 @@ export function macLinuxKeyboardMappingEquals(a: IMacLinuxKeyboardMapping, b: IM return true; } -const LOG = false; -function log(str: string): void { - if (LOG) { - console.info(str); - } -} - /** * A map from character to key codes. * e.g. Contains entries such as: @@ -87,92 +80,43 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding { this._chordPart = chordPart; } - private _getUILabelForScanCodeBinding(binding: ScanCodeBinding): string { - if (!binding) { - return null; - } - if (binding.isDuplicateModifierCase()) { - return ''; - } - return this._mapper.getUILabelForScanCode(binding.scanCode); - } - public getLabel(): string { - let firstPart = this._getUILabelForScanCodeBinding(this._firstPart); - let chordPart = this._getUILabelForScanCodeBinding(this._chordPart); + let firstPart = this._mapper.getUILabelForScanCodeBinding(this._firstPart); + let chordPart = this._mapper.getUILabelForScanCodeBinding(this._chordPart); return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS); } - public getLabelWithoutModifiers(): string { - let firstPart = this._getUILabelForScanCodeBinding(this._firstPart); - let chordPart = this._getUILabelForScanCodeBinding(this._chordPart); - return UILabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, this._OS); - } - - private _getAriaLabelForScanCodeBinding(binding: ScanCodeBinding): string { - if (!binding) { - return null; - } - if (binding.isDuplicateModifierCase()) { - return ''; - } - return this._mapper.getAriaLabelForScanCode(binding.scanCode); - } - public getAriaLabel(): string { - let firstPart = this._getAriaLabelForScanCodeBinding(this._firstPart); - let chordPart = this._getAriaLabelForScanCodeBinding(this._chordPart); + let firstPart = this._mapper.getAriaLabelForScanCodeBinding(this._firstPart); + let chordPart = this._mapper.getAriaLabelForScanCodeBinding(this._chordPart); return AriaLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS); } - public getAriaLabelWithoutModifiers(): string { - let firstPart = this._getAriaLabelForScanCodeBinding(this._firstPart); - let chordPart = this._getAriaLabelForScanCodeBinding(this._chordPart); - return AriaLabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, this._OS); - } - - private _getElectronAcceleratorLabelForScanCodeBinding(binding: ScanCodeBinding): string { - if (!binding) { - return null; - } - if (binding.isDuplicateModifierCase()) { - return null; - } - return this._mapper.getElectronLabelForScanCode(binding.scanCode); - } - public getElectronAccelerator(): string { if (this._chordPart !== null) { // Electron cannot handle chords return null; } - let firstPart = this._getElectronAcceleratorLabelForScanCodeBinding(this._firstPart); + let firstPart = this._mapper.getElectronAcceleratorLabelForScanCodeBinding(this._firstPart); return ElectronAcceleratorLabelProvider.toLabel(this._firstPart, firstPart, null, null, this._OS); } - private _getUserSettingsLabelForScanCodeBinding(binding: ScanCodeBinding): string { - if (!binding) { - return null; - } - if (binding.isDuplicateModifierCase()) { - return ''; - } - return this._mapper.getUserSettingsLabel(binding.scanCode); - } - public getUserSettingsLabel(): string { - let firstPart = this._getUserSettingsLabelForScanCodeBinding(this._firstPart); - let chordPart = this._getUserSettingsLabelForScanCodeBinding(this._chordPart); + let firstPart = this._mapper.getUserSettingsLabelForScanCodeBinding(this._firstPart); + let chordPart = this._mapper.getUserSettingsLabelForScanCodeBinding(this._chordPart); return UserSettingsLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS); } - private _isWYSIWYG(scanCode: ScanCode): boolean { - if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) { + private _isWYSIWYG(binding: ScanCodeBinding): boolean { + if (!binding) { return true; } - let a = this._mapper.getAriaLabelForScanCode(scanCode); - let b = this._mapper.getUserSettingsLabel(scanCode); + if (IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode] !== -1) { + return true; + } + let a = this._mapper.getAriaLabelForScanCodeBinding(binding); + let b = this._mapper.getUserSettingsLabelForScanCodeBinding(binding); if (!a && !b) { return true; @@ -184,46 +128,33 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding { } public isWYSIWYG(): boolean { - let result = true; - result = result && (this._firstPart ? this._isWYSIWYG(this._firstPart.scanCode) : true); - result = result && (this._chordPart ? this._isWYSIWYG(this._chordPart.scanCode) : true); - return result; + return (this._isWYSIWYG(this._firstPart) && this._isWYSIWYG(this._chordPart)); } public isChord(): boolean { return (this._chordPart ? true : false); } - public hasCtrlModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.ctrlKey; + public getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart] { + return [ + this._toResolvedKeybindingPart(this._firstPart), + this._toResolvedKeybindingPart(this._chordPart) + ]; } - public hasShiftModifier(): boolean { - if (this._chordPart) { - return false; + private _toResolvedKeybindingPart(binding: ScanCodeBinding): ResolvedKeybindingPart { + if (!binding) { + return null; } - return this._firstPart.shiftKey; - } - public hasAltModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.altKey; - } - - public hasMetaModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.metaKey; - } - - public getParts(): [ResolvedKeybinding, ResolvedKeybinding] { - return [new NativeResolvedKeybinding(this._mapper, this._OS, this._firstPart, null), this._chordPart ? new NativeResolvedKeybinding(this._mapper, this._OS, this._chordPart, null) : null]; + return new ResolvedKeybindingPart( + binding.ctrlKey, + binding.shiftKey, + binding.altKey, + binding.metaKey, + this._mapper.getUILabelForScanCodeBinding(binding), + this._mapper.getAriaLabelForScanCodeBinding(binding) + ); } public getDispatchParts(): [string, string] { @@ -334,17 +265,6 @@ class ScanCodeKeyCodeMapper { } public registrationComplete(): void { - for (let i = 0; i < ScanCode.MAX_VALUE; i++) { - let base = (i << 3); - for (let j = 0; j < 8; j++) { - let actual = base + j; - let entry = this._scanCodeToKeyCode[actual]; - if (typeof entry === 'undefined') { - log(`${ScanCodeUtils.toString(i)} - ${j.toString(2)} --- is missing`); - } - } - } - // IntlHash and IntlBackslash are rare keys, so ensure they don't end up being the preferred... this._moveToEnd(ScanCode.IntlHash); this._moveToEnd(ScanCode.IntlBackslash); @@ -547,6 +467,38 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { this._scanCodeToLabel = []; this._scanCodeToDispatch = []; + const _registerIfUnknown = ( + hwCtrlKey: 0 | 1, hwShiftKey: 0 | 1, hwAltKey: 0 | 1, scanCode: ScanCode, + kbCtrlKey: 0 | 1, kbShiftKey: 0 | 1, kbAltKey: 0 | 1, keyCode: KeyCode, + ): void => { + this._scanCodeKeyCodeMapper.registerIfUnknown( + new ScanCodeCombo(hwCtrlKey ? true : false, hwShiftKey ? true : false, hwAltKey ? true : false, scanCode), + new KeyCodeCombo(kbCtrlKey ? true : false, kbShiftKey ? true : false, kbAltKey ? true : false, keyCode) + ); + }; + + const _registerAllCombos = (_ctrlKey: 0 | 1, _shiftKey: 0 | 1, _altKey: 0 | 1, scanCode: ScanCode, keyCode: KeyCode): void => { + for (let ctrlKey = _ctrlKey; ctrlKey <= 1; ctrlKey++) { + for (let shiftKey = _shiftKey; shiftKey <= 1; shiftKey++) { + for (let altKey = _altKey; altKey <= 1; altKey++) { + _registerIfUnknown( + ctrlKey, shiftKey, altKey, scanCode, + ctrlKey, shiftKey, altKey, keyCode + ); + } + } + } + }; + + let producesLetter: boolean[] = []; + const _registerLetterIfMissing = (charCode: CharCode, scanCode: ScanCode, keyCode: KeyCode): void => { + if (!producesLetter[charCode]) { + _registerAllCombos(0, 0, 0, scanCode, keyCode); + this._scanCodeToLabel[scanCode] = String.fromCharCode(charCode); + } + }; + + // Initialize `_scanCodeToLabel` for (let scanCode = ScanCode.None; scanCode < ScanCode.MAX_VALUE; scanCode++) { this._scanCodeToLabel[scanCode] = null; @@ -561,7 +513,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { for (let scanCode = ScanCode.None; scanCode < ScanCode.MAX_VALUE; scanCode++) { const keyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; if (keyCode !== -1) { - this._registerAllCombos1(false, false, false, scanCode, keyCode); + _registerAllCombos(0, 0, 0, scanCode, keyCode); this._scanCodeToLabel[scanCode] = KeyCodeUtils.toString(keyCode); if (keyCode === KeyCode.Unknown || keyCode === KeyCode.Ctrl || keyCode === KeyCode.Meta || keyCode === KeyCode.Alt || keyCode === KeyCode.Shift) { @@ -573,12 +525,10 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { } let mappings: IScanCodeMapping[] = [], mappingsLen = 0; - let producesLetter: boolean[] = []; for (let strScanCode in rawMappings) { if (rawMappings.hasOwnProperty(strScanCode)) { const scanCode = ScanCodeUtils.toEnum(strScanCode); if (scanCode === ScanCode.None) { - log(`Unknown ScanCode ${strScanCode} in mapping.`); continue; } if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) { @@ -621,87 +571,157 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { // Handle all `withShiftAltGr` entries for (let i = mappings.length - 1; i >= 0; i--) { const mapping = mappings[i]; + const scanCode = mapping.scanCode; const withShiftAltGr = mapping.withShiftAltGr; if (withShiftAltGr === mapping.withAltGr || withShiftAltGr === mapping.withShift || withShiftAltGr === mapping.value) { // handled below continue; } - this._registerCharCode(mapping.scanCode, true, true, true, withShiftAltGr); + const kb = MacLinuxKeyboardMapper._charCodeToKb(withShiftAltGr); + if (!kb) { + continue; + } + const kbShiftKey = kb.shiftKey; + const keyCode = kb.keyCode; + + if (kbShiftKey) { + // Ctrl+Shift+Alt+ScanCode => Shift+KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 0, 1, 0, keyCode); // Ctrl+Alt+ScanCode => Shift+KeyCode + } else { + // Ctrl+Shift+Alt+ScanCode => KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 0, 0, 0, keyCode); // Ctrl+Alt+ScanCode => KeyCode + } } // Handle all `withAltGr` entries for (let i = mappings.length - 1; i >= 0; i--) { const mapping = mappings[i]; + const scanCode = mapping.scanCode; const withAltGr = mapping.withAltGr; if (withAltGr === mapping.withShift || withAltGr === mapping.value) { // handled below continue; } - this._registerCharCode(mapping.scanCode, true, false, true, withAltGr); + const kb = MacLinuxKeyboardMapper._charCodeToKb(withAltGr); + if (!kb) { + continue; + } + const kbShiftKey = kb.shiftKey; + const keyCode = kb.keyCode; + + if (kbShiftKey) { + // Ctrl+Alt+ScanCode => Shift+KeyCode + _registerIfUnknown(1, 0, 1, scanCode, 0, 1, 0, keyCode); // Ctrl+Alt+ScanCode => Shift+KeyCode + } else { + // Ctrl+Alt+ScanCode => KeyCode + _registerIfUnknown(1, 0, 1, scanCode, 0, 0, 0, keyCode); // Ctrl+Alt+ScanCode => KeyCode + } } // Handle all `withShift` entries for (let i = mappings.length - 1; i >= 0; i--) { const mapping = mappings[i]; + const scanCode = mapping.scanCode; const withShift = mapping.withShift; if (withShift === mapping.value) { // handled below continue; } - this._registerCharCode(mapping.scanCode, false, true, false, withShift); + const kb = MacLinuxKeyboardMapper._charCodeToKb(withShift); + if (!kb) { + continue; + } + const kbShiftKey = kb.shiftKey; + const keyCode = kb.keyCode; + + if (kbShiftKey) { + // Shift+ScanCode => Shift+KeyCode + _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode); // Shift+ScanCode => Shift+KeyCode + _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode); // Shift+Alt+ScanCode => Shift+Alt+KeyCode + _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode); // Ctrl+Shift+ScanCode => Ctrl+Shift+KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode); // Ctrl+Shift+Alt+ScanCode => Ctrl+Shift+Alt+KeyCode + } else { + // Shift+ScanCode => KeyCode + _registerIfUnknown(0, 1, 0, scanCode, 0, 0, 0, keyCode); // Shift+ScanCode => KeyCode + _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode); // Shift+ScanCode => Shift+KeyCode + _registerIfUnknown(0, 1, 1, scanCode, 0, 0, 1, keyCode); // Shift+Alt+ScanCode => Alt+KeyCode + _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode); // Shift+Alt+ScanCode => Shift+Alt+KeyCode + _registerIfUnknown(1, 1, 0, scanCode, 1, 0, 0, keyCode); // Ctrl+Shift+ScanCode => Ctrl+KeyCode + _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode); // Ctrl+Shift+ScanCode => Ctrl+Shift+KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 1, 0, 1, keyCode); // Ctrl+Shift+Alt+ScanCode => Ctrl+Alt+KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode); // Ctrl+Shift+Alt+ScanCode => Ctrl+Shift+Alt+KeyCode + } } // Handle all `value` entries for (let i = mappings.length - 1; i >= 0; i--) { const mapping = mappings[i]; - this._registerCharCode(mapping.scanCode, false, false, false, mapping.value); + const scanCode = mapping.scanCode; + const kb = MacLinuxKeyboardMapper._charCodeToKb(mapping.value); + if (!kb) { + continue; + } + const kbShiftKey = kb.shiftKey; + const keyCode = kb.keyCode; + + if (kbShiftKey) { + // ScanCode => Shift+KeyCode + _registerIfUnknown(0, 0, 0, scanCode, 0, 1, 0, keyCode); // ScanCode => Shift+KeyCode + _registerIfUnknown(0, 0, 1, scanCode, 0, 1, 1, keyCode); // Alt+ScanCode => Shift+Alt+KeyCode + _registerIfUnknown(1, 0, 0, scanCode, 1, 1, 0, keyCode); // Ctrl+ScanCode => Ctrl+Shift+KeyCode + _registerIfUnknown(1, 0, 1, scanCode, 1, 1, 1, keyCode); // Ctrl+Alt+ScanCode => Ctrl+Shift+Alt+KeyCode + } else { + // ScanCode => KeyCode + _registerIfUnknown(0, 0, 0, scanCode, 0, 0, 0, keyCode); // ScanCode => KeyCode + _registerIfUnknown(0, 0, 1, scanCode, 0, 0, 1, keyCode); // Alt+ScanCode => Alt+KeyCode + _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode); // Shift+ScanCode => Shift+KeyCode + _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode); // Shift+Alt+ScanCode => Shift+Alt+KeyCode + _registerIfUnknown(1, 0, 0, scanCode, 1, 0, 0, keyCode); // Ctrl+ScanCode => Ctrl+KeyCode + _registerIfUnknown(1, 0, 1, scanCode, 1, 0, 1, keyCode); // Ctrl+Alt+ScanCode => Ctrl+Alt+KeyCode + _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode); // Ctrl+Shift+ScanCode => Ctrl+Shift+KeyCode + _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode); // Ctrl+Shift+Alt+ScanCode => Ctrl+Shift+Alt+KeyCode + } } // Handle all left-over available digits - this._registerAllCombos1(false, false, false, ScanCode.Digit1, KeyCode.KEY_1); - this._registerAllCombos1(false, false, false, ScanCode.Digit2, KeyCode.KEY_2); - this._registerAllCombos1(false, false, false, ScanCode.Digit3, KeyCode.KEY_3); - this._registerAllCombos1(false, false, false, ScanCode.Digit4, KeyCode.KEY_4); - this._registerAllCombos1(false, false, false, ScanCode.Digit5, KeyCode.KEY_5); - this._registerAllCombos1(false, false, false, ScanCode.Digit6, KeyCode.KEY_6); - this._registerAllCombos1(false, false, false, ScanCode.Digit7, KeyCode.KEY_7); - this._registerAllCombos1(false, false, false, ScanCode.Digit8, KeyCode.KEY_8); - this._registerAllCombos1(false, false, false, ScanCode.Digit9, KeyCode.KEY_9); - this._registerAllCombos1(false, false, false, ScanCode.Digit0, KeyCode.KEY_0); + _registerAllCombos(0, 0, 0, ScanCode.Digit1, KeyCode.KEY_1); + _registerAllCombos(0, 0, 0, ScanCode.Digit2, KeyCode.KEY_2); + _registerAllCombos(0, 0, 0, ScanCode.Digit3, KeyCode.KEY_3); + _registerAllCombos(0, 0, 0, ScanCode.Digit4, KeyCode.KEY_4); + _registerAllCombos(0, 0, 0, ScanCode.Digit5, KeyCode.KEY_5); + _registerAllCombos(0, 0, 0, ScanCode.Digit6, KeyCode.KEY_6); + _registerAllCombos(0, 0, 0, ScanCode.Digit7, KeyCode.KEY_7); + _registerAllCombos(0, 0, 0, ScanCode.Digit8, KeyCode.KEY_8); + _registerAllCombos(0, 0, 0, ScanCode.Digit9, KeyCode.KEY_9); + _registerAllCombos(0, 0, 0, ScanCode.Digit0, KeyCode.KEY_0); // Ensure letters are mapped - this._registerLetterIfMissing(producesLetter, CharCode.A, ScanCode.KeyA, KeyCode.KEY_A); - this._registerLetterIfMissing(producesLetter, CharCode.B, ScanCode.KeyB, KeyCode.KEY_B); - this._registerLetterIfMissing(producesLetter, CharCode.C, ScanCode.KeyC, KeyCode.KEY_C); - this._registerLetterIfMissing(producesLetter, CharCode.D, ScanCode.KeyD, KeyCode.KEY_D); - this._registerLetterIfMissing(producesLetter, CharCode.E, ScanCode.KeyE, KeyCode.KEY_E); - this._registerLetterIfMissing(producesLetter, CharCode.F, ScanCode.KeyF, KeyCode.KEY_F); - this._registerLetterIfMissing(producesLetter, CharCode.G, ScanCode.KeyG, KeyCode.KEY_G); - this._registerLetterIfMissing(producesLetter, CharCode.H, ScanCode.KeyH, KeyCode.KEY_H); - this._registerLetterIfMissing(producesLetter, CharCode.I, ScanCode.KeyI, KeyCode.KEY_I); - this._registerLetterIfMissing(producesLetter, CharCode.J, ScanCode.KeyJ, KeyCode.KEY_J); - this._registerLetterIfMissing(producesLetter, CharCode.K, ScanCode.KeyK, KeyCode.KEY_K); - this._registerLetterIfMissing(producesLetter, CharCode.L, ScanCode.KeyL, KeyCode.KEY_L); - this._registerLetterIfMissing(producesLetter, CharCode.M, ScanCode.KeyM, KeyCode.KEY_M); - this._registerLetterIfMissing(producesLetter, CharCode.N, ScanCode.KeyN, KeyCode.KEY_N); - this._registerLetterIfMissing(producesLetter, CharCode.O, ScanCode.KeyO, KeyCode.KEY_O); - this._registerLetterIfMissing(producesLetter, CharCode.P, ScanCode.KeyP, KeyCode.KEY_P); - this._registerLetterIfMissing(producesLetter, CharCode.Q, ScanCode.KeyQ, KeyCode.KEY_Q); - this._registerLetterIfMissing(producesLetter, CharCode.R, ScanCode.KeyR, KeyCode.KEY_R); - this._registerLetterIfMissing(producesLetter, CharCode.S, ScanCode.KeyS, KeyCode.KEY_S); - this._registerLetterIfMissing(producesLetter, CharCode.T, ScanCode.KeyT, KeyCode.KEY_T); - this._registerLetterIfMissing(producesLetter, CharCode.U, ScanCode.KeyU, KeyCode.KEY_U); - this._registerLetterIfMissing(producesLetter, CharCode.V, ScanCode.KeyV, KeyCode.KEY_V); - this._registerLetterIfMissing(producesLetter, CharCode.W, ScanCode.KeyW, KeyCode.KEY_W); - this._registerLetterIfMissing(producesLetter, CharCode.X, ScanCode.KeyX, KeyCode.KEY_X); - this._registerLetterIfMissing(producesLetter, CharCode.Y, ScanCode.KeyY, KeyCode.KEY_Y); - this._registerLetterIfMissing(producesLetter, CharCode.Z, ScanCode.KeyZ, KeyCode.KEY_Z); + _registerLetterIfMissing(CharCode.A, ScanCode.KeyA, KeyCode.KEY_A); + _registerLetterIfMissing(CharCode.B, ScanCode.KeyB, KeyCode.KEY_B); + _registerLetterIfMissing(CharCode.C, ScanCode.KeyC, KeyCode.KEY_C); + _registerLetterIfMissing(CharCode.D, ScanCode.KeyD, KeyCode.KEY_D); + _registerLetterIfMissing(CharCode.E, ScanCode.KeyE, KeyCode.KEY_E); + _registerLetterIfMissing(CharCode.F, ScanCode.KeyF, KeyCode.KEY_F); + _registerLetterIfMissing(CharCode.G, ScanCode.KeyG, KeyCode.KEY_G); + _registerLetterIfMissing(CharCode.H, ScanCode.KeyH, KeyCode.KEY_H); + _registerLetterIfMissing(CharCode.I, ScanCode.KeyI, KeyCode.KEY_I); + _registerLetterIfMissing(CharCode.J, ScanCode.KeyJ, KeyCode.KEY_J); + _registerLetterIfMissing(CharCode.K, ScanCode.KeyK, KeyCode.KEY_K); + _registerLetterIfMissing(CharCode.L, ScanCode.KeyL, KeyCode.KEY_L); + _registerLetterIfMissing(CharCode.M, ScanCode.KeyM, KeyCode.KEY_M); + _registerLetterIfMissing(CharCode.N, ScanCode.KeyN, KeyCode.KEY_N); + _registerLetterIfMissing(CharCode.O, ScanCode.KeyO, KeyCode.KEY_O); + _registerLetterIfMissing(CharCode.P, ScanCode.KeyP, KeyCode.KEY_P); + _registerLetterIfMissing(CharCode.Q, ScanCode.KeyQ, KeyCode.KEY_Q); + _registerLetterIfMissing(CharCode.R, ScanCode.KeyR, KeyCode.KEY_R); + _registerLetterIfMissing(CharCode.S, ScanCode.KeyS, KeyCode.KEY_S); + _registerLetterIfMissing(CharCode.T, ScanCode.KeyT, KeyCode.KEY_T); + _registerLetterIfMissing(CharCode.U, ScanCode.KeyU, KeyCode.KEY_U); + _registerLetterIfMissing(CharCode.V, ScanCode.KeyV, KeyCode.KEY_V); + _registerLetterIfMissing(CharCode.W, ScanCode.KeyW, KeyCode.KEY_W); + _registerLetterIfMissing(CharCode.X, ScanCode.KeyX, KeyCode.KEY_X); + _registerLetterIfMissing(CharCode.Y, ScanCode.KeyY, KeyCode.KEY_Y); + _registerLetterIfMissing(CharCode.Z, ScanCode.KeyZ, KeyCode.KEY_Z); this._scanCodeKeyCodeMapper.registrationComplete(); } - private _registerLetterIfMissing(producesLetter: boolean[], charCode: CharCode, scanCode: ScanCode, keyCode: KeyCode): void { - if (!producesLetter[charCode]) { - this._registerAllCombos1(false, false, false, scanCode, keyCode); - } - } - public dumpDebugInfo(): string { let result: string[] = []; @@ -804,94 +824,6 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return str; } - private _registerIfUnknown( - hwCtrlKey: boolean, hwShiftKey: boolean, hwAltKey: boolean, scanCode: ScanCode, - kbCtrlKey: boolean, kbShiftKey: boolean, kbAltKey: boolean, keyCode: KeyCode, - ): void { - this._scanCodeKeyCodeMapper.registerIfUnknown( - new ScanCodeCombo(hwCtrlKey, hwShiftKey, hwAltKey, scanCode), - new KeyCodeCombo(kbCtrlKey, kbShiftKey, kbAltKey, keyCode) - ); - } - - private _registerAllCombos1( - _ctrlKey: boolean, _shiftKey: boolean, _altKey: boolean, scanCode: ScanCode, - keyCode: KeyCode, - ): void { - for (let _ctrl = (_ctrlKey ? 1 : 0); _ctrl <= 1; _ctrl++) { - const ctrlKey = (_ctrl ? true : false); - for (let _shift = (_shiftKey ? 1 : 0); _shift <= 1; _shift++) { - const shiftKey = (_shift ? true : false); - for (let _alt = (_altKey ? 1 : 0); _alt <= 1; _alt++) { - const altKey = (_alt ? true : false); - this._registerIfUnknown( - ctrlKey, shiftKey, altKey, scanCode, - ctrlKey, shiftKey, altKey, keyCode - ); - } - } - } - } - - private _registerAllCombos2( - hwCtrlKey: boolean, hwShiftKey: boolean, hwAltKey: boolean, scanCode: ScanCode, - kbShiftKey: boolean, keyCode: KeyCode, - ): void { - this._registerIfUnknown( - hwCtrlKey, hwShiftKey, hwAltKey, scanCode, - false, kbShiftKey, false, keyCode - ); - - if (!kbShiftKey) { - for (let _ctrl = (hwCtrlKey ? 1 : 0); _ctrl <= 1; _ctrl++) { - const ctrlKey = (_ctrl ? true : false); - for (let _alt = (hwAltKey ? 1 : 0); _alt <= 1; _alt++) { - const altKey = (_alt ? true : false); - this._registerIfUnknown( - ctrlKey, hwShiftKey, altKey, scanCode, - ctrlKey, kbShiftKey, altKey, keyCode - ); - this._registerIfUnknown( - ctrlKey, true, altKey, scanCode, - ctrlKey, true, altKey, keyCode - ); - } - } - } else { - for (let _ctrl = (hwCtrlKey ? 1 : 0); _ctrl <= 1; _ctrl++) { - const ctrlKey = (_ctrl ? true : false); - for (let _alt = (hwAltKey ? 1 : 0); _alt <= 1; _alt++) { - const altKey = (_alt ? true : false); - this._registerIfUnknown( - ctrlKey, hwShiftKey, altKey, scanCode, - ctrlKey, kbShiftKey, altKey, keyCode - ); - } - } - } - } - - private _registerCharCode(scanCode: ScanCode, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, charCode: number): void { - - let _kb = MacLinuxKeyboardMapper._charCodeToKb(charCode); - let kb = _kb ? { - ctrlKey: false, - shiftKey: _kb.shiftKey, - altKey: false, - keyCode: _kb.keyCode - } : null; - - if (!_kb) { - this._registerAllCombos1(ctrlKey, shiftKey, altKey, scanCode, KeyCode.Unknown); - return; - } - - this._registerAllCombos2( - ctrlKey, shiftKey, altKey, scanCode, - kb.shiftKey, kb.keyCode - ); - } - public simpleKeybindingToScanCodeBinding(keybinding: SimpleKeybinding): ScanCodeBinding[] { // Avoid double Enter bindings (both ScanCode.NumpadEnter and ScanCode.Enter point to KeyCode.Enter) if (keybinding.keyCode === KeyCode.Enter) { @@ -910,9 +842,15 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return result; } - public getUILabelForScanCode(scanCode: ScanCode): string { + public getUILabelForScanCodeBinding(binding: ScanCodeBinding): string { + if (!binding) { + return null; + } + if (binding.isDuplicateModifierCase()) { + return ''; + } if (this._OS === OperatingSystem.Macintosh) { - switch (scanCode) { + switch (binding.scanCode) { case ScanCode.ArrowLeft: return 'â†'; case ScanCode.ArrowUp: @@ -923,11 +861,17 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return '↓'; } } - return this._scanCodeToLabel[scanCode]; + return this._scanCodeToLabel[binding.scanCode]; } - public getAriaLabelForScanCode(scanCode: ScanCode): string { - return this._scanCodeToLabel[scanCode]; + public getAriaLabelForScanCodeBinding(binding: ScanCodeBinding): string { + if (!binding) { + return null; + } + if (binding.isDuplicateModifierCase()) { + return ''; + } + return this._scanCodeToLabel[binding.scanCode]; } public getDispatchStrForScanCodeBinding(keypress: ScanCodeBinding): string { @@ -954,19 +898,33 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return result; } - public getUserSettingsLabel(scanCode: ScanCode): string { - const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; + public getUserSettingsLabelForScanCodeBinding(binding: ScanCodeBinding): string { + if (!binding) { + return null; + } + if (binding.isDuplicateModifierCase()) { + return ''; + } + + const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode]; if (immutableKeyCode !== -1) { - return USER_SETTINGS.fromKeyCode(immutableKeyCode).toLowerCase(); + return KeyCodeUtils.toUserSettingsUS(immutableKeyCode).toLowerCase(); } // Check if this scanCode always maps to the same keyCode and back - let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(scanCode); + let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode); if (constantKeyCode !== -1) { - return USER_SETTINGS.fromKeyCode(constantKeyCode).toLowerCase(); + // Verify that this is a good key code that can be mapped back to the same scan code + let reverseBindings = this.simpleKeybindingToScanCodeBinding(new SimpleKeybinding(binding.ctrlKey, binding.shiftKey, binding.altKey, binding.metaKey, constantKeyCode)); + for (let i = 0, len = reverseBindings.length; i < len; i++) { + const reverseBinding = reverseBindings[i]; + if (reverseBinding.scanCode === binding.scanCode) { + return KeyCodeUtils.toUserSettingsUS(constantKeyCode).toLowerCase(); + } + } } - return this._scanCodeToDispatch[scanCode]; + return this._scanCodeToDispatch[binding.scanCode]; } private _getElectronLabelForKeyCode(keyCode: KeyCode): string { @@ -990,14 +948,21 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return KeyCodeUtils.toString(keyCode); } - public getElectronLabelForScanCode(scanCode: ScanCode): string { - const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; + public getElectronAcceleratorLabelForScanCodeBinding(binding: ScanCodeBinding): string { + if (!binding) { + return null; + } + if (binding.isDuplicateModifierCase()) { + return null; + } + + const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode]; if (immutableKeyCode !== -1) { return this._getElectronLabelForKeyCode(immutableKeyCode); } // Check if this scanCode always maps to the same keyCode and back - let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(scanCode); + const constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode); if (!this._isUSStandard) { // Electron cannot handle these key codes on anything else than standard US diff --git a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts index 04c1a8e4010..3772cc723fb 100644 --- a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts @@ -5,10 +5,10 @@ 'use strict'; -import { KeyCode, KeyCodeUtils, ResolvedKeybinding, Keybinding, SimpleKeybinding, KeybindingType, USER_SETTINGS } from 'vs/base/common/keyCodes'; +import { KeyCode, KeyCodeUtils, ResolvedKeybinding, Keybinding, SimpleKeybinding, KeybindingType, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { CharCode } from 'vs/base/common/charCode'; -import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider, NO_MODIFIERS } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; import { OperatingSystem } from 'vs/base/common/platform'; import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; @@ -107,12 +107,6 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, OperatingSystem.Windows); } - public getLabelWithoutModifiers(): string { - let firstPart = this._getUILabelForKeybinding(this._firstPart); - let chordPart = this._getUILabelForKeybinding(this._chordPart); - return UILabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, OperatingSystem.Windows); - } - private _getAriaLabelForKeybinding(keybinding: SimpleKeybinding): string { if (!keybinding) { return null; @@ -129,12 +123,6 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { return AriaLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, OperatingSystem.Windows); } - public getAriaLabelWithoutModifiers(): string { - let firstPart = this._getAriaLabelForKeybinding(this._firstPart); - let chordPart = this._getAriaLabelForKeybinding(this._chordPart); - return AriaLabelProvider.toLabel(NO_MODIFIERS, firstPart, NO_MODIFIERS, chordPart, OperatingSystem.Windows); - } - private _keyCodeToElectronAccelerator(keyCode: KeyCode): string { if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { // Electron cannot handle numpad keys @@ -183,7 +171,7 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { if (keybinding.isDuplicateModifierCase()) { return ''; } - return USER_SETTINGS.fromKeyCode(keybinding.keyCode); + return this._mapper.getUserSettingsLabelForKeyCode(keybinding.keyCode); } public getUserSettingsLabel(): string { @@ -194,49 +182,53 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { } public isWYSIWYG(): boolean { - let firstPart1 = this._firstPart ? this._mapper.getAriaLabelForKeyCode(this._firstPart.keyCode) : null; - let chordPart1 = this._chordPart ? this._mapper.getAriaLabelForKeyCode(this._chordPart.keyCode) : null; + if (this._firstPart && !this._isWYSIWYG(this._firstPart.keyCode)) { + return false; + } + if (this._chordPart && !this._isWYSIWYG(this._chordPart.keyCode)) { + return false; + } + return true; + } - let firstPart2 = this._firstPart ? KeyCodeUtils.toString(this._firstPart.keyCode) : null; - let chordPart2 = this._chordPart ? KeyCodeUtils.toString(this._chordPart.keyCode) : null; - - return (firstPart1 === firstPart2 && chordPart1 === chordPart2); + private _isWYSIWYG(keyCode: KeyCode): boolean { + if ( + keyCode === KeyCode.LeftArrow + || keyCode === KeyCode.UpArrow + || keyCode === KeyCode.RightArrow + || keyCode === KeyCode.DownArrow + ) { + return true; + } + const ariaLabel = this._mapper.getAriaLabelForKeyCode(keyCode); + const userSettingsLabel = this._mapper.getUserSettingsLabelForKeyCode(keyCode); + return (ariaLabel === userSettingsLabel); } public isChord(): boolean { return (this._chordPart ? true : false); } - public hasCtrlModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.ctrlKey; + public getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart] { + return [ + this._toResolvedKeybindingPart(this._firstPart), + this._toResolvedKeybindingPart(this._chordPart) + ]; } - public hasShiftModifier(): boolean { - if (this._chordPart) { - return false; + private _toResolvedKeybindingPart(keybinding: SimpleKeybinding): ResolvedKeybindingPart { + if (!keybinding) { + return null; } - return this._firstPart.shiftKey; - } - public hasAltModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.altKey; - } - - public hasMetaModifier(): boolean { - if (this._chordPart) { - return false; - } - return this._firstPart.metaKey; - } - - public getParts(): [ResolvedKeybinding, ResolvedKeybinding] { - return [new WindowsNativeResolvedKeybinding(this._mapper, this._firstPart, null), this._chordPart ? new WindowsNativeResolvedKeybinding(this._mapper, this._chordPart, null) : null]; + return new ResolvedKeybindingPart( + keybinding.ctrlKey, + keybinding.shiftKey, + keybinding.altKey, + keybinding.metaKey, + this._getUILabelForKeybinding(keybinding), + this._getAriaLabelForKeybinding(keybinding) + ); } public getDispatchParts(): [string, string] { @@ -295,12 +287,14 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { export class WindowsKeyboardMapper implements IKeyboardMapper { + public readonly isUSStandard: boolean; private readonly _codeInfo: IScanCodeMapping[]; private readonly _scanCodeToKeyCode: KeyCode[]; private readonly _keyCodeToLabel: string[] = []; private readonly _keyCodeExists: boolean[]; - constructor(rawMappings: IWindowsKeyboardMapping) { + constructor(isUSStandard: boolean, rawMappings: IWindowsKeyboardMapping) { + this.isUSStandard = isUSStandard; this._scanCodeToKeyCode = []; this._keyCodeToLabel = []; this._keyCodeExists = []; @@ -315,6 +309,8 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { } } + let producesLetter: boolean[] = []; + this._codeInfo = []; for (let strCode in rawMappings) { if (rawMappings.hasOwnProperty(strCode)) { @@ -323,11 +319,21 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { log(`Unknown scanCode ${strCode} in mapping.`); continue; } - if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) { - continue; + const rawMapping = rawMappings[strCode]; + + const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; + if (immutableKeyCode !== -1) { + const keyCode = NATIVE_KEY_CODE_TO_KEY_CODE[rawMapping.vkey] || KeyCode.Unknown; + if (keyCode === KeyCode.Unknown || immutableKeyCode === keyCode) { + continue; + } + if (scanCode !== ScanCode.NumpadComma) { + // Looks like ScanCode.NumpadComma doesn't always map to KeyCode.NUMPAD_SEPARATOR + // e.g. on POR - PTB + continue; + } } - const rawMapping = rawMappings[strCode]; const value = rawMapping.value; const withShift = rawMapping.withShift; const withAltGr = rawMapping.withAltGr; @@ -343,25 +349,76 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { withShiftAltGr: withShiftAltGr, }; this._codeInfo[scanCode] = mapping; + this._scanCodeToKeyCode[scanCode] = keyCode; - if (keyCode !== KeyCode.Unknown) { - this._keyCodeExists[keyCode] = true; - if (value.length === 0) { - this._keyCodeToLabel[keyCode] = null; - } else if (value.length === 1) { - const charCode = value.charCodeAt(0); - if (charCode >= CharCode.a && charCode <= CharCode.z) { - this._keyCodeToLabel[keyCode] = String.fromCharCode(CharCode.A + (charCode - CharCode.a)); - } else { - this._keyCodeToLabel[keyCode] = value; - } - } else { + if (keyCode === KeyCode.Unknown) { + continue; + } + this._keyCodeExists[keyCode] = true; + + if (value.length === 0) { + // This key does not produce strings + this._keyCodeToLabel[keyCode] = null; + } + + else if (value.length > 1) { + // This key produces a letter representable with multiple UTF-16 code units. + this._keyCodeToLabel[keyCode] = value; + } + + else { + const charCode = value.charCodeAt(0); + + if (charCode >= CharCode.a && charCode <= CharCode.z) { + const upperCaseValue = CharCode.A + (charCode - CharCode.a); + producesLetter[upperCaseValue] = true; + this._keyCodeToLabel[keyCode] = String.fromCharCode(CharCode.A + (charCode - CharCode.a)); + } + + else if (charCode >= CharCode.A && charCode <= CharCode.Z) { + producesLetter[charCode] = true; + this._keyCodeToLabel[keyCode] = value; + } + + else { this._keyCodeToLabel[keyCode] = value; } } - this._scanCodeToKeyCode[scanCode] = keyCode; } } + + // Handle keyboard layouts where latin characters are not produced e.g. Cyrillic + const _registerLetterIfMissing = (charCode: CharCode, keyCode: KeyCode): void => { + if (!producesLetter[charCode]) { + this._keyCodeToLabel[keyCode] = String.fromCharCode(charCode); + } + }; + _registerLetterIfMissing(CharCode.A, KeyCode.KEY_A); + _registerLetterIfMissing(CharCode.B, KeyCode.KEY_B); + _registerLetterIfMissing(CharCode.C, KeyCode.KEY_C); + _registerLetterIfMissing(CharCode.D, KeyCode.KEY_D); + _registerLetterIfMissing(CharCode.E, KeyCode.KEY_E); + _registerLetterIfMissing(CharCode.F, KeyCode.KEY_F); + _registerLetterIfMissing(CharCode.G, KeyCode.KEY_G); + _registerLetterIfMissing(CharCode.H, KeyCode.KEY_H); + _registerLetterIfMissing(CharCode.I, KeyCode.KEY_I); + _registerLetterIfMissing(CharCode.J, KeyCode.KEY_J); + _registerLetterIfMissing(CharCode.K, KeyCode.KEY_K); + _registerLetterIfMissing(CharCode.L, KeyCode.KEY_L); + _registerLetterIfMissing(CharCode.M, KeyCode.KEY_M); + _registerLetterIfMissing(CharCode.N, KeyCode.KEY_N); + _registerLetterIfMissing(CharCode.O, KeyCode.KEY_O); + _registerLetterIfMissing(CharCode.P, KeyCode.KEY_P); + _registerLetterIfMissing(CharCode.Q, KeyCode.KEY_Q); + _registerLetterIfMissing(CharCode.R, KeyCode.KEY_R); + _registerLetterIfMissing(CharCode.S, KeyCode.KEY_S); + _registerLetterIfMissing(CharCode.T, KeyCode.KEY_T); + _registerLetterIfMissing(CharCode.U, KeyCode.KEY_U); + _registerLetterIfMissing(CharCode.V, KeyCode.KEY_V); + _registerLetterIfMissing(CharCode.W, KeyCode.KEY_W); + _registerLetterIfMissing(CharCode.X, KeyCode.KEY_X); + _registerLetterIfMissing(CharCode.Y, KeyCode.KEY_Y); + _registerLetterIfMissing(CharCode.Z, KeyCode.KEY_Z); } public dumpDebugInfo(): string { @@ -373,7 +430,7 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { ]; let cnt = 0; - result.push(`------------------------------------------------------------------------------------------------------------`); + result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`); for (let scanCode = ScanCode.None; scanCode < ScanCode.MAX_VALUE; scanCode++) { if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) { if (immutableSamples.indexOf(scanCode) === -1) { @@ -382,8 +439,8 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { } if (cnt % 6 === 0) { - result.push(`| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG |`); - result.push(`------------------------------------------------------------------------------------------------------------`); + result.push(`| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG |`); + result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`); } cnt++; @@ -404,13 +461,14 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { const outScanCode = `${ctrlKey ? 'Ctrl+' : ''}${shiftKey ? 'Shift+' : ''}${altKey ? 'Alt+' : ''}${strCode}`; const ariaLabel = (resolvedKb ? resolvedKb.getAriaLabel() : null); const outUILabel = (ariaLabel ? ariaLabel.replace(/Control\+/, 'Ctrl+') : null); + const outUserSettings = (resolvedKb ? resolvedKb.getUserSettingsLabel() : null); const outKey = WindowsNativeResolvedKeybinding.getProducedChar(scanCodeBinding, mapping); const outKb = (strKeyCode ? `${ctrlKey ? 'Ctrl+' : ''}${shiftKey ? 'Shift+' : ''}${altKey ? 'Alt+' : ''}${strKeyCode}` : null); const isWYSIWYG = (resolvedKb ? resolvedKb.isWYSIWYG() : false); const outWYSIWYG = (isWYSIWYG ? ' ' : ' NO '); - result.push(`| ${this._leftPad(outScanCode, 30)} | ${outKey} | ${this._leftPad(outKb, 25)} | ${this._leftPad(outUILabel, 25)} | ${outWYSIWYG} |`); + result.push(`| ${this._leftPad(outScanCode, 30)} | ${outKey} | ${this._leftPad(outKb, 25)} | ${this._leftPad(outUILabel, 25)} | ${this._leftPad(outUserSettings, 25)} | ${outWYSIWYG} |`); } - result.push(`------------------------------------------------------------------------------------------------------------`); + result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`); } @@ -435,6 +493,13 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { return this._getLabelForKeyCode(keyCode); } + public getUserSettingsLabelForKeyCode(keyCode: KeyCode): string { + if (this.isUSStandard) { + return KeyCodeUtils.toUserSettingsUS(keyCode); + } + return KeyCodeUtils.toUserSettingsGeneral(keyCode); + } + private _getLabelForKeyCode(keyCode: KeyCode): string { return this._keyCodeToLabel[keyCode] || KeyCodeUtils.toString(KeyCode.Unknown); } @@ -647,6 +712,8 @@ function _getNativeMap() { VK_OEM_PERIOD: KeyCode.US_DOT, VK_OEM_2: KeyCode.US_SLASH, VK_OEM_3: KeyCode.US_BACKTICK, + VK_ABNT_C1: KeyCode.ABNT_C1, + VK_ABNT_C2: KeyCode.ABNT_C2, VK_OEM_4: KeyCode.US_OPEN_SQUARE_BRACKET, VK_OEM_5: KeyCode.US_BACKSLASH, VK_OEM_6: KeyCode.US_CLOSE_SQUARE_BRACKET, diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index a569b807971..9e6f12e696c 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -126,8 +126,9 @@ export class KeyboardMapperFactory { } private static _createKeyboardMapper(isISOKeyboard: boolean, layoutInfo: nativeKeymap.IKeyboardLayoutInfo, rawMapping: nativeKeymap.IKeyboardMapping): IKeyboardMapper { + const isUSStandard = KeyboardMapperFactory._isUSStandard(layoutInfo); if (OS === OperatingSystem.Windows) { - return new WindowsKeyboardMapper(rawMapping); + return new WindowsKeyboardMapper(isUSStandard, rawMapping); } if (Object.keys(rawMapping).length === 0) { @@ -143,7 +144,6 @@ export class KeyboardMapperFactory { } } - const isUSStandard = KeyboardMapperFactory._isUSStandard(layoutInfo); return new MacLinuxKeyboardMapper(isISOKeyboard, isUSStandard, rawMapping, OS); } @@ -266,10 +266,10 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService { @IContextKeyService contextKeyService: IContextKeyService, @ICommandService commandService: ICommandService, @ITelemetryService private telemetryService: ITelemetryService, - @IMessageService private messageService: IMessageService, + @IMessageService messageService: IMessageService, @IEnvironmentService environmentService: IEnvironmentService, @IStatusbarService statusBarService: IStatusbarService, - @IConfigurationService private configurationService: IConfigurationService + @IConfigurationService configurationService: IConfigurationService ) { super(contextKeyService, commandService, messageService, statusBarService); diff --git a/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts index 9a0d80873c6..cc4495e14e9 100644 --- a/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts @@ -16,7 +16,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { KeyCode, SimpleKeybinding, ChordKeybinding } from 'vs/base/common/keyCodes'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import extfs = require('vs/base/node/extfs'); -import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import uuid = require('vs/base/common/uuid'); import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { FileService } from 'vs/workbench/services/files/node/fileService'; @@ -66,6 +67,7 @@ suite('Keybindings Editing', () => { instantiationService.stub(IConfigurationService, 'getConfiguration', { 'eol': '\n' }); instantiationService.stub(IConfigurationService, 'onDidUpdateConfiguration', () => { }); + instantiationService.stub(IWorkspaceContextService, new TestContextService()); instantiationService.stub(ILifecycleService, new TestLifecycleService()); instantiationService.stub(IEditorGroupService, new TestEditorGroupService()); instantiationService.stub(ITelemetryService, NullTelemetryService); diff --git a/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts b/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts index 2a9f0cb3f9c..c3fd1c5d78d 100644 --- a/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts +++ b/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts @@ -84,6 +84,8 @@ suite('keybindingIO', () => { testRoundtrip(KeyCode.US_DOT, '.', '.', '.'); testRoundtrip(KeyCode.US_SLASH, '/', '/', '/'); testRoundtrip(KeyCode.US_BACKTICK, '`', '`', '`'); + testRoundtrip(KeyCode.ABNT_C1, 'abnt_c1', 'abnt_c1', 'abnt_c1'); + testRoundtrip(KeyCode.ABNT_C2, 'abnt_c2', 'abnt_c2', 'abnt_c2'); testRoundtrip(KeyCode.US_OPEN_SQUARE_BRACKET, '[', '[', '['); testRoundtrip(KeyCode.US_BACKSLASH, '\\', '\\', '\\'); testRoundtrip(KeyCode.US_CLOSE_SQUARE_BRACKET, ']', ']', ']'); @@ -99,6 +101,8 @@ suite('keybindingIO', () => { testDeserialization('OEM_PERIOD', 'OEM_PERIOD', 'OEM_PERIOD', KeyCode.US_DOT); testDeserialization('OEM_2', 'OEM_2', 'OEM_2', KeyCode.US_SLASH); testDeserialization('OEM_3', 'OEM_3', 'OEM_3', KeyCode.US_BACKTICK); + testDeserialization('ABNT_C1', 'ABNT_C1', 'ABNT_C1', KeyCode.ABNT_C1); + testDeserialization('ABNT_C2', 'ABNT_C2', 'ABNT_C2', KeyCode.ABNT_C2); testDeserialization('OEM_4', 'OEM_4', 'OEM_4', KeyCode.US_OPEN_SQUARE_BRACKET); testDeserialization('OEM_5', 'OEM_5', 'OEM_5', KeyCode.US_BACKSLASH); testDeserialization('OEM_6', 'OEM_6', 'OEM_6', KeyCode.US_CLOSE_SQUARE_BRACKET); diff --git a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts b/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts index 8f5acff5abf..d79895b63f0 100644 --- a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts +++ b/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts @@ -17,34 +17,22 @@ import { ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCod export interface IResolvedKeybinding { label: string; - labelWithoutModifiers: string; ariaLabel: string; - ariaLabelWithoutModifiers: string; electronAccelerator: string; userSettingsLabel: string; isWYSIWYG: boolean; isChord: boolean; - hasCtrlModifier: boolean; - hasShiftModifier: boolean; - hasAltModifier: boolean; - hasMetaModifier: boolean; dispatchParts: [string, string]; } function toIResolvedKeybinding(kb: ResolvedKeybinding): IResolvedKeybinding { return { label: kb.getLabel(), - labelWithoutModifiers: kb.getLabelWithoutModifiers(), ariaLabel: kb.getAriaLabel(), - ariaLabelWithoutModifiers: kb.getAriaLabelWithoutModifiers(), electronAccelerator: kb.getElectronAccelerator(), userSettingsLabel: kb.getUserSettingsLabel(), isWYSIWYG: kb.isWYSIWYG(), isChord: kb.isChord(), - hasCtrlModifier: kb.hasCtrlModifier(), - hasShiftModifier: kb.hasShiftModifier(), - hasAltModifier: kb.hasAltModifier(), - hasMetaModifier: kb.hasMetaModifier(), dispatchParts: kb.getDispatchParts(), }; } @@ -100,7 +88,7 @@ export function readRawMapping(file: string): TPromise { let contents = buff.toString(); let func = new Function('define', contents); let rawMappings: T = null; - func(function (value) { + func(function (value: T) { rawMappings = value; }); return rawMappings; diff --git a/src/vs/workbench/services/keybinding/test/linux_de_ch.txt b/src/vs/workbench/services/keybinding/test/linux_de_ch.txt index ed9a85c54bc..aaf9263ec26 100644 --- a/src/vs/workbench/services/keybinding/test/linux_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/linux_de_ch.txt @@ -349,7 +349,6 @@ isUSStandard: false | | | ] | 1 | | | | | | | Shift+Alt+Digit9 | ) | Shift+Alt+9 | | Shift+Alt+9 | shift+alt+9 | Shift+Alt+9 | shift+alt+[Digit9] | | | Ctrl+Shift+Alt+Digit9 | ± | Ctrl+Shift+Alt+9 | | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+[Digit9] | | -| | | Ctrl+Shift+Alt+] | 1 | | | | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Digit0 | 0 | 0 | | 0 | 0 | 0 | [Digit0] | | | Ctrl+Digit0 | 0 | Ctrl+0 | | Ctrl+0 | ctrl+0 | Ctrl+0 | ctrl+[Digit0] | | @@ -392,7 +391,7 @@ isUSStandard: false | Alt+BracketLeft | ü | | | Alt+ü | alt+[BracketLeft] | null | alt+[BracketLeft] | NO | | Ctrl+Alt+BracketLeft | [ | [ | | Ctrl+Alt+ü | ctrl+alt+[BracketLeft] | null | ctrl+alt+[BracketLeft] | NO | | Shift+Alt+BracketLeft | è | | | Shift+Alt+ü | shift+alt+[BracketLeft] | null | shift+alt+[BracketLeft] | NO | -| Ctrl+Shift+Alt+BracketLeft | Ëš | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+ü | ctrl+shift+alt+[BracketLeft] | null | ctrl+shift+alt+[BracketLeft] | NO | +| Ctrl+Shift+Alt+BracketLeft | Ëš | | | Ctrl+Shift+Alt+ü | ctrl+shift+alt+[BracketLeft] | null | ctrl+shift+alt+[BracketLeft] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | BracketRight | ¨ | | | ¨ | [BracketRight] | null | [BracketRight] | NO | | Ctrl+BracketRight | ¨ | | | Ctrl+¨ | ctrl+[BracketRight] | null | ctrl+[BracketRight] | NO | @@ -401,7 +400,7 @@ isUSStandard: false | Alt+BracketRight | ¨ | | | Alt+¨ | alt+[BracketRight] | null | alt+[BracketRight] | NO | | Ctrl+Alt+BracketRight | ] | ] | 2 | Ctrl+Alt+¨ | ctrl+alt+[BracketRight] | null | ctrl+alt+[BracketRight] | NO | | Shift+Alt+BracketRight | ! | | | Shift+Alt+¨ | shift+alt+[BracketRight] | null | shift+alt+[BracketRight] | NO | -| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | 2 | Ctrl+Shift+Alt+¨ | ctrl+shift+alt+[BracketRight] | null | ctrl+shift+alt+[BracketRight] | NO | +| Ctrl+Shift+Alt+BracketRight | ¯ | | | Ctrl+Shift+Alt+¨ | ctrl+shift+alt+[BracketRight] | null | ctrl+shift+alt+[BracketRight] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -506,7 +505,7 @@ isUSStandard: false | Alt+IntlBackslash | < | Shift+Alt+, | | Alt+< | alt+[IntlBackslash] | null | alt+[IntlBackslash] | NO | | Ctrl+Alt+IntlBackslash | \ | \ | | Ctrl+Alt+< | ctrl+alt+[IntlBackslash] | null | ctrl+alt+[IntlBackslash] | NO | | Shift+Alt+IntlBackslash | > | Shift+Alt+. | | Shift+Alt+< | shift+alt+[IntlBackslash] | null | shift+alt+[IntlBackslash] | NO | -| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+< | ctrl+shift+alt+[IntlBackslash] | null | ctrl+shift+alt+[IntlBackslash] | NO | +| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+< | ctrl+shift+alt+[IntlBackslash] | null | ctrl+shift+alt+[IntlBackslash] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | IntlRo | --- | | | null | [IntlRo] | null | [IntlRo] | NO | | Ctrl+IntlRo | --- | | | null | ctrl+[IntlRo] | null | ctrl+[IntlRo] | NO | diff --git a/src/vs/workbench/services/keybinding/test/linux_en_uk.js b/src/vs/workbench/services/keybinding/test/linux_en_uk.js new file mode 100644 index 00000000000..57b55abead3 --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/linux_en_uk.js @@ -0,0 +1,1046 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +define({ + "Sleep": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "WakeUp": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "KeyA": { + "value": "a", + "withShift": "A", + "withAltGr": "æ", + "withShiftAltGr": "Æ" + }, + "KeyB": { + "value": "b", + "withShift": "B", + "withAltGr": "â€", + "withShiftAltGr": "’" + }, + "KeyC": { + "value": "c", + "withShift": "C", + "withAltGr": "¢", + "withShiftAltGr": "©" + }, + "KeyD": { + "value": "d", + "withShift": "D", + "withAltGr": "ð", + "withShiftAltGr": "Ã" + }, + "KeyE": { + "value": "e", + "withShift": "E", + "withAltGr": "e", + "withShiftAltGr": "E" + }, + "KeyF": { + "value": "f", + "withShift": "F", + "withAltGr": "Ä‘", + "withShiftAltGr": "ª" + }, + "KeyG": { + "value": "g", + "withShift": "G", + "withAltGr": "Å‹", + "withShiftAltGr": "ÅŠ" + }, + "KeyH": { + "value": "h", + "withShift": "H", + "withAltGr": "ħ", + "withShiftAltGr": "Ħ" + }, + "KeyI": { + "value": "i", + "withShift": "I", + "withAltGr": "→", + "withShiftAltGr": "ı" + }, + "KeyJ": { + "value": "j", + "withShift": "J", + "withAltGr": "̉", + "withShiftAltGr": "Ì›" + }, + "KeyK": { + "value": "k", + "withShift": "K", + "withAltGr": "ĸ", + "withShiftAltGr": "&" + }, + "KeyL": { + "value": "l", + "withShift": "L", + "withAltGr": "Å‚", + "withShiftAltGr": "Å" + }, + "KeyM": { + "value": "m", + "withShift": "M", + "withAltGr": "µ", + "withShiftAltGr": "º" + }, + "KeyN": { + "value": "n", + "withShift": "N", + "withAltGr": "n", + "withShiftAltGr": "N" + }, + "KeyO": { + "value": "o", + "withShift": "O", + "withAltGr": "ø", + "withShiftAltGr": "Ø" + }, + "KeyP": { + "value": "p", + "withShift": "P", + "withAltGr": "þ", + "withShiftAltGr": "Þ" + }, + "KeyQ": { + "value": "q", + "withShift": "Q", + "withAltGr": "@", + "withShiftAltGr": "Ω" + }, + "KeyR": { + "value": "r", + "withShift": "R", + "withAltGr": "¶", + "withShiftAltGr": "®" + }, + "KeyS": { + "value": "s", + "withShift": "S", + "withAltGr": "ß", + "withShiftAltGr": "§" + }, + "KeyT": { + "value": "t", + "withShift": "T", + "withAltGr": "ŧ", + "withShiftAltGr": "Ŧ" + }, + "KeyU": { + "value": "u", + "withShift": "U", + "withAltGr": "↓", + "withShiftAltGr": "↑" + }, + "KeyV": { + "value": "v", + "withShift": "V", + "withAltGr": "“", + "withShiftAltGr": "‘" + }, + "KeyW": { + "value": "w", + "withShift": "W", + "withAltGr": "Å‚", + "withShiftAltGr": "Å" + }, + "KeyX": { + "value": "x", + "withShift": "X", + "withAltGr": "»", + "withShiftAltGr": ">" + }, + "KeyY": { + "value": "y", + "withShift": "Y", + "withAltGr": "â†", + "withShiftAltGr": "Â¥" + }, + "KeyZ": { + "value": "z", + "withShift": "Z", + "withAltGr": "«", + "withShiftAltGr": "<" + }, + "Digit1": { + "value": "1", + "withShift": "!", + "withAltGr": "¹", + "withShiftAltGr": "¡" + }, + "Digit2": { + "value": "2", + "withShift": "\"", + "withAltGr": "²", + "withShiftAltGr": "â…›" + }, + "Digit3": { + "value": "3", + "withShift": "£", + "withAltGr": "³", + "withShiftAltGr": "£" + }, + "Digit4": { + "value": "4", + "withShift": "$", + "withAltGr": "€", + "withShiftAltGr": "¼" + }, + "Digit5": { + "value": "5", + "withShift": "%", + "withAltGr": "½", + "withShiftAltGr": "â…œ" + }, + "Digit6": { + "value": "6", + "withShift": "^", + "withAltGr": "¾", + "withShiftAltGr": "â…" + }, + "Digit7": { + "value": "7", + "withShift": "&", + "withAltGr": "{", + "withShiftAltGr": "â…ž" + }, + "Digit8": { + "value": "8", + "withShift": "*", + "withAltGr": "[", + "withShiftAltGr": "â„¢" + }, + "Digit9": { + "value": "9", + "withShift": "(", + "withAltGr": "]", + "withShiftAltGr": "±" + }, + "Digit0": { + "value": "0", + "withShift": ")", + "withAltGr": "}", + "withShiftAltGr": "°" + }, + "Enter": { + "value": "\r", + "withShift": "\r", + "withAltGr": "\r", + "withShiftAltGr": "\r" + }, + "Escape": { + "value": "\u001b", + "withShift": "\u001b", + "withAltGr": "\u001b", + "withShiftAltGr": "\u001b" + }, + "Backspace": { + "value": "\b", + "withShift": "\b", + "withAltGr": "\b", + "withShiftAltGr": "\b" + }, + "Tab": { + "value": "\t", + "withShift": "", + "withAltGr": "\t", + "withShiftAltGr": "" + }, + "Space": { + "value": " ", + "withShift": " ", + "withAltGr": " ", + "withShiftAltGr": " " + }, + "Minus": { + "value": "-", + "withShift": "_", + "withAltGr": "\\", + "withShiftAltGr": "¿" + }, + "Equal": { + "value": "=", + "withShift": "+", + "withAltGr": "̧", + "withShiftAltGr": "̨" + }, + "BracketLeft": { + "value": "[", + "withShift": "{", + "withAltGr": "̈", + "withShiftAltGr": "ÌŠ" + }, + "BracketRight": { + "value": "]", + "withShift": "}", + "withAltGr": "̃", + "withShiftAltGr": "Ì„" + }, + "Backslash": { + "value": "#", + "withShift": "~", + "withAltGr": "Ì€", + "withShiftAltGr": "̆" + }, + "Semicolon": { + "value": ";", + "withShift": ":", + "withAltGr": "Ì", + "withShiftAltGr": "Ì‹" + }, + "Quote": { + "value": "'", + "withShift": "@", + "withAltGr": "Ì‚", + "withShiftAltGr": "ÌŒ" + }, + "Backquote": { + "value": "`", + "withShift": "¬", + "withAltGr": "|", + "withShiftAltGr": "|" + }, + "Comma": { + "value": ",", + "withShift": "<", + "withAltGr": "─", + "withShiftAltGr": "×" + }, + "Period": { + "value": ".", + "withShift": ">", + "withAltGr": "·", + "withShiftAltGr": "÷" + }, + "Slash": { + "value": "/", + "withShift": "?", + "withAltGr": "Ì£", + "withShiftAltGr": "̇" + }, + "CapsLock": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F1": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F2": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F3": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F4": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F5": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F6": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F7": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F8": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F9": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F10": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F11": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F12": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "PrintScreen": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ScrollLock": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Pause": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Insert": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Home": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "PageUp": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Delete": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "End": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "PageDown": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ArrowRight": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ArrowLeft": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ArrowDown": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ArrowUp": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NumLock": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NumpadDivide": { + "value": "/", + "withShift": "/", + "withAltGr": "/", + "withShiftAltGr": "/" + }, + "NumpadMultiply": { + "value": "*", + "withShift": "*", + "withAltGr": "*", + "withShiftAltGr": "*" + }, + "NumpadSubtract": { + "value": "-", + "withShift": "-", + "withAltGr": "-", + "withShiftAltGr": "-" + }, + "NumpadAdd": { + "value": "+", + "withShift": "+", + "withAltGr": "+", + "withShiftAltGr": "+" + }, + "NumpadEnter": { + "value": "\r", + "withShift": "\r", + "withAltGr": "\r", + "withShiftAltGr": "\r" + }, + "Numpad1": { + "value": "", + "withShift": "1", + "withAltGr": "", + "withShiftAltGr": "1" + }, + "Numpad2": { + "value": "", + "withShift": "2", + "withAltGr": "", + "withShiftAltGr": "2" + }, + "Numpad3": { + "value": "", + "withShift": "3", + "withAltGr": "", + "withShiftAltGr": "3" + }, + "Numpad4": { + "value": "", + "withShift": "4", + "withAltGr": "", + "withShiftAltGr": "4" + }, + "Numpad5": { + "value": "", + "withShift": "5", + "withAltGr": "", + "withShiftAltGr": "5" + }, + "Numpad6": { + "value": "", + "withShift": "6", + "withAltGr": "", + "withShiftAltGr": "6" + }, + "Numpad7": { + "value": "", + "withShift": "7", + "withAltGr": "", + "withShiftAltGr": "7" + }, + "Numpad8": { + "value": "", + "withShift": "8", + "withAltGr": "", + "withShiftAltGr": "8" + }, + "Numpad9": { + "value": "", + "withShift": "9", + "withAltGr": "", + "withShiftAltGr": "9" + }, + "Numpad0": { + "value": "", + "withShift": "0", + "withAltGr": "", + "withShiftAltGr": "0" + }, + "NumpadDecimal": { + "value": "", + "withShift": ".", + "withAltGr": "", + "withShiftAltGr": "." + }, + "IntlBackslash": { + "value": "\\", + "withShift": "|", + "withAltGr": "|", + "withShiftAltGr": "¦" + }, + "ContextMenu": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Power": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NumpadEqual": { + "value": "=", + "withShift": "=", + "withAltGr": "=", + "withShiftAltGr": "=" + }, + "F13": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F14": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F15": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F16": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F17": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F18": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F19": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F20": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F21": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F22": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F23": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "F24": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Open": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Help": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Select": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Again": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Undo": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Cut": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Copy": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Paste": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Find": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "AudioVolumeMute": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "AudioVolumeUp": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "AudioVolumeDown": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NumpadComma": { + "value": ".", + "withShift": ".", + "withAltGr": ".", + "withShiftAltGr": "." + }, + "IntlRo": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "KanaMode": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "IntlYen": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Convert": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NonConvert": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Lang1": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Lang2": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Lang3": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Lang4": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Lang5": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "NumpadParenLeft": { + "value": "(", + "withShift": "(", + "withAltGr": "(", + "withShiftAltGr": "(" + }, + "NumpadParenRight": { + "value": ")", + "withShift": ")", + "withAltGr": ")", + "withShiftAltGr": ")" + }, + "ControlLeft": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ShiftLeft": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "AltLeft": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MetaLeft": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ControlRight": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "ShiftRight": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "AltRight": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MetaRight": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrightnessUp": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrightnessDown": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaPlay": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaRecord": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaFastForward": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaRewind": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaTrackNext": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaTrackPrevious": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaStop": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "Eject": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaPlayPause": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MediaSelect": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "LaunchMail": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "LaunchApp2": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "LaunchApp1": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "SelectTask": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "LaunchScreenSaver": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserSearch": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserHome": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserBack": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserForward": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserStop": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserRefresh": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "BrowserFavorites": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MailReply": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MailForward": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + }, + "MailSend": { + "value": "", + "withShift": "", + "withAltGr": "", + "withShiftAltGr": "" + } +}); diff --git a/src/vs/workbench/services/keybinding/test/linux_en_uk.txt b/src/vs/workbench/services/keybinding/test/linux_en_uk.txt new file mode 100644 index 00000000000..9d1ab7184c4 --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/linux_en_uk.txt @@ -0,0 +1,517 @@ +isUSStandard: false +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyA | a | A | | A | a | A | [KeyA] | | +| Ctrl+KeyA | a | Ctrl+A | | Ctrl+A | ctrl+a | Ctrl+A | ctrl+[KeyA] | | +| Shift+KeyA | A | Shift+A | | Shift+A | shift+a | Shift+A | shift+[KeyA] | | +| Ctrl+Shift+KeyA | A | Ctrl+Shift+A | | Ctrl+Shift+A | ctrl+shift+a | Ctrl+Shift+A | ctrl+shift+[KeyA] | | +| Alt+KeyA | a | Alt+A | | Alt+A | alt+a | Alt+A | alt+[KeyA] | | +| Ctrl+Alt+KeyA | æ | Ctrl+Alt+A | | Ctrl+Alt+A | ctrl+alt+a | Ctrl+Alt+A | ctrl+alt+[KeyA] | | +| Shift+Alt+KeyA | A | Shift+Alt+A | | Shift+Alt+A | shift+alt+a | Shift+Alt+A | shift+alt+[KeyA] | | +| Ctrl+Shift+Alt+KeyA | Æ | Ctrl+Shift+Alt+A | | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | Ctrl+Shift+Alt+A | ctrl+shift+alt+[KeyA] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyB | b | B | | B | b | B | [KeyB] | | +| Ctrl+KeyB | b | Ctrl+B | | Ctrl+B | ctrl+b | Ctrl+B | ctrl+[KeyB] | | +| Shift+KeyB | B | Shift+B | | Shift+B | shift+b | Shift+B | shift+[KeyB] | | +| Ctrl+Shift+KeyB | B | Ctrl+Shift+B | | Ctrl+Shift+B | ctrl+shift+b | Ctrl+Shift+B | ctrl+shift+[KeyB] | | +| Alt+KeyB | b | Alt+B | | Alt+B | alt+b | Alt+B | alt+[KeyB] | | +| Ctrl+Alt+KeyB | †| Ctrl+Alt+B | | Ctrl+Alt+B | ctrl+alt+b | Ctrl+Alt+B | ctrl+alt+[KeyB] | | +| Shift+Alt+KeyB | B | Shift+Alt+B | | Shift+Alt+B | shift+alt+b | Shift+Alt+B | shift+alt+[KeyB] | | +| Ctrl+Shift+Alt+KeyB | ’ | Ctrl+Shift+Alt+B | | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | Ctrl+Shift+Alt+B | ctrl+shift+alt+[KeyB] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyC | c | C | | C | c | C | [KeyC] | | +| Ctrl+KeyC | c | Ctrl+C | | Ctrl+C | ctrl+c | Ctrl+C | ctrl+[KeyC] | | +| Shift+KeyC | C | Shift+C | | Shift+C | shift+c | Shift+C | shift+[KeyC] | | +| Ctrl+Shift+KeyC | C | Ctrl+Shift+C | | Ctrl+Shift+C | ctrl+shift+c | Ctrl+Shift+C | ctrl+shift+[KeyC] | | +| Alt+KeyC | c | Alt+C | | Alt+C | alt+c | Alt+C | alt+[KeyC] | | +| Ctrl+Alt+KeyC | ¢ | Ctrl+Alt+C | | Ctrl+Alt+C | ctrl+alt+c | Ctrl+Alt+C | ctrl+alt+[KeyC] | | +| Shift+Alt+KeyC | C | Shift+Alt+C | | Shift+Alt+C | shift+alt+c | Shift+Alt+C | shift+alt+[KeyC] | | +| Ctrl+Shift+Alt+KeyC | © | Ctrl+Shift+Alt+C | | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | Ctrl+Shift+Alt+C | ctrl+shift+alt+[KeyC] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyD | d | D | | D | d | D | [KeyD] | | +| Ctrl+KeyD | d | Ctrl+D | | Ctrl+D | ctrl+d | Ctrl+D | ctrl+[KeyD] | | +| Shift+KeyD | D | Shift+D | | Shift+D | shift+d | Shift+D | shift+[KeyD] | | +| Ctrl+Shift+KeyD | D | Ctrl+Shift+D | | Ctrl+Shift+D | ctrl+shift+d | Ctrl+Shift+D | ctrl+shift+[KeyD] | | +| Alt+KeyD | d | Alt+D | | Alt+D | alt+d | Alt+D | alt+[KeyD] | | +| Ctrl+Alt+KeyD | ð | Ctrl+Alt+D | | Ctrl+Alt+D | ctrl+alt+d | Ctrl+Alt+D | ctrl+alt+[KeyD] | | +| Shift+Alt+KeyD | D | Shift+Alt+D | | Shift+Alt+D | shift+alt+d | Shift+Alt+D | shift+alt+[KeyD] | | +| Ctrl+Shift+Alt+KeyD | à | Ctrl+Shift+Alt+D | | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | Ctrl+Shift+Alt+D | ctrl+shift+alt+[KeyD] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyE | e | E | | E | e | E | [KeyE] | | +| Ctrl+KeyE | e | Ctrl+E | | Ctrl+E | ctrl+e | Ctrl+E | ctrl+[KeyE] | | +| Shift+KeyE | E | Shift+E | | Shift+E | shift+e | Shift+E | shift+[KeyE] | | +| Ctrl+Shift+KeyE | E | Ctrl+Shift+E | | Ctrl+Shift+E | ctrl+shift+e | Ctrl+Shift+E | ctrl+shift+[KeyE] | | +| Alt+KeyE | e | Alt+E | | Alt+E | alt+e | Alt+E | alt+[KeyE] | | +| Ctrl+Alt+KeyE | e | Ctrl+Alt+E | | Ctrl+Alt+E | ctrl+alt+e | Ctrl+Alt+E | ctrl+alt+[KeyE] | | +| Shift+Alt+KeyE | E | Shift+Alt+E | | Shift+Alt+E | shift+alt+e | Shift+Alt+E | shift+alt+[KeyE] | | +| Ctrl+Shift+Alt+KeyE | E | Ctrl+Shift+Alt+E | | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | Ctrl+Shift+Alt+E | ctrl+shift+alt+[KeyE] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyF | f | F | | F | f | F | [KeyF] | | +| Ctrl+KeyF | f | Ctrl+F | | Ctrl+F | ctrl+f | Ctrl+F | ctrl+[KeyF] | | +| Shift+KeyF | F | Shift+F | | Shift+F | shift+f | Shift+F | shift+[KeyF] | | +| Ctrl+Shift+KeyF | F | Ctrl+Shift+F | | Ctrl+Shift+F | ctrl+shift+f | Ctrl+Shift+F | ctrl+shift+[KeyF] | | +| Alt+KeyF | f | Alt+F | | Alt+F | alt+f | Alt+F | alt+[KeyF] | | +| Ctrl+Alt+KeyF | Ä‘ | Ctrl+Alt+F | | Ctrl+Alt+F | ctrl+alt+f | Ctrl+Alt+F | ctrl+alt+[KeyF] | | +| Shift+Alt+KeyF | F | Shift+Alt+F | | Shift+Alt+F | shift+alt+f | Shift+Alt+F | shift+alt+[KeyF] | | +| Ctrl+Shift+Alt+KeyF | ª | Ctrl+Shift+Alt+F | | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | Ctrl+Shift+Alt+F | ctrl+shift+alt+[KeyF] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyG | g | G | | G | g | G | [KeyG] | | +| Ctrl+KeyG | g | Ctrl+G | | Ctrl+G | ctrl+g | Ctrl+G | ctrl+[KeyG] | | +| Shift+KeyG | G | Shift+G | | Shift+G | shift+g | Shift+G | shift+[KeyG] | | +| Ctrl+Shift+KeyG | G | Ctrl+Shift+G | | Ctrl+Shift+G | ctrl+shift+g | Ctrl+Shift+G | ctrl+shift+[KeyG] | | +| Alt+KeyG | g | Alt+G | | Alt+G | alt+g | Alt+G | alt+[KeyG] | | +| Ctrl+Alt+KeyG | Å‹ | Ctrl+Alt+G | | Ctrl+Alt+G | ctrl+alt+g | Ctrl+Alt+G | ctrl+alt+[KeyG] | | +| Shift+Alt+KeyG | G | Shift+Alt+G | | Shift+Alt+G | shift+alt+g | Shift+Alt+G | shift+alt+[KeyG] | | +| Ctrl+Shift+Alt+KeyG | ÅŠ | Ctrl+Shift+Alt+G | | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | Ctrl+Shift+Alt+G | ctrl+shift+alt+[KeyG] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyH | h | H | | H | h | H | [KeyH] | | +| Ctrl+KeyH | h | Ctrl+H | | Ctrl+H | ctrl+h | Ctrl+H | ctrl+[KeyH] | | +| Shift+KeyH | H | Shift+H | | Shift+H | shift+h | Shift+H | shift+[KeyH] | | +| Ctrl+Shift+KeyH | H | Ctrl+Shift+H | | Ctrl+Shift+H | ctrl+shift+h | Ctrl+Shift+H | ctrl+shift+[KeyH] | | +| Alt+KeyH | h | Alt+H | | Alt+H | alt+h | Alt+H | alt+[KeyH] | | +| Ctrl+Alt+KeyH | ħ | Ctrl+Alt+H | | Ctrl+Alt+H | ctrl+alt+h | Ctrl+Alt+H | ctrl+alt+[KeyH] | | +| Shift+Alt+KeyH | H | Shift+Alt+H | | Shift+Alt+H | shift+alt+h | Shift+Alt+H | shift+alt+[KeyH] | | +| Ctrl+Shift+Alt+KeyH | Ħ | Ctrl+Shift+Alt+H | | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | Ctrl+Shift+Alt+H | ctrl+shift+alt+[KeyH] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyI | i | I | | I | i | I | [KeyI] | | +| Ctrl+KeyI | i | Ctrl+I | | Ctrl+I | ctrl+i | Ctrl+I | ctrl+[KeyI] | | +| Shift+KeyI | I | Shift+I | | Shift+I | shift+i | Shift+I | shift+[KeyI] | | +| Ctrl+Shift+KeyI | I | Ctrl+Shift+I | | Ctrl+Shift+I | ctrl+shift+i | Ctrl+Shift+I | ctrl+shift+[KeyI] | | +| Alt+KeyI | i | Alt+I | | Alt+I | alt+i | Alt+I | alt+[KeyI] | | +| Ctrl+Alt+KeyI | → | Ctrl+Alt+I | | Ctrl+Alt+I | ctrl+alt+i | Ctrl+Alt+I | ctrl+alt+[KeyI] | | +| Shift+Alt+KeyI | I | Shift+Alt+I | | Shift+Alt+I | shift+alt+i | Shift+Alt+I | shift+alt+[KeyI] | | +| Ctrl+Shift+Alt+KeyI | ı | Ctrl+Shift+Alt+I | | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | Ctrl+Shift+Alt+I | ctrl+shift+alt+[KeyI] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyJ | j | J | | J | j | J | [KeyJ] | | +| Ctrl+KeyJ | j | Ctrl+J | | Ctrl+J | ctrl+j | Ctrl+J | ctrl+[KeyJ] | | +| Shift+KeyJ | J | Shift+J | | Shift+J | shift+j | Shift+J | shift+[KeyJ] | | +| Ctrl+Shift+KeyJ | J | Ctrl+Shift+J | | Ctrl+Shift+J | ctrl+shift+j | Ctrl+Shift+J | ctrl+shift+[KeyJ] | | +| Alt+KeyJ | j | Alt+J | | Alt+J | alt+j | Alt+J | alt+[KeyJ] | | +| Ctrl+Alt+KeyJ | U+309 | Ctrl+Alt+J | | Ctrl+Alt+J | ctrl+alt+j | Ctrl+Alt+J | ctrl+alt+[KeyJ] | | +| Shift+Alt+KeyJ | J | Shift+Alt+J | | Shift+Alt+J | shift+alt+j | Shift+Alt+J | shift+alt+[KeyJ] | | +| Ctrl+Shift+Alt+KeyJ | U+31b | Ctrl+Shift+Alt+J | | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | Ctrl+Shift+Alt+J | ctrl+shift+alt+[KeyJ] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyK | k | K | | K | k | K | [KeyK] | | +| Ctrl+KeyK | k | Ctrl+K | | Ctrl+K | ctrl+k | Ctrl+K | ctrl+[KeyK] | | +| Shift+KeyK | K | Shift+K | | Shift+K | shift+k | Shift+K | shift+[KeyK] | | +| Ctrl+Shift+KeyK | K | Ctrl+Shift+K | | Ctrl+Shift+K | ctrl+shift+k | Ctrl+Shift+K | ctrl+shift+[KeyK] | | +| Alt+KeyK | k | Alt+K | | Alt+K | alt+k | Alt+K | alt+[KeyK] | | +| Ctrl+Alt+KeyK | ĸ | Ctrl+Alt+K | | Ctrl+Alt+K | ctrl+alt+k | Ctrl+Alt+K | ctrl+alt+[KeyK] | | +| Shift+Alt+KeyK | K | Shift+Alt+K | | Shift+Alt+K | shift+alt+k | Shift+Alt+K | shift+alt+[KeyK] | | +| Ctrl+Shift+Alt+KeyK | & | Ctrl+Shift+Alt+K | | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | Ctrl+Shift+Alt+K | ctrl+shift+alt+[KeyK] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyL | l | L | | L | l | L | [KeyL] | | +| Ctrl+KeyL | l | Ctrl+L | | Ctrl+L | ctrl+l | Ctrl+L | ctrl+[KeyL] | | +| Shift+KeyL | L | Shift+L | | Shift+L | shift+l | Shift+L | shift+[KeyL] | | +| Ctrl+Shift+KeyL | L | Ctrl+Shift+L | | Ctrl+Shift+L | ctrl+shift+l | Ctrl+Shift+L | ctrl+shift+[KeyL] | | +| Alt+KeyL | l | Alt+L | | Alt+L | alt+l | Alt+L | alt+[KeyL] | | +| Ctrl+Alt+KeyL | Å‚ | Ctrl+Alt+L | | Ctrl+Alt+L | ctrl+alt+l | Ctrl+Alt+L | ctrl+alt+[KeyL] | | +| Shift+Alt+KeyL | L | Shift+Alt+L | | Shift+Alt+L | shift+alt+l | Shift+Alt+L | shift+alt+[KeyL] | | +| Ctrl+Shift+Alt+KeyL | Å | Ctrl+Shift+Alt+L | | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | Ctrl+Shift+Alt+L | ctrl+shift+alt+[KeyL] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyM | m | M | | M | m | M | [KeyM] | | +| Ctrl+KeyM | m | Ctrl+M | | Ctrl+M | ctrl+m | Ctrl+M | ctrl+[KeyM] | | +| Shift+KeyM | M | Shift+M | | Shift+M | shift+m | Shift+M | shift+[KeyM] | | +| Ctrl+Shift+KeyM | M | Ctrl+Shift+M | | Ctrl+Shift+M | ctrl+shift+m | Ctrl+Shift+M | ctrl+shift+[KeyM] | | +| Alt+KeyM | m | Alt+M | | Alt+M | alt+m | Alt+M | alt+[KeyM] | | +| Ctrl+Alt+KeyM | µ | Ctrl+Alt+M | | Ctrl+Alt+M | ctrl+alt+m | Ctrl+Alt+M | ctrl+alt+[KeyM] | | +| Shift+Alt+KeyM | M | Shift+Alt+M | | Shift+Alt+M | shift+alt+m | Shift+Alt+M | shift+alt+[KeyM] | | +| Ctrl+Shift+Alt+KeyM | º | Ctrl+Shift+Alt+M | | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | Ctrl+Shift+Alt+M | ctrl+shift+alt+[KeyM] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyN | n | N | | N | n | N | [KeyN] | | +| Ctrl+KeyN | n | Ctrl+N | | Ctrl+N | ctrl+n | Ctrl+N | ctrl+[KeyN] | | +| Shift+KeyN | N | Shift+N | | Shift+N | shift+n | Shift+N | shift+[KeyN] | | +| Ctrl+Shift+KeyN | N | Ctrl+Shift+N | | Ctrl+Shift+N | ctrl+shift+n | Ctrl+Shift+N | ctrl+shift+[KeyN] | | +| Alt+KeyN | n | Alt+N | | Alt+N | alt+n | Alt+N | alt+[KeyN] | | +| Ctrl+Alt+KeyN | n | Ctrl+Alt+N | | Ctrl+Alt+N | ctrl+alt+n | Ctrl+Alt+N | ctrl+alt+[KeyN] | | +| Shift+Alt+KeyN | N | Shift+Alt+N | | Shift+Alt+N | shift+alt+n | Shift+Alt+N | shift+alt+[KeyN] | | +| Ctrl+Shift+Alt+KeyN | N | Ctrl+Shift+Alt+N | | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | Ctrl+Shift+Alt+N | ctrl+shift+alt+[KeyN] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyO | o | O | | O | o | O | [KeyO] | | +| Ctrl+KeyO | o | Ctrl+O | | Ctrl+O | ctrl+o | Ctrl+O | ctrl+[KeyO] | | +| Shift+KeyO | O | Shift+O | | Shift+O | shift+o | Shift+O | shift+[KeyO] | | +| Ctrl+Shift+KeyO | O | Ctrl+Shift+O | | Ctrl+Shift+O | ctrl+shift+o | Ctrl+Shift+O | ctrl+shift+[KeyO] | | +| Alt+KeyO | o | Alt+O | | Alt+O | alt+o | Alt+O | alt+[KeyO] | | +| Ctrl+Alt+KeyO | ø | Ctrl+Alt+O | | Ctrl+Alt+O | ctrl+alt+o | Ctrl+Alt+O | ctrl+alt+[KeyO] | | +| Shift+Alt+KeyO | O | Shift+Alt+O | | Shift+Alt+O | shift+alt+o | Shift+Alt+O | shift+alt+[KeyO] | | +| Ctrl+Shift+Alt+KeyO | Ø | Ctrl+Shift+Alt+O | | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | Ctrl+Shift+Alt+O | ctrl+shift+alt+[KeyO] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyP | p | P | | P | p | P | [KeyP] | | +| Ctrl+KeyP | p | Ctrl+P | | Ctrl+P | ctrl+p | Ctrl+P | ctrl+[KeyP] | | +| Shift+KeyP | P | Shift+P | | Shift+P | shift+p | Shift+P | shift+[KeyP] | | +| Ctrl+Shift+KeyP | P | Ctrl+Shift+P | | Ctrl+Shift+P | ctrl+shift+p | Ctrl+Shift+P | ctrl+shift+[KeyP] | | +| Alt+KeyP | p | Alt+P | | Alt+P | alt+p | Alt+P | alt+[KeyP] | | +| Ctrl+Alt+KeyP | þ | Ctrl+Alt+P | | Ctrl+Alt+P | ctrl+alt+p | Ctrl+Alt+P | ctrl+alt+[KeyP] | | +| Shift+Alt+KeyP | P | Shift+Alt+P | | Shift+Alt+P | shift+alt+p | Shift+Alt+P | shift+alt+[KeyP] | | +| Ctrl+Shift+Alt+KeyP | Þ | Ctrl+Shift+Alt+P | | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | Ctrl+Shift+Alt+P | ctrl+shift+alt+[KeyP] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyQ | q | Q | | Q | q | Q | [KeyQ] | | +| Ctrl+KeyQ | q | Ctrl+Q | | Ctrl+Q | ctrl+q | Ctrl+Q | ctrl+[KeyQ] | | +| Shift+KeyQ | Q | Shift+Q | | Shift+Q | shift+q | Shift+Q | shift+[KeyQ] | | +| Ctrl+Shift+KeyQ | Q | Ctrl+Shift+Q | | Ctrl+Shift+Q | ctrl+shift+q | Ctrl+Shift+Q | ctrl+shift+[KeyQ] | | +| Alt+KeyQ | q | Alt+Q | | Alt+Q | alt+q | Alt+Q | alt+[KeyQ] | | +| Ctrl+Alt+KeyQ | @ | Ctrl+Alt+Q | | Ctrl+Alt+Q | ctrl+alt+q | Ctrl+Alt+Q | ctrl+alt+[KeyQ] | | +| Shift+Alt+KeyQ | Q | Shift+Alt+Q | | Shift+Alt+Q | shift+alt+q | Shift+Alt+Q | shift+alt+[KeyQ] | | +| Ctrl+Shift+Alt+KeyQ | Ω | Ctrl+Shift+Alt+Q | | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+[KeyQ] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyR | r | R | | R | r | R | [KeyR] | | +| Ctrl+KeyR | r | Ctrl+R | | Ctrl+R | ctrl+r | Ctrl+R | ctrl+[KeyR] | | +| Shift+KeyR | R | Shift+R | | Shift+R | shift+r | Shift+R | shift+[KeyR] | | +| Ctrl+Shift+KeyR | R | Ctrl+Shift+R | | Ctrl+Shift+R | ctrl+shift+r | Ctrl+Shift+R | ctrl+shift+[KeyR] | | +| Alt+KeyR | r | Alt+R | | Alt+R | alt+r | Alt+R | alt+[KeyR] | | +| Ctrl+Alt+KeyR | ¶ | Ctrl+Alt+R | | Ctrl+Alt+R | ctrl+alt+r | Ctrl+Alt+R | ctrl+alt+[KeyR] | | +| Shift+Alt+KeyR | R | Shift+Alt+R | | Shift+Alt+R | shift+alt+r | Shift+Alt+R | shift+alt+[KeyR] | | +| Ctrl+Shift+Alt+KeyR | ® | Ctrl+Shift+Alt+R | | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | Ctrl+Shift+Alt+R | ctrl+shift+alt+[KeyR] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyS | s | S | | S | s | S | [KeyS] | | +| Ctrl+KeyS | s | Ctrl+S | | Ctrl+S | ctrl+s | Ctrl+S | ctrl+[KeyS] | | +| Shift+KeyS | S | Shift+S | | Shift+S | shift+s | Shift+S | shift+[KeyS] | | +| Ctrl+Shift+KeyS | S | Ctrl+Shift+S | | Ctrl+Shift+S | ctrl+shift+s | Ctrl+Shift+S | ctrl+shift+[KeyS] | | +| Alt+KeyS | s | Alt+S | | Alt+S | alt+s | Alt+S | alt+[KeyS] | | +| Ctrl+Alt+KeyS | ß | Ctrl+Alt+S | | Ctrl+Alt+S | ctrl+alt+s | Ctrl+Alt+S | ctrl+alt+[KeyS] | | +| Shift+Alt+KeyS | S | Shift+Alt+S | | Shift+Alt+S | shift+alt+s | Shift+Alt+S | shift+alt+[KeyS] | | +| Ctrl+Shift+Alt+KeyS | § | Ctrl+Shift+Alt+S | | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | Ctrl+Shift+Alt+S | ctrl+shift+alt+[KeyS] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyT | t | T | | T | t | T | [KeyT] | | +| Ctrl+KeyT | t | Ctrl+T | | Ctrl+T | ctrl+t | Ctrl+T | ctrl+[KeyT] | | +| Shift+KeyT | T | Shift+T | | Shift+T | shift+t | Shift+T | shift+[KeyT] | | +| Ctrl+Shift+KeyT | T | Ctrl+Shift+T | | Ctrl+Shift+T | ctrl+shift+t | Ctrl+Shift+T | ctrl+shift+[KeyT] | | +| Alt+KeyT | t | Alt+T | | Alt+T | alt+t | Alt+T | alt+[KeyT] | | +| Ctrl+Alt+KeyT | ŧ | Ctrl+Alt+T | | Ctrl+Alt+T | ctrl+alt+t | Ctrl+Alt+T | ctrl+alt+[KeyT] | | +| Shift+Alt+KeyT | T | Shift+Alt+T | | Shift+Alt+T | shift+alt+t | Shift+Alt+T | shift+alt+[KeyT] | | +| Ctrl+Shift+Alt+KeyT | Ŧ | Ctrl+Shift+Alt+T | | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | Ctrl+Shift+Alt+T | ctrl+shift+alt+[KeyT] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyU | u | U | | U | u | U | [KeyU] | | +| Ctrl+KeyU | u | Ctrl+U | | Ctrl+U | ctrl+u | Ctrl+U | ctrl+[KeyU] | | +| Shift+KeyU | U | Shift+U | | Shift+U | shift+u | Shift+U | shift+[KeyU] | | +| Ctrl+Shift+KeyU | U | Ctrl+Shift+U | | Ctrl+Shift+U | ctrl+shift+u | Ctrl+Shift+U | ctrl+shift+[KeyU] | | +| Alt+KeyU | u | Alt+U | | Alt+U | alt+u | Alt+U | alt+[KeyU] | | +| Ctrl+Alt+KeyU | ↓ | Ctrl+Alt+U | | Ctrl+Alt+U | ctrl+alt+u | Ctrl+Alt+U | ctrl+alt+[KeyU] | | +| Shift+Alt+KeyU | U | Shift+Alt+U | | Shift+Alt+U | shift+alt+u | Shift+Alt+U | shift+alt+[KeyU] | | +| Ctrl+Shift+Alt+KeyU | ↑ | Ctrl+Shift+Alt+U | | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | Ctrl+Shift+Alt+U | ctrl+shift+alt+[KeyU] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyV | v | V | | V | v | V | [KeyV] | | +| Ctrl+KeyV | v | Ctrl+V | | Ctrl+V | ctrl+v | Ctrl+V | ctrl+[KeyV] | | +| Shift+KeyV | V | Shift+V | | Shift+V | shift+v | Shift+V | shift+[KeyV] | | +| Ctrl+Shift+KeyV | V | Ctrl+Shift+V | | Ctrl+Shift+V | ctrl+shift+v | Ctrl+Shift+V | ctrl+shift+[KeyV] | | +| Alt+KeyV | v | Alt+V | | Alt+V | alt+v | Alt+V | alt+[KeyV] | | +| Ctrl+Alt+KeyV | “ | Ctrl+Alt+V | | Ctrl+Alt+V | ctrl+alt+v | Ctrl+Alt+V | ctrl+alt+[KeyV] | | +| Shift+Alt+KeyV | V | Shift+Alt+V | | Shift+Alt+V | shift+alt+v | Shift+Alt+V | shift+alt+[KeyV] | | +| Ctrl+Shift+Alt+KeyV | ‘ | Ctrl+Shift+Alt+V | | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | Ctrl+Shift+Alt+V | ctrl+shift+alt+[KeyV] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyW | w | W | | W | w | W | [KeyW] | | +| Ctrl+KeyW | w | Ctrl+W | | Ctrl+W | ctrl+w | Ctrl+W | ctrl+[KeyW] | | +| Shift+KeyW | W | Shift+W | | Shift+W | shift+w | Shift+W | shift+[KeyW] | | +| Ctrl+Shift+KeyW | W | Ctrl+Shift+W | | Ctrl+Shift+W | ctrl+shift+w | Ctrl+Shift+W | ctrl+shift+[KeyW] | | +| Alt+KeyW | w | Alt+W | | Alt+W | alt+w | Alt+W | alt+[KeyW] | | +| Ctrl+Alt+KeyW | Å‚ | Ctrl+Alt+W | | Ctrl+Alt+W | ctrl+alt+w | Ctrl+Alt+W | ctrl+alt+[KeyW] | | +| Shift+Alt+KeyW | W | Shift+Alt+W | | Shift+Alt+W | shift+alt+w | Shift+Alt+W | shift+alt+[KeyW] | | +| Ctrl+Shift+Alt+KeyW | Å | Ctrl+Shift+Alt+W | | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | Ctrl+Shift+Alt+W | ctrl+shift+alt+[KeyW] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyX | x | X | | X | x | X | [KeyX] | | +| Ctrl+KeyX | x | Ctrl+X | | Ctrl+X | ctrl+x | Ctrl+X | ctrl+[KeyX] | | +| Shift+KeyX | X | Shift+X | | Shift+X | shift+x | Shift+X | shift+[KeyX] | | +| Ctrl+Shift+KeyX | X | Ctrl+Shift+X | | Ctrl+Shift+X | ctrl+shift+x | Ctrl+Shift+X | ctrl+shift+[KeyX] | | +| Alt+KeyX | x | Alt+X | | Alt+X | alt+x | Alt+X | alt+[KeyX] | | +| Ctrl+Alt+KeyX | » | Ctrl+Alt+X | | Ctrl+Alt+X | ctrl+alt+x | Ctrl+Alt+X | ctrl+alt+[KeyX] | | +| Shift+Alt+KeyX | X | Shift+Alt+X | | Shift+Alt+X | shift+alt+x | Shift+Alt+X | shift+alt+[KeyX] | | +| Ctrl+Shift+Alt+KeyX | > | Ctrl+Shift+Alt+X | | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | Ctrl+Shift+Alt+X | ctrl+shift+alt+[KeyX] | | +| | | Shift+. | 2 | | | | | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyY | y | Y | | Y | y | Y | [KeyY] | | +| Ctrl+KeyY | y | Ctrl+Y | | Ctrl+Y | ctrl+y | Ctrl+Y | ctrl+[KeyY] | | +| Shift+KeyY | Y | Shift+Y | | Shift+Y | shift+y | Shift+Y | shift+[KeyY] | | +| Ctrl+Shift+KeyY | Y | Ctrl+Shift+Y | | Ctrl+Shift+Y | ctrl+shift+y | Ctrl+Shift+Y | ctrl+shift+[KeyY] | | +| Alt+KeyY | y | Alt+Y | | Alt+Y | alt+y | Alt+Y | alt+[KeyY] | | +| Ctrl+Alt+KeyY | ↠| Ctrl+Alt+Y | | Ctrl+Alt+Y | ctrl+alt+y | Ctrl+Alt+Y | ctrl+alt+[KeyY] | | +| Shift+Alt+KeyY | Y | Shift+Alt+Y | | Shift+Alt+Y | shift+alt+y | Shift+Alt+Y | shift+alt+[KeyY] | | +| Ctrl+Shift+Alt+KeyY | Â¥ | Ctrl+Shift+Alt+Y | | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+[KeyY] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| KeyZ | z | Z | | Z | z | Z | [KeyZ] | | +| Ctrl+KeyZ | z | Ctrl+Z | | Ctrl+Z | ctrl+z | Ctrl+Z | ctrl+[KeyZ] | | +| Shift+KeyZ | Z | Shift+Z | | Shift+Z | shift+z | Shift+Z | shift+[KeyZ] | | +| Ctrl+Shift+KeyZ | Z | Ctrl+Shift+Z | | Ctrl+Shift+Z | ctrl+shift+z | Ctrl+Shift+Z | ctrl+shift+[KeyZ] | | +| Alt+KeyZ | z | Alt+Z | | Alt+Z | alt+z | Alt+Z | alt+[KeyZ] | | +| Ctrl+Alt+KeyZ | « | Ctrl+Alt+Z | | Ctrl+Alt+Z | ctrl+alt+z | Ctrl+Alt+Z | ctrl+alt+[KeyZ] | | +| Shift+Alt+KeyZ | Z | Shift+Alt+Z | | Shift+Alt+Z | shift+alt+z | Shift+Alt+Z | shift+alt+[KeyZ] | | +| Ctrl+Shift+Alt+KeyZ | < | Ctrl+Shift+Alt+Z | | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+[KeyZ] | | +| | | Shift+, | 2 | | | | | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit1 | 1 | 1 | | 1 | 1 | 1 | [Digit1] | | +| Ctrl+Digit1 | 1 | Ctrl+1 | | Ctrl+1 | ctrl+1 | Ctrl+1 | ctrl+[Digit1] | | +| Shift+Digit1 | ! | Shift+1 | | Shift+1 | shift+1 | Shift+1 | shift+[Digit1] | | +| Ctrl+Shift+Digit1 | ! | Ctrl+Shift+1 | | Ctrl+Shift+1 | ctrl+shift+1 | Ctrl+Shift+1 | ctrl+shift+[Digit1] | | +| Alt+Digit1 | 1 | Alt+1 | | Alt+1 | alt+1 | Alt+1 | alt+[Digit1] | | +| Ctrl+Alt+Digit1 | ¹ | Ctrl+Alt+1 | | Ctrl+Alt+1 | ctrl+alt+1 | Ctrl+Alt+1 | ctrl+alt+[Digit1] | | +| Shift+Alt+Digit1 | ! | Shift+Alt+1 | | Shift+Alt+1 | shift+alt+1 | Shift+Alt+1 | shift+alt+[Digit1] | | +| Ctrl+Shift+Alt+Digit1 | ¡ | Ctrl+Shift+Alt+1 | | Ctrl+Shift+Alt+1 | ctrl+shift+alt+1 | Ctrl+Shift+Alt+1 | ctrl+shift+alt+[Digit1] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit2 | 2 | 2 | | 2 | 2 | 2 | [Digit2] | | +| Ctrl+Digit2 | 2 | Ctrl+2 | | Ctrl+2 | ctrl+2 | Ctrl+2 | ctrl+[Digit2] | | +| Shift+Digit2 | " | Shift+2 | | Shift+2 | shift+2 | Shift+2 | shift+[Digit2] | | +| | | Shift+' | 2 | | | | | | +| Ctrl+Shift+Digit2 | " | Ctrl+Shift+2 | | Ctrl+Shift+2 | ctrl+shift+2 | Ctrl+Shift+2 | ctrl+shift+[Digit2] | | +| | | Ctrl+Shift+' | 2 | | | | | | +| Alt+Digit2 | 2 | Alt+2 | | Alt+2 | alt+2 | Alt+2 | alt+[Digit2] | | +| Ctrl+Alt+Digit2 | ² | Ctrl+Alt+2 | | Ctrl+Alt+2 | ctrl+alt+2 | Ctrl+Alt+2 | ctrl+alt+[Digit2] | | +| Shift+Alt+Digit2 | " | Shift+Alt+2 | | Shift+Alt+2 | shift+alt+2 | Shift+Alt+2 | shift+alt+[Digit2] | | +| | | Shift+Alt+' | 2 | | | | | | +| Ctrl+Shift+Alt+Digit2 | â…› | Ctrl+Shift+Alt+2 | | Ctrl+Shift+Alt+2 | ctrl+shift+alt+2 | Ctrl+Shift+Alt+2 | ctrl+shift+alt+[Digit2] | | +| | | Ctrl+Shift+Alt+' | 2 | | | | | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit3 | 3 | 3 | | 3 | 3 | 3 | [Digit3] | | +| Ctrl+Digit3 | 3 | Ctrl+3 | | Ctrl+3 | ctrl+3 | Ctrl+3 | ctrl+[Digit3] | | +| Shift+Digit3 | £ | Shift+3 | | Shift+3 | shift+3 | Shift+3 | shift+[Digit3] | | +| Ctrl+Shift+Digit3 | £ | Ctrl+Shift+3 | | Ctrl+Shift+3 | ctrl+shift+3 | Ctrl+Shift+3 | ctrl+shift+[Digit3] | | +| Alt+Digit3 | 3 | Alt+3 | | Alt+3 | alt+3 | Alt+3 | alt+[Digit3] | | +| Ctrl+Alt+Digit3 | ³ | Ctrl+Alt+3 | | Ctrl+Alt+3 | ctrl+alt+3 | Ctrl+Alt+3 | ctrl+alt+[Digit3] | | +| Shift+Alt+Digit3 | £ | Shift+Alt+3 | | Shift+Alt+3 | shift+alt+3 | Shift+Alt+3 | shift+alt+[Digit3] | | +| Ctrl+Shift+Alt+Digit3 | £ | Ctrl+Shift+Alt+3 | | Ctrl+Shift+Alt+3 | ctrl+shift+alt+3 | Ctrl+Shift+Alt+3 | ctrl+shift+alt+[Digit3] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit4 | 4 | 4 | | 4 | 4 | 4 | [Digit4] | | +| Ctrl+Digit4 | 4 | Ctrl+4 | | Ctrl+4 | ctrl+4 | Ctrl+4 | ctrl+[Digit4] | | +| Shift+Digit4 | $ | Shift+4 | | Shift+4 | shift+4 | Shift+4 | shift+[Digit4] | | +| Ctrl+Shift+Digit4 | $ | Ctrl+Shift+4 | | Ctrl+Shift+4 | ctrl+shift+4 | Ctrl+Shift+4 | ctrl+shift+[Digit4] | | +| Alt+Digit4 | 4 | Alt+4 | | Alt+4 | alt+4 | Alt+4 | alt+[Digit4] | | +| Ctrl+Alt+Digit4 | € | Ctrl+Alt+4 | | Ctrl+Alt+4 | ctrl+alt+4 | Ctrl+Alt+4 | ctrl+alt+[Digit4] | | +| Shift+Alt+Digit4 | $ | Shift+Alt+4 | | Shift+Alt+4 | shift+alt+4 | Shift+Alt+4 | shift+alt+[Digit4] | | +| Ctrl+Shift+Alt+Digit4 | ¼ | Ctrl+Shift+Alt+4 | | Ctrl+Shift+Alt+4 | ctrl+shift+alt+4 | Ctrl+Shift+Alt+4 | ctrl+shift+alt+[Digit4] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit5 | 5 | 5 | | 5 | 5 | 5 | [Digit5] | | +| Ctrl+Digit5 | 5 | Ctrl+5 | | Ctrl+5 | ctrl+5 | Ctrl+5 | ctrl+[Digit5] | | +| Shift+Digit5 | % | Shift+5 | | Shift+5 | shift+5 | Shift+5 | shift+[Digit5] | | +| Ctrl+Shift+Digit5 | % | Ctrl+Shift+5 | | Ctrl+Shift+5 | ctrl+shift+5 | Ctrl+Shift+5 | ctrl+shift+[Digit5] | | +| Alt+Digit5 | 5 | Alt+5 | | Alt+5 | alt+5 | Alt+5 | alt+[Digit5] | | +| Ctrl+Alt+Digit5 | ½ | Ctrl+Alt+5 | | Ctrl+Alt+5 | ctrl+alt+5 | Ctrl+Alt+5 | ctrl+alt+[Digit5] | | +| Shift+Alt+Digit5 | % | Shift+Alt+5 | | Shift+Alt+5 | shift+alt+5 | Shift+Alt+5 | shift+alt+[Digit5] | | +| Ctrl+Shift+Alt+Digit5 | â…œ | Ctrl+Shift+Alt+5 | | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+[Digit5] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit6 | 6 | 6 | | 6 | 6 | 6 | [Digit6] | | +| Ctrl+Digit6 | 6 | Ctrl+6 | | Ctrl+6 | ctrl+6 | Ctrl+6 | ctrl+[Digit6] | | +| Shift+Digit6 | ^ | Shift+6 | | Shift+6 | shift+6 | Shift+6 | shift+[Digit6] | | +| Ctrl+Shift+Digit6 | ^ | Ctrl+Shift+6 | | Ctrl+Shift+6 | ctrl+shift+6 | Ctrl+Shift+6 | ctrl+shift+[Digit6] | | +| Alt+Digit6 | 6 | Alt+6 | | Alt+6 | alt+6 | Alt+6 | alt+[Digit6] | | +| Ctrl+Alt+Digit6 | ¾ | Ctrl+Alt+6 | | Ctrl+Alt+6 | ctrl+alt+6 | Ctrl+Alt+6 | ctrl+alt+[Digit6] | | +| Shift+Alt+Digit6 | ^ | Shift+Alt+6 | | Shift+Alt+6 | shift+alt+6 | Shift+Alt+6 | shift+alt+[Digit6] | | +| Ctrl+Shift+Alt+Digit6 | â… | Ctrl+Shift+Alt+6 | | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+[Digit6] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit7 | 7 | 7 | | 7 | 7 | 7 | [Digit7] | | +| Ctrl+Digit7 | 7 | Ctrl+7 | | Ctrl+7 | ctrl+7 | Ctrl+7 | ctrl+[Digit7] | | +| Shift+Digit7 | & | Shift+7 | | Shift+7 | shift+7 | Shift+7 | shift+[Digit7] | | +| Ctrl+Shift+Digit7 | & | Ctrl+Shift+7 | | Ctrl+Shift+7 | ctrl+shift+7 | Ctrl+Shift+7 | ctrl+shift+[Digit7] | | +| Alt+Digit7 | 7 | Alt+7 | | Alt+7 | alt+7 | Alt+7 | alt+[Digit7] | | +| Ctrl+Alt+Digit7 | { | Ctrl+Alt+7 | | Ctrl+Alt+7 | ctrl+alt+7 | Ctrl+Alt+7 | ctrl+alt+[Digit7] | | +| | | Shift+[ | 2 | | | | | | +| Shift+Alt+Digit7 | & | Shift+Alt+7 | | Shift+Alt+7 | shift+alt+7 | Shift+Alt+7 | shift+alt+[Digit7] | | +| Ctrl+Shift+Alt+Digit7 | â…ž | Ctrl+Shift+Alt+7 | | Ctrl+Shift+Alt+7 | ctrl+shift+alt+7 | Ctrl+Shift+Alt+7 | ctrl+shift+alt+[Digit7] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit8 | 8 | 8 | | 8 | 8 | 8 | [Digit8] | | +| Ctrl+Digit8 | 8 | Ctrl+8 | | Ctrl+8 | ctrl+8 | Ctrl+8 | ctrl+[Digit8] | | +| Shift+Digit8 | * | Shift+8 | | Shift+8 | shift+8 | Shift+8 | shift+[Digit8] | | +| Ctrl+Shift+Digit8 | * | Ctrl+Shift+8 | | Ctrl+Shift+8 | ctrl+shift+8 | Ctrl+Shift+8 | ctrl+shift+[Digit8] | | +| Alt+Digit8 | 8 | Alt+8 | | Alt+8 | alt+8 | Alt+8 | alt+[Digit8] | | +| Ctrl+Alt+Digit8 | [ | Ctrl+Alt+8 | | Ctrl+Alt+8 | ctrl+alt+8 | Ctrl+Alt+8 | ctrl+alt+[Digit8] | | +| | | [ | 2 | | | | | | +| Shift+Alt+Digit8 | * | Shift+Alt+8 | | Shift+Alt+8 | shift+alt+8 | Shift+Alt+8 | shift+alt+[Digit8] | | +| Ctrl+Shift+Alt+Digit8 | â„¢ | Ctrl+Shift+Alt+8 | | Ctrl+Shift+Alt+8 | ctrl+shift+alt+8 | Ctrl+Shift+Alt+8 | ctrl+shift+alt+[Digit8] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit9 | 9 | 9 | | 9 | 9 | 9 | [Digit9] | | +| Ctrl+Digit9 | 9 | Ctrl+9 | | Ctrl+9 | ctrl+9 | Ctrl+9 | ctrl+[Digit9] | | +| Shift+Digit9 | ( | Shift+9 | | Shift+9 | shift+9 | Shift+9 | shift+[Digit9] | | +| Ctrl+Shift+Digit9 | ( | Ctrl+Shift+9 | | Ctrl+Shift+9 | ctrl+shift+9 | Ctrl+Shift+9 | ctrl+shift+[Digit9] | | +| Alt+Digit9 | 9 | Alt+9 | | Alt+9 | alt+9 | Alt+9 | alt+[Digit9] | | +| Ctrl+Alt+Digit9 | ] | Ctrl+Alt+9 | | Ctrl+Alt+9 | ctrl+alt+9 | Ctrl+Alt+9 | ctrl+alt+[Digit9] | | +| | | ] | 2 | | | | | | +| Shift+Alt+Digit9 | ( | Shift+Alt+9 | | Shift+Alt+9 | shift+alt+9 | Shift+Alt+9 | shift+alt+[Digit9] | | +| Ctrl+Shift+Alt+Digit9 | ± | Ctrl+Shift+Alt+9 | | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+[Digit9] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Digit0 | 0 | 0 | | 0 | 0 | 0 | [Digit0] | | +| Ctrl+Digit0 | 0 | Ctrl+0 | | Ctrl+0 | ctrl+0 | Ctrl+0 | ctrl+[Digit0] | | +| Shift+Digit0 | ) | Shift+0 | | Shift+0 | shift+0 | Shift+0 | shift+[Digit0] | | +| Ctrl+Shift+Digit0 | ) | Ctrl+Shift+0 | | Ctrl+Shift+0 | ctrl+shift+0 | Ctrl+Shift+0 | ctrl+shift+[Digit0] | | +| Alt+Digit0 | 0 | Alt+0 | | Alt+0 | alt+0 | Alt+0 | alt+[Digit0] | | +| Ctrl+Alt+Digit0 | } | Ctrl+Alt+0 | | Ctrl+Alt+0 | ctrl+alt+0 | Ctrl+Alt+0 | ctrl+alt+[Digit0] | | +| | | Shift+] | 2 | | | | | | +| Shift+Alt+Digit0 | ) | Shift+Alt+0 | | Shift+Alt+0 | shift+alt+0 | Shift+Alt+0 | shift+alt+[Digit0] | | +| Ctrl+Shift+Alt+Digit0 | ° | Ctrl+Shift+Alt+0 | | Ctrl+Shift+Alt+0 | ctrl+shift+alt+0 | Ctrl+Shift+Alt+0 | ctrl+shift+alt+[Digit0] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Minus | - | - | | - | - | null | [Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | +| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | null | shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | +| Alt+Minus | - | Alt+- | | Alt+- | alt+- | null | alt+[Minus] | | +| Ctrl+Alt+Minus | \ | \ | 1 | Ctrl+Alt+- | ctrl+alt+[Minus] | null | ctrl+alt+[Minus] | NO | +| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Minus] | | +| Ctrl+Shift+Alt+Minus | ¿ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Minus] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Equal | = | = | | = | = | null | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | +| Ctrl+Alt+Equal | U+327 | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | U+328 | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| BracketLeft | [ | [ | 1 | [ | [ | null | [BracketLeft] | | +| Ctrl+BracketLeft | [ | Ctrl+[ | | Ctrl+[ | ctrl+[ | null | ctrl+[BracketLeft] | | +| Shift+BracketLeft | { | Shift+[ | 1 | Shift+[ | shift+[ | null | shift+[BracketLeft] | | +| Ctrl+Shift+BracketLeft | { | Ctrl+Shift+[ | | Ctrl+Shift+[ | ctrl+shift+[ | null | ctrl+shift+[BracketLeft] | | +| Alt+BracketLeft | [ | Alt+[ | | Alt+[ | alt+[ | null | alt+[BracketLeft] | | +| Ctrl+Alt+BracketLeft | ¨ | Ctrl+Alt+[ | | Ctrl+Alt+[ | ctrl+alt+[ | null | ctrl+alt+[BracketLeft] | | +| Shift+Alt+BracketLeft | { | Shift+Alt+[ | | Shift+Alt+[ | shift+alt+[ | null | shift+alt+[BracketLeft] | | +| Ctrl+Shift+Alt+BracketLeft | Ëš | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | null | ctrl+shift+alt+[BracketLeft] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| BracketRight | ] | ] | 1 | ] | ] | null | [BracketRight] | | +| Ctrl+BracketRight | ] | Ctrl+] | | Ctrl+] | ctrl+] | null | ctrl+[BracketRight] | | +| Shift+BracketRight | } | Shift+] | 1 | Shift+] | shift+] | null | shift+[BracketRight] | | +| Ctrl+Shift+BracketRight | } | Ctrl+Shift+] | | Ctrl+Shift+] | ctrl+shift+] | null | ctrl+shift+[BracketRight] | | +| Alt+BracketRight | ] | Alt+] | | Alt+] | alt+] | null | alt+[BracketRight] | | +| Ctrl+Alt+BracketRight | Ëœ | Ctrl+Alt+] | | Ctrl+Alt+] | ctrl+alt+] | null | ctrl+alt+[BracketRight] | | +| Shift+Alt+BracketRight | } | Shift+Alt+] | | Shift+Alt+] | shift+alt+] | null | shift+alt+[BracketRight] | | +| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | null | ctrl+shift+alt+[BracketRight] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Backslash | # | | | # | [Backslash] | null | [Backslash] | NO | +| Ctrl+Backslash | # | | | Ctrl+# | ctrl+[Backslash] | null | ctrl+[Backslash] | NO | +| Shift+Backslash | ~ | Shift+` | 2 | Shift+# | shift+[Backslash] | null | shift+[Backslash] | NO | +| Ctrl+Shift+Backslash | ~ | Ctrl+Shift+` | 2 | Ctrl+Shift+# | ctrl+shift+[Backslash] | null | ctrl+shift+[Backslash] | NO | +| Alt+Backslash | # | | | Alt+# | alt+[Backslash] | null | alt+[Backslash] | NO | +| Ctrl+Alt+Backslash | ` | ` | 2 | Ctrl+Alt+# | ctrl+alt+[Backslash] | null | ctrl+alt+[Backslash] | NO | +| Shift+Alt+Backslash | ~ | Shift+Alt+` | 2 | Shift+Alt+# | shift+alt+[Backslash] | null | shift+alt+[Backslash] | NO | +| Ctrl+Shift+Alt+Backslash | ˘ | Ctrl+Shift+Alt+` | 2 | Ctrl+Shift+Alt+# | ctrl+shift+alt+[Backslash] | null | ctrl+shift+alt+[Backslash] | NO | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| IntlHash | --- | | | null | null | null | null | | +| Ctrl+IntlHash | --- | | | null | null | null | null | | +| Shift+IntlHash | --- | | | null | null | null | null | | +| Ctrl+Shift+IntlHash | --- | | | null | null | null | null | | +| Alt+IntlHash | --- | | | null | null | null | null | | +| Ctrl+Alt+IntlHash | --- | | | null | null | null | null | | +| Shift+Alt+IntlHash | --- | | | null | null | null | null | | +| Ctrl+Shift+Alt+IntlHash | --- | | | null | null | null | null | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Semicolon | ; | ; | | ; | ; | null | [Semicolon] | | +| Ctrl+Semicolon | ; | Ctrl+; | | Ctrl+; | ctrl+; | null | ctrl+[Semicolon] | | +| Shift+Semicolon | : | Shift+; | | Shift+; | shift+; | null | shift+[Semicolon] | | +| Ctrl+Shift+Semicolon | : | Ctrl+Shift+; | | Ctrl+Shift+; | ctrl+shift+; | null | ctrl+shift+[Semicolon] | | +| Alt+Semicolon | ; | Alt+; | | Alt+; | alt+; | null | alt+[Semicolon] | | +| Ctrl+Alt+Semicolon | ´ | Ctrl+Alt+; | | Ctrl+Alt+; | ctrl+alt+; | null | ctrl+alt+[Semicolon] | | +| Shift+Alt+Semicolon | : | Shift+Alt+; | | Shift+Alt+; | shift+alt+; | null | shift+alt+[Semicolon] | | +| Ctrl+Shift+Alt+Semicolon | Ë | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | null | ctrl+shift+alt+[Semicolon] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Quote | ' | ' | | ' | ' | ' | [Quote] | | +| Ctrl+Quote | ' | Ctrl+' | | Ctrl+' | ctrl+' | Ctrl+' | ctrl+[Quote] | | +| Shift+Quote | @ | Shift+' | 1 | Shift+' | shift+' | Shift+' | shift+[Quote] | | +| Ctrl+Shift+Quote | @ | Ctrl+Shift+' | 1 | Ctrl+Shift+' | ctrl+shift+' | Ctrl+Shift+' | ctrl+shift+[Quote] | | +| Alt+Quote | ' | Alt+' | | Alt+' | alt+' | Alt+' | alt+[Quote] | | +| Ctrl+Alt+Quote | ^ | Ctrl+Alt+' | | Ctrl+Alt+' | ctrl+alt+' | Ctrl+Alt+' | ctrl+alt+[Quote] | | +| Shift+Alt+Quote | @ | Shift+Alt+' | 1 | Shift+Alt+' | shift+alt+' | Shift+Alt+' | shift+alt+[Quote] | | +| Ctrl+Shift+Alt+Quote | U+30c | Ctrl+Shift+Alt+' | 1 | Ctrl+Shift+Alt+' | ctrl+shift+alt+' | Ctrl+Shift+Alt+' | ctrl+shift+alt+[Quote] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Backquote | ` | ` | 1 | ` | ` | null | [Backquote] | | +| Ctrl+Backquote | ` | Ctrl+` | | Ctrl+` | ctrl+` | null | ctrl+[Backquote] | | +| Shift+Backquote | ¬ | Shift+` | 1 | Shift+` | shift+` | null | shift+[Backquote] | | +| Ctrl+Shift+Backquote | ¬ | Ctrl+Shift+` | 1 | Ctrl+Shift+` | ctrl+shift+` | null | ctrl+shift+[Backquote] | | +| Alt+Backquote | ` | Alt+` | | Alt+` | alt+` | null | alt+[Backquote] | | +| Ctrl+Alt+Backquote | | | Shift+\ | 1 | Ctrl+Alt+` | ctrl+alt+[Backquote] | null | ctrl+alt+[Backquote] | NO | +| Shift+Alt+Backquote | ¬ | Shift+Alt+` | 1 | Shift+Alt+` | shift+alt+` | null | shift+alt+[Backquote] | | +| Ctrl+Shift+Alt+Backquote | | | Ctrl+Shift+Alt+` | 1 | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | null | ctrl+shift+alt+[Backquote] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Comma | , | , | | , | , | null | [Comma] | | +| Ctrl+Comma | , | Ctrl+, | | Ctrl+, | ctrl+, | null | ctrl+[Comma] | | +| Shift+Comma | < | Shift+, | 1 | Shift+, | shift+, | null | shift+[Comma] | | +| Ctrl+Shift+Comma | < | Ctrl+Shift+, | | Ctrl+Shift+, | ctrl+shift+, | null | ctrl+shift+[Comma] | | +| Alt+Comma | , | Alt+, | | Alt+, | alt+, | null | alt+[Comma] | | +| Ctrl+Alt+Comma | ─ | Ctrl+Alt+, | | Ctrl+Alt+, | ctrl+alt+, | null | ctrl+alt+[Comma] | | +| Shift+Alt+Comma | < | Shift+Alt+, | | Shift+Alt+, | shift+alt+, | null | shift+alt+[Comma] | | +| Ctrl+Shift+Alt+Comma | × | Ctrl+Shift+Alt+, | | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | null | ctrl+shift+alt+[Comma] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Period | . | . | | . | . | null | [Period] | | +| Ctrl+Period | . | Ctrl+. | | Ctrl+. | ctrl+. | null | ctrl+[Period] | | +| Shift+Period | > | Shift+. | 1 | Shift+. | shift+. | null | shift+[Period] | | +| Ctrl+Shift+Period | > | Ctrl+Shift+. | | Ctrl+Shift+. | ctrl+shift+. | null | ctrl+shift+[Period] | | +| Alt+Period | . | Alt+. | | Alt+. | alt+. | null | alt+[Period] | | +| Ctrl+Alt+Period | · | Ctrl+Alt+. | | Ctrl+Alt+. | ctrl+alt+. | null | ctrl+alt+[Period] | | +| Shift+Alt+Period | > | Shift+Alt+. | | Shift+Alt+. | shift+alt+. | null | shift+alt+[Period] | | +| Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | null | ctrl+shift+alt+[Period] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Slash | / | / | | / | / | null | [Slash] | | +| Ctrl+Slash | / | Ctrl+/ | | Ctrl+/ | ctrl+/ | null | ctrl+[Slash] | | +| Shift+Slash | ? | Shift+/ | | Shift+/ | shift+/ | null | shift+[Slash] | | +| Ctrl+Shift+Slash | ? | Ctrl+Shift+/ | | Ctrl+Shift+/ | ctrl+shift+/ | null | ctrl+shift+[Slash] | | +| Alt+Slash | / | Alt+/ | | Alt+/ | alt+/ | null | alt+[Slash] | | +| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+/ | | Ctrl+Alt+/ | ctrl+alt+/ | null | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | ? | Shift+Alt+/ | | Shift+Alt+/ | shift+alt+/ | null | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | Ë™ | Ctrl+Shift+Alt+/ | | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | null | ctrl+shift+alt+[Slash] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| ArrowUp | --- | UpArrow | | UpArrow | up | Up | [ArrowUp] | | +| Ctrl+ArrowUp | --- | Ctrl+UpArrow | | Ctrl+UpArrow | ctrl+up | Ctrl+Up | ctrl+[ArrowUp] | | +| Shift+ArrowUp | --- | Shift+UpArrow | | Shift+UpArrow | shift+up | Shift+Up | shift+[ArrowUp] | | +| Ctrl+Shift+ArrowUp | --- | Ctrl+Shift+UpArrow | | Ctrl+Shift+UpArrow | ctrl+shift+up | Ctrl+Shift+Up | ctrl+shift+[ArrowUp] | | +| Alt+ArrowUp | --- | Alt+UpArrow | | Alt+UpArrow | alt+up | Alt+Up | alt+[ArrowUp] | | +| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | | Ctrl+Alt+UpArrow | ctrl+alt+up | Ctrl+Alt+Up | ctrl+alt+[ArrowUp] | | +| Shift+Alt+ArrowUp | --- | Shift+Alt+UpArrow | | Shift+Alt+UpArrow | shift+alt+up | Shift+Alt+Up | shift+alt+[ArrowUp] | | +| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | | Ctrl+Shift+Alt+UpArrow | ctrl+shift+alt+up | Ctrl+Shift+Alt+Up | ctrl+shift+alt+[ArrowUp] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Numpad0 | --- | NumPad0 | | NumPad0 | numpad0 | null | [Numpad0] | | +| Ctrl+Numpad0 | --- | Ctrl+NumPad0 | | Ctrl+NumPad0 | ctrl+numpad0 | null | ctrl+[Numpad0] | | +| Shift+Numpad0 | --- | Shift+NumPad0 | | Shift+NumPad0 | shift+numpad0 | null | shift+[Numpad0] | | +| Ctrl+Shift+Numpad0 | --- | Ctrl+Shift+NumPad0 | | Ctrl+Shift+NumPad0 | ctrl+shift+numpad0 | null | ctrl+shift+[Numpad0] | | +| Alt+Numpad0 | --- | Alt+NumPad0 | | Alt+NumPad0 | alt+numpad0 | null | alt+[Numpad0] | | +| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | | Ctrl+Alt+NumPad0 | ctrl+alt+numpad0 | null | ctrl+alt+[Numpad0] | | +| Shift+Alt+Numpad0 | --- | Shift+Alt+NumPad0 | | Shift+Alt+NumPad0 | shift+alt+numpad0 | null | shift+alt+[Numpad0] | | +| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | null | ctrl+shift+alt+[Numpad0] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| IntlBackslash | \ | \ | 2 | \ | \ | null | [IntlBackslash] | | +| Ctrl+IntlBackslash | \ | Ctrl+\ | | Ctrl+\ | ctrl+\ | null | ctrl+[IntlBackslash] | | +| Shift+IntlBackslash | | | Shift+\ | 2 | Shift+\ | shift+\ | null | shift+[IntlBackslash] | | +| Ctrl+Shift+IntlBackslash | | | Ctrl+Shift+\ | | Ctrl+Shift+\ | ctrl+shift+\ | null | ctrl+shift+[IntlBackslash] | | +| Alt+IntlBackslash | \ | Alt+\ | | Alt+\ | alt+\ | null | alt+[IntlBackslash] | | +| Ctrl+Alt+IntlBackslash | | | Ctrl+Alt+\ | | Ctrl+Alt+\ | ctrl+alt+\ | null | ctrl+alt+[IntlBackslash] | | +| Shift+Alt+IntlBackslash | | | Shift+Alt+\ | | Shift+Alt+\ | shift+alt+\ | null | shift+alt+[IntlBackslash] | | +| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | null | ctrl+shift+alt+[IntlBackslash] | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| IntlRo | --- | | | null | [IntlRo] | null | [IntlRo] | NO | +| Ctrl+IntlRo | --- | | | null | ctrl+[IntlRo] | null | ctrl+[IntlRo] | NO | +| Shift+IntlRo | --- | | | null | shift+[IntlRo] | null | shift+[IntlRo] | NO | +| Ctrl+Shift+IntlRo | --- | | | null | ctrl+shift+[IntlRo] | null | ctrl+shift+[IntlRo] | NO | +| Alt+IntlRo | --- | | | null | alt+[IntlRo] | null | alt+[IntlRo] | NO | +| Ctrl+Alt+IntlRo | --- | | | null | ctrl+alt+[IntlRo] | null | ctrl+alt+[IntlRo] | NO | +| Shift+Alt+IntlRo | --- | | | null | shift+alt+[IntlRo] | null | shift+alt+[IntlRo] | NO | +| Ctrl+Shift+Alt+IntlRo | --- | | | null | ctrl+shift+alt+[IntlRo] | null | ctrl+shift+alt+[IntlRo] | NO | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| IntlYen | --- | | | null | [IntlYen] | null | [IntlYen] | NO | +| Ctrl+IntlYen | --- | | | null | ctrl+[IntlYen] | null | ctrl+[IntlYen] | NO | +| Shift+IntlYen | --- | | | null | shift+[IntlYen] | null | shift+[IntlYen] | NO | +| Ctrl+Shift+IntlYen | --- | | | null | ctrl+shift+[IntlYen] | null | ctrl+shift+[IntlYen] | NO | +| Alt+IntlYen | --- | | | null | alt+[IntlYen] | null | alt+[IntlYen] | NO | +| Ctrl+Alt+IntlYen | --- | | | null | ctrl+alt+[IntlYen] | null | ctrl+alt+[IntlYen] | NO | +| Shift+Alt+IntlYen | --- | | | null | shift+alt+[IntlYen] | null | shift+alt+[IntlYen] | NO | +| Ctrl+Shift+Alt+IntlYen | --- | | | null | ctrl+shift+alt+[IntlYen] | null | ctrl+shift+alt+[IntlYen] | NO | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/linux_ru.txt b/src/vs/workbench/services/keybinding/test/linux_ru.txt index bee3cad8cf8..389681ee995 100644 --- a/src/vs/workbench/services/keybinding/test/linux_ru.txt +++ b/src/vs/workbench/services/keybinding/test/linux_ru.txt @@ -2,251 +2,251 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyA | Ñ„ | A | | Ñ„ | a | A | [KeyA] | NO | -| Ctrl+KeyA | Ñ„ | Ctrl+A | | Ctrl+Ñ„ | ctrl+a | Ctrl+A | ctrl+[KeyA] | NO | -| Shift+KeyA | Ф | Shift+A | | Shift+Ñ„ | shift+a | Shift+A | shift+[KeyA] | NO | -| Ctrl+Shift+KeyA | Ф | Ctrl+Shift+A | | Ctrl+Shift+Ñ„ | ctrl+shift+a | Ctrl+Shift+A | ctrl+shift+[KeyA] | NO | -| Alt+KeyA | Ñ„ | Alt+A | | Alt+Ñ„ | alt+a | Alt+A | alt+[KeyA] | NO | -| Ctrl+Alt+KeyA | Ñ„ | Ctrl+Alt+A | | Ctrl+Alt+Ñ„ | ctrl+alt+a | Ctrl+Alt+A | ctrl+alt+[KeyA] | NO | -| Shift+Alt+KeyA | Ф | Shift+Alt+A | | Shift+Alt+Ñ„ | shift+alt+a | Shift+Alt+A | shift+alt+[KeyA] | NO | -| Ctrl+Shift+Alt+KeyA | Ф | Ctrl+Shift+Alt+A | | Ctrl+Shift+Alt+Ñ„ | ctrl+shift+alt+a | Ctrl+Shift+Alt+A | ctrl+shift+alt+[KeyA] | NO | +| KeyA | Ñ„ | A | | A | a | A | [KeyA] | | +| Ctrl+KeyA | Ñ„ | Ctrl+A | | Ctrl+A | ctrl+a | Ctrl+A | ctrl+[KeyA] | | +| Shift+KeyA | Ф | Shift+A | | Shift+A | shift+a | Shift+A | shift+[KeyA] | | +| Ctrl+Shift+KeyA | Ф | Ctrl+Shift+A | | Ctrl+Shift+A | ctrl+shift+a | Ctrl+Shift+A | ctrl+shift+[KeyA] | | +| Alt+KeyA | Ñ„ | Alt+A | | Alt+A | alt+a | Alt+A | alt+[KeyA] | | +| Ctrl+Alt+KeyA | Ñ„ | Ctrl+Alt+A | | Ctrl+Alt+A | ctrl+alt+a | Ctrl+Alt+A | ctrl+alt+[KeyA] | | +| Shift+Alt+KeyA | Ф | Shift+Alt+A | | Shift+Alt+A | shift+alt+a | Shift+Alt+A | shift+alt+[KeyA] | | +| Ctrl+Shift+Alt+KeyA | Ф | Ctrl+Shift+Alt+A | | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | Ctrl+Shift+Alt+A | ctrl+shift+alt+[KeyA] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyB | и | B | | и | b | B | [KeyB] | NO | -| Ctrl+KeyB | и | Ctrl+B | | Ctrl+и | ctrl+b | Ctrl+B | ctrl+[KeyB] | NO | -| Shift+KeyB | И | Shift+B | | Shift+и | shift+b | Shift+B | shift+[KeyB] | NO | -| Ctrl+Shift+KeyB | И | Ctrl+Shift+B | | Ctrl+Shift+и | ctrl+shift+b | Ctrl+Shift+B | ctrl+shift+[KeyB] | NO | -| Alt+KeyB | и | Alt+B | | Alt+и | alt+b | Alt+B | alt+[KeyB] | NO | -| Ctrl+Alt+KeyB | и | Ctrl+Alt+B | | Ctrl+Alt+и | ctrl+alt+b | Ctrl+Alt+B | ctrl+alt+[KeyB] | NO | -| Shift+Alt+KeyB | И | Shift+Alt+B | | Shift+Alt+и | shift+alt+b | Shift+Alt+B | shift+alt+[KeyB] | NO | -| Ctrl+Shift+Alt+KeyB | И | Ctrl+Shift+Alt+B | | Ctrl+Shift+Alt+и | ctrl+shift+alt+b | Ctrl+Shift+Alt+B | ctrl+shift+alt+[KeyB] | NO | +| KeyB | и | B | | B | b | B | [KeyB] | | +| Ctrl+KeyB | и | Ctrl+B | | Ctrl+B | ctrl+b | Ctrl+B | ctrl+[KeyB] | | +| Shift+KeyB | И | Shift+B | | Shift+B | shift+b | Shift+B | shift+[KeyB] | | +| Ctrl+Shift+KeyB | И | Ctrl+Shift+B | | Ctrl+Shift+B | ctrl+shift+b | Ctrl+Shift+B | ctrl+shift+[KeyB] | | +| Alt+KeyB | и | Alt+B | | Alt+B | alt+b | Alt+B | alt+[KeyB] | | +| Ctrl+Alt+KeyB | и | Ctrl+Alt+B | | Ctrl+Alt+B | ctrl+alt+b | Ctrl+Alt+B | ctrl+alt+[KeyB] | | +| Shift+Alt+KeyB | И | Shift+Alt+B | | Shift+Alt+B | shift+alt+b | Shift+Alt+B | shift+alt+[KeyB] | | +| Ctrl+Shift+Alt+KeyB | И | Ctrl+Shift+Alt+B | | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | Ctrl+Shift+Alt+B | ctrl+shift+alt+[KeyB] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyC | Ñ | C | | Ñ | c | C | [KeyC] | NO | -| Ctrl+KeyC | Ñ | Ctrl+C | | Ctrl+Ñ | ctrl+c | Ctrl+C | ctrl+[KeyC] | NO | -| Shift+KeyC | С | Shift+C | | Shift+Ñ | shift+c | Shift+C | shift+[KeyC] | NO | -| Ctrl+Shift+KeyC | С | Ctrl+Shift+C | | Ctrl+Shift+Ñ | ctrl+shift+c | Ctrl+Shift+C | ctrl+shift+[KeyC] | NO | -| Alt+KeyC | Ñ | Alt+C | | Alt+Ñ | alt+c | Alt+C | alt+[KeyC] | NO | -| Ctrl+Alt+KeyC | Ñ | Ctrl+Alt+C | | Ctrl+Alt+Ñ | ctrl+alt+c | Ctrl+Alt+C | ctrl+alt+[KeyC] | NO | -| Shift+Alt+KeyC | С | Shift+Alt+C | | Shift+Alt+Ñ | shift+alt+c | Shift+Alt+C | shift+alt+[KeyC] | NO | -| Ctrl+Shift+Alt+KeyC | С | Ctrl+Shift+Alt+C | | Ctrl+Shift+Alt+Ñ | ctrl+shift+alt+c | Ctrl+Shift+Alt+C | ctrl+shift+alt+[KeyC] | NO | +| KeyC | Ñ | C | | C | c | C | [KeyC] | | +| Ctrl+KeyC | Ñ | Ctrl+C | | Ctrl+C | ctrl+c | Ctrl+C | ctrl+[KeyC] | | +| Shift+KeyC | С | Shift+C | | Shift+C | shift+c | Shift+C | shift+[KeyC] | | +| Ctrl+Shift+KeyC | С | Ctrl+Shift+C | | Ctrl+Shift+C | ctrl+shift+c | Ctrl+Shift+C | ctrl+shift+[KeyC] | | +| Alt+KeyC | Ñ | Alt+C | | Alt+C | alt+c | Alt+C | alt+[KeyC] | | +| Ctrl+Alt+KeyC | Ñ | Ctrl+Alt+C | | Ctrl+Alt+C | ctrl+alt+c | Ctrl+Alt+C | ctrl+alt+[KeyC] | | +| Shift+Alt+KeyC | С | Shift+Alt+C | | Shift+Alt+C | shift+alt+c | Shift+Alt+C | shift+alt+[KeyC] | | +| Ctrl+Shift+Alt+KeyC | С | Ctrl+Shift+Alt+C | | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | Ctrl+Shift+Alt+C | ctrl+shift+alt+[KeyC] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyD | в | D | | в | d | D | [KeyD] | NO | -| Ctrl+KeyD | в | Ctrl+D | | Ctrl+в | ctrl+d | Ctrl+D | ctrl+[KeyD] | NO | -| Shift+KeyD | Ð’ | Shift+D | | Shift+в | shift+d | Shift+D | shift+[KeyD] | NO | -| Ctrl+Shift+KeyD | Ð’ | Ctrl+Shift+D | | Ctrl+Shift+в | ctrl+shift+d | Ctrl+Shift+D | ctrl+shift+[KeyD] | NO | -| Alt+KeyD | в | Alt+D | | Alt+в | alt+d | Alt+D | alt+[KeyD] | NO | -| Ctrl+Alt+KeyD | в | Ctrl+Alt+D | | Ctrl+Alt+в | ctrl+alt+d | Ctrl+Alt+D | ctrl+alt+[KeyD] | NO | -| Shift+Alt+KeyD | Ð’ | Shift+Alt+D | | Shift+Alt+в | shift+alt+d | Shift+Alt+D | shift+alt+[KeyD] | NO | -| Ctrl+Shift+Alt+KeyD | Ð’ | Ctrl+Shift+Alt+D | | Ctrl+Shift+Alt+в | ctrl+shift+alt+d | Ctrl+Shift+Alt+D | ctrl+shift+alt+[KeyD] | NO | +| KeyD | в | D | | D | d | D | [KeyD] | | +| Ctrl+KeyD | в | Ctrl+D | | Ctrl+D | ctrl+d | Ctrl+D | ctrl+[KeyD] | | +| Shift+KeyD | Ð’ | Shift+D | | Shift+D | shift+d | Shift+D | shift+[KeyD] | | +| Ctrl+Shift+KeyD | Ð’ | Ctrl+Shift+D | | Ctrl+Shift+D | ctrl+shift+d | Ctrl+Shift+D | ctrl+shift+[KeyD] | | +| Alt+KeyD | в | Alt+D | | Alt+D | alt+d | Alt+D | alt+[KeyD] | | +| Ctrl+Alt+KeyD | в | Ctrl+Alt+D | | Ctrl+Alt+D | ctrl+alt+d | Ctrl+Alt+D | ctrl+alt+[KeyD] | | +| Shift+Alt+KeyD | Ð’ | Shift+Alt+D | | Shift+Alt+D | shift+alt+d | Shift+Alt+D | shift+alt+[KeyD] | | +| Ctrl+Shift+Alt+KeyD | Ð’ | Ctrl+Shift+Alt+D | | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | Ctrl+Shift+Alt+D | ctrl+shift+alt+[KeyD] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyE | у | E | | у | e | E | [KeyE] | NO | -| Ctrl+KeyE | у | Ctrl+E | | Ctrl+у | ctrl+e | Ctrl+E | ctrl+[KeyE] | NO | -| Shift+KeyE | У | Shift+E | | Shift+у | shift+e | Shift+E | shift+[KeyE] | NO | -| Ctrl+Shift+KeyE | У | Ctrl+Shift+E | | Ctrl+Shift+у | ctrl+shift+e | Ctrl+Shift+E | ctrl+shift+[KeyE] | NO | -| Alt+KeyE | у | Alt+E | | Alt+у | alt+e | Alt+E | alt+[KeyE] | NO | -| Ctrl+Alt+KeyE | у | Ctrl+Alt+E | | Ctrl+Alt+у | ctrl+alt+e | Ctrl+Alt+E | ctrl+alt+[KeyE] | NO | -| Shift+Alt+KeyE | У | Shift+Alt+E | | Shift+Alt+у | shift+alt+e | Shift+Alt+E | shift+alt+[KeyE] | NO | -| Ctrl+Shift+Alt+KeyE | У | Ctrl+Shift+Alt+E | | Ctrl+Shift+Alt+у | ctrl+shift+alt+e | Ctrl+Shift+Alt+E | ctrl+shift+alt+[KeyE] | NO | +| KeyE | у | E | | E | e | E | [KeyE] | | +| Ctrl+KeyE | у | Ctrl+E | | Ctrl+E | ctrl+e | Ctrl+E | ctrl+[KeyE] | | +| Shift+KeyE | У | Shift+E | | Shift+E | shift+e | Shift+E | shift+[KeyE] | | +| Ctrl+Shift+KeyE | У | Ctrl+Shift+E | | Ctrl+Shift+E | ctrl+shift+e | Ctrl+Shift+E | ctrl+shift+[KeyE] | | +| Alt+KeyE | у | Alt+E | | Alt+E | alt+e | Alt+E | alt+[KeyE] | | +| Ctrl+Alt+KeyE | у | Ctrl+Alt+E | | Ctrl+Alt+E | ctrl+alt+e | Ctrl+Alt+E | ctrl+alt+[KeyE] | | +| Shift+Alt+KeyE | У | Shift+Alt+E | | Shift+Alt+E | shift+alt+e | Shift+Alt+E | shift+alt+[KeyE] | | +| Ctrl+Shift+Alt+KeyE | У | Ctrl+Shift+Alt+E | | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | Ctrl+Shift+Alt+E | ctrl+shift+alt+[KeyE] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyF | а | F | | а | f | F | [KeyF] | NO | -| Ctrl+KeyF | а | Ctrl+F | | Ctrl+а | ctrl+f | Ctrl+F | ctrl+[KeyF] | NO | -| Shift+KeyF | Ð | Shift+F | | Shift+а | shift+f | Shift+F | shift+[KeyF] | NO | -| Ctrl+Shift+KeyF | Ð | Ctrl+Shift+F | | Ctrl+Shift+а | ctrl+shift+f | Ctrl+Shift+F | ctrl+shift+[KeyF] | NO | -| Alt+KeyF | а | Alt+F | | Alt+а | alt+f | Alt+F | alt+[KeyF] | NO | -| Ctrl+Alt+KeyF | а | Ctrl+Alt+F | | Ctrl+Alt+а | ctrl+alt+f | Ctrl+Alt+F | ctrl+alt+[KeyF] | NO | -| Shift+Alt+KeyF | Ð | Shift+Alt+F | | Shift+Alt+а | shift+alt+f | Shift+Alt+F | shift+alt+[KeyF] | NO | -| Ctrl+Shift+Alt+KeyF | Ð | Ctrl+Shift+Alt+F | | Ctrl+Shift+Alt+а | ctrl+shift+alt+f | Ctrl+Shift+Alt+F | ctrl+shift+alt+[KeyF] | NO | +| KeyF | а | F | | F | f | F | [KeyF] | | +| Ctrl+KeyF | а | Ctrl+F | | Ctrl+F | ctrl+f | Ctrl+F | ctrl+[KeyF] | | +| Shift+KeyF | Ð | Shift+F | | Shift+F | shift+f | Shift+F | shift+[KeyF] | | +| Ctrl+Shift+KeyF | Ð | Ctrl+Shift+F | | Ctrl+Shift+F | ctrl+shift+f | Ctrl+Shift+F | ctrl+shift+[KeyF] | | +| Alt+KeyF | а | Alt+F | | Alt+F | alt+f | Alt+F | alt+[KeyF] | | +| Ctrl+Alt+KeyF | а | Ctrl+Alt+F | | Ctrl+Alt+F | ctrl+alt+f | Ctrl+Alt+F | ctrl+alt+[KeyF] | | +| Shift+Alt+KeyF | Ð | Shift+Alt+F | | Shift+Alt+F | shift+alt+f | Shift+Alt+F | shift+alt+[KeyF] | | +| Ctrl+Shift+Alt+KeyF | Ð | Ctrl+Shift+Alt+F | | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | Ctrl+Shift+Alt+F | ctrl+shift+alt+[KeyF] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyG | п | G | | п | g | G | [KeyG] | NO | -| Ctrl+KeyG | п | Ctrl+G | | Ctrl+п | ctrl+g | Ctrl+G | ctrl+[KeyG] | NO | -| Shift+KeyG | П | Shift+G | | Shift+п | shift+g | Shift+G | shift+[KeyG] | NO | -| Ctrl+Shift+KeyG | П | Ctrl+Shift+G | | Ctrl+Shift+п | ctrl+shift+g | Ctrl+Shift+G | ctrl+shift+[KeyG] | NO | -| Alt+KeyG | п | Alt+G | | Alt+п | alt+g | Alt+G | alt+[KeyG] | NO | -| Ctrl+Alt+KeyG | п | Ctrl+Alt+G | | Ctrl+Alt+п | ctrl+alt+g | Ctrl+Alt+G | ctrl+alt+[KeyG] | NO | -| Shift+Alt+KeyG | П | Shift+Alt+G | | Shift+Alt+п | shift+alt+g | Shift+Alt+G | shift+alt+[KeyG] | NO | -| Ctrl+Shift+Alt+KeyG | П | Ctrl+Shift+Alt+G | | Ctrl+Shift+Alt+п | ctrl+shift+alt+g | Ctrl+Shift+Alt+G | ctrl+shift+alt+[KeyG] | NO | +| KeyG | п | G | | G | g | G | [KeyG] | | +| Ctrl+KeyG | п | Ctrl+G | | Ctrl+G | ctrl+g | Ctrl+G | ctrl+[KeyG] | | +| Shift+KeyG | П | Shift+G | | Shift+G | shift+g | Shift+G | shift+[KeyG] | | +| Ctrl+Shift+KeyG | П | Ctrl+Shift+G | | Ctrl+Shift+G | ctrl+shift+g | Ctrl+Shift+G | ctrl+shift+[KeyG] | | +| Alt+KeyG | п | Alt+G | | Alt+G | alt+g | Alt+G | alt+[KeyG] | | +| Ctrl+Alt+KeyG | п | Ctrl+Alt+G | | Ctrl+Alt+G | ctrl+alt+g | Ctrl+Alt+G | ctrl+alt+[KeyG] | | +| Shift+Alt+KeyG | П | Shift+Alt+G | | Shift+Alt+G | shift+alt+g | Shift+Alt+G | shift+alt+[KeyG] | | +| Ctrl+Shift+Alt+KeyG | П | Ctrl+Shift+Alt+G | | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | Ctrl+Shift+Alt+G | ctrl+shift+alt+[KeyG] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyH | Ñ€ | H | | Ñ€ | h | H | [KeyH] | NO | -| Ctrl+KeyH | Ñ€ | Ctrl+H | | Ctrl+Ñ€ | ctrl+h | Ctrl+H | ctrl+[KeyH] | NO | -| Shift+KeyH | Р | Shift+H | | Shift+Ñ€ | shift+h | Shift+H | shift+[KeyH] | NO | -| Ctrl+Shift+KeyH | Р | Ctrl+Shift+H | | Ctrl+Shift+Ñ€ | ctrl+shift+h | Ctrl+Shift+H | ctrl+shift+[KeyH] | NO | -| Alt+KeyH | Ñ€ | Alt+H | | Alt+Ñ€ | alt+h | Alt+H | alt+[KeyH] | NO | -| Ctrl+Alt+KeyH | Ñ€ | Ctrl+Alt+H | | Ctrl+Alt+Ñ€ | ctrl+alt+h | Ctrl+Alt+H | ctrl+alt+[KeyH] | NO | -| Shift+Alt+KeyH | Р | Shift+Alt+H | | Shift+Alt+Ñ€ | shift+alt+h | Shift+Alt+H | shift+alt+[KeyH] | NO | -| Ctrl+Shift+Alt+KeyH | Р | Ctrl+Shift+Alt+H | | Ctrl+Shift+Alt+Ñ€ | ctrl+shift+alt+h | Ctrl+Shift+Alt+H | ctrl+shift+alt+[KeyH] | NO | +| KeyH | Ñ€ | H | | H | h | H | [KeyH] | | +| Ctrl+KeyH | Ñ€ | Ctrl+H | | Ctrl+H | ctrl+h | Ctrl+H | ctrl+[KeyH] | | +| Shift+KeyH | Р | Shift+H | | Shift+H | shift+h | Shift+H | shift+[KeyH] | | +| Ctrl+Shift+KeyH | Р | Ctrl+Shift+H | | Ctrl+Shift+H | ctrl+shift+h | Ctrl+Shift+H | ctrl+shift+[KeyH] | | +| Alt+KeyH | Ñ€ | Alt+H | | Alt+H | alt+h | Alt+H | alt+[KeyH] | | +| Ctrl+Alt+KeyH | Ñ€ | Ctrl+Alt+H | | Ctrl+Alt+H | ctrl+alt+h | Ctrl+Alt+H | ctrl+alt+[KeyH] | | +| Shift+Alt+KeyH | Р | Shift+Alt+H | | Shift+Alt+H | shift+alt+h | Shift+Alt+H | shift+alt+[KeyH] | | +| Ctrl+Shift+Alt+KeyH | Р | Ctrl+Shift+Alt+H | | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | Ctrl+Shift+Alt+H | ctrl+shift+alt+[KeyH] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyI | ш | I | | ш | i | I | [KeyI] | NO | -| Ctrl+KeyI | ш | Ctrl+I | | Ctrl+ш | ctrl+i | Ctrl+I | ctrl+[KeyI] | NO | -| Shift+KeyI | Ш | Shift+I | | Shift+ш | shift+i | Shift+I | shift+[KeyI] | NO | -| Ctrl+Shift+KeyI | Ш | Ctrl+Shift+I | | Ctrl+Shift+ш | ctrl+shift+i | Ctrl+Shift+I | ctrl+shift+[KeyI] | NO | -| Alt+KeyI | ш | Alt+I | | Alt+ш | alt+i | Alt+I | alt+[KeyI] | NO | -| Ctrl+Alt+KeyI | ш | Ctrl+Alt+I | | Ctrl+Alt+ш | ctrl+alt+i | Ctrl+Alt+I | ctrl+alt+[KeyI] | NO | -| Shift+Alt+KeyI | Ш | Shift+Alt+I | | Shift+Alt+ш | shift+alt+i | Shift+Alt+I | shift+alt+[KeyI] | NO | -| Ctrl+Shift+Alt+KeyI | Ш | Ctrl+Shift+Alt+I | | Ctrl+Shift+Alt+ш | ctrl+shift+alt+i | Ctrl+Shift+Alt+I | ctrl+shift+alt+[KeyI] | NO | +| KeyI | ш | I | | I | i | I | [KeyI] | | +| Ctrl+KeyI | ш | Ctrl+I | | Ctrl+I | ctrl+i | Ctrl+I | ctrl+[KeyI] | | +| Shift+KeyI | Ш | Shift+I | | Shift+I | shift+i | Shift+I | shift+[KeyI] | | +| Ctrl+Shift+KeyI | Ш | Ctrl+Shift+I | | Ctrl+Shift+I | ctrl+shift+i | Ctrl+Shift+I | ctrl+shift+[KeyI] | | +| Alt+KeyI | ш | Alt+I | | Alt+I | alt+i | Alt+I | alt+[KeyI] | | +| Ctrl+Alt+KeyI | ш | Ctrl+Alt+I | | Ctrl+Alt+I | ctrl+alt+i | Ctrl+Alt+I | ctrl+alt+[KeyI] | | +| Shift+Alt+KeyI | Ш | Shift+Alt+I | | Shift+Alt+I | shift+alt+i | Shift+Alt+I | shift+alt+[KeyI] | | +| Ctrl+Shift+Alt+KeyI | Ш | Ctrl+Shift+Alt+I | | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | Ctrl+Shift+Alt+I | ctrl+shift+alt+[KeyI] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyJ | о | J | | о | j | J | [KeyJ] | NO | -| Ctrl+KeyJ | о | Ctrl+J | | Ctrl+о | ctrl+j | Ctrl+J | ctrl+[KeyJ] | NO | -| Shift+KeyJ | О | Shift+J | | Shift+о | shift+j | Shift+J | shift+[KeyJ] | NO | -| Ctrl+Shift+KeyJ | О | Ctrl+Shift+J | | Ctrl+Shift+о | ctrl+shift+j | Ctrl+Shift+J | ctrl+shift+[KeyJ] | NO | -| Alt+KeyJ | о | Alt+J | | Alt+о | alt+j | Alt+J | alt+[KeyJ] | NO | -| Ctrl+Alt+KeyJ | о | Ctrl+Alt+J | | Ctrl+Alt+о | ctrl+alt+j | Ctrl+Alt+J | ctrl+alt+[KeyJ] | NO | -| Shift+Alt+KeyJ | О | Shift+Alt+J | | Shift+Alt+о | shift+alt+j | Shift+Alt+J | shift+alt+[KeyJ] | NO | -| Ctrl+Shift+Alt+KeyJ | О | Ctrl+Shift+Alt+J | | Ctrl+Shift+Alt+о | ctrl+shift+alt+j | Ctrl+Shift+Alt+J | ctrl+shift+alt+[KeyJ] | NO | +| KeyJ | о | J | | J | j | J | [KeyJ] | | +| Ctrl+KeyJ | о | Ctrl+J | | Ctrl+J | ctrl+j | Ctrl+J | ctrl+[KeyJ] | | +| Shift+KeyJ | О | Shift+J | | Shift+J | shift+j | Shift+J | shift+[KeyJ] | | +| Ctrl+Shift+KeyJ | О | Ctrl+Shift+J | | Ctrl+Shift+J | ctrl+shift+j | Ctrl+Shift+J | ctrl+shift+[KeyJ] | | +| Alt+KeyJ | о | Alt+J | | Alt+J | alt+j | Alt+J | alt+[KeyJ] | | +| Ctrl+Alt+KeyJ | о | Ctrl+Alt+J | | Ctrl+Alt+J | ctrl+alt+j | Ctrl+Alt+J | ctrl+alt+[KeyJ] | | +| Shift+Alt+KeyJ | О | Shift+Alt+J | | Shift+Alt+J | shift+alt+j | Shift+Alt+J | shift+alt+[KeyJ] | | +| Ctrl+Shift+Alt+KeyJ | О | Ctrl+Shift+Alt+J | | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | Ctrl+Shift+Alt+J | ctrl+shift+alt+[KeyJ] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyK | л | K | | л | k | K | [KeyK] | NO | -| Ctrl+KeyK | л | Ctrl+K | | Ctrl+л | ctrl+k | Ctrl+K | ctrl+[KeyK] | NO | -| Shift+KeyK | Л | Shift+K | | Shift+л | shift+k | Shift+K | shift+[KeyK] | NO | -| Ctrl+Shift+KeyK | Л | Ctrl+Shift+K | | Ctrl+Shift+л | ctrl+shift+k | Ctrl+Shift+K | ctrl+shift+[KeyK] | NO | -| Alt+KeyK | л | Alt+K | | Alt+л | alt+k | Alt+K | alt+[KeyK] | NO | -| Ctrl+Alt+KeyK | л | Ctrl+Alt+K | | Ctrl+Alt+л | ctrl+alt+k | Ctrl+Alt+K | ctrl+alt+[KeyK] | NO | -| Shift+Alt+KeyK | Л | Shift+Alt+K | | Shift+Alt+л | shift+alt+k | Shift+Alt+K | shift+alt+[KeyK] | NO | -| Ctrl+Shift+Alt+KeyK | Л | Ctrl+Shift+Alt+K | | Ctrl+Shift+Alt+л | ctrl+shift+alt+k | Ctrl+Shift+Alt+K | ctrl+shift+alt+[KeyK] | NO | +| KeyK | л | K | | K | k | K | [KeyK] | | +| Ctrl+KeyK | л | Ctrl+K | | Ctrl+K | ctrl+k | Ctrl+K | ctrl+[KeyK] | | +| Shift+KeyK | Л | Shift+K | | Shift+K | shift+k | Shift+K | shift+[KeyK] | | +| Ctrl+Shift+KeyK | Л | Ctrl+Shift+K | | Ctrl+Shift+K | ctrl+shift+k | Ctrl+Shift+K | ctrl+shift+[KeyK] | | +| Alt+KeyK | л | Alt+K | | Alt+K | alt+k | Alt+K | alt+[KeyK] | | +| Ctrl+Alt+KeyK | л | Ctrl+Alt+K | | Ctrl+Alt+K | ctrl+alt+k | Ctrl+Alt+K | ctrl+alt+[KeyK] | | +| Shift+Alt+KeyK | Л | Shift+Alt+K | | Shift+Alt+K | shift+alt+k | Shift+Alt+K | shift+alt+[KeyK] | | +| Ctrl+Shift+Alt+KeyK | Л | Ctrl+Shift+Alt+K | | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | Ctrl+Shift+Alt+K | ctrl+shift+alt+[KeyK] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyL | д | L | | д | l | L | [KeyL] | NO | -| Ctrl+KeyL | д | Ctrl+L | | Ctrl+д | ctrl+l | Ctrl+L | ctrl+[KeyL] | NO | -| Shift+KeyL | Д | Shift+L | | Shift+д | shift+l | Shift+L | shift+[KeyL] | NO | -| Ctrl+Shift+KeyL | Д | Ctrl+Shift+L | | Ctrl+Shift+д | ctrl+shift+l | Ctrl+Shift+L | ctrl+shift+[KeyL] | NO | -| Alt+KeyL | д | Alt+L | | Alt+д | alt+l | Alt+L | alt+[KeyL] | NO | -| Ctrl+Alt+KeyL | д | Ctrl+Alt+L | | Ctrl+Alt+д | ctrl+alt+l | Ctrl+Alt+L | ctrl+alt+[KeyL] | NO | -| Shift+Alt+KeyL | Д | Shift+Alt+L | | Shift+Alt+д | shift+alt+l | Shift+Alt+L | shift+alt+[KeyL] | NO | -| Ctrl+Shift+Alt+KeyL | Д | Ctrl+Shift+Alt+L | | Ctrl+Shift+Alt+д | ctrl+shift+alt+l | Ctrl+Shift+Alt+L | ctrl+shift+alt+[KeyL] | NO | +| KeyL | д | L | | L | l | L | [KeyL] | | +| Ctrl+KeyL | д | Ctrl+L | | Ctrl+L | ctrl+l | Ctrl+L | ctrl+[KeyL] | | +| Shift+KeyL | Д | Shift+L | | Shift+L | shift+l | Shift+L | shift+[KeyL] | | +| Ctrl+Shift+KeyL | Д | Ctrl+Shift+L | | Ctrl+Shift+L | ctrl+shift+l | Ctrl+Shift+L | ctrl+shift+[KeyL] | | +| Alt+KeyL | д | Alt+L | | Alt+L | alt+l | Alt+L | alt+[KeyL] | | +| Ctrl+Alt+KeyL | д | Ctrl+Alt+L | | Ctrl+Alt+L | ctrl+alt+l | Ctrl+Alt+L | ctrl+alt+[KeyL] | | +| Shift+Alt+KeyL | Д | Shift+Alt+L | | Shift+Alt+L | shift+alt+l | Shift+Alt+L | shift+alt+[KeyL] | | +| Ctrl+Shift+Alt+KeyL | Д | Ctrl+Shift+Alt+L | | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | Ctrl+Shift+Alt+L | ctrl+shift+alt+[KeyL] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyM | ÑŒ | M | | ÑŒ | m | M | [KeyM] | NO | -| Ctrl+KeyM | ÑŒ | Ctrl+M | | Ctrl+ÑŒ | ctrl+m | Ctrl+M | ctrl+[KeyM] | NO | -| Shift+KeyM | Ь | Shift+M | | Shift+ÑŒ | shift+m | Shift+M | shift+[KeyM] | NO | -| Ctrl+Shift+KeyM | Ь | Ctrl+Shift+M | | Ctrl+Shift+ÑŒ | ctrl+shift+m | Ctrl+Shift+M | ctrl+shift+[KeyM] | NO | -| Alt+KeyM | ÑŒ | Alt+M | | Alt+ÑŒ | alt+m | Alt+M | alt+[KeyM] | NO | -| Ctrl+Alt+KeyM | ÑŒ | Ctrl+Alt+M | | Ctrl+Alt+ÑŒ | ctrl+alt+m | Ctrl+Alt+M | ctrl+alt+[KeyM] | NO | -| Shift+Alt+KeyM | Ь | Shift+Alt+M | | Shift+Alt+ÑŒ | shift+alt+m | Shift+Alt+M | shift+alt+[KeyM] | NO | -| Ctrl+Shift+Alt+KeyM | Ь | Ctrl+Shift+Alt+M | | Ctrl+Shift+Alt+ÑŒ | ctrl+shift+alt+m | Ctrl+Shift+Alt+M | ctrl+shift+alt+[KeyM] | NO | +| KeyM | ÑŒ | M | | M | m | M | [KeyM] | | +| Ctrl+KeyM | ÑŒ | Ctrl+M | | Ctrl+M | ctrl+m | Ctrl+M | ctrl+[KeyM] | | +| Shift+KeyM | Ь | Shift+M | | Shift+M | shift+m | Shift+M | shift+[KeyM] | | +| Ctrl+Shift+KeyM | Ь | Ctrl+Shift+M | | Ctrl+Shift+M | ctrl+shift+m | Ctrl+Shift+M | ctrl+shift+[KeyM] | | +| Alt+KeyM | ÑŒ | Alt+M | | Alt+M | alt+m | Alt+M | alt+[KeyM] | | +| Ctrl+Alt+KeyM | ÑŒ | Ctrl+Alt+M | | Ctrl+Alt+M | ctrl+alt+m | Ctrl+Alt+M | ctrl+alt+[KeyM] | | +| Shift+Alt+KeyM | Ь | Shift+Alt+M | | Shift+Alt+M | shift+alt+m | Shift+Alt+M | shift+alt+[KeyM] | | +| Ctrl+Shift+Alt+KeyM | Ь | Ctrl+Shift+Alt+M | | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | Ctrl+Shift+Alt+M | ctrl+shift+alt+[KeyM] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyN | Ñ‚ | N | | Ñ‚ | n | N | [KeyN] | NO | -| Ctrl+KeyN | Ñ‚ | Ctrl+N | | Ctrl+Ñ‚ | ctrl+n | Ctrl+N | ctrl+[KeyN] | NO | -| Shift+KeyN | Т | Shift+N | | Shift+Ñ‚ | shift+n | Shift+N | shift+[KeyN] | NO | -| Ctrl+Shift+KeyN | Т | Ctrl+Shift+N | | Ctrl+Shift+Ñ‚ | ctrl+shift+n | Ctrl+Shift+N | ctrl+shift+[KeyN] | NO | -| Alt+KeyN | Ñ‚ | Alt+N | | Alt+Ñ‚ | alt+n | Alt+N | alt+[KeyN] | NO | -| Ctrl+Alt+KeyN | Ñ‚ | Ctrl+Alt+N | | Ctrl+Alt+Ñ‚ | ctrl+alt+n | Ctrl+Alt+N | ctrl+alt+[KeyN] | NO | -| Shift+Alt+KeyN | Т | Shift+Alt+N | | Shift+Alt+Ñ‚ | shift+alt+n | Shift+Alt+N | shift+alt+[KeyN] | NO | -| Ctrl+Shift+Alt+KeyN | Т | Ctrl+Shift+Alt+N | | Ctrl+Shift+Alt+Ñ‚ | ctrl+shift+alt+n | Ctrl+Shift+Alt+N | ctrl+shift+alt+[KeyN] | NO | +| KeyN | Ñ‚ | N | | N | n | N | [KeyN] | | +| Ctrl+KeyN | Ñ‚ | Ctrl+N | | Ctrl+N | ctrl+n | Ctrl+N | ctrl+[KeyN] | | +| Shift+KeyN | Т | Shift+N | | Shift+N | shift+n | Shift+N | shift+[KeyN] | | +| Ctrl+Shift+KeyN | Т | Ctrl+Shift+N | | Ctrl+Shift+N | ctrl+shift+n | Ctrl+Shift+N | ctrl+shift+[KeyN] | | +| Alt+KeyN | Ñ‚ | Alt+N | | Alt+N | alt+n | Alt+N | alt+[KeyN] | | +| Ctrl+Alt+KeyN | Ñ‚ | Ctrl+Alt+N | | Ctrl+Alt+N | ctrl+alt+n | Ctrl+Alt+N | ctrl+alt+[KeyN] | | +| Shift+Alt+KeyN | Т | Shift+Alt+N | | Shift+Alt+N | shift+alt+n | Shift+Alt+N | shift+alt+[KeyN] | | +| Ctrl+Shift+Alt+KeyN | Т | Ctrl+Shift+Alt+N | | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | Ctrl+Shift+Alt+N | ctrl+shift+alt+[KeyN] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyO | щ | O | | щ | o | O | [KeyO] | NO | -| Ctrl+KeyO | щ | Ctrl+O | | Ctrl+щ | ctrl+o | Ctrl+O | ctrl+[KeyO] | NO | -| Shift+KeyO | Щ | Shift+O | | Shift+щ | shift+o | Shift+O | shift+[KeyO] | NO | -| Ctrl+Shift+KeyO | Щ | Ctrl+Shift+O | | Ctrl+Shift+щ | ctrl+shift+o | Ctrl+Shift+O | ctrl+shift+[KeyO] | NO | -| Alt+KeyO | щ | Alt+O | | Alt+щ | alt+o | Alt+O | alt+[KeyO] | NO | -| Ctrl+Alt+KeyO | щ | Ctrl+Alt+O | | Ctrl+Alt+щ | ctrl+alt+o | Ctrl+Alt+O | ctrl+alt+[KeyO] | NO | -| Shift+Alt+KeyO | Щ | Shift+Alt+O | | Shift+Alt+щ | shift+alt+o | Shift+Alt+O | shift+alt+[KeyO] | NO | -| Ctrl+Shift+Alt+KeyO | Щ | Ctrl+Shift+Alt+O | | Ctrl+Shift+Alt+щ | ctrl+shift+alt+o | Ctrl+Shift+Alt+O | ctrl+shift+alt+[KeyO] | NO | +| KeyO | щ | O | | O | o | O | [KeyO] | | +| Ctrl+KeyO | щ | Ctrl+O | | Ctrl+O | ctrl+o | Ctrl+O | ctrl+[KeyO] | | +| Shift+KeyO | Щ | Shift+O | | Shift+O | shift+o | Shift+O | shift+[KeyO] | | +| Ctrl+Shift+KeyO | Щ | Ctrl+Shift+O | | Ctrl+Shift+O | ctrl+shift+o | Ctrl+Shift+O | ctrl+shift+[KeyO] | | +| Alt+KeyO | щ | Alt+O | | Alt+O | alt+o | Alt+O | alt+[KeyO] | | +| Ctrl+Alt+KeyO | щ | Ctrl+Alt+O | | Ctrl+Alt+O | ctrl+alt+o | Ctrl+Alt+O | ctrl+alt+[KeyO] | | +| Shift+Alt+KeyO | Щ | Shift+Alt+O | | Shift+Alt+O | shift+alt+o | Shift+Alt+O | shift+alt+[KeyO] | | +| Ctrl+Shift+Alt+KeyO | Щ | Ctrl+Shift+Alt+O | | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | Ctrl+Shift+Alt+O | ctrl+shift+alt+[KeyO] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyP | з | P | | з | p | P | [KeyP] | NO | -| Ctrl+KeyP | з | Ctrl+P | | Ctrl+з | ctrl+p | Ctrl+P | ctrl+[KeyP] | NO | -| Shift+KeyP | З | Shift+P | | Shift+з | shift+p | Shift+P | shift+[KeyP] | NO | -| Ctrl+Shift+KeyP | З | Ctrl+Shift+P | | Ctrl+Shift+з | ctrl+shift+p | Ctrl+Shift+P | ctrl+shift+[KeyP] | NO | -| Alt+KeyP | з | Alt+P | | Alt+з | alt+p | Alt+P | alt+[KeyP] | NO | -| Ctrl+Alt+KeyP | з | Ctrl+Alt+P | | Ctrl+Alt+з | ctrl+alt+p | Ctrl+Alt+P | ctrl+alt+[KeyP] | NO | -| Shift+Alt+KeyP | З | Shift+Alt+P | | Shift+Alt+з | shift+alt+p | Shift+Alt+P | shift+alt+[KeyP] | NO | -| Ctrl+Shift+Alt+KeyP | З | Ctrl+Shift+Alt+P | | Ctrl+Shift+Alt+з | ctrl+shift+alt+p | Ctrl+Shift+Alt+P | ctrl+shift+alt+[KeyP] | NO | +| KeyP | з | P | | P | p | P | [KeyP] | | +| Ctrl+KeyP | з | Ctrl+P | | Ctrl+P | ctrl+p | Ctrl+P | ctrl+[KeyP] | | +| Shift+KeyP | З | Shift+P | | Shift+P | shift+p | Shift+P | shift+[KeyP] | | +| Ctrl+Shift+KeyP | З | Ctrl+Shift+P | | Ctrl+Shift+P | ctrl+shift+p | Ctrl+Shift+P | ctrl+shift+[KeyP] | | +| Alt+KeyP | з | Alt+P | | Alt+P | alt+p | Alt+P | alt+[KeyP] | | +| Ctrl+Alt+KeyP | з | Ctrl+Alt+P | | Ctrl+Alt+P | ctrl+alt+p | Ctrl+Alt+P | ctrl+alt+[KeyP] | | +| Shift+Alt+KeyP | З | Shift+Alt+P | | Shift+Alt+P | shift+alt+p | Shift+Alt+P | shift+alt+[KeyP] | | +| Ctrl+Shift+Alt+KeyP | З | Ctrl+Shift+Alt+P | | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | Ctrl+Shift+Alt+P | ctrl+shift+alt+[KeyP] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyQ | й | Q | | й | q | Q | [KeyQ] | NO | -| Ctrl+KeyQ | й | Ctrl+Q | | Ctrl+й | ctrl+q | Ctrl+Q | ctrl+[KeyQ] | NO | -| Shift+KeyQ | Й | Shift+Q | | Shift+й | shift+q | Shift+Q | shift+[KeyQ] | NO | -| Ctrl+Shift+KeyQ | Й | Ctrl+Shift+Q | | Ctrl+Shift+й | ctrl+shift+q | Ctrl+Shift+Q | ctrl+shift+[KeyQ] | NO | -| Alt+KeyQ | й | Alt+Q | | Alt+й | alt+q | Alt+Q | alt+[KeyQ] | NO | -| Ctrl+Alt+KeyQ | й | Ctrl+Alt+Q | | Ctrl+Alt+й | ctrl+alt+q | Ctrl+Alt+Q | ctrl+alt+[KeyQ] | NO | -| Shift+Alt+KeyQ | Й | Shift+Alt+Q | | Shift+Alt+й | shift+alt+q | Shift+Alt+Q | shift+alt+[KeyQ] | NO | -| Ctrl+Shift+Alt+KeyQ | Й | Ctrl+Shift+Alt+Q | | Ctrl+Shift+Alt+й | ctrl+shift+alt+q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+[KeyQ] | NO | +| KeyQ | й | Q | | Q | q | Q | [KeyQ] | | +| Ctrl+KeyQ | й | Ctrl+Q | | Ctrl+Q | ctrl+q | Ctrl+Q | ctrl+[KeyQ] | | +| Shift+KeyQ | Й | Shift+Q | | Shift+Q | shift+q | Shift+Q | shift+[KeyQ] | | +| Ctrl+Shift+KeyQ | Й | Ctrl+Shift+Q | | Ctrl+Shift+Q | ctrl+shift+q | Ctrl+Shift+Q | ctrl+shift+[KeyQ] | | +| Alt+KeyQ | й | Alt+Q | | Alt+Q | alt+q | Alt+Q | alt+[KeyQ] | | +| Ctrl+Alt+KeyQ | й | Ctrl+Alt+Q | | Ctrl+Alt+Q | ctrl+alt+q | Ctrl+Alt+Q | ctrl+alt+[KeyQ] | | +| Shift+Alt+KeyQ | Й | Shift+Alt+Q | | Shift+Alt+Q | shift+alt+q | Shift+Alt+Q | shift+alt+[KeyQ] | | +| Ctrl+Shift+Alt+KeyQ | Й | Ctrl+Shift+Alt+Q | | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+[KeyQ] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyR | к | R | | к | r | R | [KeyR] | NO | -| Ctrl+KeyR | к | Ctrl+R | | Ctrl+к | ctrl+r | Ctrl+R | ctrl+[KeyR] | NO | -| Shift+KeyR | К | Shift+R | | Shift+к | shift+r | Shift+R | shift+[KeyR] | NO | -| Ctrl+Shift+KeyR | К | Ctrl+Shift+R | | Ctrl+Shift+к | ctrl+shift+r | Ctrl+Shift+R | ctrl+shift+[KeyR] | NO | -| Alt+KeyR | к | Alt+R | | Alt+к | alt+r | Alt+R | alt+[KeyR] | NO | -| Ctrl+Alt+KeyR | к | Ctrl+Alt+R | | Ctrl+Alt+к | ctrl+alt+r | Ctrl+Alt+R | ctrl+alt+[KeyR] | NO | -| Shift+Alt+KeyR | К | Shift+Alt+R | | Shift+Alt+к | shift+alt+r | Shift+Alt+R | shift+alt+[KeyR] | NO | -| Ctrl+Shift+Alt+KeyR | К | Ctrl+Shift+Alt+R | | Ctrl+Shift+Alt+к | ctrl+shift+alt+r | Ctrl+Shift+Alt+R | ctrl+shift+alt+[KeyR] | NO | +| KeyR | к | R | | R | r | R | [KeyR] | | +| Ctrl+KeyR | к | Ctrl+R | | Ctrl+R | ctrl+r | Ctrl+R | ctrl+[KeyR] | | +| Shift+KeyR | К | Shift+R | | Shift+R | shift+r | Shift+R | shift+[KeyR] | | +| Ctrl+Shift+KeyR | К | Ctrl+Shift+R | | Ctrl+Shift+R | ctrl+shift+r | Ctrl+Shift+R | ctrl+shift+[KeyR] | | +| Alt+KeyR | к | Alt+R | | Alt+R | alt+r | Alt+R | alt+[KeyR] | | +| Ctrl+Alt+KeyR | к | Ctrl+Alt+R | | Ctrl+Alt+R | ctrl+alt+r | Ctrl+Alt+R | ctrl+alt+[KeyR] | | +| Shift+Alt+KeyR | К | Shift+Alt+R | | Shift+Alt+R | shift+alt+r | Shift+Alt+R | shift+alt+[KeyR] | | +| Ctrl+Shift+Alt+KeyR | К | Ctrl+Shift+Alt+R | | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | Ctrl+Shift+Alt+R | ctrl+shift+alt+[KeyR] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyS | Ñ‹ | S | | Ñ‹ | s | S | [KeyS] | NO | -| Ctrl+KeyS | Ñ‹ | Ctrl+S | | Ctrl+Ñ‹ | ctrl+s | Ctrl+S | ctrl+[KeyS] | NO | -| Shift+KeyS | Ы | Shift+S | | Shift+Ñ‹ | shift+s | Shift+S | shift+[KeyS] | NO | -| Ctrl+Shift+KeyS | Ы | Ctrl+Shift+S | | Ctrl+Shift+Ñ‹ | ctrl+shift+s | Ctrl+Shift+S | ctrl+shift+[KeyS] | NO | -| Alt+KeyS | Ñ‹ | Alt+S | | Alt+Ñ‹ | alt+s | Alt+S | alt+[KeyS] | NO | -| Ctrl+Alt+KeyS | Ñ‹ | Ctrl+Alt+S | | Ctrl+Alt+Ñ‹ | ctrl+alt+s | Ctrl+Alt+S | ctrl+alt+[KeyS] | NO | -| Shift+Alt+KeyS | Ы | Shift+Alt+S | | Shift+Alt+Ñ‹ | shift+alt+s | Shift+Alt+S | shift+alt+[KeyS] | NO | -| Ctrl+Shift+Alt+KeyS | Ы | Ctrl+Shift+Alt+S | | Ctrl+Shift+Alt+Ñ‹ | ctrl+shift+alt+s | Ctrl+Shift+Alt+S | ctrl+shift+alt+[KeyS] | NO | +| KeyS | Ñ‹ | S | | S | s | S | [KeyS] | | +| Ctrl+KeyS | Ñ‹ | Ctrl+S | | Ctrl+S | ctrl+s | Ctrl+S | ctrl+[KeyS] | | +| Shift+KeyS | Ы | Shift+S | | Shift+S | shift+s | Shift+S | shift+[KeyS] | | +| Ctrl+Shift+KeyS | Ы | Ctrl+Shift+S | | Ctrl+Shift+S | ctrl+shift+s | Ctrl+Shift+S | ctrl+shift+[KeyS] | | +| Alt+KeyS | Ñ‹ | Alt+S | | Alt+S | alt+s | Alt+S | alt+[KeyS] | | +| Ctrl+Alt+KeyS | Ñ‹ | Ctrl+Alt+S | | Ctrl+Alt+S | ctrl+alt+s | Ctrl+Alt+S | ctrl+alt+[KeyS] | | +| Shift+Alt+KeyS | Ы | Shift+Alt+S | | Shift+Alt+S | shift+alt+s | Shift+Alt+S | shift+alt+[KeyS] | | +| Ctrl+Shift+Alt+KeyS | Ы | Ctrl+Shift+Alt+S | | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | Ctrl+Shift+Alt+S | ctrl+shift+alt+[KeyS] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyT | е | T | | е | t | T | [KeyT] | NO | -| Ctrl+KeyT | е | Ctrl+T | | Ctrl+е | ctrl+t | Ctrl+T | ctrl+[KeyT] | NO | -| Shift+KeyT | Е | Shift+T | | Shift+е | shift+t | Shift+T | shift+[KeyT] | NO | -| Ctrl+Shift+KeyT | Е | Ctrl+Shift+T | | Ctrl+Shift+е | ctrl+shift+t | Ctrl+Shift+T | ctrl+shift+[KeyT] | NO | -| Alt+KeyT | е | Alt+T | | Alt+е | alt+t | Alt+T | alt+[KeyT] | NO | -| Ctrl+Alt+KeyT | е | Ctrl+Alt+T | | Ctrl+Alt+е | ctrl+alt+t | Ctrl+Alt+T | ctrl+alt+[KeyT] | NO | -| Shift+Alt+KeyT | Е | Shift+Alt+T | | Shift+Alt+е | shift+alt+t | Shift+Alt+T | shift+alt+[KeyT] | NO | -| Ctrl+Shift+Alt+KeyT | Е | Ctrl+Shift+Alt+T | | Ctrl+Shift+Alt+е | ctrl+shift+alt+t | Ctrl+Shift+Alt+T | ctrl+shift+alt+[KeyT] | NO | +| KeyT | е | T | | T | t | T | [KeyT] | | +| Ctrl+KeyT | е | Ctrl+T | | Ctrl+T | ctrl+t | Ctrl+T | ctrl+[KeyT] | | +| Shift+KeyT | Е | Shift+T | | Shift+T | shift+t | Shift+T | shift+[KeyT] | | +| Ctrl+Shift+KeyT | Е | Ctrl+Shift+T | | Ctrl+Shift+T | ctrl+shift+t | Ctrl+Shift+T | ctrl+shift+[KeyT] | | +| Alt+KeyT | е | Alt+T | | Alt+T | alt+t | Alt+T | alt+[KeyT] | | +| Ctrl+Alt+KeyT | е | Ctrl+Alt+T | | Ctrl+Alt+T | ctrl+alt+t | Ctrl+Alt+T | ctrl+alt+[KeyT] | | +| Shift+Alt+KeyT | Е | Shift+Alt+T | | Shift+Alt+T | shift+alt+t | Shift+Alt+T | shift+alt+[KeyT] | | +| Ctrl+Shift+Alt+KeyT | Е | Ctrl+Shift+Alt+T | | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | Ctrl+Shift+Alt+T | ctrl+shift+alt+[KeyT] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyU | г | U | | г | u | U | [KeyU] | NO | -| Ctrl+KeyU | г | Ctrl+U | | Ctrl+г | ctrl+u | Ctrl+U | ctrl+[KeyU] | NO | -| Shift+KeyU | Г | Shift+U | | Shift+г | shift+u | Shift+U | shift+[KeyU] | NO | -| Ctrl+Shift+KeyU | Г | Ctrl+Shift+U | | Ctrl+Shift+г | ctrl+shift+u | Ctrl+Shift+U | ctrl+shift+[KeyU] | NO | -| Alt+KeyU | г | Alt+U | | Alt+г | alt+u | Alt+U | alt+[KeyU] | NO | -| Ctrl+Alt+KeyU | г | Ctrl+Alt+U | | Ctrl+Alt+г | ctrl+alt+u | Ctrl+Alt+U | ctrl+alt+[KeyU] | NO | -| Shift+Alt+KeyU | Г | Shift+Alt+U | | Shift+Alt+г | shift+alt+u | Shift+Alt+U | shift+alt+[KeyU] | NO | -| Ctrl+Shift+Alt+KeyU | Г | Ctrl+Shift+Alt+U | | Ctrl+Shift+Alt+г | ctrl+shift+alt+u | Ctrl+Shift+Alt+U | ctrl+shift+alt+[KeyU] | NO | +| KeyU | г | U | | U | u | U | [KeyU] | | +| Ctrl+KeyU | г | Ctrl+U | | Ctrl+U | ctrl+u | Ctrl+U | ctrl+[KeyU] | | +| Shift+KeyU | Г | Shift+U | | Shift+U | shift+u | Shift+U | shift+[KeyU] | | +| Ctrl+Shift+KeyU | Г | Ctrl+Shift+U | | Ctrl+Shift+U | ctrl+shift+u | Ctrl+Shift+U | ctrl+shift+[KeyU] | | +| Alt+KeyU | г | Alt+U | | Alt+U | alt+u | Alt+U | alt+[KeyU] | | +| Ctrl+Alt+KeyU | г | Ctrl+Alt+U | | Ctrl+Alt+U | ctrl+alt+u | Ctrl+Alt+U | ctrl+alt+[KeyU] | | +| Shift+Alt+KeyU | Г | Shift+Alt+U | | Shift+Alt+U | shift+alt+u | Shift+Alt+U | shift+alt+[KeyU] | | +| Ctrl+Shift+Alt+KeyU | Г | Ctrl+Shift+Alt+U | | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | Ctrl+Shift+Alt+U | ctrl+shift+alt+[KeyU] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyV | м | V | | м | v | V | [KeyV] | NO | -| Ctrl+KeyV | м | Ctrl+V | | Ctrl+м | ctrl+v | Ctrl+V | ctrl+[KeyV] | NO | -| Shift+KeyV | М | Shift+V | | Shift+м | shift+v | Shift+V | shift+[KeyV] | NO | -| Ctrl+Shift+KeyV | М | Ctrl+Shift+V | | Ctrl+Shift+м | ctrl+shift+v | Ctrl+Shift+V | ctrl+shift+[KeyV] | NO | -| Alt+KeyV | м | Alt+V | | Alt+м | alt+v | Alt+V | alt+[KeyV] | NO | -| Ctrl+Alt+KeyV | м | Ctrl+Alt+V | | Ctrl+Alt+м | ctrl+alt+v | Ctrl+Alt+V | ctrl+alt+[KeyV] | NO | -| Shift+Alt+KeyV | М | Shift+Alt+V | | Shift+Alt+м | shift+alt+v | Shift+Alt+V | shift+alt+[KeyV] | NO | -| Ctrl+Shift+Alt+KeyV | М | Ctrl+Shift+Alt+V | | Ctrl+Shift+Alt+м | ctrl+shift+alt+v | Ctrl+Shift+Alt+V | ctrl+shift+alt+[KeyV] | NO | +| KeyV | м | V | | V | v | V | [KeyV] | | +| Ctrl+KeyV | м | Ctrl+V | | Ctrl+V | ctrl+v | Ctrl+V | ctrl+[KeyV] | | +| Shift+KeyV | М | Shift+V | | Shift+V | shift+v | Shift+V | shift+[KeyV] | | +| Ctrl+Shift+KeyV | М | Ctrl+Shift+V | | Ctrl+Shift+V | ctrl+shift+v | Ctrl+Shift+V | ctrl+shift+[KeyV] | | +| Alt+KeyV | м | Alt+V | | Alt+V | alt+v | Alt+V | alt+[KeyV] | | +| Ctrl+Alt+KeyV | м | Ctrl+Alt+V | | Ctrl+Alt+V | ctrl+alt+v | Ctrl+Alt+V | ctrl+alt+[KeyV] | | +| Shift+Alt+KeyV | М | Shift+Alt+V | | Shift+Alt+V | shift+alt+v | Shift+Alt+V | shift+alt+[KeyV] | | +| Ctrl+Shift+Alt+KeyV | М | Ctrl+Shift+Alt+V | | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | Ctrl+Shift+Alt+V | ctrl+shift+alt+[KeyV] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyW | ц | W | | ц | w | W | [KeyW] | NO | -| Ctrl+KeyW | ц | Ctrl+W | | Ctrl+ц | ctrl+w | Ctrl+W | ctrl+[KeyW] | NO | -| Shift+KeyW | Ц | Shift+W | | Shift+ц | shift+w | Shift+W | shift+[KeyW] | NO | -| Ctrl+Shift+KeyW | Ц | Ctrl+Shift+W | | Ctrl+Shift+ц | ctrl+shift+w | Ctrl+Shift+W | ctrl+shift+[KeyW] | NO | -| Alt+KeyW | ц | Alt+W | | Alt+ц | alt+w | Alt+W | alt+[KeyW] | NO | -| Ctrl+Alt+KeyW | ц | Ctrl+Alt+W | | Ctrl+Alt+ц | ctrl+alt+w | Ctrl+Alt+W | ctrl+alt+[KeyW] | NO | -| Shift+Alt+KeyW | Ц | Shift+Alt+W | | Shift+Alt+ц | shift+alt+w | Shift+Alt+W | shift+alt+[KeyW] | NO | -| Ctrl+Shift+Alt+KeyW | Ц | Ctrl+Shift+Alt+W | | Ctrl+Shift+Alt+ц | ctrl+shift+alt+w | Ctrl+Shift+Alt+W | ctrl+shift+alt+[KeyW] | NO | +| KeyW | ц | W | | W | w | W | [KeyW] | | +| Ctrl+KeyW | ц | Ctrl+W | | Ctrl+W | ctrl+w | Ctrl+W | ctrl+[KeyW] | | +| Shift+KeyW | Ц | Shift+W | | Shift+W | shift+w | Shift+W | shift+[KeyW] | | +| Ctrl+Shift+KeyW | Ц | Ctrl+Shift+W | | Ctrl+Shift+W | ctrl+shift+w | Ctrl+Shift+W | ctrl+shift+[KeyW] | | +| Alt+KeyW | ц | Alt+W | | Alt+W | alt+w | Alt+W | alt+[KeyW] | | +| Ctrl+Alt+KeyW | ц | Ctrl+Alt+W | | Ctrl+Alt+W | ctrl+alt+w | Ctrl+Alt+W | ctrl+alt+[KeyW] | | +| Shift+Alt+KeyW | Ц | Shift+Alt+W | | Shift+Alt+W | shift+alt+w | Shift+Alt+W | shift+alt+[KeyW] | | +| Ctrl+Shift+Alt+KeyW | Ц | Ctrl+Shift+Alt+W | | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | Ctrl+Shift+Alt+W | ctrl+shift+alt+[KeyW] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyX | ч | X | | ч | x | X | [KeyX] | NO | -| Ctrl+KeyX | ч | Ctrl+X | | Ctrl+ч | ctrl+x | Ctrl+X | ctrl+[KeyX] | NO | -| Shift+KeyX | Ч | Shift+X | | Shift+ч | shift+x | Shift+X | shift+[KeyX] | NO | -| Ctrl+Shift+KeyX | Ч | Ctrl+Shift+X | | Ctrl+Shift+ч | ctrl+shift+x | Ctrl+Shift+X | ctrl+shift+[KeyX] | NO | -| Alt+KeyX | ч | Alt+X | | Alt+ч | alt+x | Alt+X | alt+[KeyX] | NO | -| Ctrl+Alt+KeyX | ч | Ctrl+Alt+X | | Ctrl+Alt+ч | ctrl+alt+x | Ctrl+Alt+X | ctrl+alt+[KeyX] | NO | -| Shift+Alt+KeyX | Ч | Shift+Alt+X | | Shift+Alt+ч | shift+alt+x | Shift+Alt+X | shift+alt+[KeyX] | NO | -| Ctrl+Shift+Alt+KeyX | Ч | Ctrl+Shift+Alt+X | | Ctrl+Shift+Alt+ч | ctrl+shift+alt+x | Ctrl+Shift+Alt+X | ctrl+shift+alt+[KeyX] | NO | +| KeyX | ч | X | | X | x | X | [KeyX] | | +| Ctrl+KeyX | ч | Ctrl+X | | Ctrl+X | ctrl+x | Ctrl+X | ctrl+[KeyX] | | +| Shift+KeyX | Ч | Shift+X | | Shift+X | shift+x | Shift+X | shift+[KeyX] | | +| Ctrl+Shift+KeyX | Ч | Ctrl+Shift+X | | Ctrl+Shift+X | ctrl+shift+x | Ctrl+Shift+X | ctrl+shift+[KeyX] | | +| Alt+KeyX | ч | Alt+X | | Alt+X | alt+x | Alt+X | alt+[KeyX] | | +| Ctrl+Alt+KeyX | ч | Ctrl+Alt+X | | Ctrl+Alt+X | ctrl+alt+x | Ctrl+Alt+X | ctrl+alt+[KeyX] | | +| Shift+Alt+KeyX | Ч | Shift+Alt+X | | Shift+Alt+X | shift+alt+x | Shift+Alt+X | shift+alt+[KeyX] | | +| Ctrl+Shift+Alt+KeyX | Ч | Ctrl+Shift+Alt+X | | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | Ctrl+Shift+Alt+X | ctrl+shift+alt+[KeyX] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyY | н | Y | | н | y | Y | [KeyY] | NO | -| Ctrl+KeyY | н | Ctrl+Y | | Ctrl+н | ctrl+y | Ctrl+Y | ctrl+[KeyY] | NO | -| Shift+KeyY | Ð | Shift+Y | | Shift+н | shift+y | Shift+Y | shift+[KeyY] | NO | -| Ctrl+Shift+KeyY | Ð | Ctrl+Shift+Y | | Ctrl+Shift+н | ctrl+shift+y | Ctrl+Shift+Y | ctrl+shift+[KeyY] | NO | -| Alt+KeyY | н | Alt+Y | | Alt+н | alt+y | Alt+Y | alt+[KeyY] | NO | -| Ctrl+Alt+KeyY | н | Ctrl+Alt+Y | | Ctrl+Alt+н | ctrl+alt+y | Ctrl+Alt+Y | ctrl+alt+[KeyY] | NO | -| Shift+Alt+KeyY | Ð | Shift+Alt+Y | | Shift+Alt+н | shift+alt+y | Shift+Alt+Y | shift+alt+[KeyY] | NO | -| Ctrl+Shift+Alt+KeyY | Ð | Ctrl+Shift+Alt+Y | | Ctrl+Shift+Alt+н | ctrl+shift+alt+y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+[KeyY] | NO | +| KeyY | н | Y | | Y | y | Y | [KeyY] | | +| Ctrl+KeyY | н | Ctrl+Y | | Ctrl+Y | ctrl+y | Ctrl+Y | ctrl+[KeyY] | | +| Shift+KeyY | Ð | Shift+Y | | Shift+Y | shift+y | Shift+Y | shift+[KeyY] | | +| Ctrl+Shift+KeyY | Ð | Ctrl+Shift+Y | | Ctrl+Shift+Y | ctrl+shift+y | Ctrl+Shift+Y | ctrl+shift+[KeyY] | | +| Alt+KeyY | н | Alt+Y | | Alt+Y | alt+y | Alt+Y | alt+[KeyY] | | +| Ctrl+Alt+KeyY | н | Ctrl+Alt+Y | | Ctrl+Alt+Y | ctrl+alt+y | Ctrl+Alt+Y | ctrl+alt+[KeyY] | | +| Shift+Alt+KeyY | Ð | Shift+Alt+Y | | Shift+Alt+Y | shift+alt+y | Shift+Alt+Y | shift+alt+[KeyY] | | +| Ctrl+Shift+Alt+KeyY | Ð | Ctrl+Shift+Alt+Y | | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+[KeyY] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| KeyZ | Ñ | Z | | Ñ | z | Z | [KeyZ] | NO | -| Ctrl+KeyZ | Ñ | Ctrl+Z | | Ctrl+Ñ | ctrl+z | Ctrl+Z | ctrl+[KeyZ] | NO | -| Shift+KeyZ | Я | Shift+Z | | Shift+Ñ | shift+z | Shift+Z | shift+[KeyZ] | NO | -| Ctrl+Shift+KeyZ | Я | Ctrl+Shift+Z | | Ctrl+Shift+Ñ | ctrl+shift+z | Ctrl+Shift+Z | ctrl+shift+[KeyZ] | NO | -| Alt+KeyZ | Ñ | Alt+Z | | Alt+Ñ | alt+z | Alt+Z | alt+[KeyZ] | NO | -| Ctrl+Alt+KeyZ | Ñ | Ctrl+Alt+Z | | Ctrl+Alt+Ñ | ctrl+alt+z | Ctrl+Alt+Z | ctrl+alt+[KeyZ] | NO | -| Shift+Alt+KeyZ | Я | Shift+Alt+Z | | Shift+Alt+Ñ | shift+alt+z | Shift+Alt+Z | shift+alt+[KeyZ] | NO | -| Ctrl+Shift+Alt+KeyZ | Я | Ctrl+Shift+Alt+Z | | Ctrl+Shift+Alt+Ñ | ctrl+shift+alt+z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+[KeyZ] | NO | +| KeyZ | Ñ | Z | | Z | z | Z | [KeyZ] | | +| Ctrl+KeyZ | Ñ | Ctrl+Z | | Ctrl+Z | ctrl+z | Ctrl+Z | ctrl+[KeyZ] | | +| Shift+KeyZ | Я | Shift+Z | | Shift+Z | shift+z | Shift+Z | shift+[KeyZ] | | +| Ctrl+Shift+KeyZ | Я | Ctrl+Shift+Z | | Ctrl+Shift+Z | ctrl+shift+z | Ctrl+Shift+Z | ctrl+shift+[KeyZ] | | +| Alt+KeyZ | Ñ | Alt+Z | | Alt+Z | alt+z | Alt+Z | alt+[KeyZ] | | +| Ctrl+Alt+KeyZ | Ñ | Ctrl+Alt+Z | | Ctrl+Alt+Z | ctrl+alt+z | Ctrl+Alt+Z | ctrl+alt+[KeyZ] | | +| Shift+Alt+KeyZ | Я | Shift+Alt+Z | | Shift+Alt+Z | shift+alt+z | Shift+Alt+Z | shift+alt+[KeyZ] | | +| Ctrl+Shift+Alt+KeyZ | Я | Ctrl+Shift+Alt+Z | | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+[KeyZ] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Digit1 | 1 | 1 | | 1 | 1 | 1 | [Digit1] | | | Ctrl+Digit1 | 1 | Ctrl+1 | | Ctrl+1 | ctrl+1 | Ctrl+1 | ctrl+[Digit1] | | diff --git a/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts index 5c6156521d7..73ff188981b 100644 --- a/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts @@ -25,16 +25,10 @@ suite('keyboardMapper - MAC fallback', () => { [{ label: '⌘Z', ariaLabel: 'Command+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Cmd+Z', userSettingsLabel: 'cmd+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+Z', null], }] ); @@ -46,16 +40,10 @@ suite('keyboardMapper - MAC fallback', () => { [{ label: '⌘K ⌘=', ariaLabel: 'Command+K Command+=', - labelWithoutModifiers: 'K =', - ariaLabelWithoutModifiers: 'K =', electronAccelerator: null, userSettingsLabel: 'cmd+k cmd+=', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+K', 'meta+='], }] ); @@ -75,16 +63,10 @@ suite('keyboardMapper - MAC fallback', () => { { label: '⌘Z', ariaLabel: 'Command+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Cmd+Z', userSettingsLabel: 'cmd+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+Z', null], } ); @@ -98,16 +80,10 @@ suite('keyboardMapper - MAC fallback', () => { [{ label: '⌘, ⌘/', ariaLabel: 'Command+, Command+/', - labelWithoutModifiers: ', /', - ariaLabelWithoutModifiers: ', /', electronAccelerator: null, userSettingsLabel: 'cmd+, cmd+/', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+,', 'meta+/'], }] ); @@ -127,16 +103,10 @@ suite('keyboardMapper - MAC fallback', () => { { label: '⌘', ariaLabel: 'Command+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'cmd+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: [null, null], } ); @@ -157,16 +127,10 @@ suite('keyboardMapper - LINUX fallback', () => { [{ label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Z', null], }] ); @@ -178,16 +142,10 @@ suite('keyboardMapper - LINUX fallback', () => { [{ label: 'Ctrl+K Ctrl+=', ariaLabel: 'Control+K Control+=', - labelWithoutModifiers: 'K =', - ariaLabelWithoutModifiers: 'K =', electronAccelerator: null, userSettingsLabel: 'ctrl+k ctrl+=', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+K', 'ctrl+='], }] ); @@ -207,16 +165,10 @@ suite('keyboardMapper - LINUX fallback', () => { { label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Z', null], } ); @@ -230,16 +182,10 @@ suite('keyboardMapper - LINUX fallback', () => { [{ label: 'Ctrl+, Ctrl+/', ariaLabel: 'Control+, Control+/', - labelWithoutModifiers: ', /', - ariaLabelWithoutModifiers: ', /', electronAccelerator: null, userSettingsLabel: 'ctrl+, ctrl+/', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+,', 'ctrl+/'], }] ); @@ -253,16 +199,10 @@ suite('keyboardMapper - LINUX fallback', () => { [{ label: 'Ctrl+,', ariaLabel: 'Control+,', - labelWithoutModifiers: ',', - ariaLabelWithoutModifiers: ',', electronAccelerator: 'Ctrl+,', userSettingsLabel: 'ctrl+,', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+,', null], }] ); @@ -282,16 +222,10 @@ suite('keyboardMapper - LINUX fallback', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); diff --git a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts index d47b0dccf77..f168b02ef2f 100644 --- a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts @@ -67,16 +67,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘A', ariaLabel: 'Command+A', - labelWithoutModifiers: 'A', - ariaLabelWithoutModifiers: 'A', electronAccelerator: 'Cmd+A', userSettingsLabel: 'cmd+a', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[KeyA]', null], }] ); @@ -88,16 +82,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘B', ariaLabel: 'Command+B', - labelWithoutModifiers: 'B', - ariaLabelWithoutModifiers: 'B', electronAccelerator: 'Cmd+B', userSettingsLabel: 'cmd+b', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[KeyB]', null], }] ); @@ -109,16 +97,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘Z', ariaLabel: 'Command+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Cmd+Z', userSettingsLabel: 'cmd+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[KeyY]', null], }] ); @@ -138,16 +120,10 @@ suite('keyboardMapper - MAC de_ch', () => { { label: '⌘Z', ariaLabel: 'Command+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Cmd+Z', userSettingsLabel: 'cmd+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[KeyY]', null], } ); @@ -159,16 +135,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌃⌥⌘6', ariaLabel: 'Control+Alt+Command+6', - labelWithoutModifiers: '6', - ariaLabelWithoutModifiers: '6', electronAccelerator: 'Ctrl+Alt+Cmd+6', userSettingsLabel: 'ctrl+alt+cmd+6', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: true, - hasMetaModifier: true, dispatchParts: ['ctrl+alt+meta+[Digit6]', null], }] ); @@ -188,16 +158,10 @@ suite('keyboardMapper - MAC de_ch', () => { { label: '⌘¨', ariaLabel: 'Command+¨', - labelWithoutModifiers: '¨', - ariaLabelWithoutModifiers: '¨', electronAccelerator: null, userSettingsLabel: 'cmd+[BracketRight]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[BracketRight]', null], } ); @@ -209,16 +173,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌃⌥9', ariaLabel: 'Control+Alt+9', - labelWithoutModifiers: '9', - ariaLabelWithoutModifiers: '9', electronAccelerator: 'Ctrl+Alt+9', userSettingsLabel: 'ctrl+alt+9', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: true, - hasMetaModifier: false, dispatchParts: ['ctrl+alt+[Digit9]', null], }] ); @@ -230,16 +188,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⇧⌘7', ariaLabel: 'Shift+Command+7', - labelWithoutModifiers: '7', - ariaLabelWithoutModifiers: '7', electronAccelerator: 'Shift+Cmd+7', userSettingsLabel: 'shift+cmd+7', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['shift+meta+[Digit7]', null], }] ); @@ -251,16 +203,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⇧⌘\'', ariaLabel: 'Shift+Command+\'', - labelWithoutModifiers: '\'', - ariaLabelWithoutModifiers: '\'', electronAccelerator: null, userSettingsLabel: 'shift+cmd+[Minus]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['shift+meta+[Minus]', null], }] ); @@ -272,16 +218,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘K ⌃⇧⌥⌘7', ariaLabel: 'Command+K Control+Shift+Alt+Command+7', - labelWithoutModifiers: 'K 7', - ariaLabelWithoutModifiers: 'K 7', electronAccelerator: null, userSettingsLabel: 'cmd+k ctrl+shift+alt+cmd+7', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+[KeyK]', 'ctrl+shift+alt+meta+[Digit7]'], }] ); @@ -293,16 +233,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘K ⇧⌘0', ariaLabel: 'Command+K Shift+Command+0', - labelWithoutModifiers: 'K 0', - ariaLabelWithoutModifiers: 'K 0', electronAccelerator: null, userSettingsLabel: 'cmd+k shift+cmd+0', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+[KeyK]', 'shift+meta+[Digit0]'], }] ); @@ -314,16 +248,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘↓', ariaLabel: 'Command+DownArrow', - labelWithoutModifiers: '↓', - ariaLabelWithoutModifiers: 'DownArrow', electronAccelerator: 'Cmd+Down', userSettingsLabel: 'cmd+down', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[ArrowDown]', null], }] ); @@ -335,16 +263,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘NumPad0', ariaLabel: 'Command+NumPad0', - labelWithoutModifiers: 'NumPad0', - ariaLabelWithoutModifiers: 'NumPad0', electronAccelerator: null, userSettingsLabel: 'cmd+numpad0', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[Numpad0]', null], }] ); @@ -356,16 +278,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘Home', ariaLabel: 'Command+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Cmd+Home', userSettingsLabel: 'cmd+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[Home]', null], }] ); @@ -385,16 +301,10 @@ suite('keyboardMapper - MAC de_ch', () => { { label: '⌘Home', ariaLabel: 'Command+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Cmd+Home', userSettingsLabel: 'cmd+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: ['meta+[Home]', null], } ); @@ -408,16 +318,10 @@ suite('keyboardMapper - MAC de_ch', () => { [{ label: '⌘, ⇧⌘7', ariaLabel: 'Command+, Shift+Command+7', - labelWithoutModifiers: ', 7', - ariaLabelWithoutModifiers: ', 7', electronAccelerator: null, userSettingsLabel: 'cmd+[Comma] shift+cmd+7', isWYSIWYG: false, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+[Comma]', 'shift+meta+[Digit7]'], }] ); @@ -437,16 +341,10 @@ suite('keyboardMapper - MAC de_ch', () => { { label: '⌘', ariaLabel: 'Command+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'cmd+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: [null, null], } ); @@ -466,16 +364,10 @@ suite('keyboardMapper - MAC de_ch', () => { { label: '⌘', ariaLabel: 'Command+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'cmd+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: [null, null], } ); @@ -505,16 +397,10 @@ suite('keyboardMapper - MAC en_us', () => { [{ label: '⌘, ⌘/', ariaLabel: 'Command+, Command+/', - labelWithoutModifiers: ', /', - ariaLabelWithoutModifiers: ', /', electronAccelerator: null, userSettingsLabel: 'cmd+, cmd+/', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['meta+[Comma]', 'meta+[Slash]'], }] ); @@ -534,16 +420,10 @@ suite('keyboardMapper - MAC en_us', () => { { label: '⌘', ariaLabel: 'Command+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'cmd+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: [null, null], } ); @@ -563,16 +443,10 @@ suite('keyboardMapper - MAC en_us', () => { { label: '⌘', ariaLabel: 'Command+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'cmd+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: true, dispatchParts: [null, null], } ); @@ -623,16 +497,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+A', ariaLabel: 'Control+A', - labelWithoutModifiers: 'A', - ariaLabelWithoutModifiers: 'A', electronAccelerator: 'Ctrl+A', userSettingsLabel: 'ctrl+a', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyA]', null], }] ); @@ -644,16 +512,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyY]', null], }] ); @@ -673,16 +535,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyY]', null], } ); @@ -709,16 +565,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+¨', ariaLabel: 'Control+¨', - labelWithoutModifiers: '¨', - ariaLabelWithoutModifiers: '¨', electronAccelerator: null, userSettingsLabel: 'ctrl+[BracketRight]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[BracketRight]', null], } ); @@ -730,30 +580,18 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+Alt+0', ariaLabel: 'Control+Alt+0', - labelWithoutModifiers: '0', - ariaLabelWithoutModifiers: '0', electronAccelerator: 'Ctrl+Alt+0', userSettingsLabel: 'ctrl+alt+0', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: true, - hasMetaModifier: false, dispatchParts: ['ctrl+alt+[Digit0]', null], }, { label: 'Ctrl+Alt+$', ariaLabel: 'Control+Alt+$', - labelWithoutModifiers: '$', - ariaLabelWithoutModifiers: '$', electronAccelerator: null, userSettingsLabel: 'ctrl+alt+[Backslash]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: true, - hasMetaModifier: false, dispatchParts: ['ctrl+alt+[Backslash]', null], }] ); @@ -765,16 +603,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+Shift+7', ariaLabel: 'Control+Shift+7', - labelWithoutModifiers: '7', - ariaLabelWithoutModifiers: '7', electronAccelerator: 'Ctrl+Shift+7', userSettingsLabel: 'ctrl+shift+7', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+shift+[Digit7]', null], }] ); @@ -786,16 +618,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+Shift+\'', ariaLabel: 'Control+Shift+\'', - labelWithoutModifiers: '\'', - ariaLabelWithoutModifiers: '\'', electronAccelerator: null, userSettingsLabel: 'ctrl+shift+[Minus]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+shift+[Minus]', null], }] ); @@ -814,16 +640,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+K Ctrl+Shift+0', ariaLabel: 'Control+K Control+Shift+0', - labelWithoutModifiers: 'K 0', - ariaLabelWithoutModifiers: 'K 0', electronAccelerator: null, userSettingsLabel: 'ctrl+k ctrl+shift+0', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyK]', 'ctrl+shift+[Digit0]'], }] ); @@ -835,16 +655,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+DownArrow', ariaLabel: 'Control+DownArrow', - labelWithoutModifiers: 'DownArrow', - ariaLabelWithoutModifiers: 'DownArrow', electronAccelerator: 'Ctrl+Down', userSettingsLabel: 'ctrl+down', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[ArrowDown]', null], }] ); @@ -856,16 +670,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+NumPad0', ariaLabel: 'Control+NumPad0', - labelWithoutModifiers: 'NumPad0', - ariaLabelWithoutModifiers: 'NumPad0', electronAccelerator: null, userSettingsLabel: 'ctrl+numpad0', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Numpad0]', null], }] ); @@ -877,16 +685,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Home]', null], }] ); @@ -906,16 +708,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Home]', null], } ); @@ -935,16 +731,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+X', ariaLabel: 'Control+X', - labelWithoutModifiers: 'X', - ariaLabelWithoutModifiers: 'X', electronAccelerator: 'Ctrl+X', userSettingsLabel: 'ctrl+x', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyX]', null], } ); @@ -958,16 +748,10 @@ suite('keyboardMapper - LINUX de_ch', () => { [{ label: 'Ctrl+, Ctrl+Shift+7', ariaLabel: 'Control+, Control+Shift+7', - labelWithoutModifiers: ', 7', - ariaLabelWithoutModifiers: ', 7', electronAccelerator: null, userSettingsLabel: 'ctrl+[Comma] ctrl+shift+7', isWYSIWYG: false, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Comma]', 'ctrl+shift+[Digit7]'], }] ); @@ -987,16 +771,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); @@ -1016,16 +794,10 @@ suite('keyboardMapper - LINUX de_ch', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); @@ -1057,16 +829,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+A', ariaLabel: 'Control+A', - labelWithoutModifiers: 'A', - ariaLabelWithoutModifiers: 'A', electronAccelerator: 'Ctrl+A', userSettingsLabel: 'ctrl+a', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyA]', null], }] ); @@ -1078,16 +844,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyZ]', null], }] ); @@ -1107,16 +867,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyZ]', null], } ); @@ -1128,16 +882,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+]', ariaLabel: 'Control+]', - labelWithoutModifiers: ']', - ariaLabelWithoutModifiers: ']', electronAccelerator: 'Ctrl+]', userSettingsLabel: 'ctrl+]', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[BracketRight]', null], }] ); @@ -1157,16 +905,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+]', ariaLabel: 'Control+]', - labelWithoutModifiers: ']', - ariaLabelWithoutModifiers: ']', electronAccelerator: 'Ctrl+]', userSettingsLabel: 'ctrl+]', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[BracketRight]', null], } ); @@ -1178,16 +920,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Shift+]', ariaLabel: 'Shift+]', - labelWithoutModifiers: ']', - ariaLabelWithoutModifiers: ']', electronAccelerator: 'Shift+]', userSettingsLabel: 'shift+]', isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['shift+[BracketRight]', null], }] ); @@ -1199,16 +935,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+/', ariaLabel: 'Control+/', - labelWithoutModifiers: '/', - ariaLabelWithoutModifiers: '/', electronAccelerator: 'Ctrl+/', userSettingsLabel: 'ctrl+/', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Slash]', null], }] ); @@ -1220,16 +950,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+Shift+/', ariaLabel: 'Control+Shift+/', - labelWithoutModifiers: '/', - ariaLabelWithoutModifiers: '/', electronAccelerator: 'Ctrl+Shift+/', userSettingsLabel: 'ctrl+shift+/', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+shift+[Slash]', null], }] ); @@ -1241,16 +965,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+K Ctrl+\\', ariaLabel: 'Control+K Control+\\', - labelWithoutModifiers: 'K \\', - ariaLabelWithoutModifiers: 'K \\', electronAccelerator: null, userSettingsLabel: 'ctrl+k ctrl+\\', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyK]', 'ctrl+[Backslash]'], }] ); @@ -1262,16 +980,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+K Ctrl+=', ariaLabel: 'Control+K Control+=', - labelWithoutModifiers: 'K =', - ariaLabelWithoutModifiers: 'K =', electronAccelerator: null, userSettingsLabel: 'ctrl+k ctrl+=', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyK]', 'ctrl+[Equal]'], }] ); @@ -1283,16 +995,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+DownArrow', ariaLabel: 'Control+DownArrow', - labelWithoutModifiers: 'DownArrow', - ariaLabelWithoutModifiers: 'DownArrow', electronAccelerator: 'Ctrl+Down', userSettingsLabel: 'ctrl+down', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[ArrowDown]', null], }] ); @@ -1304,16 +1010,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+NumPad0', ariaLabel: 'Control+NumPad0', - labelWithoutModifiers: 'NumPad0', - ariaLabelWithoutModifiers: 'NumPad0', electronAccelerator: null, userSettingsLabel: 'ctrl+numpad0', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Numpad0]', null], }] ); @@ -1325,16 +1025,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Home]', null], }] ); @@ -1354,16 +1048,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Home]', null], } ); @@ -1375,30 +1063,18 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+Shift+,', ariaLabel: 'Control+Shift+,', - labelWithoutModifiers: ',', - ariaLabelWithoutModifiers: ',', electronAccelerator: 'Ctrl+Shift+,', userSettingsLabel: 'ctrl+shift+,', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+shift+[Comma]', null], }, { label: 'Ctrl+<', ariaLabel: 'Control+<', - labelWithoutModifiers: '<', - ariaLabelWithoutModifiers: '<', electronAccelerator: null, userSettingsLabel: 'ctrl+[IntlBackslash]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[IntlBackslash]', null], }] ); @@ -1410,16 +1086,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+Enter', ariaLabel: 'Control+Enter', - labelWithoutModifiers: 'Enter', - ariaLabelWithoutModifiers: 'Enter', electronAccelerator: 'Ctrl+Enter', userSettingsLabel: 'ctrl+enter', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Enter]', null], }] ); @@ -1439,16 +1109,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+Enter', ariaLabel: 'Control+Enter', - labelWithoutModifiers: 'Enter', - ariaLabelWithoutModifiers: 'Enter', electronAccelerator: 'Ctrl+Enter', userSettingsLabel: 'ctrl+enter', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Enter]', null], } ); @@ -1462,16 +1126,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+, Ctrl+/', ariaLabel: 'Control+, Control+/', - labelWithoutModifiers: ', /', - ariaLabelWithoutModifiers: ', /', electronAccelerator: null, userSettingsLabel: 'ctrl+, ctrl+/', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Comma]', 'ctrl+[Slash]'], }] ); @@ -1485,16 +1143,10 @@ suite('keyboardMapper - LINUX en_us', () => { [{ label: 'Ctrl+,', ariaLabel: 'Control+,', - labelWithoutModifiers: ',', - ariaLabelWithoutModifiers: ',', electronAccelerator: 'Ctrl+,', userSettingsLabel: 'ctrl+,', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Comma]', null], }] ); @@ -1514,16 +1166,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); @@ -1543,16 +1189,10 @@ suite('keyboardMapper - LINUX en_us', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); @@ -1584,16 +1224,10 @@ suite('keyboardMapper', () => { { label: 'Ctrl+`', ariaLabel: 'Control+`', - labelWithoutModifiers: '`', - ariaLabelWithoutModifiers: '`', electronAccelerator: null, userSettingsLabel: 'ctrl+`', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Backquote]', null], } ); @@ -1616,16 +1250,10 @@ suite('keyboardMapper', () => { { label: label, ariaLabel: label, - labelWithoutModifiers: label, - ariaLabelWithoutModifiers: label, electronAccelerator: electronAccelerator, userSettingsLabel: userSettingsLabel, isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [dispatch, null], } ); @@ -1661,16 +1289,10 @@ suite('keyboardMapper', () => { { label: label, ariaLabel: label, - labelWithoutModifiers: label, - ariaLabelWithoutModifiers: label, electronAccelerator: electronAccelerator, userSettingsLabel: userSettingsLabel, isWYSIWYG: true, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [dispatch, null], } ); @@ -1730,16 +1352,10 @@ suite('keyboardMapper', () => { { label: '⌃§', ariaLabel: 'Control+§', - labelWithoutModifiers: '§', - ariaLabelWithoutModifiers: '§', electronAccelerator: null, userSettingsLabel: 'ctrl+[IntlBackslash]', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[IntlBackslash]', null], } ); @@ -1757,16 +1373,10 @@ suite('keyboardMapper', () => { { label: '⌃`', ariaLabel: 'Control+`', - labelWithoutModifiers: '`', - ariaLabelWithoutModifiers: '`', electronAccelerator: null, userSettingsLabel: 'ctrl+`', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[Backquote]', null], } ); @@ -1797,24 +1407,57 @@ suite('keyboardMapper - LINUX ru', () => { _assertResolveKeybinding( KeyMod.CtrlCmd | KeyCode.KEY_S, [{ - label: 'Ctrl+Ñ‹', - ariaLabel: 'Control+Ñ‹', - labelWithoutModifiers: 'Ñ‹', - ariaLabelWithoutModifiers: 'Ñ‹', + label: 'Ctrl+S', + ariaLabel: 'Control+S', electronAccelerator: 'Ctrl+S', userSettingsLabel: 'ctrl+s', - isWYSIWYG: false, + isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+[KeyS]', null], }] ); }); }); +suite('keyboardMapper - LINUX en_uk', () => { + + let mapper: MacLinuxKeyboardMapper; + + suiteSetup((done) => { + createKeyboardMapper(false, 'linux_en_uk', OperatingSystem.Linux).then((_mapper) => { + mapper = _mapper; + done(); + }, done); + }); + + test('mapping', (done) => { + assertMapping(WRITE_FILE_IF_DIFFERENT, mapper, 'linux_en_uk.txt', done); + }); + + test('issue #24522: resolveKeyboardEvent Ctrl+Alt+[Minus]', () => { + assertResolveKeyboardEvent( + mapper, + { + ctrlKey: true, + shiftKey: false, + altKey: true, + metaKey: false, + keyCode: -1, + code: 'Minus' + }, + { + label: 'Ctrl+Alt+-', + ariaLabel: 'Control+Alt+-', + electronAccelerator: null, + userSettingsLabel: 'ctrl+alt+[Minus]', + isWYSIWYG: false, + isChord: false, + dispatchParts: ['ctrl+alt+[Minus]', null], + } + ); + }); +}); + function _assertKeybindingTranslation(mapper: MacLinuxKeyboardMapper, OS: OperatingSystem, kb: number, _expected: string | string[]): void { let expected: string[]; if (typeof _expected === 'string') { diff --git a/src/vs/workbench/services/keybinding/test/mac_de_ch.txt b/src/vs/workbench/services/keybinding/test/mac_de_ch.txt index 0adb9f82eb5..d4274eed3e0 100644 --- a/src/vs/workbench/services/keybinding/test/mac_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/mac_de_ch.txt @@ -304,7 +304,6 @@ isUSStandard: false | | | [ | | | | | | | | Shift+Alt+Digit5 | % | Shift+Alt+5 | | Shift+Alt+5 | shift+alt+5 | Shift+Alt+5 | shift+alt+[Digit5] | | | Ctrl+Shift+Alt+Digit5 | [ | Ctrl+Shift+Alt+5 | | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+[Digit5] | | -| | | Ctrl+Shift+Alt+[ | | | | | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Digit6 | 6 | 6 | | 6 | 6 | 6 | [Digit6] | | | Ctrl+Digit6 | 6 | Ctrl+6 | | Ctrl+6 | ctrl+6 | Ctrl+6 | ctrl+[Digit6] | | @@ -315,7 +314,6 @@ isUSStandard: false | | | ] | | | | | | | | Shift+Alt+Digit6 | & | Shift+Alt+6 | | Shift+Alt+6 | shift+alt+6 | Shift+Alt+6 | shift+alt+[Digit6] | | | Ctrl+Shift+Alt+Digit6 | ] | Ctrl+Shift+Alt+6 | | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+[Digit6] | | -| | | Ctrl+Shift+Alt+] | | | | | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/vs/workbench/services/keybinding/test/win_de_ch.txt b/src/vs/workbench/services/keybinding/test/win_de_ch.txt index 4936e72b405..ac0575e250e 100644 --- a/src/vs/workbench/services/keybinding/test/win_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/win_de_ch.txt @@ -1,284 +1,284 @@ ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyA | a | A | A | | -| Shift+KeyA | A | Shift+A | Shift+A | | -| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | | -| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | | ------------------------------------------------------------------------------------------------------------- -| KeyB | b | B | B | | -| Shift+KeyB | B | Shift+B | Shift+B | | -| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | | -| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | | ------------------------------------------------------------------------------------------------------------- -| KeyC | c | C | C | | -| Shift+KeyC | C | Shift+C | Shift+C | | -| Ctrl+Alt+KeyC | --- | Ctrl+Alt+C | Ctrl+Alt+C | | -| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | | ------------------------------------------------------------------------------------------------------------- -| KeyD | d | D | D | | -| Shift+KeyD | D | Shift+D | Shift+D | | -| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | | -| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | | ------------------------------------------------------------------------------------------------------------- -| KeyE | e | E | E | | -| Shift+KeyE | E | Shift+E | Shift+E | | -| Ctrl+Alt+KeyE | € | Ctrl+Alt+E | Ctrl+Alt+E | | -| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | | ------------------------------------------------------------------------------------------------------------- -| KeyF | f | F | F | | -| Shift+KeyF | F | Shift+F | Shift+F | | -| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | | -| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyG | g | G | G | | -| Shift+KeyG | G | Shift+G | Shift+G | | -| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | | -| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | | ------------------------------------------------------------------------------------------------------------- -| KeyH | h | H | H | | -| Shift+KeyH | H | Shift+H | Shift+H | | -| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | | -| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | | ------------------------------------------------------------------------------------------------------------- -| KeyI | i | I | I | | -| Shift+KeyI | I | Shift+I | Shift+I | | -| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | | -| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | | ------------------------------------------------------------------------------------------------------------- -| KeyJ | j | J | J | | -| Shift+KeyJ | J | Shift+J | Shift+J | | -| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | | -| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | | ------------------------------------------------------------------------------------------------------------- -| KeyK | k | K | K | | -| Shift+KeyK | K | Shift+K | Shift+K | | -| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | | -| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | | ------------------------------------------------------------------------------------------------------------- -| KeyL | l | L | L | | -| Shift+KeyL | L | Shift+L | Shift+L | | -| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | | -| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyM | m | M | M | | -| Shift+KeyM | M | Shift+M | Shift+M | | -| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | | -| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | | ------------------------------------------------------------------------------------------------------------- -| KeyN | n | N | N | | -| Shift+KeyN | N | Shift+N | Shift+N | | -| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | | -| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | | ------------------------------------------------------------------------------------------------------------- -| KeyO | o | O | O | | -| Shift+KeyO | O | Shift+O | Shift+O | | -| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | | -| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | | ------------------------------------------------------------------------------------------------------------- -| KeyP | p | P | P | | -| Shift+KeyP | P | Shift+P | Shift+P | | -| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | | -| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | | ------------------------------------------------------------------------------------------------------------- -| KeyQ | q | Q | Q | | -| Shift+KeyQ | Q | Shift+Q | Shift+Q | | -| Ctrl+Alt+KeyQ | --- | Ctrl+Alt+Q | Ctrl+Alt+Q | | -| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | | ------------------------------------------------------------------------------------------------------------- -| KeyR | r | R | R | | -| Shift+KeyR | R | Shift+R | Shift+R | | -| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | | -| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyS | s | S | S | | -| Shift+KeyS | S | Shift+S | Shift+S | | -| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | | -| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | | ------------------------------------------------------------------------------------------------------------- -| KeyT | t | T | T | | -| Shift+KeyT | T | Shift+T | Shift+T | | -| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | | -| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | | ------------------------------------------------------------------------------------------------------------- -| KeyU | u | U | U | | -| Shift+KeyU | U | Shift+U | Shift+U | | -| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | | -| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | | ------------------------------------------------------------------------------------------------------------- -| KeyV | v | V | V | | -| Shift+KeyV | V | Shift+V | Shift+V | | -| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | | -| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | | ------------------------------------------------------------------------------------------------------------- -| KeyW | w | W | W | | -| Shift+KeyW | W | Shift+W | Shift+W | | -| Ctrl+Alt+KeyW | --- | Ctrl+Alt+W | Ctrl+Alt+W | | -| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | | ------------------------------------------------------------------------------------------------------------- -| KeyX | x | X | X | | -| Shift+KeyX | X | Shift+X | Shift+X | | -| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | | -| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyY | z | Z | Z | | -| Shift+KeyY | Z | Shift+Z | Shift+Z | | -| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | | -| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | | ------------------------------------------------------------------------------------------------------------- -| KeyZ | y | Y | Y | | -| Shift+KeyZ | Y | Shift+Y | Shift+Y | | -| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | | -| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | | ------------------------------------------------------------------------------------------------------------- -| Digit1 | 1 | 1 | 1 | | -| Shift+Digit1 | + | Shift+1 | Shift+1 | | -| Ctrl+Alt+Digit1 | ¦ | Ctrl+Alt+1 | Ctrl+Alt+1 | | -| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | | ------------------------------------------------------------------------------------------------------------- -| Digit2 | 2 | 2 | 2 | | -| Shift+Digit2 | " | Shift+2 | Shift+2 | | -| Ctrl+Alt+Digit2 | @ | Ctrl+Alt+2 | Ctrl+Alt+2 | | -| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | | ------------------------------------------------------------------------------------------------------------- -| Digit3 | 3 | 3 | 3 | | -| Shift+Digit3 | * | Shift+3 | Shift+3 | | -| Ctrl+Alt+Digit3 | # | Ctrl+Alt+3 | Ctrl+Alt+3 | | -| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | | ------------------------------------------------------------------------------------------------------------- -| Digit4 | 4 | 4 | 4 | | -| Shift+Digit4 | ç | Shift+4 | Shift+4 | | -| Ctrl+Alt+Digit4 | ° | Ctrl+Alt+4 | Ctrl+Alt+4 | | -| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Digit5 | 5 | 5 | 5 | | -| Shift+Digit5 | % | Shift+5 | Shift+5 | | -| Ctrl+Alt+Digit5 | § | Ctrl+Alt+5 | Ctrl+Alt+5 | | -| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | | ------------------------------------------------------------------------------------------------------------- -| Digit6 | 6 | 6 | 6 | | -| Shift+Digit6 | & | Shift+6 | Shift+6 | | -| Ctrl+Alt+Digit6 | ¬ | Ctrl+Alt+6 | Ctrl+Alt+6 | | -| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | | ------------------------------------------------------------------------------------------------------------- -| Digit7 | 7 | 7 | 7 | | -| Shift+Digit7 | / | Shift+7 | Shift+7 | | -| Ctrl+Alt+Digit7 | | | Ctrl+Alt+7 | Ctrl+Alt+7 | | -| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | | ------------------------------------------------------------------------------------------------------------- -| Digit8 | 8 | 8 | 8 | | -| Shift+Digit8 | ( | Shift+8 | Shift+8 | | -| Ctrl+Alt+Digit8 | ¢ | Ctrl+Alt+8 | Ctrl+Alt+8 | | -| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | | ------------------------------------------------------------------------------------------------------------- -| Digit9 | 9 | 9 | 9 | | -| Shift+Digit9 | ) | Shift+9 | Shift+9 | | -| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | | -| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | | ------------------------------------------------------------------------------------------------------------- -| Digit0 | 0 | 0 | 0 | | -| Shift+Digit0 | = | Shift+0 | Shift+0 | | -| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | | -| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Minus | ' | [ | ' | NO | -| Shift+Minus | ? | Shift+[ | Shift+' | NO | -| Ctrl+Alt+Minus | ´ | Ctrl+Alt+[ | Ctrl+Alt+' | NO | -| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+' | NO | ------------------------------------------------------------------------------------------------------------- -| Equal | ^ | ] | ^ | NO | -| Shift+Equal | ` | Shift+] | Shift+^ | NO | -| Ctrl+Alt+Equal | ~ | Ctrl+Alt+] | Ctrl+Alt+^ | NO | -| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+^ | NO | ------------------------------------------------------------------------------------------------------------- -| BracketLeft | ü | ; | ü | NO | -| Shift+BracketLeft | è | Shift+; | Shift+ü | NO | -| Ctrl+Alt+BracketLeft | [ | Ctrl+Alt+; | Ctrl+Alt+ü | NO | -| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+ü | NO | ------------------------------------------------------------------------------------------------------------- -| BracketRight | ¨ | ` | ¨ | NO | -| Shift+BracketRight | ! | Shift+` | Shift+¨ | NO | -| Ctrl+Alt+BracketRight | ] | Ctrl+Alt+` | Ctrl+Alt+¨ | NO | -| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+¨ | NO | ------------------------------------------------------------------------------------------------------------- -| Backslash | $ | OEM_8 | $ | NO | -| Shift+Backslash | £ | Shift+OEM_8 | Shift+$ | NO | -| Ctrl+Alt+Backslash | } | Ctrl+Alt+OEM_8 | Ctrl+Alt+$ | NO | -| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+OEM_8 | Ctrl+Shift+Alt+$ | NO | ------------------------------------------------------------------------------------------------------------- -| IntlHash | --- | null | null | NO | -| Shift+IntlHash | --- | null | null | NO | -| Ctrl+Alt+IntlHash | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlHash | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Semicolon | ö | ' | ö | NO | -| Shift+Semicolon | é | Shift+' | Shift+ö | NO | -| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+' | Ctrl+Alt+ö | NO | -| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+ö | NO | ------------------------------------------------------------------------------------------------------------- -| Quote | ä | \ | ä | NO | -| Shift+Quote | à | Shift+\ | Shift+ä | NO | -| Ctrl+Alt+Quote | { | Ctrl+Alt+\ | Ctrl+Alt+ä | NO | -| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+ä | NO | ------------------------------------------------------------------------------------------------------------- -| Backquote | § | / | § | NO | -| Shift+Backquote | ° | Shift+/ | Shift+§ | NO | -| Ctrl+Alt+Backquote | --- | Ctrl+Alt+/ | Ctrl+Alt+§ | NO | -| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+§ | NO | ------------------------------------------------------------------------------------------------------------- -| Comma | , | , | , | | -| Shift+Comma | ; | Shift+, | Shift+, | | -| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+, | | -| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+, | | ------------------------------------------------------------------------------------------------------------- -| Period | . | . | . | | -| Shift+Period | : | Shift+. | Shift+. | | -| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+. | | -| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+. | | ------------------------------------------------------------------------------------------------------------- -| Slash | - | - | - | | -| Shift+Slash | _ | Shift+- | Shift+- | | -| Ctrl+Alt+Slash | --- | Ctrl+Alt+- | Ctrl+Alt+- | | -| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| ArrowUp | --- | UpArrow | UpArrow | | -| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | | -| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | | -| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | | ------------------------------------------------------------------------------------------------------------- -| Numpad0 | --- | NumPad0 | NumPad0 | | -| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | | -| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | | -| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | | ------------------------------------------------------------------------------------------------------------- -| IntlBackslash | < | OEM_102 | < | NO | -| Shift+IntlBackslash | > | Shift+OEM_102 | Shift+< | NO | -| Ctrl+Alt+IntlBackslash | \ | Ctrl+Alt+OEM_102 | Ctrl+Alt+< | NO | -| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+< | NO | ------------------------------------------------------------------------------------------------------------- -| IntlRo | --- | null | null | NO | -| Shift+IntlRo | --- | null | null | NO | -| Ctrl+Alt+IntlRo | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlRo | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- -| IntlYen | --- | null | null | NO | -| Shift+IntlYen | --- | null | null | NO | -| Ctrl+Alt+IntlYen | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlYen | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- \ No newline at end of file +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyA | a | A | A | a | | +| Shift+KeyA | A | Shift+A | Shift+A | shift+a | | +| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | ctrl+alt+a | | +| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyB | b | B | B | b | | +| Shift+KeyB | B | Shift+B | Shift+B | shift+b | | +| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | ctrl+alt+b | | +| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyC | c | C | C | c | | +| Shift+KeyC | C | Shift+C | Shift+C | shift+c | | +| Ctrl+Alt+KeyC | --- | Ctrl+Alt+C | Ctrl+Alt+C | ctrl+alt+c | | +| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyD | d | D | D | d | | +| Shift+KeyD | D | Shift+D | Shift+D | shift+d | | +| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | ctrl+alt+d | | +| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyE | e | E | E | e | | +| Shift+KeyE | E | Shift+E | Shift+E | shift+e | | +| Ctrl+Alt+KeyE | € | Ctrl+Alt+E | Ctrl+Alt+E | ctrl+alt+e | | +| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyF | f | F | F | f | | +| Shift+KeyF | F | Shift+F | Shift+F | shift+f | | +| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | ctrl+alt+f | | +| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyG | g | G | G | g | | +| Shift+KeyG | G | Shift+G | Shift+G | shift+g | | +| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | ctrl+alt+g | | +| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyH | h | H | H | h | | +| Shift+KeyH | H | Shift+H | Shift+H | shift+h | | +| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | ctrl+alt+h | | +| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyI | i | I | I | i | | +| Shift+KeyI | I | Shift+I | Shift+I | shift+i | | +| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | ctrl+alt+i | | +| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyJ | j | J | J | j | | +| Shift+KeyJ | J | Shift+J | Shift+J | shift+j | | +| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | ctrl+alt+j | | +| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyK | k | K | K | k | | +| Shift+KeyK | K | Shift+K | Shift+K | shift+k | | +| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | ctrl+alt+k | | +| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyL | l | L | L | l | | +| Shift+KeyL | L | Shift+L | Shift+L | shift+l | | +| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | ctrl+alt+l | | +| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyM | m | M | M | m | | +| Shift+KeyM | M | Shift+M | Shift+M | shift+m | | +| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | ctrl+alt+m | | +| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyN | n | N | N | n | | +| Shift+KeyN | N | Shift+N | Shift+N | shift+n | | +| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | ctrl+alt+n | | +| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyO | o | O | O | o | | +| Shift+KeyO | O | Shift+O | Shift+O | shift+o | | +| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | ctrl+alt+o | | +| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyP | p | P | P | p | | +| Shift+KeyP | P | Shift+P | Shift+P | shift+p | | +| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | ctrl+alt+p | | +| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyQ | q | Q | Q | q | | +| Shift+KeyQ | Q | Shift+Q | Shift+Q | shift+q | | +| Ctrl+Alt+KeyQ | --- | Ctrl+Alt+Q | Ctrl+Alt+Q | ctrl+alt+q | | +| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyR | r | R | R | r | | +| Shift+KeyR | R | Shift+R | Shift+R | shift+r | | +| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | ctrl+alt+r | | +| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyS | s | S | S | s | | +| Shift+KeyS | S | Shift+S | Shift+S | shift+s | | +| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | ctrl+alt+s | | +| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyT | t | T | T | t | | +| Shift+KeyT | T | Shift+T | Shift+T | shift+t | | +| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | ctrl+alt+t | | +| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyU | u | U | U | u | | +| Shift+KeyU | U | Shift+U | Shift+U | shift+u | | +| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | ctrl+alt+u | | +| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyV | v | V | V | v | | +| Shift+KeyV | V | Shift+V | Shift+V | shift+v | | +| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | ctrl+alt+v | | +| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyW | w | W | W | w | | +| Shift+KeyW | W | Shift+W | Shift+W | shift+w | | +| Ctrl+Alt+KeyW | --- | Ctrl+Alt+W | Ctrl+Alt+W | ctrl+alt+w | | +| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyX | x | X | X | x | | +| Shift+KeyX | X | Shift+X | Shift+X | shift+x | | +| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | ctrl+alt+x | | +| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyY | z | Z | Z | z | | +| Shift+KeyY | Z | Shift+Z | Shift+Z | shift+z | | +| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | ctrl+alt+z | | +| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyZ | y | Y | Y | y | | +| Shift+KeyZ | Y | Shift+Y | Shift+Y | shift+y | | +| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | ctrl+alt+y | | +| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit1 | 1 | 1 | 1 | 1 | | +| Shift+Digit1 | + | Shift+1 | Shift+1 | shift+1 | | +| Ctrl+Alt+Digit1 | ¦ | Ctrl+Alt+1 | Ctrl+Alt+1 | ctrl+alt+1 | | +| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | ctrl+shift+alt+1 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit2 | 2 | 2 | 2 | 2 | | +| Shift+Digit2 | " | Shift+2 | Shift+2 | shift+2 | | +| Ctrl+Alt+Digit2 | @ | Ctrl+Alt+2 | Ctrl+Alt+2 | ctrl+alt+2 | | +| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | ctrl+shift+alt+2 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit3 | 3 | 3 | 3 | 3 | | +| Shift+Digit3 | * | Shift+3 | Shift+3 | shift+3 | | +| Ctrl+Alt+Digit3 | # | Ctrl+Alt+3 | Ctrl+Alt+3 | ctrl+alt+3 | | +| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | ctrl+shift+alt+3 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit4 | 4 | 4 | 4 | 4 | | +| Shift+Digit4 | ç | Shift+4 | Shift+4 | shift+4 | | +| Ctrl+Alt+Digit4 | ° | Ctrl+Alt+4 | Ctrl+Alt+4 | ctrl+alt+4 | | +| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | ctrl+shift+alt+4 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit5 | 5 | 5 | 5 | 5 | | +| Shift+Digit5 | % | Shift+5 | Shift+5 | shift+5 | | +| Ctrl+Alt+Digit5 | § | Ctrl+Alt+5 | Ctrl+Alt+5 | ctrl+alt+5 | | +| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit6 | 6 | 6 | 6 | 6 | | +| Shift+Digit6 | & | Shift+6 | Shift+6 | shift+6 | | +| Ctrl+Alt+Digit6 | ¬ | Ctrl+Alt+6 | Ctrl+Alt+6 | ctrl+alt+6 | | +| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit7 | 7 | 7 | 7 | 7 | | +| Shift+Digit7 | / | Shift+7 | Shift+7 | shift+7 | | +| Ctrl+Alt+Digit7 | | | Ctrl+Alt+7 | Ctrl+Alt+7 | ctrl+alt+7 | | +| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | ctrl+shift+alt+7 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit8 | 8 | 8 | 8 | 8 | | +| Shift+Digit8 | ( | Shift+8 | Shift+8 | shift+8 | | +| Ctrl+Alt+Digit8 | ¢ | Ctrl+Alt+8 | Ctrl+Alt+8 | ctrl+alt+8 | | +| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | ctrl+shift+alt+8 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit9 | 9 | 9 | 9 | 9 | | +| Shift+Digit9 | ) | Shift+9 | Shift+9 | shift+9 | | +| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | ctrl+alt+9 | | +| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit0 | 0 | 0 | 0 | 0 | | +| Shift+Digit0 | = | Shift+0 | Shift+0 | shift+0 | | +| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | ctrl+alt+0 | | +| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | ctrl+shift+alt+0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Minus | ' | [ | ' | oem_4 | NO | +| Shift+Minus | ? | Shift+[ | Shift+' | shift+oem_4 | NO | +| Ctrl+Alt+Minus | ´ | Ctrl+Alt+[ | Ctrl+Alt+' | ctrl+alt+oem_4 | NO | +| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+' | ctrl+shift+alt+oem_4 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Equal | ^ | ] | ^ | oem_6 | NO | +| Shift+Equal | ` | Shift+] | Shift+^ | shift+oem_6 | NO | +| Ctrl+Alt+Equal | ~ | Ctrl+Alt+] | Ctrl+Alt+^ | ctrl+alt+oem_6 | NO | +| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+^ | ctrl+shift+alt+oem_6 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketLeft | ü | ; | ü | oem_1 | NO | +| Shift+BracketLeft | è | Shift+; | Shift+ü | shift+oem_1 | NO | +| Ctrl+Alt+BracketLeft | [ | Ctrl+Alt+; | Ctrl+Alt+ü | ctrl+alt+oem_1 | NO | +| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+ü | ctrl+shift+alt+oem_1 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketRight | ¨ | ` | ¨ | oem_3 | NO | +| Shift+BracketRight | ! | Shift+` | Shift+¨ | shift+oem_3 | NO | +| Ctrl+Alt+BracketRight | ] | Ctrl+Alt+` | Ctrl+Alt+¨ | ctrl+alt+oem_3 | NO | +| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+¨ | ctrl+shift+alt+oem_3 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backslash | $ | OEM_8 | $ | oem_8 | NO | +| Shift+Backslash | £ | Shift+OEM_8 | Shift+$ | shift+oem_8 | NO | +| Ctrl+Alt+Backslash | } | Ctrl+Alt+OEM_8 | Ctrl+Alt+$ | ctrl+alt+oem_8 | NO | +| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+OEM_8 | Ctrl+Shift+Alt+$ | ctrl+shift+alt+oem_8 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlHash | --- | null | null | null | NO | +| Shift+IntlHash | --- | null | null | null | NO | +| Ctrl+Alt+IntlHash | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlHash | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Semicolon | ö | ' | ö | oem_7 | NO | +| Shift+Semicolon | é | Shift+' | Shift+ö | shift+oem_7 | NO | +| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+' | Ctrl+Alt+ö | ctrl+alt+oem_7 | NO | +| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+ö | ctrl+shift+alt+oem_7 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Quote | ä | \ | ä | oem_5 | NO | +| Shift+Quote | à | Shift+\ | Shift+ä | shift+oem_5 | NO | +| Ctrl+Alt+Quote | { | Ctrl+Alt+\ | Ctrl+Alt+ä | ctrl+alt+oem_5 | NO | +| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+ä | ctrl+shift+alt+oem_5 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backquote | § | / | § | oem_2 | NO | +| Shift+Backquote | ° | Shift+/ | Shift+§ | shift+oem_2 | NO | +| Ctrl+Alt+Backquote | --- | Ctrl+Alt+/ | Ctrl+Alt+§ | ctrl+alt+oem_2 | NO | +| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+§ | ctrl+shift+alt+oem_2 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Comma | , | , | , | oem_comma | NO | +| Shift+Comma | ; | Shift+, | Shift+, | shift+oem_comma | NO | +| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+, | ctrl+alt+oem_comma | NO | +| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+, | ctrl+shift+alt+oem_comma | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Period | . | . | . | oem_period | NO | +| Shift+Period | : | Shift+. | Shift+. | shift+oem_period | NO | +| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+. | ctrl+alt+oem_period | NO | +| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+. | ctrl+shift+alt+oem_period | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Slash | - | - | - | oem_minus | NO | +| Shift+Slash | _ | Shift+- | Shift+- | shift+oem_minus | NO | +| Ctrl+Alt+Slash | --- | Ctrl+Alt+- | Ctrl+Alt+- | ctrl+alt+oem_minus | NO | +| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+oem_minus | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| ArrowUp | --- | UpArrow | UpArrow | up | | +| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | shift+up | | +| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | ctrl+alt+up | | +| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | ctrl+shift+alt+up | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Numpad0 | --- | NumPad0 | NumPad0 | numpad0 | | +| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | shift+numpad0 | | +| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | ctrl+alt+numpad0 | | +| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlBackslash | < | OEM_102 | < | oem_102 | NO | +| Shift+IntlBackslash | > | Shift+OEM_102 | Shift+< | shift+oem_102 | NO | +| Ctrl+Alt+IntlBackslash | \ | Ctrl+Alt+OEM_102 | Ctrl+Alt+< | ctrl+alt+oem_102 | NO | +| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+< | ctrl+shift+alt+oem_102 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlRo | --- | null | null | null | NO | +| Shift+IntlRo | --- | null | null | null | NO | +| Ctrl+Alt+IntlRo | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlRo | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlYen | --- | null | null | null | NO | +| Shift+IntlYen | --- | null | null | null | NO | +| Ctrl+Alt+IntlYen | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlYen | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/win_en_us.txt b/src/vs/workbench/services/keybinding/test/win_en_us.txt index b0b6ae6b4ac..b011bd0be56 100644 --- a/src/vs/workbench/services/keybinding/test/win_en_us.txt +++ b/src/vs/workbench/services/keybinding/test/win_en_us.txt @@ -1,284 +1,284 @@ ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyA | a | A | A | | -| Shift+KeyA | A | Shift+A | Shift+A | | -| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | | -| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | | ------------------------------------------------------------------------------------------------------------- -| KeyB | b | B | B | | -| Shift+KeyB | B | Shift+B | Shift+B | | -| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | | -| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | | ------------------------------------------------------------------------------------------------------------- -| KeyC | c | C | C | | -| Shift+KeyC | C | Shift+C | Shift+C | | -| Ctrl+Alt+KeyC | --- | Ctrl+Alt+C | Ctrl+Alt+C | | -| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | | ------------------------------------------------------------------------------------------------------------- -| KeyD | d | D | D | | -| Shift+KeyD | D | Shift+D | Shift+D | | -| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | | -| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | | ------------------------------------------------------------------------------------------------------------- -| KeyE | e | E | E | | -| Shift+KeyE | E | Shift+E | Shift+E | | -| Ctrl+Alt+KeyE | --- | Ctrl+Alt+E | Ctrl+Alt+E | | -| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | | ------------------------------------------------------------------------------------------------------------- -| KeyF | f | F | F | | -| Shift+KeyF | F | Shift+F | Shift+F | | -| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | | -| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyG | g | G | G | | -| Shift+KeyG | G | Shift+G | Shift+G | | -| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | | -| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | | ------------------------------------------------------------------------------------------------------------- -| KeyH | h | H | H | | -| Shift+KeyH | H | Shift+H | Shift+H | | -| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | | -| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | | ------------------------------------------------------------------------------------------------------------- -| KeyI | i | I | I | | -| Shift+KeyI | I | Shift+I | Shift+I | | -| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | | -| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | | ------------------------------------------------------------------------------------------------------------- -| KeyJ | j | J | J | | -| Shift+KeyJ | J | Shift+J | Shift+J | | -| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | | -| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | | ------------------------------------------------------------------------------------------------------------- -| KeyK | k | K | K | | -| Shift+KeyK | K | Shift+K | Shift+K | | -| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | | -| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | | ------------------------------------------------------------------------------------------------------------- -| KeyL | l | L | L | | -| Shift+KeyL | L | Shift+L | Shift+L | | -| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | | -| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyM | m | M | M | | -| Shift+KeyM | M | Shift+M | Shift+M | | -| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | | -| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | | ------------------------------------------------------------------------------------------------------------- -| KeyN | n | N | N | | -| Shift+KeyN | N | Shift+N | Shift+N | | -| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | | -| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | | ------------------------------------------------------------------------------------------------------------- -| KeyO | o | O | O | | -| Shift+KeyO | O | Shift+O | Shift+O | | -| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | | -| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | | ------------------------------------------------------------------------------------------------------------- -| KeyP | p | P | P | | -| Shift+KeyP | P | Shift+P | Shift+P | | -| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | | -| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | | ------------------------------------------------------------------------------------------------------------- -| KeyQ | q | Q | Q | | -| Shift+KeyQ | Q | Shift+Q | Shift+Q | | -| Ctrl+Alt+KeyQ | --- | Ctrl+Alt+Q | Ctrl+Alt+Q | | -| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | | ------------------------------------------------------------------------------------------------------------- -| KeyR | r | R | R | | -| Shift+KeyR | R | Shift+R | Shift+R | | -| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | | -| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyS | s | S | S | | -| Shift+KeyS | S | Shift+S | Shift+S | | -| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | | -| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | | ------------------------------------------------------------------------------------------------------------- -| KeyT | t | T | T | | -| Shift+KeyT | T | Shift+T | Shift+T | | -| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | | -| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | | ------------------------------------------------------------------------------------------------------------- -| KeyU | u | U | U | | -| Shift+KeyU | U | Shift+U | Shift+U | | -| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | | -| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | | ------------------------------------------------------------------------------------------------------------- -| KeyV | v | V | V | | -| Shift+KeyV | V | Shift+V | Shift+V | | -| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | | -| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | | ------------------------------------------------------------------------------------------------------------- -| KeyW | w | W | W | | -| Shift+KeyW | W | Shift+W | Shift+W | | -| Ctrl+Alt+KeyW | --- | Ctrl+Alt+W | Ctrl+Alt+W | | -| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | | ------------------------------------------------------------------------------------------------------------- -| KeyX | x | X | X | | -| Shift+KeyX | X | Shift+X | Shift+X | | -| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | | -| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| KeyY | y | Y | Y | | -| Shift+KeyY | Y | Shift+Y | Shift+Y | | -| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | | -| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | | ------------------------------------------------------------------------------------------------------------- -| KeyZ | z | Z | Z | | -| Shift+KeyZ | Z | Shift+Z | Shift+Z | | -| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | | -| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | | ------------------------------------------------------------------------------------------------------------- -| Digit1 | 1 | 1 | 1 | | -| Shift+Digit1 | ! | Shift+1 | Shift+1 | | -| Ctrl+Alt+Digit1 | --- | Ctrl+Alt+1 | Ctrl+Alt+1 | | -| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | | ------------------------------------------------------------------------------------------------------------- -| Digit2 | 2 | 2 | 2 | | -| Shift+Digit2 | @ | Shift+2 | Shift+2 | | -| Ctrl+Alt+Digit2 | --- | Ctrl+Alt+2 | Ctrl+Alt+2 | | -| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | | ------------------------------------------------------------------------------------------------------------- -| Digit3 | 3 | 3 | 3 | | -| Shift+Digit3 | # | Shift+3 | Shift+3 | | -| Ctrl+Alt+Digit3 | --- | Ctrl+Alt+3 | Ctrl+Alt+3 | | -| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | | ------------------------------------------------------------------------------------------------------------- -| Digit4 | 4 | 4 | 4 | | -| Shift+Digit4 | $ | Shift+4 | Shift+4 | | -| Ctrl+Alt+Digit4 | --- | Ctrl+Alt+4 | Ctrl+Alt+4 | | -| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Digit5 | 5 | 5 | 5 | | -| Shift+Digit5 | % | Shift+5 | Shift+5 | | -| Ctrl+Alt+Digit5 | --- | Ctrl+Alt+5 | Ctrl+Alt+5 | | -| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | | ------------------------------------------------------------------------------------------------------------- -| Digit6 | 6 | 6 | 6 | | -| Shift+Digit6 | ^ | Shift+6 | Shift+6 | | -| Ctrl+Alt+Digit6 | --- | Ctrl+Alt+6 | Ctrl+Alt+6 | | -| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | | ------------------------------------------------------------------------------------------------------------- -| Digit7 | 7 | 7 | 7 | | -| Shift+Digit7 | & | Shift+7 | Shift+7 | | -| Ctrl+Alt+Digit7 | --- | Ctrl+Alt+7 | Ctrl+Alt+7 | | -| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | | ------------------------------------------------------------------------------------------------------------- -| Digit8 | 8 | 8 | 8 | | -| Shift+Digit8 | * | Shift+8 | Shift+8 | | -| Ctrl+Alt+Digit8 | --- | Ctrl+Alt+8 | Ctrl+Alt+8 | | -| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | | ------------------------------------------------------------------------------------------------------------- -| Digit9 | 9 | 9 | 9 | | -| Shift+Digit9 | ( | Shift+9 | Shift+9 | | -| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | | -| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | | ------------------------------------------------------------------------------------------------------------- -| Digit0 | 0 | 0 | 0 | | -| Shift+Digit0 | ) | Shift+0 | Shift+0 | | -| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | | -| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Minus | - | - | - | | -| Shift+Minus | _ | Shift+- | Shift+- | | -| Ctrl+Alt+Minus | --- | Ctrl+Alt+- | Ctrl+Alt+- | | -| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | | ------------------------------------------------------------------------------------------------------------- -| Equal | = | = | = | | -| Shift+Equal | + | Shift+= | Shift+= | | -| Ctrl+Alt+Equal | --- | Ctrl+Alt+= | Ctrl+Alt+= | | -| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+= | Ctrl+Shift+Alt+= | | ------------------------------------------------------------------------------------------------------------- -| BracketLeft | [ | [ | [ | | -| Shift+BracketLeft | { | Shift+[ | Shift+[ | | -| Ctrl+Alt+BracketLeft | --- | Ctrl+Alt+[ | Ctrl+Alt+[ | | -| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+[ | | ------------------------------------------------------------------------------------------------------------- -| BracketRight | ] | ] | ] | | -| Shift+BracketRight | } | Shift+] | Shift+] | | -| Ctrl+Alt+BracketRight | --- | Ctrl+Alt+] | Ctrl+Alt+] | | -| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+] | | ------------------------------------------------------------------------------------------------------------- -| Backslash | \ | \ | \ | | -| Shift+Backslash | | | Shift+\ | Shift+\ | | -| Ctrl+Alt+Backslash | --- | Ctrl+Alt+\ | Ctrl+Alt+\ | | -| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+\ | | ------------------------------------------------------------------------------------------------------------- -| IntlHash | --- | null | null | NO | -| Shift+IntlHash | --- | null | null | NO | -| Ctrl+Alt+IntlHash | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlHash | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| Semicolon | ; | ; | ; | | -| Shift+Semicolon | : | Shift+; | Shift+; | | -| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+; | Ctrl+Alt+; | | -| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+; | | ------------------------------------------------------------------------------------------------------------- -| Quote | ' | ' | ' | | -| Shift+Quote | " | Shift+' | Shift+' | | -| Ctrl+Alt+Quote | --- | Ctrl+Alt+' | Ctrl+Alt+' | | -| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+' | | ------------------------------------------------------------------------------------------------------------- -| Backquote | ` | ` | ` | | -| Shift+Backquote | ~ | Shift+` | Shift+` | | -| Ctrl+Alt+Backquote | --- | Ctrl+Alt+` | Ctrl+Alt+` | | -| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+` | | ------------------------------------------------------------------------------------------------------------- -| Comma | , | , | , | | -| Shift+Comma | < | Shift+, | Shift+, | | -| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+, | | -| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+, | | ------------------------------------------------------------------------------------------------------------- -| Period | . | . | . | | -| Shift+Period | > | Shift+. | Shift+. | | -| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+. | | -| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+. | | ------------------------------------------------------------------------------------------------------------- -| Slash | / | / | / | | -| Shift+Slash | ? | Shift+/ | Shift+/ | | -| Ctrl+Alt+Slash | --- | Ctrl+Alt+/ | Ctrl+Alt+/ | | -| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+/ | | ------------------------------------------------------------------------------------------------------------- -| HW Code combination | Key | KeyCode combination | UI label | WYSIWYG | ------------------------------------------------------------------------------------------------------------- -| ArrowUp | --- | UpArrow | UpArrow | | -| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | | -| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | | -| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | | ------------------------------------------------------------------------------------------------------------- -| Numpad0 | --- | NumPad0 | NumPad0 | | -| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | | -| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | | -| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | | ------------------------------------------------------------------------------------------------------------- -| IntlBackslash | \ | OEM_102 | \ | NO | -| Shift+IntlBackslash | | | Shift+OEM_102 | Shift+\ | NO | -| Ctrl+Alt+IntlBackslash | --- | Ctrl+Alt+OEM_102 | Ctrl+Alt+\ | NO | -| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+\ | NO | ------------------------------------------------------------------------------------------------------------- -| IntlRo | --- | null | null | NO | -| Shift+IntlRo | --- | null | null | NO | -| Ctrl+Alt+IntlRo | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlRo | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- -| IntlYen | --- | null | null | NO | -| Shift+IntlYen | --- | null | null | NO | -| Ctrl+Alt+IntlYen | --- | null | null | NO | -| Ctrl+Shift+Alt+IntlYen | --- | null | null | NO | ------------------------------------------------------------------------------------------------------------- \ No newline at end of file +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyA | a | A | A | a | | +| Shift+KeyA | A | Shift+A | Shift+A | shift+a | | +| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | ctrl+alt+a | | +| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyB | b | B | B | b | | +| Shift+KeyB | B | Shift+B | Shift+B | shift+b | | +| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | ctrl+alt+b | | +| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyC | c | C | C | c | | +| Shift+KeyC | C | Shift+C | Shift+C | shift+c | | +| Ctrl+Alt+KeyC | --- | Ctrl+Alt+C | Ctrl+Alt+C | ctrl+alt+c | | +| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyD | d | D | D | d | | +| Shift+KeyD | D | Shift+D | Shift+D | shift+d | | +| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | ctrl+alt+d | | +| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyE | e | E | E | e | | +| Shift+KeyE | E | Shift+E | Shift+E | shift+e | | +| Ctrl+Alt+KeyE | --- | Ctrl+Alt+E | Ctrl+Alt+E | ctrl+alt+e | | +| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyF | f | F | F | f | | +| Shift+KeyF | F | Shift+F | Shift+F | shift+f | | +| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | ctrl+alt+f | | +| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyG | g | G | G | g | | +| Shift+KeyG | G | Shift+G | Shift+G | shift+g | | +| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | ctrl+alt+g | | +| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyH | h | H | H | h | | +| Shift+KeyH | H | Shift+H | Shift+H | shift+h | | +| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | ctrl+alt+h | | +| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyI | i | I | I | i | | +| Shift+KeyI | I | Shift+I | Shift+I | shift+i | | +| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | ctrl+alt+i | | +| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyJ | j | J | J | j | | +| Shift+KeyJ | J | Shift+J | Shift+J | shift+j | | +| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | ctrl+alt+j | | +| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyK | k | K | K | k | | +| Shift+KeyK | K | Shift+K | Shift+K | shift+k | | +| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | ctrl+alt+k | | +| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyL | l | L | L | l | | +| Shift+KeyL | L | Shift+L | Shift+L | shift+l | | +| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | ctrl+alt+l | | +| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyM | m | M | M | m | | +| Shift+KeyM | M | Shift+M | Shift+M | shift+m | | +| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | ctrl+alt+m | | +| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyN | n | N | N | n | | +| Shift+KeyN | N | Shift+N | Shift+N | shift+n | | +| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | ctrl+alt+n | | +| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyO | o | O | O | o | | +| Shift+KeyO | O | Shift+O | Shift+O | shift+o | | +| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | ctrl+alt+o | | +| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyP | p | P | P | p | | +| Shift+KeyP | P | Shift+P | Shift+P | shift+p | | +| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | ctrl+alt+p | | +| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyQ | q | Q | Q | q | | +| Shift+KeyQ | Q | Shift+Q | Shift+Q | shift+q | | +| Ctrl+Alt+KeyQ | --- | Ctrl+Alt+Q | Ctrl+Alt+Q | ctrl+alt+q | | +| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyR | r | R | R | r | | +| Shift+KeyR | R | Shift+R | Shift+R | shift+r | | +| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | ctrl+alt+r | | +| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyS | s | S | S | s | | +| Shift+KeyS | S | Shift+S | Shift+S | shift+s | | +| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | ctrl+alt+s | | +| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyT | t | T | T | t | | +| Shift+KeyT | T | Shift+T | Shift+T | shift+t | | +| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | ctrl+alt+t | | +| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyU | u | U | U | u | | +| Shift+KeyU | U | Shift+U | Shift+U | shift+u | | +| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | ctrl+alt+u | | +| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyV | v | V | V | v | | +| Shift+KeyV | V | Shift+V | Shift+V | shift+v | | +| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | ctrl+alt+v | | +| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyW | w | W | W | w | | +| Shift+KeyW | W | Shift+W | Shift+W | shift+w | | +| Ctrl+Alt+KeyW | --- | Ctrl+Alt+W | Ctrl+Alt+W | ctrl+alt+w | | +| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyX | x | X | X | x | | +| Shift+KeyX | X | Shift+X | Shift+X | shift+x | | +| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | ctrl+alt+x | | +| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyY | y | Y | Y | y | | +| Shift+KeyY | Y | Shift+Y | Shift+Y | shift+y | | +| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | ctrl+alt+y | | +| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyZ | z | Z | Z | z | | +| Shift+KeyZ | Z | Shift+Z | Shift+Z | shift+z | | +| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | ctrl+alt+z | | +| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit1 | 1 | 1 | 1 | 1 | | +| Shift+Digit1 | ! | Shift+1 | Shift+1 | shift+1 | | +| Ctrl+Alt+Digit1 | --- | Ctrl+Alt+1 | Ctrl+Alt+1 | ctrl+alt+1 | | +| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | ctrl+shift+alt+1 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit2 | 2 | 2 | 2 | 2 | | +| Shift+Digit2 | @ | Shift+2 | Shift+2 | shift+2 | | +| Ctrl+Alt+Digit2 | --- | Ctrl+Alt+2 | Ctrl+Alt+2 | ctrl+alt+2 | | +| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | ctrl+shift+alt+2 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit3 | 3 | 3 | 3 | 3 | | +| Shift+Digit3 | # | Shift+3 | Shift+3 | shift+3 | | +| Ctrl+Alt+Digit3 | --- | Ctrl+Alt+3 | Ctrl+Alt+3 | ctrl+alt+3 | | +| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | ctrl+shift+alt+3 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit4 | 4 | 4 | 4 | 4 | | +| Shift+Digit4 | $ | Shift+4 | Shift+4 | shift+4 | | +| Ctrl+Alt+Digit4 | --- | Ctrl+Alt+4 | Ctrl+Alt+4 | ctrl+alt+4 | | +| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | ctrl+shift+alt+4 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit5 | 5 | 5 | 5 | 5 | | +| Shift+Digit5 | % | Shift+5 | Shift+5 | shift+5 | | +| Ctrl+Alt+Digit5 | --- | Ctrl+Alt+5 | Ctrl+Alt+5 | ctrl+alt+5 | | +| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit6 | 6 | 6 | 6 | 6 | | +| Shift+Digit6 | ^ | Shift+6 | Shift+6 | shift+6 | | +| Ctrl+Alt+Digit6 | --- | Ctrl+Alt+6 | Ctrl+Alt+6 | ctrl+alt+6 | | +| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit7 | 7 | 7 | 7 | 7 | | +| Shift+Digit7 | & | Shift+7 | Shift+7 | shift+7 | | +| Ctrl+Alt+Digit7 | --- | Ctrl+Alt+7 | Ctrl+Alt+7 | ctrl+alt+7 | | +| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | ctrl+shift+alt+7 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit8 | 8 | 8 | 8 | 8 | | +| Shift+Digit8 | * | Shift+8 | Shift+8 | shift+8 | | +| Ctrl+Alt+Digit8 | --- | Ctrl+Alt+8 | Ctrl+Alt+8 | ctrl+alt+8 | | +| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | ctrl+shift+alt+8 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit9 | 9 | 9 | 9 | 9 | | +| Shift+Digit9 | ( | Shift+9 | Shift+9 | shift+9 | | +| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | ctrl+alt+9 | | +| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit0 | 0 | 0 | 0 | 0 | | +| Shift+Digit0 | ) | Shift+0 | Shift+0 | shift+0 | | +| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | ctrl+alt+0 | | +| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | ctrl+shift+alt+0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Minus | - | - | - | - | | +| Shift+Minus | _ | Shift+- | Shift+- | shift+- | | +| Ctrl+Alt+Minus | --- | Ctrl+Alt+- | Ctrl+Alt+- | ctrl+alt+- | | +| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Equal | = | = | = | = | | +| Shift+Equal | + | Shift+= | Shift+= | shift+= | | +| Ctrl+Alt+Equal | --- | Ctrl+Alt+= | Ctrl+Alt+= | ctrl+alt+= | | +| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketLeft | [ | [ | [ | [ | | +| Shift+BracketLeft | { | Shift+[ | Shift+[ | shift+[ | | +| Ctrl+Alt+BracketLeft | --- | Ctrl+Alt+[ | Ctrl+Alt+[ | ctrl+alt+[ | | +| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketRight | ] | ] | ] | ] | | +| Shift+BracketRight | } | Shift+] | Shift+] | shift+] | | +| Ctrl+Alt+BracketRight | --- | Ctrl+Alt+] | Ctrl+Alt+] | ctrl+alt+] | | +| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backslash | \ | \ | \ | \ | | +| Shift+Backslash | | | Shift+\ | Shift+\ | shift+\ | | +| Ctrl+Alt+Backslash | --- | Ctrl+Alt+\ | Ctrl+Alt+\ | ctrl+alt+\ | | +| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlHash | --- | null | null | null | NO | +| Shift+IntlHash | --- | null | null | null | NO | +| Ctrl+Alt+IntlHash | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlHash | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Semicolon | ; | ; | ; | ; | | +| Shift+Semicolon | : | Shift+; | Shift+; | shift+; | | +| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+; | Ctrl+Alt+; | ctrl+alt+; | | +| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Quote | ' | ' | ' | ' | | +| Shift+Quote | " | Shift+' | Shift+' | shift+' | | +| Ctrl+Alt+Quote | --- | Ctrl+Alt+' | Ctrl+Alt+' | ctrl+alt+' | | +| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+' | ctrl+shift+alt+' | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backquote | ` | ` | ` | ` | | +| Shift+Backquote | ~ | Shift+` | Shift+` | shift+` | | +| Ctrl+Alt+Backquote | --- | Ctrl+Alt+` | Ctrl+Alt+` | ctrl+alt+` | | +| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Comma | , | , | , | , | | +| Shift+Comma | < | Shift+, | Shift+, | shift+, | | +| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+, | ctrl+alt+, | | +| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Period | . | . | . | . | | +| Shift+Period | > | Shift+. | Shift+. | shift+. | | +| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+. | ctrl+alt+. | | +| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Slash | / | / | / | / | | +| Shift+Slash | ? | Shift+/ | Shift+/ | shift+/ | | +| Ctrl+Alt+Slash | --- | Ctrl+Alt+/ | Ctrl+Alt+/ | ctrl+alt+/ | | +| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| ArrowUp | --- | UpArrow | UpArrow | up | | +| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | shift+up | | +| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | ctrl+alt+up | | +| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | ctrl+shift+alt+up | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Numpad0 | --- | NumPad0 | NumPad0 | numpad0 | | +| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | shift+numpad0 | | +| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | ctrl+alt+numpad0 | | +| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlBackslash | \ | OEM_102 | \ | oem_102 | NO | +| Shift+IntlBackslash | | | Shift+OEM_102 | Shift+\ | shift+oem_102 | NO | +| Ctrl+Alt+IntlBackslash | --- | Ctrl+Alt+OEM_102 | Ctrl+Alt+\ | ctrl+alt+oem_102 | NO | +| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+\ | ctrl+shift+alt+oem_102 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlRo | --- | null | null | null | NO | +| Shift+IntlRo | --- | null | null | null | NO | +| Ctrl+Alt+IntlRo | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlRo | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlYen | --- | null | null | null | NO | +| Shift+IntlYen | --- | null | null | null | NO | +| Ctrl+Alt+IntlYen | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlYen | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/win_por_ptb.js b/src/vs/workbench/services/keybinding/test/win_por_ptb.js new file mode 100644 index 00000000000..683b2e24113 --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/win_por_ptb.js @@ -0,0 +1,1093 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +define({ + Sleep: { + vkey: 'VK_SLEEP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + WakeUp: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + KeyA: { + vkey: 'VK_A', + value: 'a', + withShift: 'A', + withAltGr: '', + withShiftAltGr: '' + }, + KeyB: { + vkey: 'VK_B', + value: 'b', + withShift: 'B', + withAltGr: '', + withShiftAltGr: '' + }, + KeyC: { + vkey: 'VK_C', + value: 'c', + withShift: 'C', + withAltGr: 'â‚¢', + withShiftAltGr: '' + }, + KeyD: { + vkey: 'VK_D', + value: 'd', + withShift: 'D', + withAltGr: '', + withShiftAltGr: '' + }, + KeyE: { + vkey: 'VK_E', + value: 'e', + withShift: 'E', + withAltGr: '°', + withShiftAltGr: '' + }, + KeyF: { + vkey: 'VK_F', + value: 'f', + withShift: 'F', + withAltGr: '', + withShiftAltGr: '' + }, + KeyG: { + vkey: 'VK_G', + value: 'g', + withShift: 'G', + withAltGr: '', + withShiftAltGr: '' + }, + KeyH: { + vkey: 'VK_H', + value: 'h', + withShift: 'H', + withAltGr: '', + withShiftAltGr: '' + }, + KeyI: { + vkey: 'VK_I', + value: 'i', + withShift: 'I', + withAltGr: '', + withShiftAltGr: '' + }, + KeyJ: { + vkey: 'VK_J', + value: 'j', + withShift: 'J', + withAltGr: '', + withShiftAltGr: '' + }, + KeyK: { + vkey: 'VK_K', + value: 'k', + withShift: 'K', + withAltGr: '', + withShiftAltGr: '' + }, + KeyL: { + vkey: 'VK_L', + value: 'l', + withShift: 'L', + withAltGr: '', + withShiftAltGr: '' + }, + KeyM: { + vkey: 'VK_M', + value: 'm', + withShift: 'M', + withAltGr: '', + withShiftAltGr: '' + }, + KeyN: { + vkey: 'VK_N', + value: 'n', + withShift: 'N', + withAltGr: '', + withShiftAltGr: '' + }, + KeyO: { + vkey: 'VK_O', + value: 'o', + withShift: 'O', + withAltGr: '', + withShiftAltGr: '' + }, + KeyP: { + vkey: 'VK_P', + value: 'p', + withShift: 'P', + withAltGr: '', + withShiftAltGr: '' + }, + KeyQ: { + vkey: 'VK_Q', + value: 'q', + withShift: 'Q', + withAltGr: '/', + withShiftAltGr: '' + }, + KeyR: { + vkey: 'VK_R', + value: 'r', + withShift: 'R', + withAltGr: '', + withShiftAltGr: '' + }, + KeyS: { + vkey: 'VK_S', + value: 's', + withShift: 'S', + withAltGr: '', + withShiftAltGr: '' + }, + KeyT: { + vkey: 'VK_T', + value: 't', + withShift: 'T', + withAltGr: '', + withShiftAltGr: '' + }, + KeyU: { + vkey: 'VK_U', + value: 'u', + withShift: 'U', + withAltGr: '', + withShiftAltGr: '' + }, + KeyV: { + vkey: 'VK_V', + value: 'v', + withShift: 'V', + withAltGr: '', + withShiftAltGr: '' + }, + KeyW: { + vkey: 'VK_W', + value: 'w', + withShift: 'W', + withAltGr: '?', + withShiftAltGr: '' + }, + KeyX: { + vkey: 'VK_X', + value: 'x', + withShift: 'X', + withAltGr: '', + withShiftAltGr: '' + }, + KeyY: { + vkey: 'VK_Y', + value: 'y', + withShift: 'Y', + withAltGr: '', + withShiftAltGr: '' + }, + KeyZ: { + vkey: 'VK_Z', + value: 'z', + withShift: 'Z', + withAltGr: '', + withShiftAltGr: '' + }, + Digit1: { + vkey: 'VK_1', + value: '1', + withShift: '!', + withAltGr: '¹', + withShiftAltGr: '' + }, + Digit2: { + vkey: 'VK_2', + value: '2', + withShift: '@', + withAltGr: '²', + withShiftAltGr: '' + }, + Digit3: { + vkey: 'VK_3', + value: '3', + withShift: '#', + withAltGr: '³', + withShiftAltGr: '' + }, + Digit4: { + vkey: 'VK_4', + value: '4', + withShift: '$', + withAltGr: '£', + withShiftAltGr: '' + }, + Digit5: { + vkey: 'VK_5', + value: '5', + withShift: '%', + withAltGr: '¢', + withShiftAltGr: '' + }, + Digit6: { + vkey: 'VK_6', + value: '6', + withShift: '¨', + withAltGr: '¬', + withShiftAltGr: '' + }, + Digit7: { + vkey: 'VK_7', + value: '7', + withShift: '&', + withAltGr: '', + withShiftAltGr: '' + }, + Digit8: { + vkey: 'VK_8', + value: '8', + withShift: '*', + withAltGr: '', + withShiftAltGr: '' + }, + Digit9: { + vkey: 'VK_9', + value: '9', + withShift: '(', + withAltGr: '', + withShiftAltGr: '' + }, + Digit0: { + vkey: 'VK_0', + value: '0', + withShift: ')', + withAltGr: '', + withShiftAltGr: '' + }, + Enter: { + vkey: 'VK_RETURN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Escape: { + vkey: 'VK_ESCAPE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Backspace: { + vkey: 'VK_BACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Tab: { + vkey: 'VK_TAB', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Space: { + vkey: 'VK_SPACE', + value: ' ', + withShift: ' ', + withAltGr: '', + withShiftAltGr: '' + }, + Minus: { + vkey: 'VK_OEM_MINUS', + value: '-', + withShift: '_', + withAltGr: '', + withShiftAltGr: '' + }, + Equal: { + vkey: 'VK_OEM_PLUS', + value: '=', + withShift: '+', + withAltGr: '§', + withShiftAltGr: '' + }, + BracketLeft: { + vkey: 'VK_OEM_4', + value: '´', + withShift: '`', + withAltGr: '', + withShiftAltGr: '' + }, + BracketRight: { + vkey: 'VK_OEM_6', + value: '[', + withShift: '{', + withAltGr: 'ª', + withShiftAltGr: '' + }, + Backslash: { + vkey: 'VK_OEM_5', + value: ']', + withShift: '}', + withAltGr: 'º', + withShiftAltGr: '' + }, + Semicolon: { + vkey: 'VK_OEM_1', + value: 'ç', + withShift: 'Ç', + withAltGr: '', + withShiftAltGr: '' + }, + Quote: { + vkey: 'VK_OEM_7', + value: '~', + withShift: '^', + withAltGr: '', + withShiftAltGr: '' + }, + Backquote: { + vkey: 'VK_OEM_3', + value: '\'', + withShift: '"', + withAltGr: '', + withShiftAltGr: '' + }, + Comma: { + vkey: 'VK_OEM_COMMA', + value: ',', + withShift: '<', + withAltGr: '', + withShiftAltGr: '' + }, + Period: { + vkey: 'VK_OEM_PERIOD', + value: '.', + withShift: '>', + withAltGr: '', + withShiftAltGr: '' + }, + Slash: { + vkey: 'VK_OEM_2', + value: ';', + withShift: ':', + withAltGr: '', + withShiftAltGr: '' + }, + CapsLock: { + vkey: 'VK_CAPITAL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F1: { + vkey: 'VK_F1', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F2: { + vkey: 'VK_F2', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F3: { + vkey: 'VK_F3', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F4: { + vkey: 'VK_F4', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F5: { + vkey: 'VK_F5', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F6: { + vkey: 'VK_F6', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F7: { + vkey: 'VK_F7', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F8: { + vkey: 'VK_F8', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F9: { + vkey: 'VK_F9', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F10: { + vkey: 'VK_F10', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F11: { + vkey: 'VK_F11', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F12: { + vkey: 'VK_F12', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PrintScreen: { + vkey: 'VK_SNAPSHOT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ScrollLock: { + vkey: 'VK_SCROLL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Pause: { + vkey: 'VK_NUMLOCK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Insert: { + vkey: 'VK_INSERT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Home: { + vkey: 'VK_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PageUp: { + vkey: 'VK_PRIOR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Delete: { + vkey: 'VK_DELETE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + End: { + vkey: 'VK_END', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PageDown: { + vkey: 'VK_NEXT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowRight: { + vkey: 'VK_RIGHT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowLeft: { + vkey: 'VK_LEFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowDown: { + vkey: 'VK_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowUp: { + vkey: 'VK_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumLock: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadDivide: { + vkey: 'VK_DIVIDE', + value: '/', + withShift: '/', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadMultiply: { + vkey: 'VK_MULTIPLY', + value: '*', + withShift: '*', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadSubtract: { + vkey: 'VK_SUBTRACT', + value: '-', + withShift: '-', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadAdd: { + vkey: 'VK_ADD', + value: '+', + withShift: '+', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadEnter: { + vkey: 'VK_RETURN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad1: { + vkey: 'VK_END', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad2: { + vkey: 'VK_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad3: { + vkey: 'VK_NEXT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad4: { + vkey: 'VK_LEFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad5: { + vkey: 'VK_CLEAR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad6: { + vkey: 'VK_RIGHT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad7: { + vkey: 'VK_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad8: { + vkey: 'VK_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad9: { + vkey: 'VK_PRIOR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad0: { + vkey: 'VK_INSERT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadDecimal: { + vkey: 'VK_DELETE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + IntlBackslash: { + vkey: 'VK_OEM_102', + value: '\\', + withShift: '|', + withAltGr: '', + withShiftAltGr: '' + }, + ContextMenu: { + vkey: 'VK_APPS', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Power: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadEqual: { + vkey: 'VK_CLEAR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F13: { + vkey: 'VK_F13', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F14: { + vkey: 'VK_F14', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F15: { + vkey: 'VK_F15', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F16: { + vkey: 'VK_F16', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F17: { + vkey: 'VK_F17', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F18: { + vkey: 'VK_F18', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F19: { + vkey: 'VK_F19', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F20: { + vkey: 'VK_F20', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F21: { + vkey: 'VK_F21', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F22: { + vkey: 'VK_F22', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F23: { + vkey: 'VK_F23', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F24: { + vkey: 'VK_F24', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Help: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Undo: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Cut: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Copy: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Paste: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeMute: { + vkey: 'VK_VOLUME_MUTE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeUp: { + vkey: 'VK_VOLUME_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeDown: { + vkey: 'VK_VOLUME_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadComma: { + vkey: 'VK_ABNT_C2', + value: '.', + withShift: '.', + withAltGr: '', + withShiftAltGr: '' + }, + IntlRo: { + vkey: 'VK_ABNT_C1', + value: '/', + withShift: '?', + withAltGr: '°', + withShiftAltGr: '' + }, + KanaMode: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + IntlYen: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Convert: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NonConvert: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang1: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang2: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang3: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang4: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ControlLeft: { + vkey: 'VK_CONTROL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ShiftLeft: { + vkey: 'VK_SHIFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AltLeft: { + vkey: 'VK_MENU', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MetaLeft: { + vkey: 'VK_LWIN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ControlRight: { + vkey: 'VK_CONTROL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ShiftRight: { + vkey: 'VK_SHIFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AltRight: { + vkey: 'VK_MENU', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MetaRight: { + vkey: 'VK_RWIN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaTrackNext: { + vkey: 'VK_MEDIA_NEXT_TRACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaTrackPrevious: { + vkey: 'VK_MEDIA_PREV_TRACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaStop: { + vkey: 'VK_MEDIA_STOP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Eject: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaPlayPause: { + vkey: 'VK_MEDIA_PLAY_PAUSE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaSelect: { + vkey: 'VK_LAUNCH_MEDIA_SELECT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchMail: { + vkey: 'VK_LAUNCH_MAIL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchApp2: { + vkey: 'VK_LAUNCH_APP2', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchApp1: { + vkey: 'VK_LAUNCH_APP1', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserSearch: { + vkey: 'VK_BROWSER_SEARCH', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserHome: { + vkey: 'VK_BROWSER_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserBack: { + vkey: 'VK_BROWSER_BACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserForward: { + vkey: 'VK_BROWSER_FORWARD', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserStop: { + vkey: 'VK_BROWSER_STOP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserRefresh: { + vkey: 'VK_BROWSER_REFRESH', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserFavorites: { + vkey: 'VK_BROWSER_FAVORITES', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + } +}); \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/win_por_ptb.txt b/src/vs/workbench/services/keybinding/test/win_por_ptb.txt new file mode 100644 index 00000000000..c29ed546991 --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/win_por_ptb.txt @@ -0,0 +1,284 @@ +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyA | a | A | A | a | | +| Shift+KeyA | A | Shift+A | Shift+A | shift+a | | +| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | ctrl+alt+a | | +| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyB | b | B | B | b | | +| Shift+KeyB | B | Shift+B | Shift+B | shift+b | | +| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | ctrl+alt+b | | +| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyC | c | C | C | c | | +| Shift+KeyC | C | Shift+C | Shift+C | shift+c | | +| Ctrl+Alt+KeyC | â‚¢ | Ctrl+Alt+C | Ctrl+Alt+C | ctrl+alt+c | | +| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyD | d | D | D | d | | +| Shift+KeyD | D | Shift+D | Shift+D | shift+d | | +| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | ctrl+alt+d | | +| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyE | e | E | E | e | | +| Shift+KeyE | E | Shift+E | Shift+E | shift+e | | +| Ctrl+Alt+KeyE | ° | Ctrl+Alt+E | Ctrl+Alt+E | ctrl+alt+e | | +| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyF | f | F | F | f | | +| Shift+KeyF | F | Shift+F | Shift+F | shift+f | | +| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | ctrl+alt+f | | +| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyG | g | G | G | g | | +| Shift+KeyG | G | Shift+G | Shift+G | shift+g | | +| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | ctrl+alt+g | | +| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyH | h | H | H | h | | +| Shift+KeyH | H | Shift+H | Shift+H | shift+h | | +| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | ctrl+alt+h | | +| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyI | i | I | I | i | | +| Shift+KeyI | I | Shift+I | Shift+I | shift+i | | +| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | ctrl+alt+i | | +| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyJ | j | J | J | j | | +| Shift+KeyJ | J | Shift+J | Shift+J | shift+j | | +| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | ctrl+alt+j | | +| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyK | k | K | K | k | | +| Shift+KeyK | K | Shift+K | Shift+K | shift+k | | +| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | ctrl+alt+k | | +| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyL | l | L | L | l | | +| Shift+KeyL | L | Shift+L | Shift+L | shift+l | | +| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | ctrl+alt+l | | +| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyM | m | M | M | m | | +| Shift+KeyM | M | Shift+M | Shift+M | shift+m | | +| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | ctrl+alt+m | | +| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyN | n | N | N | n | | +| Shift+KeyN | N | Shift+N | Shift+N | shift+n | | +| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | ctrl+alt+n | | +| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyO | o | O | O | o | | +| Shift+KeyO | O | Shift+O | Shift+O | shift+o | | +| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | ctrl+alt+o | | +| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyP | p | P | P | p | | +| Shift+KeyP | P | Shift+P | Shift+P | shift+p | | +| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | ctrl+alt+p | | +| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyQ | q | Q | Q | q | | +| Shift+KeyQ | Q | Shift+Q | Shift+Q | shift+q | | +| Ctrl+Alt+KeyQ | / | Ctrl+Alt+Q | Ctrl+Alt+Q | ctrl+alt+q | | +| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyR | r | R | R | r | | +| Shift+KeyR | R | Shift+R | Shift+R | shift+r | | +| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | ctrl+alt+r | | +| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyS | s | S | S | s | | +| Shift+KeyS | S | Shift+S | Shift+S | shift+s | | +| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | ctrl+alt+s | | +| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyT | t | T | T | t | | +| Shift+KeyT | T | Shift+T | Shift+T | shift+t | | +| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | ctrl+alt+t | | +| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyU | u | U | U | u | | +| Shift+KeyU | U | Shift+U | Shift+U | shift+u | | +| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | ctrl+alt+u | | +| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyV | v | V | V | v | | +| Shift+KeyV | V | Shift+V | Shift+V | shift+v | | +| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | ctrl+alt+v | | +| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyW | w | W | W | w | | +| Shift+KeyW | W | Shift+W | Shift+W | shift+w | | +| Ctrl+Alt+KeyW | ? | Ctrl+Alt+W | Ctrl+Alt+W | ctrl+alt+w | | +| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyX | x | X | X | x | | +| Shift+KeyX | X | Shift+X | Shift+X | shift+x | | +| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | ctrl+alt+x | | +| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyY | y | Y | Y | y | | +| Shift+KeyY | Y | Shift+Y | Shift+Y | shift+y | | +| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | ctrl+alt+y | | +| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyZ | z | Z | Z | z | | +| Shift+KeyZ | Z | Shift+Z | Shift+Z | shift+z | | +| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | ctrl+alt+z | | +| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit1 | 1 | 1 | 1 | 1 | | +| Shift+Digit1 | ! | Shift+1 | Shift+1 | shift+1 | | +| Ctrl+Alt+Digit1 | ¹ | Ctrl+Alt+1 | Ctrl+Alt+1 | ctrl+alt+1 | | +| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | ctrl+shift+alt+1 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit2 | 2 | 2 | 2 | 2 | | +| Shift+Digit2 | @ | Shift+2 | Shift+2 | shift+2 | | +| Ctrl+Alt+Digit2 | ² | Ctrl+Alt+2 | Ctrl+Alt+2 | ctrl+alt+2 | | +| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | ctrl+shift+alt+2 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit3 | 3 | 3 | 3 | 3 | | +| Shift+Digit3 | # | Shift+3 | Shift+3 | shift+3 | | +| Ctrl+Alt+Digit3 | ³ | Ctrl+Alt+3 | Ctrl+Alt+3 | ctrl+alt+3 | | +| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | ctrl+shift+alt+3 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit4 | 4 | 4 | 4 | 4 | | +| Shift+Digit4 | $ | Shift+4 | Shift+4 | shift+4 | | +| Ctrl+Alt+Digit4 | £ | Ctrl+Alt+4 | Ctrl+Alt+4 | ctrl+alt+4 | | +| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | ctrl+shift+alt+4 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit5 | 5 | 5 | 5 | 5 | | +| Shift+Digit5 | % | Shift+5 | Shift+5 | shift+5 | | +| Ctrl+Alt+Digit5 | ¢ | Ctrl+Alt+5 | Ctrl+Alt+5 | ctrl+alt+5 | | +| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit6 | 6 | 6 | 6 | 6 | | +| Shift+Digit6 | ¨ | Shift+6 | Shift+6 | shift+6 | | +| Ctrl+Alt+Digit6 | ¬ | Ctrl+Alt+6 | Ctrl+Alt+6 | ctrl+alt+6 | | +| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit7 | 7 | 7 | 7 | 7 | | +| Shift+Digit7 | & | Shift+7 | Shift+7 | shift+7 | | +| Ctrl+Alt+Digit7 | --- | Ctrl+Alt+7 | Ctrl+Alt+7 | ctrl+alt+7 | | +| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | ctrl+shift+alt+7 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit8 | 8 | 8 | 8 | 8 | | +| Shift+Digit8 | * | Shift+8 | Shift+8 | shift+8 | | +| Ctrl+Alt+Digit8 | --- | Ctrl+Alt+8 | Ctrl+Alt+8 | ctrl+alt+8 | | +| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | ctrl+shift+alt+8 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit9 | 9 | 9 | 9 | 9 | | +| Shift+Digit9 | ( | Shift+9 | Shift+9 | shift+9 | | +| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | ctrl+alt+9 | | +| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit0 | 0 | 0 | 0 | 0 | | +| Shift+Digit0 | ) | Shift+0 | Shift+0 | shift+0 | | +| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | ctrl+alt+0 | | +| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | ctrl+shift+alt+0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Minus | - | - | - | oem_minus | NO | +| Shift+Minus | _ | Shift+- | Shift+- | shift+oem_minus | NO | +| Ctrl+Alt+Minus | --- | Ctrl+Alt+- | Ctrl+Alt+- | ctrl+alt+oem_minus | NO | +| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+oem_minus | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Equal | = | = | = | oem_plus | NO | +| Shift+Equal | + | Shift+= | Shift+= | shift+oem_plus | NO | +| Ctrl+Alt+Equal | § | Ctrl+Alt+= | Ctrl+Alt+= | ctrl+alt+oem_plus | NO | +| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+oem_plus | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketLeft | ´ | [ | ´ | oem_4 | NO | +| Shift+BracketLeft | ` | Shift+[ | Shift+´ | shift+oem_4 | NO | +| Ctrl+Alt+BracketLeft | --- | Ctrl+Alt+[ | Ctrl+Alt+´ | ctrl+alt+oem_4 | NO | +| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+´ | ctrl+shift+alt+oem_4 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketRight | [ | ] | [ | oem_6 | NO | +| Shift+BracketRight | { | Shift+] | Shift+[ | shift+oem_6 | NO | +| Ctrl+Alt+BracketRight | ª | Ctrl+Alt+] | Ctrl+Alt+[ | ctrl+alt+oem_6 | NO | +| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+[ | ctrl+shift+alt+oem_6 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backslash | ] | \ | ] | oem_5 | NO | +| Shift+Backslash | } | Shift+\ | Shift+] | shift+oem_5 | NO | +| Ctrl+Alt+Backslash | º | Ctrl+Alt+\ | Ctrl+Alt+] | ctrl+alt+oem_5 | NO | +| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+] | ctrl+shift+alt+oem_5 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlHash | --- | null | null | null | NO | +| Shift+IntlHash | --- | null | null | null | NO | +| Ctrl+Alt+IntlHash | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlHash | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Semicolon | ç | ; | ç | oem_1 | NO | +| Shift+Semicolon | Ç | Shift+; | Shift+ç | shift+oem_1 | NO | +| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+; | Ctrl+Alt+ç | ctrl+alt+oem_1 | NO | +| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+ç | ctrl+shift+alt+oem_1 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Quote | ~ | ' | ~ | oem_7 | NO | +| Shift+Quote | ^ | Shift+' | Shift+~ | shift+oem_7 | NO | +| Ctrl+Alt+Quote | --- | Ctrl+Alt+' | Ctrl+Alt+~ | ctrl+alt+oem_7 | NO | +| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+~ | ctrl+shift+alt+oem_7 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backquote | ' | ` | ' | oem_3 | NO | +| Shift+Backquote | " | Shift+` | Shift+' | shift+oem_3 | NO | +| Ctrl+Alt+Backquote | --- | Ctrl+Alt+` | Ctrl+Alt+' | ctrl+alt+oem_3 | NO | +| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+' | ctrl+shift+alt+oem_3 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Comma | , | , | , | oem_comma | NO | +| Shift+Comma | < | Shift+, | Shift+, | shift+oem_comma | NO | +| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+, | ctrl+alt+oem_comma | NO | +| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+, | ctrl+shift+alt+oem_comma | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Period | . | . | . | oem_period | NO | +| Shift+Period | > | Shift+. | Shift+. | shift+oem_period | NO | +| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+. | ctrl+alt+oem_period | NO | +| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+. | ctrl+shift+alt+oem_period | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Slash | ; | / | ; | oem_2 | NO | +| Shift+Slash | : | Shift+/ | Shift+; | shift+oem_2 | NO | +| Ctrl+Alt+Slash | --- | Ctrl+Alt+/ | Ctrl+Alt+; | ctrl+alt+oem_2 | NO | +| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+; | ctrl+shift+alt+oem_2 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| ArrowUp | --- | UpArrow | UpArrow | up | | +| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | shift+up | | +| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | ctrl+alt+up | | +| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | ctrl+shift+alt+up | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Numpad0 | --- | NumPad0 | NumPad0 | numpad0 | | +| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | shift+numpad0 | | +| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | ctrl+alt+numpad0 | | +| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlBackslash | \ | OEM_102 | \ | oem_102 | NO | +| Shift+IntlBackslash | | | Shift+OEM_102 | Shift+\ | shift+oem_102 | NO | +| Ctrl+Alt+IntlBackslash | --- | Ctrl+Alt+OEM_102 | Ctrl+Alt+\ | ctrl+alt+oem_102 | NO | +| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+\ | ctrl+shift+alt+oem_102 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlRo | / | ABNT_C1 | / | abnt_c1 | NO | +| Shift+IntlRo | ? | Shift+ABNT_C1 | Shift+/ | shift+abnt_c1 | NO | +| Ctrl+Alt+IntlRo | ° | Ctrl+Alt+ABNT_C1 | Ctrl+Alt+/ | ctrl+alt+abnt_c1 | NO | +| Ctrl+Shift+Alt+IntlRo | --- | Ctrl+Shift+Alt+ABNT_C1 | Ctrl+Shift+Alt+/ | ctrl+shift+alt+abnt_c1 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlYen | --- | null | null | null | NO | +| Shift+IntlYen | --- | null | null | null | NO | +| Ctrl+Alt+IntlYen | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlYen | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/win_ru.js b/src/vs/workbench/services/keybinding/test/win_ru.js new file mode 100644 index 00000000000..4f024d361eb --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/win_ru.js @@ -0,0 +1,1093 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +define({ + Sleep: { + vkey: 'VK_SLEEP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + WakeUp: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + KeyA: { + vkey: 'VK_A', + value: 'Ñ„', + withShift: 'Ф', + withAltGr: '', + withShiftAltGr: '' + }, + KeyB: { + vkey: 'VK_B', + value: 'и', + withShift: 'И', + withAltGr: '', + withShiftAltGr: '' + }, + KeyC: { + vkey: 'VK_C', + value: 'Ñ', + withShift: 'С', + withAltGr: '', + withShiftAltGr: '' + }, + KeyD: { + vkey: 'VK_D', + value: 'в', + withShift: 'Ð’', + withAltGr: '', + withShiftAltGr: '' + }, + KeyE: { + vkey: 'VK_E', + value: 'у', + withShift: 'У', + withAltGr: '', + withShiftAltGr: '' + }, + KeyF: { + vkey: 'VK_F', + value: 'а', + withShift: 'Ð', + withAltGr: '', + withShiftAltGr: '' + }, + KeyG: { + vkey: 'VK_G', + value: 'п', + withShift: 'П', + withAltGr: '', + withShiftAltGr: '' + }, + KeyH: { + vkey: 'VK_H', + value: 'Ñ€', + withShift: 'Р', + withAltGr: '', + withShiftAltGr: '' + }, + KeyI: { + vkey: 'VK_I', + value: 'ш', + withShift: 'Ш', + withAltGr: '', + withShiftAltGr: '' + }, + KeyJ: { + vkey: 'VK_J', + value: 'о', + withShift: 'О', + withAltGr: '', + withShiftAltGr: '' + }, + KeyK: { + vkey: 'VK_K', + value: 'л', + withShift: 'Л', + withAltGr: '', + withShiftAltGr: '' + }, + KeyL: { + vkey: 'VK_L', + value: 'д', + withShift: 'Д', + withAltGr: '', + withShiftAltGr: '' + }, + KeyM: { + vkey: 'VK_M', + value: 'ÑŒ', + withShift: 'Ь', + withAltGr: '', + withShiftAltGr: '' + }, + KeyN: { + vkey: 'VK_N', + value: 'Ñ‚', + withShift: 'Т', + withAltGr: '', + withShiftAltGr: '' + }, + KeyO: { + vkey: 'VK_O', + value: 'щ', + withShift: 'Щ', + withAltGr: '', + withShiftAltGr: '' + }, + KeyP: { + vkey: 'VK_P', + value: 'з', + withShift: 'З', + withAltGr: '', + withShiftAltGr: '' + }, + KeyQ: { + vkey: 'VK_Q', + value: 'й', + withShift: 'Й', + withAltGr: '', + withShiftAltGr: '' + }, + KeyR: { + vkey: 'VK_R', + value: 'к', + withShift: 'К', + withAltGr: '', + withShiftAltGr: '' + }, + KeyS: { + vkey: 'VK_S', + value: 'Ñ‹', + withShift: 'Ы', + withAltGr: '', + withShiftAltGr: '' + }, + KeyT: { + vkey: 'VK_T', + value: 'е', + withShift: 'Е', + withAltGr: '', + withShiftAltGr: '' + }, + KeyU: { + vkey: 'VK_U', + value: 'г', + withShift: 'Г', + withAltGr: '', + withShiftAltGr: '' + }, + KeyV: { + vkey: 'VK_V', + value: 'м', + withShift: 'М', + withAltGr: '', + withShiftAltGr: '' + }, + KeyW: { + vkey: 'VK_W', + value: 'ц', + withShift: 'Ц', + withAltGr: '', + withShiftAltGr: '' + }, + KeyX: { + vkey: 'VK_X', + value: 'ч', + withShift: 'Ч', + withAltGr: '', + withShiftAltGr: '' + }, + KeyY: { + vkey: 'VK_Y', + value: 'н', + withShift: 'Ð', + withAltGr: '', + withShiftAltGr: '' + }, + KeyZ: { + vkey: 'VK_Z', + value: 'Ñ', + withShift: 'Я', + withAltGr: '', + withShiftAltGr: '' + }, + Digit1: { + vkey: 'VK_1', + value: '1', + withShift: '!', + withAltGr: '', + withShiftAltGr: '' + }, + Digit2: { + vkey: 'VK_2', + value: '2', + withShift: '\"', + withAltGr: '', + withShiftAltGr: '' + }, + Digit3: { + vkey: 'VK_3', + value: '3', + withShift: 'â„–', + withAltGr: '', + withShiftAltGr: '' + }, + Digit4: { + vkey: 'VK_4', + value: '4', + withShift: ';', + withAltGr: '', + withShiftAltGr: '' + }, + Digit5: { + vkey: 'VK_5', + value: '5', + withShift: '%', + withAltGr: '', + withShiftAltGr: '' + }, + Digit6: { + vkey: 'VK_6', + value: '6', + withShift: ':', + withAltGr: '', + withShiftAltGr: '' + }, + Digit7: { + vkey: 'VK_7', + value: '7', + withShift: '?', + withAltGr: '', + withShiftAltGr: '' + }, + Digit8: { + vkey: 'VK_8', + value: '8', + withShift: '*', + withAltGr: '₽', + withShiftAltGr: '' + }, + Digit9: { + vkey: 'VK_9', + value: '9', + withShift: '(', + withAltGr: '', + withShiftAltGr: '' + }, + Digit0: { + vkey: 'VK_0', + value: '0', + withShift: ')', + withAltGr: '', + withShiftAltGr: '' + }, + Enter: { + vkey: 'VK_RETURN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Escape: { + vkey: 'VK_ESCAPE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Backspace: { + vkey: 'VK_BACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Tab: { + vkey: 'VK_TAB', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Space: { + vkey: 'VK_SPACE', + value: ' ', + withShift: ' ', + withAltGr: '', + withShiftAltGr: '' + }, + Minus: { + vkey: 'VK_OEM_MINUS', + value: '-', + withShift: '_', + withAltGr: '', + withShiftAltGr: '' + }, + Equal: { + vkey: 'VK_OEM_PLUS', + value: '=', + withShift: '+', + withAltGr: '', + withShiftAltGr: '' + }, + BracketLeft: { + vkey: 'VK_OEM_4', + value: 'Ñ…', + withShift: 'Ð¥', + withAltGr: '', + withShiftAltGr: '' + }, + BracketRight: { + vkey: 'VK_OEM_6', + value: 'ÑŠ', + withShift: 'Ъ', + withAltGr: '', + withShiftAltGr: '' + }, + Backslash: { + vkey: 'VK_OEM_5', + value: '\\', + withShift: '/', + withAltGr: '', + withShiftAltGr: '' + }, + Semicolon: { + vkey: 'VK_OEM_1', + value: 'ж', + withShift: 'Ж', + withAltGr: '', + withShiftAltGr: '' + }, + Quote: { + vkey: 'VK_OEM_7', + value: 'Ñ', + withShift: 'Э', + withAltGr: '', + withShiftAltGr: '' + }, + Backquote: { + vkey: 'VK_OEM_3', + value: 'Ñ‘', + withShift: 'Ð', + withAltGr: '', + withShiftAltGr: '' + }, + Comma: { + vkey: 'VK_OEM_COMMA', + value: 'б', + withShift: 'Б', + withAltGr: '', + withShiftAltGr: '' + }, + Period: { + vkey: 'VK_OEM_PERIOD', + value: 'ÑŽ', + withShift: 'Ю', + withAltGr: '', + withShiftAltGr: '' + }, + Slash: { + vkey: 'VK_OEM_2', + value: '.', + withShift: ',', + withAltGr: '', + withShiftAltGr: '' + }, + CapsLock: { + vkey: 'VK_CAPITAL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F1: { + vkey: 'VK_F1', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F2: { + vkey: 'VK_F2', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F3: { + vkey: 'VK_F3', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F4: { + vkey: 'VK_F4', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F5: { + vkey: 'VK_F5', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F6: { + vkey: 'VK_F6', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F7: { + vkey: 'VK_F7', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F8: { + vkey: 'VK_F8', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F9: { + vkey: 'VK_F9', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F10: { + vkey: 'VK_F10', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F11: { + vkey: 'VK_F11', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F12: { + vkey: 'VK_F12', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PrintScreen: { + vkey: 'VK_SNAPSHOT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ScrollLock: { + vkey: 'VK_SCROLL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Pause: { + vkey: 'VK_NUMLOCK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Insert: { + vkey: 'VK_INSERT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Home: { + vkey: 'VK_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PageUp: { + vkey: 'VK_PRIOR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Delete: { + vkey: 'VK_DELETE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + End: { + vkey: 'VK_END', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + PageDown: { + vkey: 'VK_NEXT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowRight: { + vkey: 'VK_RIGHT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowLeft: { + vkey: 'VK_LEFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowDown: { + vkey: 'VK_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ArrowUp: { + vkey: 'VK_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumLock: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadDivide: { + vkey: 'VK_DIVIDE', + value: '/', + withShift: '/', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadMultiply: { + vkey: 'VK_MULTIPLY', + value: '*', + withShift: '*', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadSubtract: { + vkey: 'VK_SUBTRACT', + value: '-', + withShift: '-', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadAdd: { + vkey: 'VK_ADD', + value: '+', + withShift: '+', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadEnter: { + vkey: 'VK_RETURN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad1: { + vkey: 'VK_END', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad2: { + vkey: 'VK_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad3: { + vkey: 'VK_NEXT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad4: { + vkey: 'VK_LEFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad5: { + vkey: 'VK_CLEAR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad6: { + vkey: 'VK_RIGHT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad7: { + vkey: 'VK_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad8: { + vkey: 'VK_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad9: { + vkey: 'VK_PRIOR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Numpad0: { + vkey: 'VK_INSERT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadDecimal: { + vkey: 'VK_DELETE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + IntlBackslash: { + vkey: 'VK_OEM_102', + value: '\\', + withShift: '/', + withAltGr: '', + withShiftAltGr: '' + }, + ContextMenu: { + vkey: 'VK_APPS', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Power: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadEqual: { + vkey: 'VK_CLEAR', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F13: { + vkey: 'VK_F13', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F14: { + vkey: 'VK_F14', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F15: { + vkey: 'VK_F15', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F16: { + vkey: 'VK_F16', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F17: { + vkey: 'VK_F17', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F18: { + vkey: 'VK_F18', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F19: { + vkey: 'VK_F19', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F20: { + vkey: 'VK_F20', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F21: { + vkey: 'VK_F21', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F22: { + vkey: 'VK_F22', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F23: { + vkey: 'VK_F23', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + F24: { + vkey: 'VK_F24', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Help: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Undo: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Cut: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Copy: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Paste: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeMute: { + vkey: 'VK_VOLUME_MUTE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeUp: { + vkey: 'VK_VOLUME_UP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AudioVolumeDown: { + vkey: 'VK_VOLUME_DOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NumpadComma: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + IntlRo: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + KanaMode: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + IntlYen: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Convert: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + NonConvert: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang1: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang2: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang3: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Lang4: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ControlLeft: { + vkey: 'VK_CONTROL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ShiftLeft: { + vkey: 'VK_SHIFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AltLeft: { + vkey: 'VK_MENU', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MetaLeft: { + vkey: 'VK_LWIN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ControlRight: { + vkey: 'VK_CONTROL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + ShiftRight: { + vkey: 'VK_SHIFT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + AltRight: { + vkey: 'VK_MENU', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MetaRight: { + vkey: 'VK_RWIN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaTrackNext: { + vkey: 'VK_MEDIA_NEXT_TRACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaTrackPrevious: { + vkey: 'VK_MEDIA_PREV_TRACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaStop: { + vkey: 'VK_MEDIA_STOP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + Eject: { + vkey: 'VK_UNKNOWN', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaPlayPause: { + vkey: 'VK_MEDIA_PLAY_PAUSE', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + MediaSelect: { + vkey: 'VK_LAUNCH_MEDIA_SELECT', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchMail: { + vkey: 'VK_LAUNCH_MAIL', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchApp2: { + vkey: 'VK_LAUNCH_APP2', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + LaunchApp1: { + vkey: 'VK_LAUNCH_APP1', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserSearch: { + vkey: 'VK_BROWSER_SEARCH', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserHome: { + vkey: 'VK_BROWSER_HOME', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserBack: { + vkey: 'VK_BROWSER_BACK', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserForward: { + vkey: 'VK_BROWSER_FORWARD', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserStop: { + vkey: 'VK_BROWSER_STOP', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserRefresh: { + vkey: 'VK_BROWSER_REFRESH', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + }, + BrowserFavorites: { + vkey: 'VK_BROWSER_FAVORITES', + value: '', + withShift: '', + withAltGr: '', + withShiftAltGr: '' + } +}); diff --git a/src/vs/workbench/services/keybinding/test/win_ru.txt b/src/vs/workbench/services/keybinding/test/win_ru.txt new file mode 100644 index 00000000000..359a3862382 --- /dev/null +++ b/src/vs/workbench/services/keybinding/test/win_ru.txt @@ -0,0 +1,284 @@ +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyA | Ñ„ | A | A | a | | +| Shift+KeyA | Ф | Shift+A | Shift+A | shift+a | | +| Ctrl+Alt+KeyA | --- | Ctrl+Alt+A | Ctrl+Alt+A | ctrl+alt+a | | +| Ctrl+Shift+Alt+KeyA | --- | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | ctrl+shift+alt+a | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyB | и | B | B | b | | +| Shift+KeyB | И | Shift+B | Shift+B | shift+b | | +| Ctrl+Alt+KeyB | --- | Ctrl+Alt+B | Ctrl+Alt+B | ctrl+alt+b | | +| Ctrl+Shift+Alt+KeyB | --- | Ctrl+Shift+Alt+B | Ctrl+Shift+Alt+B | ctrl+shift+alt+b | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyC | Ñ | C | C | c | | +| Shift+KeyC | С | Shift+C | Shift+C | shift+c | | +| Ctrl+Alt+KeyC | --- | Ctrl+Alt+C | Ctrl+Alt+C | ctrl+alt+c | | +| Ctrl+Shift+Alt+KeyC | --- | Ctrl+Shift+Alt+C | Ctrl+Shift+Alt+C | ctrl+shift+alt+c | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyD | в | D | D | d | | +| Shift+KeyD | Ð’ | Shift+D | Shift+D | shift+d | | +| Ctrl+Alt+KeyD | --- | Ctrl+Alt+D | Ctrl+Alt+D | ctrl+alt+d | | +| Ctrl+Shift+Alt+KeyD | --- | Ctrl+Shift+Alt+D | Ctrl+Shift+Alt+D | ctrl+shift+alt+d | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyE | у | E | E | e | | +| Shift+KeyE | У | Shift+E | Shift+E | shift+e | | +| Ctrl+Alt+KeyE | --- | Ctrl+Alt+E | Ctrl+Alt+E | ctrl+alt+e | | +| Ctrl+Shift+Alt+KeyE | --- | Ctrl+Shift+Alt+E | Ctrl+Shift+Alt+E | ctrl+shift+alt+e | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyF | а | F | F | f | | +| Shift+KeyF | Ð | Shift+F | Shift+F | shift+f | | +| Ctrl+Alt+KeyF | --- | Ctrl+Alt+F | Ctrl+Alt+F | ctrl+alt+f | | +| Ctrl+Shift+Alt+KeyF | --- | Ctrl+Shift+Alt+F | Ctrl+Shift+Alt+F | ctrl+shift+alt+f | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyG | п | G | G | g | | +| Shift+KeyG | П | Shift+G | Shift+G | shift+g | | +| Ctrl+Alt+KeyG | --- | Ctrl+Alt+G | Ctrl+Alt+G | ctrl+alt+g | | +| Ctrl+Shift+Alt+KeyG | --- | Ctrl+Shift+Alt+G | Ctrl+Shift+Alt+G | ctrl+shift+alt+g | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyH | Ñ€ | H | H | h | | +| Shift+KeyH | Р | Shift+H | Shift+H | shift+h | | +| Ctrl+Alt+KeyH | --- | Ctrl+Alt+H | Ctrl+Alt+H | ctrl+alt+h | | +| Ctrl+Shift+Alt+KeyH | --- | Ctrl+Shift+Alt+H | Ctrl+Shift+Alt+H | ctrl+shift+alt+h | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyI | ш | I | I | i | | +| Shift+KeyI | Ш | Shift+I | Shift+I | shift+i | | +| Ctrl+Alt+KeyI | --- | Ctrl+Alt+I | Ctrl+Alt+I | ctrl+alt+i | | +| Ctrl+Shift+Alt+KeyI | --- | Ctrl+Shift+Alt+I | Ctrl+Shift+Alt+I | ctrl+shift+alt+i | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyJ | о | J | J | j | | +| Shift+KeyJ | О | Shift+J | Shift+J | shift+j | | +| Ctrl+Alt+KeyJ | --- | Ctrl+Alt+J | Ctrl+Alt+J | ctrl+alt+j | | +| Ctrl+Shift+Alt+KeyJ | --- | Ctrl+Shift+Alt+J | Ctrl+Shift+Alt+J | ctrl+shift+alt+j | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyK | л | K | K | k | | +| Shift+KeyK | Л | Shift+K | Shift+K | shift+k | | +| Ctrl+Alt+KeyK | --- | Ctrl+Alt+K | Ctrl+Alt+K | ctrl+alt+k | | +| Ctrl+Shift+Alt+KeyK | --- | Ctrl+Shift+Alt+K | Ctrl+Shift+Alt+K | ctrl+shift+alt+k | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyL | д | L | L | l | | +| Shift+KeyL | Д | Shift+L | Shift+L | shift+l | | +| Ctrl+Alt+KeyL | --- | Ctrl+Alt+L | Ctrl+Alt+L | ctrl+alt+l | | +| Ctrl+Shift+Alt+KeyL | --- | Ctrl+Shift+Alt+L | Ctrl+Shift+Alt+L | ctrl+shift+alt+l | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyM | ÑŒ | M | M | m | | +| Shift+KeyM | Ь | Shift+M | Shift+M | shift+m | | +| Ctrl+Alt+KeyM | --- | Ctrl+Alt+M | Ctrl+Alt+M | ctrl+alt+m | | +| Ctrl+Shift+Alt+KeyM | --- | Ctrl+Shift+Alt+M | Ctrl+Shift+Alt+M | ctrl+shift+alt+m | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyN | Ñ‚ | N | N | n | | +| Shift+KeyN | Т | Shift+N | Shift+N | shift+n | | +| Ctrl+Alt+KeyN | --- | Ctrl+Alt+N | Ctrl+Alt+N | ctrl+alt+n | | +| Ctrl+Shift+Alt+KeyN | --- | Ctrl+Shift+Alt+N | Ctrl+Shift+Alt+N | ctrl+shift+alt+n | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyO | щ | O | O | o | | +| Shift+KeyO | Щ | Shift+O | Shift+O | shift+o | | +| Ctrl+Alt+KeyO | --- | Ctrl+Alt+O | Ctrl+Alt+O | ctrl+alt+o | | +| Ctrl+Shift+Alt+KeyO | --- | Ctrl+Shift+Alt+O | Ctrl+Shift+Alt+O | ctrl+shift+alt+o | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyP | з | P | P | p | | +| Shift+KeyP | З | Shift+P | Shift+P | shift+p | | +| Ctrl+Alt+KeyP | --- | Ctrl+Alt+P | Ctrl+Alt+P | ctrl+alt+p | | +| Ctrl+Shift+Alt+KeyP | --- | Ctrl+Shift+Alt+P | Ctrl+Shift+Alt+P | ctrl+shift+alt+p | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyQ | й | Q | Q | q | | +| Shift+KeyQ | Й | Shift+Q | Shift+Q | shift+q | | +| Ctrl+Alt+KeyQ | --- | Ctrl+Alt+Q | Ctrl+Alt+Q | ctrl+alt+q | | +| Ctrl+Shift+Alt+KeyQ | --- | Ctrl+Shift+Alt+Q | Ctrl+Shift+Alt+Q | ctrl+shift+alt+q | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyR | к | R | R | r | | +| Shift+KeyR | К | Shift+R | Shift+R | shift+r | | +| Ctrl+Alt+KeyR | --- | Ctrl+Alt+R | Ctrl+Alt+R | ctrl+alt+r | | +| Ctrl+Shift+Alt+KeyR | --- | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | ctrl+shift+alt+r | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyS | Ñ‹ | S | S | s | | +| Shift+KeyS | Ы | Shift+S | Shift+S | shift+s | | +| Ctrl+Alt+KeyS | --- | Ctrl+Alt+S | Ctrl+Alt+S | ctrl+alt+s | | +| Ctrl+Shift+Alt+KeyS | --- | Ctrl+Shift+Alt+S | Ctrl+Shift+Alt+S | ctrl+shift+alt+s | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyT | е | T | T | t | | +| Shift+KeyT | Е | Shift+T | Shift+T | shift+t | | +| Ctrl+Alt+KeyT | --- | Ctrl+Alt+T | Ctrl+Alt+T | ctrl+alt+t | | +| Ctrl+Shift+Alt+KeyT | --- | Ctrl+Shift+Alt+T | Ctrl+Shift+Alt+T | ctrl+shift+alt+t | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyU | г | U | U | u | | +| Shift+KeyU | Г | Shift+U | Shift+U | shift+u | | +| Ctrl+Alt+KeyU | --- | Ctrl+Alt+U | Ctrl+Alt+U | ctrl+alt+u | | +| Ctrl+Shift+Alt+KeyU | --- | Ctrl+Shift+Alt+U | Ctrl+Shift+Alt+U | ctrl+shift+alt+u | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyV | м | V | V | v | | +| Shift+KeyV | М | Shift+V | Shift+V | shift+v | | +| Ctrl+Alt+KeyV | --- | Ctrl+Alt+V | Ctrl+Alt+V | ctrl+alt+v | | +| Ctrl+Shift+Alt+KeyV | --- | Ctrl+Shift+Alt+V | Ctrl+Shift+Alt+V | ctrl+shift+alt+v | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyW | ц | W | W | w | | +| Shift+KeyW | Ц | Shift+W | Shift+W | shift+w | | +| Ctrl+Alt+KeyW | --- | Ctrl+Alt+W | Ctrl+Alt+W | ctrl+alt+w | | +| Ctrl+Shift+Alt+KeyW | --- | Ctrl+Shift+Alt+W | Ctrl+Shift+Alt+W | ctrl+shift+alt+w | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyX | ч | X | X | x | | +| Shift+KeyX | Ч | Shift+X | Shift+X | shift+x | | +| Ctrl+Alt+KeyX | --- | Ctrl+Alt+X | Ctrl+Alt+X | ctrl+alt+x | | +| Ctrl+Shift+Alt+KeyX | --- | Ctrl+Shift+Alt+X | Ctrl+Shift+Alt+X | ctrl+shift+alt+x | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyY | н | Y | Y | y | | +| Shift+KeyY | Ð | Shift+Y | Shift+Y | shift+y | | +| Ctrl+Alt+KeyY | --- | Ctrl+Alt+Y | Ctrl+Alt+Y | ctrl+alt+y | | +| Ctrl+Shift+Alt+KeyY | --- | Ctrl+Shift+Alt+Y | Ctrl+Shift+Alt+Y | ctrl+shift+alt+y | | +----------------------------------------------------------------------------------------------------------------------------------------- +| KeyZ | Ñ | Z | Z | z | | +| Shift+KeyZ | Я | Shift+Z | Shift+Z | shift+z | | +| Ctrl+Alt+KeyZ | --- | Ctrl+Alt+Z | Ctrl+Alt+Z | ctrl+alt+z | | +| Ctrl+Shift+Alt+KeyZ | --- | Ctrl+Shift+Alt+Z | Ctrl+Shift+Alt+Z | ctrl+shift+alt+z | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit1 | 1 | 1 | 1 | 1 | | +| Shift+Digit1 | ! | Shift+1 | Shift+1 | shift+1 | | +| Ctrl+Alt+Digit1 | --- | Ctrl+Alt+1 | Ctrl+Alt+1 | ctrl+alt+1 | | +| Ctrl+Shift+Alt+Digit1 | --- | Ctrl+Shift+Alt+1 | Ctrl+Shift+Alt+1 | ctrl+shift+alt+1 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit2 | 2 | 2 | 2 | 2 | | +| Shift+Digit2 | " | Shift+2 | Shift+2 | shift+2 | | +| Ctrl+Alt+Digit2 | --- | Ctrl+Alt+2 | Ctrl+Alt+2 | ctrl+alt+2 | | +| Ctrl+Shift+Alt+Digit2 | --- | Ctrl+Shift+Alt+2 | Ctrl+Shift+Alt+2 | ctrl+shift+alt+2 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit3 | 3 | 3 | 3 | 3 | | +| Shift+Digit3 | â„– | Shift+3 | Shift+3 | shift+3 | | +| Ctrl+Alt+Digit3 | --- | Ctrl+Alt+3 | Ctrl+Alt+3 | ctrl+alt+3 | | +| Ctrl+Shift+Alt+Digit3 | --- | Ctrl+Shift+Alt+3 | Ctrl+Shift+Alt+3 | ctrl+shift+alt+3 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit4 | 4 | 4 | 4 | 4 | | +| Shift+Digit4 | ; | Shift+4 | Shift+4 | shift+4 | | +| Ctrl+Alt+Digit4 | --- | Ctrl+Alt+4 | Ctrl+Alt+4 | ctrl+alt+4 | | +| Ctrl+Shift+Alt+Digit4 | --- | Ctrl+Shift+Alt+4 | Ctrl+Shift+Alt+4 | ctrl+shift+alt+4 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit5 | 5 | 5 | 5 | 5 | | +| Shift+Digit5 | % | Shift+5 | Shift+5 | shift+5 | | +| Ctrl+Alt+Digit5 | --- | Ctrl+Alt+5 | Ctrl+Alt+5 | ctrl+alt+5 | | +| Ctrl+Shift+Alt+Digit5 | --- | Ctrl+Shift+Alt+5 | Ctrl+Shift+Alt+5 | ctrl+shift+alt+5 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit6 | 6 | 6 | 6 | 6 | | +| Shift+Digit6 | : | Shift+6 | Shift+6 | shift+6 | | +| Ctrl+Alt+Digit6 | --- | Ctrl+Alt+6 | Ctrl+Alt+6 | ctrl+alt+6 | | +| Ctrl+Shift+Alt+Digit6 | --- | Ctrl+Shift+Alt+6 | Ctrl+Shift+Alt+6 | ctrl+shift+alt+6 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit7 | 7 | 7 | 7 | 7 | | +| Shift+Digit7 | ? | Shift+7 | Shift+7 | shift+7 | | +| Ctrl+Alt+Digit7 | --- | Ctrl+Alt+7 | Ctrl+Alt+7 | ctrl+alt+7 | | +| Ctrl+Shift+Alt+Digit7 | --- | Ctrl+Shift+Alt+7 | Ctrl+Shift+Alt+7 | ctrl+shift+alt+7 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit8 | 8 | 8 | 8 | 8 | | +| Shift+Digit8 | * | Shift+8 | Shift+8 | shift+8 | | +| Ctrl+Alt+Digit8 | ₽ | Ctrl+Alt+8 | Ctrl+Alt+8 | ctrl+alt+8 | | +| Ctrl+Shift+Alt+Digit8 | --- | Ctrl+Shift+Alt+8 | Ctrl+Shift+Alt+8 | ctrl+shift+alt+8 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit9 | 9 | 9 | 9 | 9 | | +| Shift+Digit9 | ( | Shift+9 | Shift+9 | shift+9 | | +| Ctrl+Alt+Digit9 | --- | Ctrl+Alt+9 | Ctrl+Alt+9 | ctrl+alt+9 | | +| Ctrl+Shift+Alt+Digit9 | --- | Ctrl+Shift+Alt+9 | Ctrl+Shift+Alt+9 | ctrl+shift+alt+9 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Digit0 | 0 | 0 | 0 | 0 | | +| Shift+Digit0 | ) | Shift+0 | Shift+0 | shift+0 | | +| Ctrl+Alt+Digit0 | --- | Ctrl+Alt+0 | Ctrl+Alt+0 | ctrl+alt+0 | | +| Ctrl+Shift+Alt+Digit0 | --- | Ctrl+Shift+Alt+0 | Ctrl+Shift+Alt+0 | ctrl+shift+alt+0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Minus | - | - | - | oem_minus | NO | +| Shift+Minus | _ | Shift+- | Shift+- | shift+oem_minus | NO | +| Ctrl+Alt+Minus | --- | Ctrl+Alt+- | Ctrl+Alt+- | ctrl+alt+oem_minus | NO | +| Ctrl+Shift+Alt+Minus | --- | Ctrl+Shift+Alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+oem_minus | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Equal | = | = | = | oem_plus | NO | +| Shift+Equal | + | Shift+= | Shift+= | shift+oem_plus | NO | +| Ctrl+Alt+Equal | --- | Ctrl+Alt+= | Ctrl+Alt+= | ctrl+alt+oem_plus | NO | +| Ctrl+Shift+Alt+Equal | --- | Ctrl+Shift+Alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+oem_plus | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketLeft | Ñ… | [ | Ñ… | oem_4 | NO | +| Shift+BracketLeft | Ð¥ | Shift+[ | Shift+Ñ… | shift+oem_4 | NO | +| Ctrl+Alt+BracketLeft | --- | Ctrl+Alt+[ | Ctrl+Alt+Ñ… | ctrl+alt+oem_4 | NO | +| Ctrl+Shift+Alt+BracketLeft | --- | Ctrl+Shift+Alt+[ | Ctrl+Shift+Alt+Ñ… | ctrl+shift+alt+oem_4 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| BracketRight | ÑŠ | ] | ÑŠ | oem_6 | NO | +| Shift+BracketRight | Ъ | Shift+] | Shift+ÑŠ | shift+oem_6 | NO | +| Ctrl+Alt+BracketRight | --- | Ctrl+Alt+] | Ctrl+Alt+ÑŠ | ctrl+alt+oem_6 | NO | +| Ctrl+Shift+Alt+BracketRight | --- | Ctrl+Shift+Alt+] | Ctrl+Shift+Alt+ÑŠ | ctrl+shift+alt+oem_6 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backslash | \ | \ | \ | oem_5 | NO | +| Shift+Backslash | / | Shift+\ | Shift+\ | shift+oem_5 | NO | +| Ctrl+Alt+Backslash | --- | Ctrl+Alt+\ | Ctrl+Alt+\ | ctrl+alt+oem_5 | NO | +| Ctrl+Shift+Alt+Backslash | --- | Ctrl+Shift+Alt+\ | Ctrl+Shift+Alt+\ | ctrl+shift+alt+oem_5 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlHash | --- | null | null | null | NO | +| Shift+IntlHash | --- | null | null | null | NO | +| Ctrl+Alt+IntlHash | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlHash | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| Semicolon | ж | ; | ж | oem_1 | NO | +| Shift+Semicolon | Ж | Shift+; | Shift+ж | shift+oem_1 | NO | +| Ctrl+Alt+Semicolon | --- | Ctrl+Alt+; | Ctrl+Alt+ж | ctrl+alt+oem_1 | NO | +| Ctrl+Shift+Alt+Semicolon | --- | Ctrl+Shift+Alt+; | Ctrl+Shift+Alt+ж | ctrl+shift+alt+oem_1 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Quote | Ñ | ' | Ñ | oem_7 | NO | +| Shift+Quote | Э | Shift+' | Shift+Ñ | shift+oem_7 | NO | +| Ctrl+Alt+Quote | --- | Ctrl+Alt+' | Ctrl+Alt+Ñ | ctrl+alt+oem_7 | NO | +| Ctrl+Shift+Alt+Quote | --- | Ctrl+Shift+Alt+' | Ctrl+Shift+Alt+Ñ | ctrl+shift+alt+oem_7 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Backquote | Ñ‘ | ` | Ñ‘ | oem_3 | NO | +| Shift+Backquote | Ð | Shift+` | Shift+Ñ‘ | shift+oem_3 | NO | +| Ctrl+Alt+Backquote | --- | Ctrl+Alt+` | Ctrl+Alt+Ñ‘ | ctrl+alt+oem_3 | NO | +| Ctrl+Shift+Alt+Backquote | --- | Ctrl+Shift+Alt+` | Ctrl+Shift+Alt+Ñ‘ | ctrl+shift+alt+oem_3 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Comma | б | , | б | oem_comma | NO | +| Shift+Comma | Б | Shift+, | Shift+б | shift+oem_comma | NO | +| Ctrl+Alt+Comma | --- | Ctrl+Alt+, | Ctrl+Alt+б | ctrl+alt+oem_comma | NO | +| Ctrl+Shift+Alt+Comma | --- | Ctrl+Shift+Alt+, | Ctrl+Shift+Alt+б | ctrl+shift+alt+oem_comma | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Period | ÑŽ | . | ÑŽ | oem_period | NO | +| Shift+Period | Ю | Shift+. | Shift+ÑŽ | shift+oem_period | NO | +| Ctrl+Alt+Period | --- | Ctrl+Alt+. | Ctrl+Alt+ÑŽ | ctrl+alt+oem_period | NO | +| Ctrl+Shift+Alt+Period | --- | Ctrl+Shift+Alt+. | Ctrl+Shift+Alt+ÑŽ | ctrl+shift+alt+oem_period | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| Slash | . | / | . | oem_2 | NO | +| Shift+Slash | , | Shift+/ | Shift+. | shift+oem_2 | NO | +| Ctrl+Alt+Slash | --- | Ctrl+Alt+/ | Ctrl+Alt+. | ctrl+alt+oem_2 | NO | +| Ctrl+Shift+Alt+Slash | --- | Ctrl+Shift+Alt+/ | Ctrl+Shift+Alt+. | ctrl+shift+alt+oem_2 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG | +----------------------------------------------------------------------------------------------------------------------------------------- +| ArrowUp | --- | UpArrow | UpArrow | up | | +| Shift+ArrowUp | --- | Shift+UpArrow | Shift+UpArrow | shift+up | | +| Ctrl+Alt+ArrowUp | --- | Ctrl+Alt+UpArrow | Ctrl+Alt+UpArrow | ctrl+alt+up | | +| Ctrl+Shift+Alt+ArrowUp | --- | Ctrl+Shift+Alt+UpArrow | Ctrl+Shift+Alt+UpArrow | ctrl+shift+alt+up | | +----------------------------------------------------------------------------------------------------------------------------------------- +| Numpad0 | --- | NumPad0 | NumPad0 | numpad0 | | +| Shift+Numpad0 | --- | Shift+NumPad0 | Shift+NumPad0 | shift+numpad0 | | +| Ctrl+Alt+Numpad0 | --- | Ctrl+Alt+NumPad0 | Ctrl+Alt+NumPad0 | ctrl+alt+numpad0 | | +| Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlBackslash | \ | OEM_102 | \ | oem_102 | NO | +| Shift+IntlBackslash | / | Shift+OEM_102 | Shift+\ | shift+oem_102 | NO | +| Ctrl+Alt+IntlBackslash | --- | Ctrl+Alt+OEM_102 | Ctrl+Alt+\ | ctrl+alt+oem_102 | NO | +| Ctrl+Shift+Alt+IntlBackslash | --- | Ctrl+Shift+Alt+OEM_102 | Ctrl+Shift+Alt+\ | ctrl+shift+alt+oem_102 | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlRo | --- | null | null | null | NO | +| Shift+IntlRo | --- | null | null | null | NO | +| Ctrl+Alt+IntlRo | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlRo | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- +| IntlYen | --- | null | null | null | NO | +| Shift+IntlYen | --- | null | null | null | NO | +| Ctrl+Alt+IntlYen | --- | null | null | null | NO | +| Ctrl+Shift+Alt+IntlYen | --- | null | null | null | NO | +----------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts index e5304ffae29..f66d60bf206 100644 --- a/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts @@ -14,9 +14,9 @@ import { ScanCodeBinding, ScanCode } from 'vs/workbench/services/keybinding/comm const WRITE_FILE_IF_DIFFERENT = false; -function createKeyboardMapper(file: string): TPromise { +function createKeyboardMapper(isUSStandard: boolean, file: string): TPromise { return readRawMapping(file).then((rawMappings) => { - return new WindowsKeyboardMapper(rawMappings); + return new WindowsKeyboardMapper(isUSStandard, rawMappings); }); } @@ -29,7 +29,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { let mapper: WindowsKeyboardMapper; suiteSetup((done) => { - createKeyboardMapper('win_de_ch').then((_mapper) => { + createKeyboardMapper(false, 'win_de_ch').then((_mapper) => { mapper = _mapper; done(); }, done); @@ -46,16 +46,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+A', ariaLabel: 'Control+A', - labelWithoutModifiers: 'A', - ariaLabelWithoutModifiers: 'A', electronAccelerator: 'Ctrl+A', userSettingsLabel: 'ctrl+a', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+A', null], }] ); @@ -68,16 +62,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Z', null], }] ); @@ -97,16 +85,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { { label: 'Ctrl+Z', ariaLabel: 'Control+Z', - labelWithoutModifiers: 'Z', - ariaLabelWithoutModifiers: 'Z', electronAccelerator: 'Ctrl+Z', userSettingsLabel: 'ctrl+z', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Z', null], } ); @@ -119,16 +101,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+^', ariaLabel: 'Control+^', - labelWithoutModifiers: '^', - ariaLabelWithoutModifiers: '^', electronAccelerator: 'Ctrl+]', - userSettingsLabel: 'ctrl+]', + userSettingsLabel: 'ctrl+oem_6', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+]', null], }] ); @@ -148,16 +124,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { { label: 'Ctrl+^', ariaLabel: 'Control+^', - labelWithoutModifiers: '^', - ariaLabelWithoutModifiers: '^', electronAccelerator: 'Ctrl+]', - userSettingsLabel: 'ctrl+]', + userSettingsLabel: 'ctrl+oem_6', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+]', null], } ); @@ -170,16 +140,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Shift+^', ariaLabel: 'Shift+^', - labelWithoutModifiers: '^', - ariaLabelWithoutModifiers: '^', electronAccelerator: 'Shift+]', - userSettingsLabel: 'shift+]', + userSettingsLabel: 'shift+oem_6', isWYSIWYG: false, isChord: false, - hasCtrlModifier: false, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['shift+]', null], }] ); @@ -192,16 +156,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+§', ariaLabel: 'Control+§', - labelWithoutModifiers: '§', - ariaLabelWithoutModifiers: '§', electronAccelerator: 'Ctrl+/', - userSettingsLabel: 'ctrl+/', + userSettingsLabel: 'ctrl+oem_2', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+/', null], }] ); @@ -214,16 +172,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+Shift+§', ariaLabel: 'Control+Shift+§', - labelWithoutModifiers: '§', - ariaLabelWithoutModifiers: '§', electronAccelerator: 'Ctrl+Shift+/', - userSettingsLabel: 'ctrl+shift+/', + userSettingsLabel: 'ctrl+shift+oem_2', isWYSIWYG: false, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: true, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+shift+/', null], }] ); @@ -236,16 +188,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+K Ctrl+ä', ariaLabel: 'Control+K Control+ä', - labelWithoutModifiers: 'K ä', - ariaLabelWithoutModifiers: 'K ä', electronAccelerator: null, - userSettingsLabel: 'ctrl+k ctrl+\\', + userSettingsLabel: 'ctrl+k ctrl+oem_5', isWYSIWYG: false, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+K', 'ctrl+\\'], }] ); @@ -266,16 +212,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+DownArrow', ariaLabel: 'Control+DownArrow', - labelWithoutModifiers: 'DownArrow', - ariaLabelWithoutModifiers: 'DownArrow', electronAccelerator: 'Ctrl+Down', userSettingsLabel: 'ctrl+down', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+DownArrow', null], }] ); @@ -288,16 +228,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+NumPad0', ariaLabel: 'Control+NumPad0', - labelWithoutModifiers: 'NumPad0', - ariaLabelWithoutModifiers: 'NumPad0', electronAccelerator: null, userSettingsLabel: 'ctrl+numpad0', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+NumPad0', null], }] ); @@ -310,16 +244,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Home', null], }] ); @@ -339,16 +267,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { { label: 'Ctrl+Home', ariaLabel: 'Control+Home', - labelWithoutModifiers: 'Home', - ariaLabelWithoutModifiers: 'Home', electronAccelerator: 'Ctrl+Home', userSettingsLabel: 'ctrl+home', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+Home', null], } ); @@ -362,16 +284,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+, Ctrl+§', ariaLabel: 'Control+, Control+§', - labelWithoutModifiers: ', §', - ariaLabelWithoutModifiers: ', §', electronAccelerator: null, - userSettingsLabel: 'ctrl+, ctrl+/', + userSettingsLabel: 'ctrl+oem_comma ctrl+oem_2', isWYSIWYG: false, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+,', 'ctrl+/'], }] ); @@ -391,16 +307,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); @@ -412,7 +322,7 @@ suite('keyboardMapper - WINDOWS en_us', () => { let mapper: WindowsKeyboardMapper; suiteSetup((done) => { - createKeyboardMapper('win_en_us').then((_mapper) => { + createKeyboardMapper(true, 'win_en_us').then((_mapper) => { mapper = _mapper; done(); }, done); @@ -429,16 +339,10 @@ suite('keyboardMapper - WINDOWS en_us', () => { [{ label: 'Ctrl+K Ctrl+\\', ariaLabel: 'Control+K Control+\\', - labelWithoutModifiers: 'K \\', - ariaLabelWithoutModifiers: 'K \\', electronAccelerator: null, userSettingsLabel: 'ctrl+k ctrl+\\', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+K', 'ctrl+\\'], }] ); @@ -452,16 +356,10 @@ suite('keyboardMapper - WINDOWS en_us', () => { [{ label: 'Ctrl+, Ctrl+/', ariaLabel: 'Control+, Control+/', - labelWithoutModifiers: ', /', - ariaLabelWithoutModifiers: ', /', electronAccelerator: null, userSettingsLabel: 'ctrl+, ctrl+/', isWYSIWYG: true, isChord: true, - hasCtrlModifier: false, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+,', 'ctrl+/'], }] ); @@ -475,16 +373,10 @@ suite('keyboardMapper - WINDOWS en_us', () => { [{ label: 'Ctrl+,', ariaLabel: 'Control+,', - labelWithoutModifiers: ',', - ariaLabelWithoutModifiers: ',', electronAccelerator: 'Ctrl+,', userSettingsLabel: 'ctrl+,', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+,', null], }] ); @@ -504,25 +396,113 @@ suite('keyboardMapper - WINDOWS en_us', () => { { label: 'Ctrl+', ariaLabel: 'Control+', - labelWithoutModifiers: '', - ariaLabelWithoutModifiers: '', electronAccelerator: null, userSettingsLabel: 'ctrl+', isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: [null, null], } ); }); }); -suite('misc', () => { +suite('keyboardMapper - WINDOWS por_ptb', () => { + + let mapper: WindowsKeyboardMapper; + + suiteSetup((done) => { + createKeyboardMapper(false, 'win_por_ptb').then((_mapper) => { + mapper = _mapper; + done(); + }, done); + }); + + test('mapping', (done) => { + assertMapping(WRITE_FILE_IF_DIFFERENT, mapper, 'win_por_ptb.txt', done); + }); + + test('resolveKeyboardEvent Ctrl+[IntlRo]', () => { + assertResolveKeyboardEvent( + mapper, + { + ctrlKey: true, + shiftKey: false, + altKey: false, + metaKey: false, + keyCode: KeyCode.ABNT_C1, + code: null + }, + { + label: 'Ctrl+/', + ariaLabel: 'Control+/', + electronAccelerator: 'Ctrl+ABNT_C1', + userSettingsLabel: 'ctrl+abnt_c1', + isWYSIWYG: false, + isChord: false, + dispatchParts: ['ctrl+ABNT_C1', null], + } + ); + }); + + test('resolveKeyboardEvent Ctrl+[NumpadComma]', () => { + assertResolveKeyboardEvent( + mapper, + { + ctrlKey: true, + shiftKey: false, + altKey: false, + metaKey: false, + keyCode: KeyCode.ABNT_C2, + code: null + }, + { + label: 'Ctrl+.', + ariaLabel: 'Control+.', + electronAccelerator: 'Ctrl+ABNT_C2', + userSettingsLabel: 'ctrl+abnt_c2', + isWYSIWYG: false, + isChord: false, + dispatchParts: ['ctrl+ABNT_C2', null], + } + ); + }); +}); + +suite('keyboardMapper - WINDOWS ru', () => { + + let mapper: WindowsKeyboardMapper; + + suiteSetup((done) => { + createKeyboardMapper(false, 'win_ru').then((_mapper) => { + mapper = _mapper; + done(); + }, done); + }); + + test('mapping', (done) => { + assertMapping(WRITE_FILE_IF_DIFFERENT, mapper, 'win_ru.txt', done); + }); + + test('issue ##24361: resolveKeybinding Ctrl+K Ctrl+K', () => { + _assertResolveKeybinding( + mapper, + KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K), + [{ + label: 'Ctrl+K Ctrl+K', + ariaLabel: 'Control+K Control+K', + electronAccelerator: null, + userSettingsLabel: 'ctrl+k ctrl+k', + isWYSIWYG: true, + isChord: true, + dispatchParts: ['ctrl+K', 'ctrl+K'], + }] + ); + }); +}); + +suite('keyboardMapper - misc', () => { test('issue #23513: Toggle Sidebar Visibility and Go to Line display same key mapping in Arabic keyboard', () => { - const mapper = new WindowsKeyboardMapper({ + const mapper = new WindowsKeyboardMapper(false, { 'KeyB': { 'vkey': 'VK_B', 'value': 'لا', @@ -543,18 +523,12 @@ suite('misc', () => { mapper, KeyMod.CtrlCmd | KeyCode.KEY_B, [{ - label: 'Ctrl+لا', - ariaLabel: 'Control+لا', - labelWithoutModifiers: 'لا', - ariaLabelWithoutModifiers: 'لا', + label: 'Ctrl+B', + ariaLabel: 'Control+B', electronAccelerator: 'Ctrl+B', userSettingsLabel: 'ctrl+b', - isWYSIWYG: false, + isWYSIWYG: true, isChord: false, - hasCtrlModifier: true, - hasShiftModifier: false, - hasAltModifier: false, - hasMetaModifier: false, dispatchParts: ['ctrl+B', null], }] ); diff --git a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts index 105a9d202af..3cf631de01a 100644 --- a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts +++ b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts @@ -7,26 +7,45 @@ import { TPromise } from 'vs/base/common/winjs.base'; import Severity from 'vs/base/common/severity'; import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { ILifecycleService, ShutdownEvent, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; +import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { IMessageService } from 'vs/platform/message/common/message'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; import { ipcRenderer as ipc } from 'electron'; import Event, { Emitter } from 'vs/base/common/event'; export class LifecycleService implements ILifecycleService { + private static readonly _lastShutdownReasonKey = 'lifecyle.lastShutdownReason'; + public _serviceBrand: any; - private _onWillShutdown = new Emitter(); - private _onShutdown = new Emitter(); + private readonly _onWillShutdown = new Emitter(); + private readonly _onShutdown = new Emitter(); + private readonly _startupKind: StartupKind; private _willShutdown: boolean; constructor( - @IMessageService private messageService: IMessageService, - @IWindowIPCService private windowService: IWindowIPCService + @IMessageService private _messageService: IMessageService, + @IWindowIPCService private _windowService: IWindowIPCService, + @IStorageService private _storageService: IStorageService ) { - this.registerListeners(); + this._registerListeners(); + + const lastShutdownReason = this._storageService.getInteger(LifecycleService._lastShutdownReasonKey, StorageScope.WORKSPACE); + this._storageService.remove(LifecycleService._lastShutdownReasonKey, StorageScope.WORKSPACE); + if (lastShutdownReason === ShutdownReason.RELOAD) { + this._startupKind = StartupKind.ReloadedWindow; + } else if (lastShutdownReason === ShutdownReason.LOAD) { + this._startupKind = StartupKind.ReopenedWindow; + } else { + this._startupKind = StartupKind.NewWindow; + } + } + + public get startupKind(): StartupKind { + return this._startupKind; } public get willShutdown(): boolean { @@ -41,16 +60,18 @@ export class LifecycleService implements ILifecycleService { return this._onShutdown.event; } - private registerListeners(): void { - const windowId = this.windowService.getWindowId(); + private _registerListeners(): void { + const windowId = this._windowService.getWindowId(); // Main side indicates that window is about to unload, check for vetos ipc.on('vscode:beforeUnload', (event, reply: { okChannel: string, cancelChannel: string, reason: ShutdownReason }) => { this._willShutdown = true; + this._storageService.store(LifecycleService._lastShutdownReasonKey, JSON.stringify(reply.reason), StorageScope.WORKSPACE); // trigger onWillShutdown events and veto collecting this.onBeforeUnload(reply.reason).done(veto => { if (veto) { + this._storageService.remove(LifecycleService._lastShutdownReasonKey, StorageScope.WORKSPACE); this._willShutdown = false; // reset this flag since the shutdown has been vetoed! ipc.send(reply.cancelChannel, windowId); } else { @@ -92,11 +113,11 @@ export class LifecycleService implements ILifecycleService { } }, err => { // error, treated like a veto, done - this.messageService.show(Severity.Error, toErrorMessage(err)); + this._messageService.show(Severity.Error, toErrorMessage(err)); lazyValue = true; })); } } return TPromise.join(promises).then(() => lazyValue); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/message/electron-browser/messageService.ts b/src/vs/workbench/services/message/electron-browser/messageService.ts index 607db7a5253..811ba46eb10 100644 --- a/src/vs/workbench/services/message/electron-browser/messageService.ts +++ b/src/vs/workbench/services/message/electron-browser/messageService.ts @@ -26,17 +26,24 @@ export class MessageService extends WorkbenchMessageService implements IChoiceSe } public confirm(confirmation: IConfirmation): boolean { - if (!confirmation.primaryButton) { - confirmation.primaryButton = nls.localize({ key: 'yesButton', comment: ['&& denotes a mnemonic'] }, "&&Yes"); + + const buttons: string[] = []; + if (confirmation.primaryButton) { + buttons.push(confirmation.primaryButton); + } else { + buttons.push(nls.localize({ key: 'yesButton', comment: ['&& denotes a mnemonic'] }, "&&Yes")); } - if (!confirmation.secondaryButton) { - confirmation.secondaryButton = nls.localize('cancelButton', "Cancel"); + + if (confirmation.secondaryButton) { + buttons.push(confirmation.secondaryButton); + } else if (typeof confirmation.secondaryButton === 'undefined') { + buttons.push(nls.localize('cancelButton', "Cancel")); } let opts: Electron.ShowMessageBoxOptions = { title: confirmation.title, message: confirmation.message, - buttons: [confirmation.primaryButton, confirmation.secondaryButton], + buttons, defaultId: 0, cancelId: 1 }; @@ -102,4 +109,4 @@ export class MessageService extends WorkbenchMessageService implements IChoiceSe return label.replace(/&&/g, '&'); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts index d70ff8bc2e2..b7f3b7ad4dc 100644 --- a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts @@ -6,6 +6,7 @@ import { EventEmitter } from 'events'; import * as path from 'path'; +import { StringDecoder, NodeStringDecoder } from 'string_decoder'; import * as cp from 'child_process'; import { rgPath } from 'vscode-ripgrep'; @@ -174,11 +175,13 @@ export class RipgrepParser extends EventEmitter { private fileMatch: FileMatch; private remainder: string; private isDone: boolean; + private stringDecoder: NodeStringDecoder; private numResults = 0; constructor(private maxResults: number, private rootFolder: string) { super(); + this.stringDecoder = new StringDecoder(); } public cancel(): void { @@ -186,16 +189,23 @@ export class RipgrepParser extends EventEmitter { } public flush(): void { + this.handleDecodedData(this.stringDecoder.end()); + if (this.fileMatch) { this.onResult(); } } - public handleData(data: string | Buffer): void { + public handleData(data: Buffer | string): void { + const dataStr = typeof data === 'string' ? data : this.stringDecoder.write(data); + this.handleDecodedData(dataStr); + } + + private handleDecodedData(decodedData: string): void { // If the previous data chunk didn't end in a newline, prepend it to this chunk const dataStr = this.remainder ? - this.remainder + data.toString() : - data.toString(); + this.remainder + decodedData : + decodedData; const dataLines: string[] = dataStr.split(/\r\n|\n/); this.remainder = dataLines[dataLines.length - 1] ? dataLines.pop() : null; @@ -225,7 +235,7 @@ export class RipgrepParser extends EventEmitter { this.onResult(); } - this.fileMatch = new FileMatch(path.join(this.rootFolder, r[1])); + this.fileMatch = new FileMatch(path.isAbsolute(r[1]) ? r[1] : path.join(this.rootFolder, r[1])); } else { // Line is empty (or malformed) } @@ -428,6 +438,13 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.I args.push('--encoding', encoding.toCanonicalName(config.fileEncoding)); } + // Ripgrep handles -- as a -- arg separator. Only --. + // - is ok, --- is ok, --some-flag is handled as query text. Need to special case. + if (config.contentPattern.pattern === '--') { + config.contentPattern.isRegExp = true; + config.contentPattern.pattern = '\\-\\-'; + } + let searchPatternAfterDoubleDashes: string; if (config.contentPattern.isWordMatch) { const regexp = strings.createRegExp(config.contentPattern.pattern, config.contentPattern.isRegExp, { wholeWord: config.contentPattern.isWordMatch }); @@ -454,6 +471,8 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.I args.push('./'); } + args.push(...config.extraFiles); + return { args, siblingClauses }; } diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index dbdec9c59cc..1c2d62c29d1 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -135,7 +135,7 @@ export class SearchService implements ISearchService { } // Use editor API to find matches - let matches = model.findMatches(query.contentPattern.pattern, false, query.contentPattern.isRegExp, query.contentPattern.isCaseSensitive, query.contentPattern.isWordMatch, false, query.maxResults); + let matches = model.findMatches(query.contentPattern.pattern, false, query.contentPattern.isRegExp, query.contentPattern.isCaseSensitive, query.contentPattern.isWordMatch ? query.contentPattern.wordSeparators : null, false, query.maxResults); if (matches.length) { let fileMatch = new FileMatch(resource); localResults.set(resource, fileMatch); @@ -200,12 +200,12 @@ export class DiskSearch { private raw: IRawSearchService; - constructor(verboseLogging: boolean) { + constructor(verboseLogging: boolean, timeout: number = 60 * 60 * 1000) { const client = new Client( uri.parse(require.toUrl('bootstrap')).fsPath, { serverName: 'Search', - timeout: 60 * 60 * 1000, + timeout: timeout, args: ['--type=searchService'], env: { AMD_ENTRYPOINT: 'vs/workbench/services/search/node/searchApp', diff --git a/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts b/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts index 2f377d82d27..87a27629eaf 100644 --- a/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts +++ b/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts @@ -33,7 +33,11 @@ suite('RipgrepParser', () => { return matchLine; } - function parseInput(inputChunks: string[]): ISerializedFileMatch[] { + function parseInputStrings(inputChunks: string[]): ISerializedFileMatch[] { + return parseInput(inputChunks.map(chunk => new Buffer(chunk))); + } + + function parseInput(inputChunks: Buffer[]): ISerializedFileMatch[] { const matches: ISerializedFileMatch[] = []; const rgp = new RipgrepParser(1e6, rootFolder); rgp.on('result', (match: ISerializedFileMatch) => { @@ -65,7 +69,7 @@ suite('RipgrepParser', () => { [getFileLine('a.txt'), getMatchLine(1, ['before', 'match', 'after']), getMatchLine(2, ['before', 'match', 'after']), fileSectionEnd].join('\n') ]; - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 1); assert.deepEqual(results[0], { @@ -93,7 +97,7 @@ suite('RipgrepParser', () => { [getFileLine('c.txt'), getMatchLine(1, ['before', 'match', 'after']), getMatchLine(2, ['before', 'match', 'after']), fileSectionEnd].join('\n') ]; - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -116,7 +120,7 @@ suite('RipgrepParser', () => { test('Parses multiple chunks broken at each line', () => { const input = singleLineChunks.map(chunk => chunk + '\n'); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -126,7 +130,7 @@ suite('RipgrepParser', () => { .map(chunk => chunk + '\n') .map(halve)); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -136,7 +140,7 @@ suite('RipgrepParser', () => { .map(chunk => chunk + '\n') .map(arrayOfChars)); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -145,8 +149,26 @@ suite('RipgrepParser', () => { const input = singleLineChunks .map(chunk => '\n' + chunk); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); + + test('Parses chunks broken in the middle of a multibyte character', () => { + const multibyteStr = 'æ¼¢'; + const multibyteBuf = new Buffer(multibyteStr); + const text = getFileLine('foo/bar') + '\n' + getMatchLine(0, ['before', 'match', 'after']) + '\n'; + + // Split the multibyte char into two pieces and divide between the two buffers + const beforeIndex = 24; + const inputBufs = [ + Buffer.concat([new Buffer(text.substr(0, beforeIndex)), multibyteBuf.slice(0, 2)]), + Buffer.concat([multibyteBuf.slice(2), new Buffer(text.substr(beforeIndex))]) + ]; + + const results = parseInput(inputBufs); + assert.equal(results.length, 1); + assert.equal(results[0].lineMatches.length, 1); + assert.deepEqual(results[0].lineMatches[0].offsetAndLengths, [[7, 5]]); + }); }); \ No newline at end of file diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 234b9c8cc2d..eb3a76b87b1 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -18,11 +18,13 @@ import diagnostics = require('vs/base/common/diagnostics'); import types = require('vs/base/common/types'); import { IMode } from 'vs/editor/common/modes'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITextFileService, IAutoSaveConfiguration, ModelState, ITextFileEditorModel, IModelSaveOptions, ISaveErrorHandler, ISaveParticipant, StateChange, SaveReason, IRawTextContent } from 'vs/workbench/services/textfile/common/textfiles'; import { EncodingMode, EditorModel } from 'vs/workbench/common/editor'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { IBackupFileService, BACKUP_FILE_RESOLVE_OPTIONS } from 'vs/workbench/services/backup/common/backup'; -import { IFileService, IFileStat, IFileOperationResult, FileOperationResult, IContent, CONTENT_CHANGE_EVENT_BUFFER_DELAY, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files'; +import { IFileService, IFileStat, IFileOperationResult, FileOperationResult, IContent, CONTENT_CHANGE_EVENT_BUFFER_DELAY, FileChangesEvent, FileChangeType, isEqualOrParent } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -81,7 +83,9 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil @IInstantiationService private instantiationService: IInstantiationService, @ITelemetryService private telemetryService: ITelemetryService, @ITextFileService private textFileService: ITextFileService, - @IBackupFileService private backupFileService: IBackupFileService + @IBackupFileService private backupFileService: IBackupFileService, + @IEnvironmentService private environmentService: IEnvironmentService, + @IWorkspaceContextService private contextService: IWorkspaceContextService ) { super(modelService, modeService); @@ -665,7 +669,13 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil diag(`doSave(${versionId}) - after updateContent()`, this.resource, new Date()); // Telemetry - this.telemetryService.publicLog('filePUT', { mimeType: guessMimeTypes(this.resource.fsPath).join(', '), ext: paths.extname(this.lastResolvedDiskStat.resource.fsPath) }); + if ((this.contextService.getWorkspace() && isEqualOrParent(this.resource.fsPath, this.contextService.toResource('.vscode').fsPath)) || + this.resource.fsPath === this.environmentService.appSettingsPath) { + // Do not log write to user settings.json and .vscode folder as a filePUT event as it ruins our JSON usage data + this.telemetryService.publicLog('settingsWritten'); + } else { + this.telemetryService.publicLog('filePUT', { mimeType: guessMimeTypes(this.resource.fsPath).join(', '), ext: paths.extname(this.lastResolvedDiskStat.resource.fsPath) }); + } // Update dirty state unless model has changed meanwhile if (versionId === this.versionId) { diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts index 26093f69f55..f182c1494c8 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts @@ -20,6 +20,7 @@ import { Extensions, IColorRegistry, ColorIdentifier, editorBackground, editorFo import { ThemeType } from 'vs/platform/theme/common/themeService'; import { Registry } from 'vs/platform/platform'; import { WorkbenchThemeService, IColorCustomizations } from "vs/workbench/services/themes/electron-browser/workbenchThemeService"; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; let colorRegistry = Registry.as(Extensions.ColorContribution); @@ -32,7 +33,6 @@ export class ColorThemeData implements IColorTheme { label: string; settingsId: string; description?: string; - selector: string; tokenColors?: ITokenColorizationRule[]; isLoaded: boolean; path?: string; @@ -56,13 +56,8 @@ export class ColorThemeData implements IColorTheme { return colorRegistry.resolveDefaultColor(colorId, this); } - public isDefault(colorId: ColorIdentifier): boolean { - let color = this.colorMap[colorId]; - if (types.isUndefined(color)) { - return true; - } - let defaultValue = this.getDefault(colorId); - return color === null ? defaultValue === null : color.equals(defaultValue); + public defines(colorId: ColorIdentifier): boolean { + return this.customColorMap.hasOwnProperty(colorId) || this.colorMap.hasOwnProperty(colorId); } public setCustomColors(colors: IColorCustomizations) { @@ -115,7 +110,7 @@ export class ColorThemeData implements IColorTheme { id: this.id, label: this.label, settingsId: this.settingsId, - selector: this.selector, + selector: this.id.split(' ').join('.'), // to not break old clients tokenColors: this.tokenColors, extensionData: this.extensionData, colorMap: colorMapData @@ -164,7 +159,6 @@ export function fromExtensionTheme(theme: IThemeExtensionPoint, normalizedAbsolu themeData.id = `${baseTheme} ${themeSelector}`; themeData.label = theme.label || Paths.basename(theme.path); themeData.settingsId = theme.id || themeData.label; - themeData.selector = `${baseTheme}.${themeSelector}`; themeData.description = theme.description; themeData.path = normalizedAbsolutePath; themeData.extensionData = extensionData; @@ -186,7 +180,7 @@ function _loadColorThemeFromFile(themePath: string, resultRules: ITokenColorizat let errors: Json.ParseError[] = []; let contentValue = Json.parse(content.toString(), errors); if (errors.length > 0) { - return TPromise.wrapError(new Error(nls.localize('error.cannotparsejson', "Problems parsing JSON theme file: {0}", errors.map(e => Json.getParseErrorMessage(e.error)).join(', ')))); + return TPromise.wrapError(new Error(nls.localize('error.cannotparsejson', "Problems parsing JSON theme file: {0}", errors.map(e => getParseErrorMessage(e.error)).join(', ')))); } let includeCompletes = TPromise.as(null); if (contentValue.include) { diff --git a/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts b/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts index 0f840bfd95f..519c2797b97 100644 --- a/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts +++ b/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts @@ -10,7 +10,6 @@ import * as colorRegistry from 'vs/platform/theme/common/colorRegistry'; import * as editorColorRegistry from 'vs/editor/common/view/editorColorRegistry'; import * as wordHighlighter from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; import { ansiColorIdentifiers } from 'vs/workbench/parts/terminal/electron-browser/terminalColorRegistry'; -import { editorHoverHighlight } from 'vs/editor/contrib/hover/browser/hover'; import { peekViewEditorMatchHighlight, peekViewResultsMatchHighlight } from 'vs/editor/contrib/referenceSearch/browser/referencesWidget'; const settingToColorIdMapping: { [settingId: string]: string[] } = {}; @@ -56,7 +55,7 @@ addSettingMapping('inactiveSelection', colorRegistry.editorInactiveSelection); addSettingMapping('selectionHighlightColor', colorRegistry.editorSelectionHighlight); addSettingMapping('findMatchHighlight', colorRegistry.editorFindMatchHighlight); addSettingMapping('currentFindMatchHighlight', colorRegistry.editorFindMatch); -addSettingMapping('hoverHighlight', editorHoverHighlight); +addSettingMapping('hoverHighlight', colorRegistry.editorHoverHighlight); addSettingMapping('wordHighlight', wordHighlighter.editorWordHighlight); addSettingMapping('wordHighlightStrong', wordHighlighter.editorWordHighlightStrong); addSettingMapping('findRangeHighlight', colorRegistry.editorFindRangeHighlight); diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index afaaba898f8..4125a7a1ea8 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -39,6 +39,7 @@ import pfs = require('vs/base/node/pfs'); import colorThemeSchema = require('vs/workbench/services/themes/common/colorThemeSchema'); import fileIconThemeSchema = require('vs/workbench/services/themes/common/fileIconThemeSchema'); import { IDisposable } from 'vs/base/common/lifecycle'; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; // implementation @@ -50,6 +51,7 @@ const PERSISTED_THEME_STORAGE_KEY = 'colorThemeData'; const defaultThemeExtensionId = 'vscode-theme-defaults'; const oldDefaultThemeExtensionId = 'vscode-theme-colorful-defaults'; +const DEFAULT_ICON_THEME_SETTING_VALUE = 'vs-seti'; const fileIconsEnabledClass = 'file-icons-enabled'; const themingRegistry = Registry.as(ThemingExtensions.ThemingContribution); @@ -245,7 +247,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { let initialTheme = new ColorThemeData(); initialTheme.id = isLightTheme ? VS_LIGHT_THEME : VS_DARK_THEME; initialTheme.label = ''; - initialTheme.selector = isLightTheme ? VS_LIGHT_THEME : VS_DARK_THEME; initialTheme.settingsId = null; initialTheme.isLoaded = false; initialTheme.tokenColors = [{ settings: {} }]; @@ -396,10 +397,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { themeId = validateThemeId(themeId); // migrate theme ids - if (this.themingParticipantChangeListener) { - this.themingParticipantChangeListener.dispose(); - this.themingParticipantChangeListener = null; - } return this.findThemeData(themeId, DEFAULT_THEME_ID).then(themeData => { if (themeData) { @@ -407,6 +404,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { if (themeId === this.currentColorTheme.id && !this.currentColorTheme.isLoaded && this.currentColorTheme.hasEqualData(themeData)) { // the loaded theme is identical to the perisisted theme. Don't need to send an event. this.currentColorTheme = themeData; + themeData.setCustomColors(this.colorCustomizations); return TPromise.as(themeData); } themeData.setCustomColors(this.colorCustomizations); @@ -445,7 +443,9 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { $(this.container).addClass(newTheme.id); } this.currentColorTheme = newTheme; - this.themingParticipantChangeListener = themingRegistry.onThemingParticipantAdded(p => this.updateDynamicCSSRules(this.currentColorTheme)); + if (!this.themingParticipantChangeListener) { + this.themingParticipantChangeListener = themingRegistry.onThemingParticipantAdded(p => this.updateDynamicCSSRules(this.currentColorTheme)); + } this.sendTelemetry(newTheme.id, newTheme.extensionData, 'color'); @@ -752,7 +752,7 @@ function _loadIconThemeDocument(fileSetPath: string): TPromise 0) { - return TPromise.wrapError(new Error(nls.localize('error.cannotparseicontheme', "Problems parsing file icons file: {0}", errors.map(e => Json.getParseErrorMessage(e.error)).join(', ')))); + return TPromise.wrapError(new Error(nls.localize('error.cannotparseicontheme', "Problems parsing file icons file: {0}", errors.map(e => getParseErrorMessage(e.error)).join(', ')))); } return TPromise.as(contentValue); }); @@ -963,7 +963,7 @@ const colorThemeSettingSchema: IJSONSchema = { }; const iconThemeSettingSchema: IJSONSchema = { type: ['string', 'null'], - default: null, + default: DEFAULT_ICON_THEME_SETTING_VALUE, description: nls.localize('iconTheme', "Specifies the icon theme used in the workbench."), enum: [null], enumDescriptions: [nls.localize('noIconThemeDesc', 'No file icons')], diff --git a/src/vs/workbench/services/timer/common/timerService.ts b/src/vs/workbench/services/timer/common/timerService.ts index 16d9af30565..a02d7249cf9 100644 --- a/src/vs/workbench/services/timer/common/timerService.ts +++ b/src/vs/workbench/services/timer/common/timerService.ts @@ -30,6 +30,7 @@ export interface IStartupMetrics { ellapsedWorkbench: number; ellapsedTimersToTimersComputed: number; }; + timers2: { [name: string]: number }; platform: string; release: string; totalmem: number; diff --git a/src/vs/workbench/services/timer/node/timerService.ts b/src/vs/workbench/services/timer/node/timerService.ts index 4998e257ee1..ac011f4ca08 100644 --- a/src/vs/workbench/services/timer/node/timerService.ts +++ b/src/vs/workbench/services/timer/node/timerService.ts @@ -6,6 +6,7 @@ import { ITimerService, IStartupMetrics, IInitData, IMemoryInfo } from 'vs/workbench/services/timer/common/timerService'; import { virtualMachineHint } from 'vs/base/node/id'; +import { ticks } from 'vs/base/node/startupTimers'; import * as os from 'os'; @@ -35,13 +36,7 @@ export class TimerService implements ITimerService { public restoreViewletDuration: number; public restoreEditorsDuration: number; - public get startupMetrics(): IStartupMetrics { - if (!this._startupMetrics) { - this.computeStartupMetrics(); - } - return this._startupMetrics; - }; private _startupMetrics: IStartupMetrics; constructor(initData: IInitData, private isEmptyWorkbench: boolean) { @@ -56,7 +51,14 @@ export class TimerService implements ITimerService { this.hasAccessibilitySupport = initData.hasAccessibilitySupport; } - public computeStartupMetrics(): void { + get startupMetrics(): IStartupMetrics { + if (!this._startupMetrics) { + this._computeStartupMetrics(); + } + return this._startupMetrics; + } + + public _computeStartupMetrics(): void { const now = Date.now(); const initialStartup = !!this.isInitialStartup; const start = initialStartup ? this.start : this.windowLoad; @@ -88,6 +90,12 @@ export class TimerService implements ITimerService { console.error(error); // be on the safe side with these hardware method calls } + // fill in startup timers we have until now + const timers2: { [name: string]: number } = Object.create(null); + for (const tick of ticks()) { + timers2[tick.name] = tick.duration; + } + this._startupMetrics = { version: 1, ellapsed: this.workbenchStarted - start, @@ -101,6 +109,7 @@ export class TimerService implements ITimerService { ellapsedWindowLoadToRequire: this.beforeLoadWorkbenchMain - this.windowLoad, ellapsedTimersToTimersComputed: Date.now() - now }, + timers2, platform, release, totalmem, diff --git a/src/vs/workbench/test/browser/actionRegistry.test.ts b/src/vs/workbench/test/browser/actionRegistry.test.ts index 8fe4f7c8dd8..e9605ceacf6 100644 --- a/src/vs/workbench/test/browser/actionRegistry.test.ts +++ b/src/vs/workbench/test/browser/actionRegistry.test.ts @@ -10,7 +10,7 @@ import * as Platform from 'vs/platform/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actionRegistry'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { Action } from 'vs/base/common/actions'; diff --git a/src/vs/workbench/test/browser/editorStacksModel.test.ts b/src/vs/workbench/test/browser/editorStacksModel.test.ts index 9cc08d0d963..8d96c2e5c80 100644 --- a/src/vs/workbench/test/browser/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/editorStacksModel.test.ts @@ -6,8 +6,8 @@ 'use strict'; import * as assert from 'assert'; -import { EditorStacksModel, EditorGroup, GroupEvent } from 'vs/workbench/common/editor/editorStacksModel'; -import { EditorInput, IFileEditorInput, IEditorIdentifier, IEditorGroup, IStacksModelChangeEvent, IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory } from 'vs/workbench/common/editor'; +import { EditorStacksModel, EditorGroup, EditorCloseEvent } from 'vs/workbench/common/editor/editorStacksModel'; +import { EditorInput, IFileEditorInput, IEditorIdentifier, IEditorGroup, IStacksModelChangeEvent, IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory, IEditorCloseEvent } from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; import { TestStorageService, TestLifecycleService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; @@ -47,12 +47,14 @@ interface ModelEvents { renamed: IEditorGroup[]; disposed: IEditorIdentifier[]; changed: IStacksModelChangeEvent[]; + editorClosed: IEditorCloseEvent[]; + editorWillClose: IEditorCloseEvent[]; } interface GroupEvents { opened: EditorInput[]; activated: EditorInput[]; - closed: GroupEvent[]; + closed: EditorCloseEvent[]; pinned: EditorInput[]; unpinned: EditorInput[]; moved: EditorInput[]; @@ -66,7 +68,9 @@ function modelListener(model: EditorStacksModel): ModelEvents { moved: [], renamed: [], disposed: [], - changed: [] + changed: [], + editorClosed: [], + editorWillClose: [] }; model.onGroupOpened(g => modelEvents.opened.push(g)); @@ -76,6 +80,8 @@ function modelListener(model: EditorStacksModel): ModelEvents { model.onGroupRenamed(g => modelEvents.renamed.push(g)); model.onEditorDisposed(e => modelEvents.disposed.push(e)); model.onModelChanged(e => modelEvents.changed.push(e)); + model.onWillCloseEditor(e => modelEvents.editorWillClose.push(e)); + model.onEditorClosed(e => modelEvents.editorClosed.push(e)); return modelEvents; } @@ -1671,6 +1677,7 @@ suite('Editor Stacks Model', () => { test('Stack - Multiple Editors - Editor Disposed on Close', function () { const model = create(); + const events = modelListener(model); const group1 = model.openGroup('group1'); const group2 = model.openGroup('group2'); @@ -1687,6 +1694,13 @@ suite('Editor Stacks Model', () => { group1.closeEditor(input3); + assert.equal(events.editorClosed.length, 1); + assert.equal(events.editorClosed[0].editor, input3); + + assert.equal(events.editorWillClose.length, 1); + assert.equal(events.editorWillClose[0].editor, input3); + assert.equal(events.editorWillClose[0].group, group1); + assert.equal(input3.isDisposed(), true); group2.openEditor(input2, { pinned: true, active: true }); @@ -1695,18 +1709,38 @@ suite('Editor Stacks Model', () => { group1.closeEditor(input2); + assert.equal(events.editorClosed.length, 2); + assert.equal(events.editorClosed[1].editor, input2); + + assert.equal(events.editorWillClose.length, 2); + assert.equal(events.editorWillClose[1].editor, input2); + assert.equal(events.editorWillClose[1].group, group1); + assert.equal(input2.isDisposed(), false); group2.closeEditor(input2); + assert.equal(events.editorClosed.length, 3); + assert.equal(events.editorClosed[2].editor, input2); + + assert.equal(events.editorWillClose.length, 3); + assert.equal(events.editorWillClose[2].editor, input2); + assert.equal(events.editorWillClose[2].group, group2); + assert.equal(input2.isDisposed(), true); group1.closeAllEditors(); + assert.equal(events.editorClosed.length, 5); + assert.equal(events.editorWillClose.length, 5); + assert.equal(input4.isDisposed(), false); model.closeGroups(); + assert.equal(events.editorClosed.length, 7); + assert.equal(events.editorWillClose.length, 7); + assert.equal(input4.isDisposed(), true); }); diff --git a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts index 8571b4a3f0c..4050b580de0 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -6,17 +6,17 @@ 'use strict'; import * as assert from 'assert'; -import { BaseEditor, EditorInputAction, EditorInputActionContributor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { BaseEditor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, Extensions, IEditorRegistry, IEditorInputFactory } from 'vs/workbench/common/editor'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import * as Platform from 'vs/platform/platform'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; import { workbenchInstantiationService, TestThemeService } from 'vs/workbench/test/workbenchTestServices'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; const NullThemeService = new TestThemeService(); @@ -94,36 +94,7 @@ class MyOtherInput extends EditorInput { return null; } } -class MyStringInput extends StringEditorInput { } - -class MyAction extends EditorInputAction { - - public didCallIsEnabled = false; - - isEnabled() { - this.didCallIsEnabled = true; - return true; - } -} - -class MyAction2 extends EditorInputAction { - isEnabled() { - return true; - } -} - -class MyEditorInputActionContributor extends EditorInputActionContributor { - hasActionsForEditorInput(context) { - return context.input instanceof StringEditorInput; - } - - getActionsForEditorInput(context) { - return [ - new MyAction2('id1', 'label1'), - new MyAction2('id2', 'label2') - ]; - } -} +class MyResourceInput extends ResourceEditorInput { } suite('Workbench BaseEditor', () => { @@ -188,15 +159,15 @@ suite('Workbench BaseEditor', () => { let oldEditors = EditorRegistry.getEditors(); (EditorRegistry).setEditors([]); - EditorRegistry.registerEditor(d2, new SyncDescriptor(StringEditorInput)); - EditorRegistry.registerEditor(d1, new SyncDescriptor(MyStringInput)); + EditorRegistry.registerEditor(d2, new SyncDescriptor(ResourceEditorInput)); + EditorRegistry.registerEditor(d1, new SyncDescriptor(MyResourceInput)); let inst = new TestInstantiationService(); - inst.createInstance(EditorRegistry.getEditor(inst.createInstance(MyStringInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { + inst.createInstance(EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { assert.strictEqual(editor.getId(), 'myEditor'); - return inst.createInstance(EditorRegistry.getEditor(inst.createInstance(StringEditorInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { + return inst.createInstance(EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { assert.strictEqual(editor.getId(), 'myOtherEditor'); (EditorRegistry).setEditors(oldEditors); @@ -210,61 +181,17 @@ suite('Workbench BaseEditor', () => { let oldEditors = EditorRegistry.getEditors(); (EditorRegistry).setEditors([]); - EditorRegistry.registerEditor(d1, new SyncDescriptor(StringEditorInput)); + EditorRegistry.registerEditor(d1, new SyncDescriptor(ResourceEditorInput)); let inst = new TestInstantiationService(); - inst.createInstance(EditorRegistry.getEditor(inst.createInstance(MyStringInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { + inst.createInstance(EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', '', PLAINTEXT_MODE_ID, false)), 'id').then(editor => { assert.strictEqual('myOtherEditor', editor.getId()); (EditorRegistry).setEditors(oldEditors); }).done(() => done()); }); - test('Editor Input Action - triggers isEnabled properly', function () { - let inst = new TestInstantiationService(); - - let action = new MyAction('id', 'label'); - action.input = inst.createInstance(StringEditorInput, 'input', '', '', PLAINTEXT_MODE_ID, false); - assert.equal(action.didCallIsEnabled, true); - }); - - test('Editor Input Action Contributor', function () { - let inst = new TestInstantiationService(); - - let contributor = new MyEditorInputActionContributor(); - - assert(!contributor.hasActions(null)); - assert(contributor.hasActions({ editor: new MyEditor('id', NullTelemetryService), input: inst.createInstance(StringEditorInput, 'fake', '', '', PLAINTEXT_MODE_ID, false), position: 0 })); - - let actionsFirst = contributor.getActions({ editor: new MyEditor('id', NullTelemetryService), input: inst.createInstance(StringEditorInput, 'fake', '', '', PLAINTEXT_MODE_ID, false), position: 0 }); - assert.strictEqual(actionsFirst.length, 2); - - let input = inst.createInstance(StringEditorInput, 'fake', '', '', PLAINTEXT_MODE_ID, false); - let actions = contributor.getActions({ editor: new MyEditor('id', NullTelemetryService), input: input, position: 0 }); - assert(actions[0] === actionsFirst[0]); - assert(actions[1] === actionsFirst[1]); - assert((actions[0]).input === input); - assert((actions[1]).input === input); - - // other editor causes new actions to be created - actions = contributor.getActions({ editor: new MyOtherEditor('id2', NullTelemetryService), input: input, position: 0 }); - assert(actions[0] !== actionsFirst[0]); - assert(actions[1] !== actionsFirst[1]); - assert((actions[0]).input === input); - assert((actions[1]).input === input); - - // other input causes actions to loose input context - let myInput = new MyInput(); - myInput.getTypeId = function () { - return 'foo.id'; - }; - - actions = contributor.getActions({ editor: new MyEditor('id3', NullTelemetryService), input: myInput, position: 0 }); - assert(!(actionsFirst[0]).input); - assert(!(actionsFirst[1]).input); - }); - test('Editor Input Factory', function () { EditorRegistry.setInstantiationService(workbenchInstantiationService()); EditorRegistry.registerEditorInputFactory('myInputId', MyInputFactory); diff --git a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts new file mode 100644 index 00000000000..2db61acaf4e --- /dev/null +++ b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts @@ -0,0 +1,86 @@ +/*--------------------------------------------------------------------------------------------- + * 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 assert from 'assert'; +import { EditorModel } from 'vs/workbench/common/editor'; +import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; +import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorModel'; +import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; +import { IModelService } from 'vs/editor/common/services/modelService'; +import { IModeService } from 'vs/editor/common/services/modeService'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; +import URI from 'vs/base/common/uri'; +import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +import { TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { TPromise } from "vs/base/common/winjs.base"; +import { IModel } from 'vs/editor/common/editorCommon'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; + +class MyEditorModel extends EditorModel { } +class MyTextEditorModel extends BaseTextEditorModel { } + +class ServiceAccessor { + constructor( + @ITextModelResolverService public textModelResolverService: ITextModelResolverService, + @IModelService public modelService: IModelService, + @IModeService public modeService: IModeService, + @ITextFileService public textFileService: TestTextFileService, + @IUntitledEditorService public untitledEditorService: IUntitledEditorService + ) { + } +} + +suite('Workbench - EditorModel', () => { + let instantiationService: IInstantiationService; + let accessor: ServiceAccessor; + + setup(() => { + instantiationService = workbenchInstantiationService(); + accessor = instantiationService.createInstance(ServiceAccessor); + }); + + test('TextDiffEditorModel', function (done) { + const dispose = accessor.textModelResolverService.registerTextModelContentProvider('test', { + provideTextContent: function (resource: URI): TPromise { + if (resource.scheme === 'test') { + let modelContent = 'Hello Test'; + let mode = accessor.modeService.getOrCreateMode('json'); + return TPromise.as(accessor.modelService.createModel(modelContent, mode, resource)); + } + + return TPromise.as(null); + } + }); + + let input = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from({ scheme: 'test', authority: null, path: 'thePath' })); + let otherInput = instantiationService.createInstance(ResourceEditorInput, 'name2', 'description', URI.from({ scheme: 'test', authority: null, path: 'thePath' })); + let diffInput = new DiffEditorInput('name', 'description', input, otherInput); + + diffInput.resolve(true).then((model: any) => { + assert(model); + assert(model instanceof TextDiffEditorModel); + + let diffEditorModel = model.textDiffEditorModel; + assert(diffEditorModel.original); + assert(diffEditorModel.modified); + + return diffInput.resolve(true).then((model: any) => { + assert(model.isResolved()); + + assert(diffEditorModel !== model.textDiffEditorModel); + diffInput.dispose(); + assert(!model.textDiffEditorModel); + + dispose.dispose(); + }); + }).done(() => { + done(); + }); + }); +}); \ No newline at end of file diff --git a/src/vs/workbench/test/common/editor/editorModel.test.ts b/src/vs/workbench/test/common/editor/editorModel.test.ts index 61f24c0e934..b0c237b73bb 100644 --- a/src/vs/workbench/test/common/editor/editorModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorModel.test.ts @@ -9,9 +9,6 @@ import * as assert from 'assert'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { EditorModel } from 'vs/workbench/common/editor'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; -import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorModel'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; @@ -65,32 +62,6 @@ suite('Workbench - EditorModel', () => { }); }); - test('TextDiffEditorModel', function (done) { - instantiationService.stub(IModelService, stubModelService(instantiationService)); - let input = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'text/plain', false); - let otherInput = instantiationService.createInstance(StringEditorInput, 'name2', 'description', 'value2', 'text/plain', false); - let diffInput = new DiffEditorInput('name', 'description', input, otherInput); - - diffInput.resolve(true).then((model: any) => { - assert(model); - assert(model instanceof TextDiffEditorModel); - - let diffEditorModel = model.textDiffEditorModel; - assert(diffEditorModel.original); - assert(diffEditorModel.modified); - - return diffInput.resolve(true).then((model: any) => { - assert(model.isResolved()); - - assert(diffEditorModel !== model.textDiffEditorModel); - diffInput.dispose(); - assert(!model.textDiffEditorModel); - }); - }).done(() => { - done(); - }); - }); - function stubModelService(instantiationService: TestInstantiationService): IModelService { instantiationService.stub(IConfigurationService, new TestConfigurationService()); return instantiationService.createInstance(ModelServiceImpl); diff --git a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts index f04f09a97e8..e9677bbdb23 100644 --- a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts +++ b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts @@ -13,18 +13,17 @@ import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import WorkbenchEditorService = require('vs/workbench/services/editor/common/editorService'); import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; import { Model } from 'vs/editor/common/model/model'; -import { mockCodeEditor, MockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; +import { mockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { IEditorInput } from 'vs/platform/editor/common/editor'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { TextModel } from 'vs/editor/common/model/textModel'; import { Range, IRange } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; -import { Cursor } from 'vs/editor/common/controller/cursor'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; -import { CoreCommands } from 'vs/editor/common/controller/coreCommands'; +import { CoreNavigationCommands } from 'vs/editor/common/controller/coreCommands'; suite('Editor - Range decorations', () => { @@ -33,7 +32,6 @@ suite('Editor - Range decorations', () => { let modelService: IModelService; let modeService: IModeService; let codeEditor: editorCommon.ICommonCodeEditor; - let cursor: Cursor; let model: Model; let text: string; let testObject: RangeHighlightDecorations; @@ -47,7 +45,6 @@ suite('Editor - Range decorations', () => { text = 'LINE1' + '\n' + 'LINE2' + '\n' + 'LINE3' + '\n' + 'LINE4' + '\r\n' + 'LINE5'; model = aModel(URI.file('some_file')); codeEditor = mockCodeEditor([], { model }); - cursor = (codeEditor).getCursor(); mockEditorService(codeEditor.getModel().uri); instantiationService.stub(WorkbenchEditorService.IWorkbenchEditorService, 'getActiveEditor', { getControl: () => { return codeEditor; } }); @@ -111,7 +108,7 @@ suite('Editor - Range decorations', () => { test('highlight is removed on cursor position change', function () { testObject.highlightRange({ resource: model.uri, range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 } }); - cursor.trigger('mouse', CoreCommands.MoveTo.id, { + codeEditor.trigger('mouse', CoreNavigationCommands.MoveTo.id, { position: new Position(2, 1) }); diff --git a/src/vs/workbench/test/common/editor/stringEditorInput.test.ts b/src/vs/workbench/test/common/editor/stringEditorInput.test.ts deleted file mode 100644 index e2b1611c9f1..00000000000 --- a/src/vs/workbench/test/common/editor/stringEditorInput.test.ts +++ /dev/null @@ -1,115 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import URI from 'vs/base/common/uri'; -import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; -import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; -import { TestEditorService } from 'vs/workbench/test/workbenchTestServices'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { IModeService } from 'vs/editor/common/services/modeService'; -import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; -import WorkbenchEditorService = require('vs/workbench/services/editor/common/editorService'); - -suite('Workbench - StringEditorInput', () => { - let instantiationService: TestInstantiationService; - let editorService: WorkbenchEditorService.IWorkbenchEditorService; - let modelService: IModelService; - let modeService: IModeService; - - setup(() => { - instantiationService = new TestInstantiationService(); - editorService = instantiationService.stub(WorkbenchEditorService.IWorkbenchEditorService, new TestEditorService()); - modeService = instantiationService.stub(IModeService, ModeServiceImpl); - modelService = instantiationService.stub(IModelService, stubModelService(instantiationService)); - }); - - test('StringEditorInput', function (done) { - let input: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - const otherInput: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'othervalue', 'mode', false); - const otherInputSame: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - - const inputSingleton: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', true); - const otherInputSingleton: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'othervalue', 'mode', true); - assert(inputSingleton.matches(otherInputSingleton)); - (otherInputSingleton).singleton = false; - assert(!inputSingleton.matches(otherInputSingleton)); - - assert(input.matches(input)); - assert(input.matches(otherInputSame)); - assert(!input.matches(otherInput)); - assert(!input.matches(null)); - assert(input.getName()); - - input = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - - input = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - input.resolve(true).then(resolved => { - const resolvedModelA = resolved; - return input.resolve(true).then(resolved => { - assert(resolvedModelA === resolved); // assert: Resolved Model cached per instance - - const otherInput: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - return otherInput.resolve(true).then(resolved => { - assert(resolvedModelA !== resolved); // NOT assert: Different instance, different model - - input.dispose(); - - return input.resolve(true).then(resolved => { - assert(resolvedModelA !== resolved); // Different instance, because input got disposed - - const model = (resolved).textEditorModel; - return input.resolve(true).then(againResolved => { - assert(model === (againResolved).textEditorModel); // Models should not differ because string input is constant - - input.dispose(); - }); - }); - }); - }); - }).done(() => done()); - }); - - test('StringEditorInput - setValue, clearValue, append', function () { - const input: StringEditorInput = instantiationService.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - - assert.strictEqual(input.getValue(), 'value'); - input.setValue('foo'); - assert.strictEqual(input.getValue(), 'foo'); - input.setValue(''); - assert(!input.getValue()); - }); - - test('Input.matches() - StringEditorInput', function () { - const inst = new TestInstantiationService(); - - const stringEditorInput: StringEditorInput = inst.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - const promiseEditorInput: StringEditorInput = inst.createInstance(ResourceEditorInput, 'name', 'description', URI.from({ scheme: 'inMemory', authority: null, path: 'thePath' })); - - const stringEditorInput2: StringEditorInput = inst.createInstance(StringEditorInput, 'name', 'description', 'value', 'mode', false); - const promiseEditorInput2: StringEditorInput = inst.createInstance(ResourceEditorInput, 'name', 'description', URI.from({ scheme: 'inMemory', authority: null, path: 'thePath' })); - - assert.strictEqual(stringEditorInput.matches(null), false); - assert.strictEqual(promiseEditorInput.matches(null), false); - - assert.strictEqual(promiseEditorInput.matches(promiseEditorInput), true); - assert.strictEqual(stringEditorInput.matches(stringEditorInput), true); - - assert.strictEqual(promiseEditorInput.matches(promiseEditorInput2), true); - assert.strictEqual(stringEditorInput.matches(stringEditorInput2), true); - }); - - function stubModelService(instantiationService: TestInstantiationService): IModelService { - instantiationService.stub(IConfigurationService, new TestConfigurationService()); - - return instantiationService.createInstance(ModelServiceImpl); - } -}); \ No newline at end of file diff --git a/src/vs/workbench/test/common/editor/stringEditorModel.test.ts b/src/vs/workbench/test/common/editor/stringEditorModel.test.ts deleted file mode 100644 index 8258b2c28b2..00000000000 --- a/src/vs/workbench/test/common/editor/stringEditorModel.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 assert from 'assert'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { StringEditorModel } from 'vs/workbench/common/editor/stringEditorModel'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { IModeService } from 'vs/editor/common/services/modeService'; -import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; - -suite('Workbench - StringEditorModel', () => { - let instantiationService: TestInstantiationService; - - setup(() => { - instantiationService = new TestInstantiationService(); - instantiationService.stub(IModeService, ModeServiceImpl); - }); - - test('StringEditorModel', function (done) { - instantiationService.stub(IModelService, stubModelService(instantiationService)); - const m: StringEditorModel = instantiationService.createInstance(StringEditorModel, 'value', 'mode', null); - m.load().then(model => { - assert(model === m); - - const textEditorModel = m.textEditorModel; - assert.strictEqual(textEditorModel.getValue(), 'value'); - - assert.strictEqual(m.isResolved(), true); - - (m).value = 'something'; - return m.load().then(model => { - assert(textEditorModel === m.textEditorModel); - assert.strictEqual(m.getValue(), 'something'); - }); - }).done(() => { - m.dispose(); - done(); - }); - }); - - test('StringEditorModel - setValue', function (done) { - instantiationService.stub(IModelService, stubModelService(instantiationService)); - const m: StringEditorModel = instantiationService.createInstance(StringEditorModel, 'value', 'mode', null); - m.load().then(model => { - assert(model === m); - - const textEditorModel = m.textEditorModel; - assert.strictEqual(textEditorModel.getValue(), 'value'); - - m.setValue('foobar'); - assert.strictEqual(m.getValue(), 'foobar'); - assert.strictEqual(textEditorModel.getValue(), 'foobar'); - - m.setValue(''); - assert(!m.getValue()); - assert(!textEditorModel.getValue()); - }).done(() => { - m.dispose(); - done(); - }); - }); - - function stubModelService(instantiationService: TestInstantiationService): IModelService { - instantiationService.stub(IConfigurationService, new TestConfigurationService()); - - return instantiationService.createInstance(ModelServiceImpl); - } -}); \ No newline at end of file diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index f1e0c75db19..93bf0a5b895 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -20,12 +20,12 @@ import { IThreadService } from 'vs/workbench/services/thread/common/threadServic import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures'; -import { MainThreadLanguageFeatures } from 'vs/workbench/api/node/mainThreadLanguageFeatures'; -import { IHeapService } from 'vs/workbench/api/node/mainThreadHeapService'; +import { MainThreadLanguageFeatures } from 'vs/workbench/api/electron-browser/mainThreadLanguageFeatures'; +import { IHeapService } from 'vs/workbench/api/electron-browser/mainThreadHeapService'; import { ExtHostApiCommands } from 'vs/workbench/api/node/extHostApiCommands'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; import { ExtHostHeapService } from 'vs/workbench/api/node/extHostHeapService'; -import { MainThreadCommands } from 'vs/workbench/api/node/mainThreadCommands'; +import { MainThreadCommands } from 'vs/workbench/api/electron-browser/mainThreadCommands'; import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; import { MainContext, ExtHostContext } from 'vs/workbench/api/node/extHost.protocol'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts new file mode 100644 index 00000000000..1bea8cfccef --- /dev/null +++ b/src/vs/workbench/test/electron-browser/api/extHostFileSystemEventService.test.ts @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * 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 assert from 'assert'; +import { ExtHostFileSystemEventService } from 'vs/workbench/api/node/extHostFileSystemEventService'; + +suite('ExtHostFileSystemEventService', () => { + + + test('FileSystemWatcher ignore events properties are reversed #26851', function () { + + const watcher1 = new ExtHostFileSystemEventService().createFileSystemWatcher('**/somethingInteresting', false, false, false); + assert.equal(watcher1.ignoreChangeEvents, false); + assert.equal(watcher1.ignoreCreateEvents, false); + assert.equal(watcher1.ignoreDeleteEvents, false); + + const watcher2 = new ExtHostFileSystemEventService().createFileSystemWatcher('**/somethingBoring', true, true, true); + assert.equal(watcher2.ignoreChangeEvents, true); + assert.equal(watcher2.ignoreCreateEvents, true); + assert.equal(watcher2.ignoreDeleteEvents, true); + }); + +}); diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index 7f21fd42f19..e34efcb9297 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -19,16 +19,16 @@ import { IMarkerService } from 'vs/platform/markers/common/markers'; import { MarkerService } from 'vs/platform/markers/common/markerService'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures'; -import { MainThreadLanguageFeatures } from 'vs/workbench/api/node/mainThreadLanguageFeatures'; +import { MainThreadLanguageFeatures } from 'vs/workbench/api/electron-browser/mainThreadLanguageFeatures'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; -import { MainThreadCommands } from 'vs/workbench/api/node/mainThreadCommands'; -import { IHeapService } from 'vs/workbench/api/node/mainThreadHeapService'; +import { MainThreadCommands } from 'vs/workbench/api/electron-browser/mainThreadCommands'; +import { IHeapService } from 'vs/workbench/api/electron-browser/mainThreadHeapService'; import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/common/quickOpen'; import { DocumentSymbolProviderRegistry, DocumentHighlightKind } from 'vs/editor/common/modes'; import { getCodeLensData } from 'vs/editor/contrib/codelens/common/codelens'; -import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; +import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from 'vs/editor/contrib/goToDeclaration/browser/goToDeclaration'; import { getHover } from 'vs/editor/contrib/hover/common/hover'; import { getOccurrencesAtPosition } from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; import { provideReferences } from 'vs/editor/contrib/referenceSearch/browser/referenceSearch'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index 9559d13a26e..6b136cb47df 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { Action } from 'vs/base/common/actions'; -import { MainThreadMessageService } from 'vs/workbench/api/node/mainThreadMessageService'; +import { MainThreadMessageService } from 'vs/workbench/api/electron-browser/mainThreadMessageService'; import { TPromise as Promise } from 'vs/base/common/winjs.base'; suite('ExtHostMessageService', function () { diff --git a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts index 7fc02336299..c8834439d40 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTextEditor.test.ts @@ -8,8 +8,7 @@ import * as assert from 'assert'; import { TPromise } from 'vs/base/common/winjs.base'; import { TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes'; import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; -import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from 'vs/workbench/api/node/mainThreadEditor'; -import { MainThreadEditorsShape } from 'vs/workbench/api/node/extHost.protocol'; +import { MainThreadEditorsShape, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostTextEditorOptions, ExtHostTextEditor } from 'vs/workbench/api/node/extHostTextEditor'; import { ExtHostDocumentData } from 'vs/workbench/api/node/extHostDocumentData'; import URI from 'vs/base/common/uri'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts index 259d55117ad..616043909a0 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { MainThreadCommands } from 'vs/workbench/api/node/mainThreadCommands'; +import { MainThreadCommands } from 'vs/workbench/api/electron-browser/mainThreadCommands'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { OneGetThreadService } from './testThreadService'; @@ -25,4 +25,4 @@ suite('MainThreadCommands', function () { commands.$unregisterCommand('foo'); assert.equal(CommandsRegistry.getCommand('foo'), undefined); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts index 334b12318bb..b938c450d50 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocuments.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { BoundModelReferenceCollection } from 'vs/workbench/api/node/mainThreadDocuments'; +import { BoundModelReferenceCollection } from 'vs/workbench/api/electron-browser/mainThreadDocuments'; import { Model } from 'vs/editor/common/model/model'; import { TPromise } from 'vs/base/common/winjs.base'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts index 7800874df6a..3e809f5a8e8 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { MainThreadDocumentsAndEditors } from 'vs/workbench/api/node/mainThreadDocumentsAndEditors'; +import { MainThreadDocumentsAndEditors } from 'vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors'; import { OneGetThreadService } from './testThreadService'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; diff --git a/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts b/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts index cb595b9a1b8..35fc82deda8 100644 --- a/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts +++ b/src/vs/workbench/test/electron-browser/api/mainThreadSaveParticipant.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { FinalNewLineParticipant } from 'vs/workbench/api/node/mainThreadSaveParticipant'; +import { FinalNewLineParticipant } from 'vs/workbench/api/electron-browser/mainThreadSaveParticipant'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; @@ -72,4 +72,4 @@ suite('MainThreadSaveParticipant', function () { done(); }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index d5d1d7cd65a..a7f4f1ea918 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -28,7 +28,7 @@ import { IEditorInput, IEditorOptions, Position, Direction, IEditor, IResourceIn import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IMessageService, IConfirmation } from 'vs/platform/message/common/message'; import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ILifecycleService, ShutdownEvent, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; +import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { EditorStacksModel } from 'vs/workbench/common/editor/editorStacksModel'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; @@ -50,8 +50,7 @@ import { IWindowsService, IWindowService } from 'vs/platform/windows/common/wind import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { RawTextSource, IRawTextSource } from 'vs/editor/common/model/textSource'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IThemeService, ITheme, IThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { isLinux } from 'vs/base/common/platform'; @@ -848,6 +847,10 @@ export class TestWindowService implements IWindowService { unmaximizeWindow(): TPromise { return TPromise.as(void 0); } + + onWindowTitleDoubleClick(): TPromise { + return TPromise.as(void 0); + } } export class TestLifecycleService implements ILifecycleService { @@ -855,6 +858,7 @@ export class TestLifecycleService implements ILifecycleService { public _serviceBrand: any; public willShutdown: boolean; + public startupKind: StartupKind; private _onWillShutdown = new Emitter(); private _onShutdown = new Emitter(); @@ -944,6 +948,9 @@ export class TestWindowsService implements IWindowsService { unmaximizeWindow(windowId: number): TPromise { return TPromise.as(void 0); } + onWindowTitleDoubleClick(windowId: number): TPromise { + return TPromise.as(void 0); + } setDocumentEdited(windowId: number, flag: boolean): TPromise { return TPromise.as(void 0); } @@ -999,29 +1006,47 @@ export class TestWindowsService implements IWindowsService { } export class TestTheme implements ITheme { - selector: string; - type: 'light' | 'dark' | 'hc'; - getColor(color: string, useDefault?: boolean): Color { - throw new Error('Method not implemented.'); + constructor(private colors: { [id: string]: string; } = {}, public type = DARK) { } - isDefault(color: string): boolean { + getColor(color: string, useDefault?: boolean): Color { + let value = this.colors[color]; + if (value) { + return Color.fromHex(value); + } + return void 0; + } + + defines(color: string): boolean { throw new Error('Method not implemented.'); } } -const testTheme = new TestTheme(); - export class TestThemeService implements IThemeService { _serviceBrand: any; + _theme: ITheme; + _onThemeChange = new Emitter(); + + constructor(theme = new TestTheme()) { + this._theme = theme; + } getTheme(): ITheme { - return testTheme; + return this._theme; } - onThemeChange(participant: IThemingParticipant): IDisposable { - return { dispose: () => { } }; + setTheme(theme: ITheme) { + this._theme = theme; + this.fireThemeChange(); } -} \ No newline at end of file + + fireThemeChange() { + this._onThemeChange.fire(this._theme); + } + + public get onThemeChange(): Event { + return this._onThemeChange.event; + } +} diff --git a/test/README.md b/test/README.md index cad17e421e9..60860e3f523 100644 --- a/test/README.md +++ b/test/README.md @@ -2,9 +2,7 @@ ## Run -The best way to run the Code tests is from within VS Code. Simply pressF1, type "run test" and press enter to launch the tests. To make development changes to unit tests you need to be running `gulp`. See [Development Workflow](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#incremental-build) for more details. - -If you wish to run the tests from a terminal, from the `vscode` folder run: +The best way to run the Code tests is from the terminal. To make development changes to unit tests you need to be running `gulp`. See [Development Workflow](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#incremental-build) for more details. From the `vscode` folder run: **OS X and Linux** @@ -14,9 +12,12 @@ If you wish to run the tests from a terminal, from the `vscode` folder run: scripts\test + ## Debug -You can use VS Code to debug your tests. Switch to the Debug viewlet, pick the `Unit Tests` debug target and press `Play`. +To debug tests use `--debug` when running the test script. Also, the set of tests can be reduced with the `--run` and `--runGlob` flags. Both require a file path/pattern. Like so: + + ./scripts/test.sh --debug --runGrep **/extHost*.test.js ## Coverage diff --git a/test/electron/index.js b/test/electron/index.js index 0337a1421f7..74967e58122 100644 --- a/test/electron/index.js +++ b/test/electron/index.js @@ -13,11 +13,11 @@ const events = require('events'); const optimist = require('optimist') .describe('grep', 'only run tests matching ').alias('grep', 'g').alias('grep', 'f').string('grep') .describe('run', 'only run tests from ').string('run') - .describe('runGrep', 'only run tests matching ').boolean('runGrep') + .describe('runGlob', 'only run tests matching ').alias('runGlob', 'runGrep').string('runGlob') .describe('build', 'run with build output (out-build)').boolean('build') .describe('coverage', 'generate coverage report').boolean('coverage') .describe('debug', 'open dev tools, keep window open, reuse app data').string('debug') - .describe('reporter', 'the mocha reporter').string('reporter').default('reporter', 'spec') + .describe('reporter', 'the mocha reporter').string('reporter').default('reporter', process.platform === 'win32' ? 'dot' : 'spec') .describe('help', 'show the help').alias('help', 'h'); const argv = optimist.argv; @@ -113,7 +113,7 @@ app.on('ready', () => { Reporter = require(reporterPath); } catch (err) { console.warn(`could not load reporter: ${argv.reporter}`); - Reporter = mocha.reporters.Spec; + Reporter = process.platform === 'win32' ? mocha.reporters.Dot : mocha.reporters.Spec; } const runner = new IPCRunner(); diff --git a/tslint.json b/tslint.json index aae82a05a27..9c0f132b77e 100644 --- a/tslint.json +++ b/tslint.json @@ -1,4 +1,7 @@ { + "rulesDirectory": [ + "build/lib/tslint" + ], "rules": { "no-unused-expression": true, "no-duplicate-variable": true,